Inspiration

I kept coming back to one uncomfortable fact: prior authorization often forces clinics to send sensitive charts: diagnosis codes, labs, months diagnosed to a payer who really only needs a yes or no against a published policy.

That felt like the wrong privacy bargain. Midnight’s idea of rational privacy clicked for me: prove what matters, disclose only what must be public. And the AI Track made the question sharper. Can AI still be useful when the sensitive data never becomes public ledger state?

ProofPath is my answer to that. Not a DeFi toy. A product-shaped workflow patients, clinics, and payers could actually recognize.

What it does

ProofPath is privacy-preserving clinical prior authorization on Midnight Preview.

  1. A patient (demo) chart stays local, diagnosis, A1c×10, tenure.
  2. Gemini coaches eligibility against Policy 47 without uploading PHI to an insurer.
  3. A clinic attestation is signed (Schnorr-on-Jubjub) and verified in-circuit.
  4. Compact requestAuth proves the policy rules with a ZK proof.
  5. On-chain, the payer only sees policyId + AUTHORIZED or DENIED.
  6. The UI makes that contrast obvious: Patient workspace vs Payer portal vs Explorer.

Live on Preview

How we built it

Solo build over the hackathon weekend:

  • Compact circuits (requestAuth, registerProvider) inspired by Midnight’s example-zkloan Schnorr pattern
  • Express + TypeScript backend for attestation, Gemini assist, and one-click ZK auth
  • React + Vite + Tailwind frontend with Patient / Payer / Explorer views
  • Deployed and exercised on Midnight Preview (remote proof server + Lace)

The intentional split: real ZK + real Gemini + real Preview txs; mock clinic EHR and a single demo policy so the story stays complete.

Challenges we ran into

Honestly, the sharp edges taught me the most.

  • Node version landmines — Node 20 broke wallet sync (pendingOutputs.values.map…). Node 22 fixed it. Small detail, huge time sink.
  • Private state discipline — calling LevelDB before setContractAddress fails in confusing ways. Midnight private state is powerful, but unforgiving.
  • Compact Maps aren’t iterable — no for…of; I had to probe authId ranges for the payer view.
  • Proof latencyrequestAuth takes ~a minute on Preview. The UI needed staged progress so the demo doesn’t feel “stuck.”
  • Explorer deep-linkstxIdtxHash. Early links 404’d until I learned Preview explorer wants /transactions/0x{hash}.

None of that killed the product, it just forced me to build for reality, not a happy-path slide.

Accomplishments that we're proud of

  • A full path that judges can see: AI → prove → payer sees a decision without clinical numbers.
  • Real Preview deployment + successful requestAuth (Policy 47 · Authorized).
  • A UI that teaches the privacy boundary instead of hiding it in docs.
  • Shipping as a solo builder without abandoning the healthcare story for something easier.

What we learned

Selective disclosure is not a slogan, it’s a product design constraint. Once I treated “what never leaves the witness” as a first-class UI concept, the whole app got clearer.

I also learned Midnight rewards careful ops: same admin secret as deploy, Node 22, patience with Preview sync, and respect for the private-state lifecycle.

And personally: AI Track doesn’t mean “add a chatbot.” It means showing that capable AI can coexist with strong privacy. Gemini helps the patient, Midnight protects them.

What's next for ProofPath

  • Selective-disclosure appeals (patient chooses which extra fields to reveal for a dispute)
  • Richer policy packs beyond Policy 47
  • Stronger clinic/EHR integration (less mock)
  • Mainnet-ready hardening once Preview lessons are baked in

If this weekend proved anything, it’s that healthcare + Midnight isn’t a stretch narrative, it’s one of the clearest homes for rational privacy.

Built With

  • ai
  • compact
  • healthcare
  • lace
  • midnight
  • schnorr
  • typescript
  • zk
Share this project:

Updates