PharmChain
From Lab to Life - Every Pill, Verified on Chain
Created on 25th January 2026
•
PharmChain
From Lab to Life - Every Pill, Verified on Chain
The problem PharmChain solves
PharmChain solves the global counterfeit medicine crisis - a $200 billion problem killing 250,000+ people yearly with a complete blockchain-powered supply chain solution.
The Problem in Detail:
Global Crisis:
10% of medicines in developing countries are counterfeit
250,000+ deaths yearly from fake medications
$200 billion lost annually to counterfeit drugs
Zero accountability in current supply chains
Temperature-sensitive drugs degrade due to poor storage conditions
Consumers cannot verify authenticity before use
Specific Use Cases Where This Crisis Occurs:
Rural areas with limited pharmacy regulation
Developing countries with weak enforcement
Online pharmacies with no oversight
Disaster zones where supply chains break
Refugee camps with limited medicine access
What PharmChain Does - Complete Feature Set:
- MetaMask Wallet Integration
Connects users' Ethereum wallets securely
Enables blockchain transactions without intermediaries
Shows connected wallet address in interface
Persists connection across sessions
- Drug Registration & NFT Passport Creation
Users register new drug batches with:
Drug name (e.g., Aspirin)
Unique batch ID (e.g., BATCH-2024-001)
Manufacturing date
Automatically creates NFT passport containing:
Drug metadata (name, batch, date)
Manufacturing location
Drug attributes
Blockchain registration details
NFT uploaded to IPFS (Pinata) for permanent, decentralized storage
Each NFT has unique IPFS hash that cannot be forged
Real Ethereum Sepolia transaction records registration immutably
- Real-Time Supply Chain Tracking
Records drug location at each supply chain point:
Manufacturing facility
Warehouse storage
Distribution centers
Pharmacies
Each location update includes:
GPS/location name
Exact timestamp
Temperature reading
Humidity percentage
Transit status
Creates complete, immutable journey history
Shows WHERE the drug has been and WHO handled it
- Temperature & Condition Monitoring
Tracks storage conditions throughout supply chain
Simulates IoT sensor data:
Real-time temperature readings
Humidity levels
Shock/impact detection
Visual temperature chart showing:
12-hour temperature trend
Safe zone indicator (2-8°C for most drugs)
Temperature violations highlighted
Professional graph visualization
Alerts if conditions violated
Prevents drug degradation from poor storage
- Instant Consumer Verification
Patients/consumers can:
Scan QR code on medicine box
Enter batch ID on website
Instantly verify if drug is authentic
Verification shows:
✅ Is this medicine genuine?
🌡️ Was it stored correctly?
📍 Where did it come from?
⏰ Is it still safe to use?
Two possible outcomes:
Authentic (Green): Drug found in blockchain registry, shows complete journey
Counterfeit (Red): Drug not in registry, warning to not use and report authorities
Works offline and online
Requires no medical knowledge
- Persistent Data Storage
All registered drugs saved in browser's localStorage
Data survives page refresh and browser closure
Enables offline verification capability
No database required (perfect for MVP)
Ready for MongoDB backend upgrade
- Responsive, Professional UI/UX
Works on desktop, tablet, and mobile devices
Intuitive navigation with sticky navbar
Color-coded sections:
Purple gradient hero (attention-grabbing)
Light gray demo section (professional)
White cards with shadow effects (modern)
Clear visual feedback:
Green messages for success
Red warnings for counterfeits
Blue loading states
Smooth transitions and animations
Accessible buttons and forms
- Complete Journey Visualization
Timeline view showing drug's complete path
Each tracking point displays:
Location emoji (🏭 🚚 💊 etc.)
Exact timestamp
Temperature and humidity at that point
Status indicator
Visual markers (blue circles) on left timeline
Chronological order showing progression
Real-World Applications:
For Patients:
Buy medicine with confidence
Verify authenticity before consuming
Know the complete journey their medicine took
Report suspicious products to authorities
For Pharmacists & Retailers:
Track drug batches in real-time
Identify suspicious batches before selling
Prevent accidental sale of counterfeits
Maintain accurate inventory with blockchain proof
For Manufacturers & Distributors:
Monitor temperature throughout transit
Automatic alerts for condition violations
Real-time location tracking
Emergency recall system for compromised batches
One-click recall notifies all stakeholders
Smart contract freezes affected NFTs instantly
For Healthcare Systems:
Build patient trust in medicine supply
Reduce liability from fake drugs
Improve patient safety metrics
Meet regulatory requirements
Audit trail for all transactions
For Regulators & Law Enforcement:
Identify counterfeit networks
Track illegal distribution channels
Enforce accountability
Catch bad actors systematically
Build case against counterfeiters with blockchain evidence
Challenges we ran into
Challenge 1: Complete Pivot from React Complex Architecture
The Situation:
Started with ambitious React.js + Redux + TypeScript architecture. After 12 hours of development, realized:
Too complex for 36-hour timeline
Build system taking too long to set up (Webpack, Babel configuration)
State management overhead slowing down progress
Learning curve for team members unfamiliar with React ecosystem
Every small change required full component re-render testing
Decision Point:
Made critical decision: Scratch everything and restart with vanilla JavaScript + HTML5
How We Solved It:
Pivoted to vanilla HTML/CSS/JavaScript (took 1 hour to restructure project)
Eliminated dependency on npm build tools
Used CDN links instead (Ethers.js, no installation needed)
Focused on core features: blockchain integration only
Separated concerns into modular files without over-engineering
Web3-config.js for API keys
Web3-integration.js for blockchain logic
script.js for UI interactions
Styles.css for responsive design
Lesson Learned:
Simplicity wins in hackathons. Vanilla stack allowed us to focus on features (blockchain, IPFS, wallet integration) instead of tooling. Deployment to GitHub Pages took 5 minutes instead of 30+ minutes with build tools.
Result:
Saved 12+ hours of debugging and complexity. Went from stuck state to fully functional MVP in remaining 24 hours.
Challenge 2: Ethereum Smart Contract Integration Without Prior Web3 Experience
The Situation:
Team had minimal Web3.js/Ethers.js experience. Need to:
Connect MetaMask wallet from browser
Send transactions to blockchain
Read data from smart contracts
Handle async operations properly
Challenges Encountered:
MetaMask window.ethereum object undefined initially (needed to check installation)
Transaction confirmation timing (didn't know to use tx.wait())
Wallet persistence across page refreshes
Understanding contract ABI vs actual contract address
How We Solved It:
Used Ethers.js instead of Web3.js (simpler API)
Researched MetaMask docs for 1 hour
Created abstraction layer (web3-integration.js) hiding complexity
Used pre-deployed smart contracts to avoid compilation issues
Tested on Sepolia testnet with free test ETH
Created utility functions:
connectWallet() - handles connection with proper error handling
registerDrugOnChain() - wraps smart contract call
verifyDrug() - reads contract data safely
Result:
Got blockchain integration working in 4 hours. User can actually execute real transactions on Ethereum.
Challenge 3: Decentralized File Storage (IPFS) API Integration
The Situation:
NFTs need to be stored permanently somewhere. Can't use centralized server (no backend). Discovered IPFS + Pinata as solution but:
Never used Pinata API before
Didn't understand IPFS hashing
Frontend to API communication seemed complex
Challenges:
FormData object creation for file upload
API authentication headers
Handling async file upload completion
Getting back IPFS hash and using it
Understanding CORS (Cross-Origin Resource Sharing)
How We Solved It:
Signed up for Pinata free tier (https://pinata.cloud)
Studied API documentation (30 minutes)
Created NFT metadata as JSON blob
Used FormData to send to Pinata
Parsed response to extract IPFS hash
Verified uploaded file by accessing via ipfs.io gateway
Testing:
Uploaded test file, got IPFS hash (QmXxxx)
Verified by visiting https://ipfs.io/ipfs/QmXxxx
Data persisted permanently on IPFS
Result:
NFTs actually stored on decentralized IPFS. Can prove to judges that files are permanent and cannot be deleted.