E-commerce pharmacy website using IPFS for storage

E-commerce pharmacy website using IPFS for storage

We have essentially built an e-commerce pharmacy website where patients can buy prescription medication. It is through the blockchain that we are ensuring prescriptions' information certification.

E-commerce pharmacy website using IPFS for storage

E-commerce pharmacy website using IPFS for storage

We have essentially built an e-commerce pharmacy website where patients can buy prescription medication. It is through the blockchain that we are ensuring prescriptions' information certification.

The problem E-commerce pharmacy website using IPFS for storage solves

In some countries, like Italy, the way medical prescriptions are managed by the national health care system (NHS) poses many issues. The following are the main identified limits:

  1. Anonymity and privacy of patient data: medical data are managed in cleartext;
  2. Security of communications: medical data are sent by email exposing it to phishing, malware or similar attacks;
  3. Information certification: there isn’t a protocol in place to guarantee certification of the prescription, in terms of the authenticity of the content and involvement of actors;
  4. Availability and resilience of the service: current platforms are based on centralized applications and databases that are subjected to failures, attacks and routine maintenance unavailability;
  5. Counterfeiting of the medical prescriptions: NHS deals with a lot of scams and false prescription uses, often facilitated by the weakness of the protocol;

[Please note that the detailed technical documentation has been posted in the repo under 'documentation.docx']

Using our solution we preserve the anonymity of the patient's data as we are not pushing his/her name onto IPFS along with their prescription (JSON Object).

We connect the prescription from the doctor to the patient via a QR code that is shared during the appointment itself, thus eliminating the dangers of point 2.

Our solution solves the problem of point 3 as well. Have a look at the documentation in the repo to see how.

We use the blockchains' unique property of Immutability to tackle point 4.

Counterfeiting of medical prescriptions is possible but when he/she tries to use a fake prescription or someone else's prescription to buy medicine from our website, we will not let that happen since when he does login to the website he can only buy the medicines corresponding to the prescriptions they have been issued. There is no option to buy random medicine. There is an option to buy the medicine that is prescribed to them.

Challenges we ran into

Our front-end team was building the front-end using nextJS and ThirdWeb but the backend blockchain devs were writing the functions to interact with the contract in javascript using ethers.js. This disconnect and lack of communication between the teams led to us not being able to integrate the front-end with the back-end. We couldn't figure out how to make ethers.js work with the syntax of NextJS. We had reached a certain stage of the hackathon where reworking the front-end was not a possibility so we had to try and convert the javascript functions using ethers.js to functions using ThirdWeb and that proved very challenging as their documentation didn't seem to be well written. There was no documentation on how to pass a parameter to the contract function if I'm just reading content from the function.

Other than this we also faced a lot of trouble in getting IPFS up and running. Since we were working on a windows machine, installing the dependencies and figuring out the path took a very long time. Finally, we just took the front-end guy's Mac and managed to figure out all the dependency issues etc.

Discussion