Inspiration
Every time you search your symptoms online, that data gets logged, profiled, and sold. Health data is the most personal information you have, and yet every AI health tool today requires you to hand it over to a server. We wanted to prove that does not have to be the case.
What it does
PrivateDoc is an AI-powered health symptom checker that gives users real medical insights without ever exposing their raw symptom data. Users select a symptom category, describe what they are experiencing, and receive a full AI analysis including possible conditions, urgency level, recommendations, and self-care steps. The key difference is that Midnight's zero-knowledge proof system ensures only a session ID ever touches the blockchain. Your symptoms never leave your device unencrypted, never get stored, and never get seen by anyone.
How we built it
- React frontend with a live privacy pipeline that animates as analysis runs
- Express backend calling the Claude API for AI health insights
- Midnight blockchain with a custom Compact smart contract that records only a session ID and proof count on chain, never symptom data
- Zero-knowledge proofs generated locally via Midnight's proof server, using symptoms as a private witness \( w \) such that the proof \( \pi \) attests the circuit ran without revealing \( w \)
Challenges we ran into
Setting up the Midnight toolchain on Windows was the biggest hurdle. The Compact compiler requires WSL, and getting Docker, WSL, and the proof server all working together took a lot of debugging. We also had to carefully design the smart contract so that symptom data is bound into the ZK circuit as a private input but never disclosed to the public ledger.
Accomplishments that we're proud of
Getting the full ZK proof pipeline working end to end was the big one. Seeing the Midnight session ID appear on screen after a real proof was generated locally felt like the whole thing clicked. We are also proud of how the UI turned out. It looks professional and makes the privacy story easy to understand for anyone, not just developers.
What we learned
Zero-knowledge proofs are a genuinely powerful tool for privacy-preserving AI. The core idea is that you can prove a computation happened without revealing its inputs. That opens up entirely new categories of applications, not just in health, but anywhere sensitive data meets AI. We also learned that Midnight's Compact language is more approachable than expected if you already know TypeScript.
What's next for PrivateDoc
- Real Midnight mainnet deployment
- Symptom history tracking where only the user can decrypt their own records
- Integration with wearable health data
- Expanding beyond health into other sensitive use cases like financial and legal advice
Built With
- claude-api
- compact
- docker
- express.js
- midnight-blockchain
- node.js
- react
- typescript
- wsl
Log in or sign up for Devpost to join the conversation.