- Live lab
- Coursework
2023 · Blockchain · Product authentication · Coursework · CSE 345 Blockchain Technologies
Fake Product Detection using Blockchain
A product-authentication platform that links QR codes to tamper-evident blockchain records, so a customer can check that a product identity matches what the manufacturer registered. Try the live demo.
- Solidity
- Ganache
- MetaMask
- QR codes
- Blockchain
Headline
4 outcomes
Authentic · Suspicious · Revoked · Not verified
On this page
01 · Problem
Problem
Counterfeit products damage customer safety, brand reputation and supply-chain trust, and a customer cannot tell a genuine product from its packaging alone. Centralised verification can itself be altered or spoofed.
02 · Approach
Approach
System design
A hybrid design. Only what benefits from immutability goes on the chain: a product hash, the manufacturer's address, a timestamp, a status and a verification counter. Everything else (names, images, accounts, scan history) stays in a conventional database. The original coursework build used Solidity with Ganache and MetaMask; this version runs the contract on a local Hardhat chain behind a FastAPI and PostgreSQL service.
Method
Each product gets a unique identity and a verification token. Its hash, SHA-256 of the product ID, manufacturer, batch, serial and a private secret, is registered on the chain, and the QR code carries only a verification URL, never the secret. Verifying a scan runs in layers: check the token's format, find the product, read its on-chain record, recompute the hash from the current database record and compare, check the product is still active, log the event, and score the risk.
Key concept
A valid QR is not proof the object is genuine
The chain protects the integrity of the registered identity. A counterfeiter can still copy a genuine QR code onto a fake product, so the system also watches scan history (repeated scans, scans from distant places) and reports an anomaly, not a verdict on the physical item.
Live lab
Try it
What you're looking at
A simulation of the registry in your browser. Register a product and print its QR code, then scan it; alter a record, a block or a code and see which check catches it.
Loading demo…
03 · Results
Results
A working model, runnable in this page, of registration, QR generation and verification, with four outcomes: authentic, suspicious, revoked and not verified. Altering an off-chain record, a block, or a QR code each gets caught.
04 · Limitations
Limitations
What it does not show
The public page runs a simulation of the registry logic in the browser. A separate local build runs the real stack (Solidity contract on a Hardhat chain, FastAPI, PostgreSQL) and the Live backend tab connects to it when it is running; it is not deployed to a public network or hosted. The risk score is a set of rules, not a trained model, and the photo check is visual similarity, not a counterfeit classifier. A production system would need a security audit, hardened authentication and a privacy review.
Lessons
Deciding what belongs on-chain and what does not matters as much as the contract itself: personal data, images and large records stay off-chain, and the hash is what ties them together.
Responsible AI
No personal data is stored on the chain, and the project states plainly what blockchain can and cannot guarantee instead of claiming counterfeits become impossible.