Skip to content
All work

MediChain

Web · 2026

Lab reports a patient controls, sealed on a blockchain so any change shows.

MediChain landing page on a dark ground: the headline Medical records that can prove themselves and an Open the patient vault button beside backlit glass vials and a bottle

A safe online folder for lab reports. It reads the numbers out of each report and charts them over time, lets a patient share chosen reports with a doctor for a set number of days, and records every view in a tamper-evident log. A small blockchain registry proves a report has not changed since it was sealed; only salted fingerprints go on chain, never health data. It runs end to end as a local demo with synthetic patients.

Problem

Lab reports live as scattered PDFs that are hard to compare over time. Once a patient shares one, nobody can prove it is unaltered or see who has read it, and putting medical data on a blockchain to fix that would expose the very data it should protect.

Approach

A Next.js frontend over a FastAPI backend with SQLAlchemy and Alembic. Each file is encrypted with its own AES-256-GCM key, wrapped by a per-patient key, so deleting that key erases the patient. Every read passes one policy gate that writes a hash-chained audit entry before any data leaves. Text PDFs are parsed into values for nine common tests, odd values are flagged for the patient to check, and a report can be sealed only once every flag is cleared. Sealing registers a salted hash of the file in a Solidity contract through web3.py.

Next.js, TypeScript, FastAPI, Python, Solidity, Hardhat, web3.py

What was hard

Keeping health data off chain while still proving integrity meant treating the blockchain as a notary for salted fingerprints and nothing more. Concurrent writes forked the audit hash chain until appends were serialised, a reminder that tamper evidence is only as good as its ordering. Making a person confirm every extracted value before sealing kept the parser's mistakes out of the record.

DistraAINext project