Proofs in the browser, no wallet
How a person's browser builds, proves and seals an answer to Midnight without a wallet, a proof server or tokens, and how Mitome pays for it.
Answering a Midnight contract normally needs a wallet: to hold keys, to prove, and to pay. Mitome's answers need none of that. Every part below is Midnight's own code, wired together in a way the official examples don't show.
- 01
Throwaway keys
Made in the browser for this call
ZswapSecretKeys.fromSeed
- 02
Build the call
Run against the chain's current state
createUnprovenCallTx
- 03
Prove it
In a Web Worker, about 12 s
zkir-v3 prove
- 04
Seal it
Nothing to balance: an answer moves no value
bind()
- 05
Mitome pays
Adds the DUST fee, submits
receipt on Midnight


In the browser
All of Midnight runs in one Web Worker, so typing never stutters while it works.
- Load early. When the form opens (or, in an embed, at the first tap), the worker starts and fetches the circuit's keys: about 4 MB for the answer circuit, cached by the browser after the first form. A module worker drops messages sent while its WebAssembly is still loading, so it says "ready" first and the page waits for that.
- The person's secret. A random 32-byte secret for this form, made once and kept in the browser's storage. It's the private input the circuit uses; it never leaves the worker.
- Prove before Submit. A form without checks is proven as soon as it opens; a form with checks right after the last check passes. Building the call runs the contract against the chain's current state first, so "already answered", "paused" or "closed" show at once, before anything is sent.
- Seal. The proven transaction is bound (
bind()), which locks its contents: a sponsor can add a fee to it, nothing else. - Submit is instant. At Submit the page only encrypts the answers to the team's keys (read from Midnight; on Preprod through Mitome's read-only window), signs them with the answer's one-time key and sends. If the proof is older than 45 minutes, it's made again first.
No proof server is involved: a hosted prover would see the person's secret and could link their answers.
Paid by Mitome
Mitome's API receives the sealed transaction and the sealed answer. Before paying, it checks:
- the signature on the sealed answer, by the one-time key sent with it (once the call is on chain, that key must match the one it recorded);
- that the transaction is a single call to
submitCheckedorsubmitOpenon this form's contract, moving no value; - the form is live, inside its times, under its response limit, the sender's network address is under 30 answers an hour, and the form under 60 a minute.
Then its sponsor wallet adds the DUST fee and submits. The person sees Recording on Midnight… at once; Mitome follows the transaction until it's included and the receipt is in the contract, then marks the answer Recorded on Midnight.
Stale proofs
A proof states how much its call writes, sized against the contract's state when it was built. If other answers change the receipts map before it's included, Midnight can turn it down (error 104). Mitome marks the answer for a rebuild, the person's browser makes a fresh proof with the same answer key and pass, signs it, and Mitome sends it again, up to four more times (five tries in all). In testing this happened to 2 of about 11 answers, and 0 of 8 in a dedicated run.
Measured
On a local Midnight network, 2026-11-20 and 21:
| Measured | Result |
|---|---|
| Proof in the browser, first answer | 14.8 s (15.1 s inside an embed on another site) |
| Proof in the browser, warm | 12.35 to 12.39 s |
| Worker ready after the page loads | about 0.5 s |
| Submit to thank-you, proof already made | 0.15 s |
| Sealed answer transaction | 5 KiB |
| Fee added, included and indexed | 16 to 20 s |
| Deploying a form | 15 to 18 s |
On Midnight Preview, 2026-11-23:
| Measured | Result |
|---|---|
| Publishing a form | 17.6 to 22.7 s; fee about 5.5 DUST |
| Submit to thank-you, proof already made | 0.0 s (open form), 0.8 s (work-email check) |
| Submit to "Recorded on Midnight" | 18.0 s (open form), 23.5 s (work-email check) |
| Fee for an answer | 0.36 DUST, paid by Mitome |
No special headers are needed (no cross-origin isolation), so the same works inside an embed on any site.
The form contract
form.compact, the Compact contract every form deploys: its public state, its circuits, and the checks each one makes.
One answer per person
Nullifiers let the contract refuse a second answer from the same person without ever learning who they are, and keep their answers to different forms unlinkable.