How I built it: The "before" app is a small Express server and vanilla JS frontend with three articles, one gated behind a naive date-of-birth form that gets written straight to a JSON file on disk.

For the "after" version, compact/age_verification.compact defines the actual zero-knowledge circuit: a private witness (date of birth, as days since epoch) compared against a public cutoff date, returning a boolean. midnight/prover.js runs client-side, evaluating that same comparison locally so the birthdate never leaves the browser. midnight/verifier.js runs server-side and only ever receives the proof result plus the public cutoff date, never a birthdate. The original before-hackathon files are kept in the repo (server.before.js, app.before.js, admin.before.html) so the diff is easy to inspect directly.

Challenges we ran into: The build environment didn't have Midnight's compactc compiler or a live proof server available, so the proving/verification step is simulated rather than run against real Midnight infrastructure disclosed directly in code comments in prover.js and verifier.js. What's real and tested end-to-end is the privacy property that matters: the birthdate is read once in the browser and never serialized, transmitted, or stored anywhere.

What's next: Compiling the circuit against a real compactc toolchain and wiring in an actual Midnight proof server and wallet integration via midnight.js, so the proof itself is cryptographically sound rather than simulated.

Built With

Share this project:

Updates

Submission history