MediChain - Blog

Tamper-Proof Medicine Supply Chain Tagging

A Blockchain-Based Anti-Counterfeit System — Planned & Built with Kiro


Project Introduction:

Counterfeit and improperly handled medicines are a serious public health issue, especially in countries like India where pharmaceutical supply chains involve multiple intermediaries. Fake medicines, reused packaging, skipped distributors, and lack of transparency make it nearly impossible for consumers and hospitals to verify authenticity.

Our hackathon project, Tamper-Proof Medicine Supply Chain Tagging, addresses this problem by creating an end-to-end verifiable medicine supply chain using blockchain, QR-based verification, and secure off-chain metadata storage.

The system enables manufacturers, distributors, pharmacies, and customers to track a medicine batch from manufacturing to sale and instantly detect suspicious or counterfeit activity.

This project was planned, structured, and executed using Kiro, with a strong emphasis on documentation, decision-making, and clarity.




Why We Used Kiro:

At the start of the hackathon, we made a common mistake — jumping straight into coding. This led to unclear feature priorities, rushed architectural decisions, and confusion around what should be built within limited time.

Kiro helped us slow down and think like system designers instead of just coders. We used Kiro to:

  • Break down the problem clearly
  • Document assumptions and constraints
  • Evaluate multiple architectural approaches
  • Decide what not to build
  • Maintain a single source of truth during execution




Core System Architecture (Planned Using Kiro)

๐Ÿ”— Blockchain Layer

Using Kiro-led planning, we designed smart contracts that store only critical immutable data:

  • BatchID
  • ManufacturerID
  • Timestamp
  • CurrentOwner
  • Status (Manufactured, In Transit, Delivered, Sold)

This ensures transparency and tamper resistance while keeping gas costs low.

๐Ÿงพ Off-Chain Metadata

Detailed batch metadata is stored off-chain, including:

  • Medicine name and dosage
  • Expiry date
  • Manufacturer license
  • Storage temperature requirements
  • Certificates

Only a cryptographic hash pointer is stored on-chain. This hybrid approach was a deliberate design decision documented in Kiro.






How the System Works (End-to-End Flow)

  1. Manufacturer
    • Creates a new medicine batch
    • Uploads batch metadata
    • Hash pointer stored on the blockchain
  2. Distributor
    • Scans and accepts custody of the batch
    • Ownership update recorded on-chain
  3. Pharmacy
    • Verifies batch authenticity
    • Marks medicine as available for sale
  4. Customer
    • Scans QR code on medicine packaging
    • Sees verification status:
      • ✅ Verified
      • ⚠️ Suspicious (Missing Link)
      • ❌ Invalid / Tampered




Out-of-the-Box MVPs Designed Using Kiro:

๐Ÿง  MVP 1: Missing Link Detection Engine

Through structured ideation in Kiro, we identified that counterfeit medicines often skip supply chain steps.

Smart contracts enforce mandatory checkpoints. If a batch jumps directly from manufacturer to pharmacy without passing through a distributor, the system flags it as suspicious.

๐Ÿ“ก MVP 2: Offline-First QR Verification

Our QR codes support offline cryptographic verification, allowing authenticity checks without internet access and syncing to blockchain later.

๐Ÿงฌ MVP 3: Dynamic QR Codes (Anti-Reuse)

Dynamic, time-based QR hashes detect duplicate scans across locations and flag suspicious reuse.




What We Built vs What We Planned:

✅ Built During Hackathon

  • Smart contracts for batch tracking
  • QR-based medicine verification
  • Missing link detection logic
  • Manufacturer and verification dashboards
  • Kiro-based planning and documentation

๐Ÿงช Planned / Future Enhancements

  • Hospital bulk verification mode
  • Doctor-facing trust score for medicines
  • Cold-chain temperature compliance tracking
  • Regulatory analytics dashboards


How Kiro Helped Us:

Kiro helped us structure the problem, document trade-offs, control scope, and map execution steps back to planning decisions. It acted as a planning compass throughout the hackathon.



Demo Validation:

The demo showcased batch creation, metadata upload, QR verification, and detection of broken supply chain paths, proving the system can detect counterfeit behavior — not just log data.


Impact:

  • ๐Ÿง‘‍⚕️ Protects patients from counterfeit medicines
  • ๐Ÿฅ Enables hospital-level verification
  • ๐Ÿงพ Improves pharmaceutical accountability
  • ๐ŸŒ Scalable at national level
  • ๐Ÿ‡ฎ๐Ÿ‡ณ Designed for Indian infrastructure constraints


Challenges Faced:

Retrofitting structured planning, being honest about trade-offs, and cutting non-feasible features were difficult — but Kiro helped guide better decisions.


Key Learnings:

  • Planning multiplies development speed
  • Blockchain fails more from bad design than bad code
  • Kiro adds clarity even when adopted mid-project


Future Scope:

  • Hospital and regulatory dashboards
  • Doctor trust scores
  • IoT-based cold-chain compliance
  • Advanced counterfeit analytics


Final Thoughts:

This project is not just a blockchain prototype. It is a planning-first, real-world system designed using Kiro to ensure clarity, traceability, and impact.

Kiro fundamentally changed how we approached problem-solving, architecture, and execution — and we plan to use it from day one in future projects.


Links:

GitHub Repository: MediChain
Demo Video: Click Here to Watch
Kiro Planning Folder: /.kiro/HERO

Comments