Counterfeit drugs pose a significant threat to global health and the integrity of pharmaceutical supply chains. With rising demands for transparency and traceability, our team took on the challenge of leveraging blockchain technology to create an innovative solution for tracking and tracing pharmaceuticals. This project, developed during our Final Year Project (FYP), was both a journey of learning and practical implementation.
Why Blockchain?
Blockchain's decentralized and immutable ledger is a game-changer for the pharmaceutical industry. By integrating blockchain technology, we sought to:
-
Eliminate Counterfeit Drugs: Blockchain ensures the authenticity of drugs by tracking their journey from manufacturer to consumer.
-
Enhance Transparency: A public, distributed ledger enables stakeholders to view real-time updates and track the provenance of pharmaceutical products.
-
Ensure Integrity: Immutable records prevent tampering and ensure data accuracy.
-
Authenticate Products: Using QR codes linked to the blockchain, consumers can verify the legitimacy of their medicine.
Our Proof-of-Concept (POC)
To demonstrate the potential of blockchain in the pharmaceutical supply chain, we developed a Proof-of-Concept (POC) focusing on core aspects such as authenticity, traceability, and user interaction. The POC not only showcased technical feasibility but also answered critical questions about scalability and implementation.
Technology Stack
Our implementation utilized cutting-edge technologies and tools to achieve the desired functionality:
-
Smart Contracts:
-
Created with Solidity to implement Access Control and ERC-721 standards.
-
Used OpenZeppelin for secure, standardized smart contract code.
-
-
Production Test Nets:
- Deployed contracts on Goerli and Sepolia, Ethereum test networks.
-
Frontend & Libraries:
-
NextJS (13+): Developed a robust, modular frontend using TypeScript.
-
wagmi: React hooks for seamless Web3 integrations.
-
react-qr-code: Integrated QR code generation for drug verification.
-
MUI 5+: Styled components for a professional, intuitive UI.
-
next-pwa: Enabled offline functionality.
-
-
Wallet Integration:
- Utilized Metamask for secure transactions, authentication, and authorization.
-
Database:
- Indexed data with MongoDB Atlas for high availability and scalability.
-
Local Development:
- Simulated blockchain environments using Hardhat.
-
Hosting:
- Deployed the solution on Vercel for a seamless, production-ready experience.
Implementation Highlights
-
Drug Lifecycle Tracking:
-
Each pharmaceutical product was assigned a unique identifier linked to an ERC-721 token.
-
The journey of the product—from manufacturing to end-user—was immutably recorded on the blockchain.
-
-
QR Code Integration:
-
QR codes were generated for each drug, allowing consumers to scan and verify authenticity.
-
The QR code displayed crucial details such as origin, batch number, and current status.
-
-
Access Control:
- Implemented using smart contracts to ensure that only authorized stakeholders (e.g., manufacturers, distributors) could modify data.
-
User-Friendly Interface:
-
Developed a sleek, responsive interface for stakeholders to interact with the platform.
-
Metamask integration enabled seamless user authentication and transactions.
-
Results and Key Learnings
-
Improved Traceability:
-
The blockchain-based system ensured 100% transparency in the pharmaceutical supply chain.
-
Real-time data updates reduced the risk of counterfeit drugs entering the market.
-
-
Optimized Efficiency:
- Automated tracking processes reduced manual errors and improved operational efficiency.
-
Consumer Empowerment:
- Consumers could verify product authenticity with a simple QR code scan, fostering trust.
-
Knowledge Gained:
-
Extensive research into blockchain, Web3 development, and supply chain management.
-
Hands-on experience with Solidity, NextJS, MongoDB, and production-ready tools.
-
Visual Insights
Future Directions
While the POC demonstrated the potential of blockchain in pharmaceutical track and traceability, there is scope for further improvements:
-
Scalability: Exploring Layer 2 solutions (e.g., Polygon) to reduce transaction costs and enhance throughput.
-
Regulatory Compliance: Ensuring the solution adheres to global pharmaceutical regulations (e.g., FDA, EMA).
-
Advanced Analytics: Integrating AI-driven analytics for predictive insights and anomaly detection.
-
Stakeholder Collaboration: Expanding partnerships with pharmaceutical companies to pilot the solution in real-world scenarios.
Conclusion
Our blockchain-integrated track and traceability solution represents a significant step towards eliminating counterfeit drugs and ensuring the safety of pharmaceutical supply chains. By leveraging the power of blockchain, smart contracts, and cutting-edge Web3 tools, we have built a system that fosters trust, transparency, and efficiency.
This project was not just about solving a problem—it was about learning, innovating, and contributing to a better future for the pharmaceutical industry.
Let us know your thoughts or explore our codebase and detailed documentation here: GitHub Repository.