TrialChain

Privacy-first clinical trials — patients prove eligibility without revealing their medical records.

Repo

About

## Wave 5 submission

WHAT WE BUILT

6-transition Leo smart contract on Aleo Testnet + Next.js 14 frontend with 4 role-based interfaces (Patient, Sponsor, Hospital/IRB, Regulator).

TRANSITION 1 — register_trial (Suppression Lock) Before enrollment begins, sponsor pre-commits to results using BHP256: commitment = BHP256::commit_to_field((result_hash, 0u32, 0u32), salt) Salt is a private ZK input — never on-chain. Commitment is. When results are posted, contract recomputes and asserts match. Wrong hash = rejected. Negative outcomes cannot be buried. The math won't allow it.

TRANSITION 2 — issue_credential (Privacy Boundary) Hospital issues PatientCredential record with age: u8, condition_hash: field, lab_value: u64 as PRIVATE inputs into the ZK circuit. Output is an encrypted record — only the patient's wallet can decrypt it. After issuance, even the hospital cannot read it. No mapping writes. Zero PII ever touches the chain.

TRANSITION 3 — enroll_patient (Core ZK Innovation) Patient submits private PatientCredential + public trial_id. Inside the ZK circuit: assert(credential.age >= trial.min_age) ← PRIVATE assert(credential.condition_hash == required) ← PRIVATE Verifier gets a valid proof that all checks passed — but never sees age, diagnosis, or lab value. Nullifier = BHP256(patient) XOR trial_id prevents double enrollment. Enrollment count increments publicly. Nobody knows who the 47 enrolled patients are.

TRANSITION 4 — commit_results (Accountability) Sponsor posts results with their private SponsorKey record. Contract recomputes BHP256 commitment and asserts it matches what was locked at registration. Falsified counts or swapped result hash = tx rejected. Result hash (IPFS CIDv1) written publicly — anyone can verify.

TRANSITION 5 — claim_compensation (Patient Value) Cross-program call to test_usdcx_stablecoin.aleo/transfer_private pays patient USDCx privately. ZK record system breaks transaction graph — outgoing and incoming payments cannot be linked. compensated mapping (nullifier => bool) prevents double claims.

TRANSITION 6 — verify_enrollment (Selective Disclosure) Patient proves participation to regulator without revealing identity. Returns BHP256::hash_to_field(nullifier) — verifiable against used_nullifiers mapping. Patient controls exactly what they disclose.

FRONTEND: Shield Wallet via @demox-labs/aleo-wallet-adapter-react, DecryptPermission.UponRequest, requestRecords() for private record fetching, ZK proof generated client-side in WASM before broadcast.

From the public Akindo product page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

Not checked yet.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.