Proving health facts with absolute cryptographic certainty. Sharing zero medical data.
β οΈ DISCLAIMER: This application is live and running entirely on the Midnight PREPROD Network.
- Live Preprod Demo: https://verihealth-preprod.vercel.app (Live VeriHealth Application on Preprod)
- GitHub Repository: https://github.com/thisisouvik/VeriHealth
- Product X (Twitter): https://x.com/verihealth_web3 (Official VeriHealth X Profile)
- Demo Video: Watch the VeriHealth MVP Demo
For a deeper dive into the technical setup, usage, and original vision for VeriHealth, please refer to our detailed markdown guides:
- SETUP.md β Comprehensive guide on configuring the WSL2 environment, installing the Compact compiler, and spinning up the Midnight network.
- USAGE.md β Step-by-step walkthrough of the workflows for Admins, Issuers (Hospitals), and Patients.
- PROPOSAL.md β The original hackathon proposal detailing the core problem, our privacy-first solution, and business model.
- About the Product
- Public State vs Private Witness
- Project Screenshots
- Smart Contracts
- System Architecture
- User Workflow
- File Structure
- Testing
- Future Implementation
Healthcare data sharing today is all-or-nothing. Proving a single fact β vaccination status, procedure eligibility, allergy-free status β typically requires handing over an entire medical record or portal login. Every recipient of that data becomes a new breach target and a new compliance liability, even though regulations like HIPAA and GDPR explicitly call for data minimization. Current tooling forces a trade-off between usability and privacy that the law does not actually require.
VeriHealth is a zero-knowledge health credential network built entirely on the Midnight Blockchain. Hospitals and labs issue medical facts as cryptographically signed credentials that never leave the patient's device. To prove something to an employer, insurer, or pharmacy, the patient's wallet generates a Zero-Knowledge proof β mathematical evidence the fact is true β without revealing why.
Verifiers check the proof on-chain in milliseconds and learn only the answer (e.g., VALID: YES), never the medical record.
VeriHealth leverages Midnight's native Data Protection features to separate what is public from what is private:
- Public State: The registry of authorized issuers (Hospitals/Labs) and the cryptographic commitments of the credentials. This ensures anyone can verify who issued a credential and that it hasn't been revoked, ensuring trust without central authorities.
- Private Witness: The actual clinical data (blood pressure, specific test results, PII). This data stays purely on the Patient's device. During verification, the ZK Circuit acts as a private witness, asserting that the patient holds a valid credential matching the public commitment, without ever leaking the payload to the network.
Landing Page
Admin Panel (Registering Issuers)
Issuer Portal (Form & Issuing)
Patient Dashboard
Verifier Portal (Challenge & Results)
Our smart contracts are written in Compact and deployed on the Midnight PREPROD network. They handle institutional trust through authorized registries and credential revocation.
| Action | Txn ID / Contract Address | Explorer Link |
|---|---|---|
| π Contract Deployment | 4779029ff10019881b4125128c60b5f7aecaa00820614dac825271d2d830f47a |
View on Explorer |
| π₯ Register Issuer Tx | 1579645f5e6c7ad2f33a009300870386636574ef9ea16e289a0687addd7afec5 |
View on Explorer |
| π Issue Credentials Tx | 3030488a6b33e15b2fbc5ee1dd6b88ed3b65b6b2377a721ccab4de5c9d315fd2 |
View on Explorer |
graph TD
subgraph Frontend [Next.js App UI]
AdminUI[Admin Dashboard]
IssuerUI[Issuer Portal]
PatientUI[Patient Portal]
VerifierUI[Verifier Portal]
end
subgraph Backend [Next.js API & DB]
API[API Routes]
DB[(Prisma PostgreSQL)]
end
subgraph Midnight [Midnight PREPROD Network]
Compact[verihealth.compact]
ZK[Zero-Knowledge Proofs]
end
AdminUI -->|Authorize| API
IssuerUI -->|Create Credential| API
PatientUI -->|Query Facts| API
VerifierUI -->|Verify ZK Challenge| API
API <-->|State Cache| DB
API -->|Submit ZK Proofs| ZK
ZK <-->|Verify| Compact
sequenceDiagram
actor Admin
actor Hospital as Issuer (Hospital)
actor Patient
actor Employer as Verifier (Employer)
participant Midnight as Midnight Blockchain
Admin->>Midnight: 1. Deploy Contract
Admin->>Midnight: 2. Register Hospital Public Key
Hospital->>Patient: 3. Verify real-world identity
Hospital->>Midnight: 4. Issue Credential (ZK Commitment)
Midnight-->>Patient: 5. Store Private Data Locally
Employer->>Patient: 6. Request Work Clearance Proof
Patient->>Midnight: 7. Generate ZK Proof via 1 AM Wallet
Patient-->>Employer: 8. Provide Shareable Link / QR
Employer->>Midnight: 9. Verify Proof mathematically
Midnight-->>Employer: 10. Return "VALID" (No data leaked)
VeriHealth/
βββ app/ # Next.js App Router (Frontend + API)
β βββ (auth)/ # Dashboards (Admin, Issuer, Patient, Verifier)
β βββ api/ # Backend routes interfacing with Midnight SDK
β βββ components/ # Reusable UI components
βββ contracts/ # Midnight Smart Contracts
β βββ src/
β β βββ verihealth.compact # Core ZK Circuit Logic
β βββ artifacts/ # Compiled circuits and prover keys (.bzkir)
βββ prisma/ # Database schema and migrations
βββ __tests__/ # Jest UI test suite
βββ .github/workflows/ # CI/CD Pipelines
βββ assets/ # Documentation images & screenshots
We use Jest and React Testing Library to ensure UI reliability, combined with strict TypeScript checks via our GitHub Actions CI pipeline.
To run tests locally:
npm install
npm run testVeriHealthβs architecture paves the way for a massive transformation in health data handling:
- IoT Medical Devices: Wearables (like glucose monitors or ECG patches) could act as direct issuers to a patient's Midnight wallet. A patient could prove to an insurance company that they maintained healthy thresholds all year without revealing their exact minute-by-minute biometric data.
- Pharmacy Prescriptions: A doctor issues a prescription credential. The patient proves to a pharmacy that they hold a valid script for a specific medication without the pharmacy system having access to their broader medical diagnosis or history.
- Automated Insurance Underwriting: Submitting ZK proofs of health factors to immediately fulfill smart-contract-based insurance policies, bypassing manual claims review and completely eliminating data leaks.
A massive Thank You to the Midnight Team for organizing this incredible hackathon, providing phenomenal documentation, and building a blockchain that genuinely prioritizes data protection and privacy! πβ¨



