Inspiration
PharmaLedger was inspired by a harsh reality, and that is counterfeit drugs quietly kill millions every year. The WHO estimates that 1 in 10 medicines in developing countries is fake or substandard, fueling a $200B black market.
Imagine a patient in Nigeria buying malaria medicine that looks real, but contains no active ingredients. Treatment fails and the patient suffers, paying the full price of the drug.
At the core is a trust problem. Consumers can't verify authenticity, manufacturers can’t prove integrity, and regulators can’t track drugs across borders. By using XRPL's high speed and low fees, we realised we could create a solution that utilises blockchain to provide something the industry lacks, which is the tamper-proof proof of authenticity. This idea bred PharmaLedger.
What it does
PharmaLedger gives every pharmaceutical batch a digital identity on the XRP Ledger.
Manufacturers mint an NFT for each batch containing verified details like batch number, expiry date, and a cryptographic signature. The NFT ID is embedded into an NFC chip on the packaging.
At purchase, consumers simply tap their phone. In seconds, they see whether the drug is authentic or counterfeit. This is directly verified on the blockchain.
Once created, the record cannot be altered, duplicated and tampered with, giving buyers the peace of mind when they purchase the drugs.
- Drug Manufacturing
- Each pharmaceutical batch is produced by an authorized manufacturer
- An NFC chip is attached to the drug packaging
The NFC chip stores:
- Public key
- NFT Token ID
NFT Minting (XRP Ledger)
The manufacturer mints an NFT on the XRP Ledger representing the drug batch
The NFT contains metadata:
- Product name
- Batch number
- Manufacturing & expiry dates
- Chip Public Key
The NFT is minted from the manufacturer’s verified XRPL wallet
Off-Chain Registration (PharmaLedger)
PharmaLedger records the following for fast verification:
- NFT Token ID
- Associated public key
- Manufacturer’s verified wallet address
This database improves performance but does not replace blockchain trust
Consumer Verification (NFC Scan)
The customer taps their phone on the NFC chip
The app retrieves:
- NFT Token ID
- Public key
The system queries the XRP Ledger to:
- Confirm the NFT exists
- Check the NFT is owned by the correct manufacturer wallet
Authenticity Validation
AUTHENTIC
- Token ID exists on XRPL
- NFT belongs to the verified manufacturer wallet
- Token ID exists on XRPL
COUNTERFEIT
- Token ID not found
- NFT ownership does not match manufacturer
- Token ID not found
Security Guarantees
XRPL NFTs are immutable and non-duplicable
Counterfeiters cannot mint valid NFTs without the manufacturer’s private key
NFC data tampering breaks cryptographic verification
Provides a permanent, global audit trail
How we built it
There are two main features of our product:
- The tokenization of batches of drugs (Minting of NFTs)
- The verification of authenticity of a batch of drugs (Verify whether it is counterfeit or authentic)
We divided our work with one person working on the minting, and the other working on the verification process. Finally, we merged our progress together to form the final product.
Challenges we ran into
- Difficulty navigating the use of our product due to no polished UI to test on.
- Difficulty syncing up account details of XRPL
- Lack of understanding of the XRPL relevant libraries, have to learn and read the documentations from scratch
Accomplishments that we're proud of
We are able to successfully tokenize the drugs and mint it on testnet. We are also able to retrieve information from XRPL and firebase, compare it with each other to verify the authenticity of the drugs in question.
What we learned
- Technical understanding of XRPL relevant libraries
- Ability to link XRPL API to our own API
What's next for PharmaLedger
Right now, there is no polished UI for users (either buyers/manufacturers) to use. So there exists big potential to create a polished UI for users to easily navigate, without the need for command line commands.
Another thing is that our NFC logic is very simplified and hardcoded due to the lack of time and resources. Perhaps, it could be emulated better with other pre-existing libraries/softwares.
Built With
- dotenv
- express.js
- firebase
- javascript
- json
- node.js
- vscode
- xrpl
Log in or sign up for Devpost to join the conversation.