Build
Architecture
The parts of Mitome, what runs where, and what each one can and can't see.


The parts
| Part | Runs | Does | Can't |
|---|---|---|---|
Web app (apps/web, Vite + React) | Browsers | The owner app, the form people answer, embeds, receipts | — |
| Answer worker | The person's browser | Holds their secret, builds and proves the Midnight call, seals it | — |
API (apps/api, Hono on Node) | Mitome's server | Accounts, forms, publishing, paying fees, storing sealed answers, claims and files, relaying owner actions, draws, tickets and check-in, updates, reminders, the daily email, link previews, webhooks, the Preprod read-only window | Read an answer or a claim, sign an owner action, change a proven call |
MCP server (apps/api/src/mcp) | Mitome's server, at /mcp | Lets AI agents build, check and publish forms after OAuth consent | Read answers or claims |
Checker (apps/verify, Hono on Node) | Mitome's server | Checks passports, emails, accounts and wallets; signs passes | See answers |
Form contract (packages/contract) | Midnight | Accepts an answer with a valid proof, once per person; enforces open, paused, closed | — |
| Postgres | Mitome's server | Forms, sealed answers, hashed lists, sessions | — |
| Proof server | Mitome's server | Proves deploys and owner actions (their inputs are all public) | Anything for answers: people prove those themselves |
What talks to what
- The person's browser fetches the published form from the API (never with cookies), talks to the checker for checks, reads the team's keys from Midnight's indexer (directly on Preview, through Mitome's read-only window on Preprod) and checks there that it hasn't answered, sends the sealed answer to the API, and follows its receipt through the API.
- The owner's browser talks to the API, opens answers with its own key, and reads receipts from the indexer (the same way) for the integrity check.
- The door's phone reads each entry's key from the indexer when check-in opens and checks tickets against it; Mitome's server checks newer entries and records each ticket's use once.
- The API holds the sponsor wallet: it deploys contracts, pays answers' fees and submits owner actions to a Midnight node.
- The checker verifies ZKPassport proofs itself (reading ZKPassport's certificate registry from Ethereum), talks to GitHub, Discord and X for sign-in, and to public Ethereum and Base nodes for balances. Both servers send email through Resend.
The repo
| Folder | What |
|---|---|
apps/web | The owner app, the respondent page and public/embed.js |
apps/api | The API, sponsor, publisher, webhooks |
apps/verify | The checker |
apps/site | The landing page (Next.js) |
apps/docs | These docs (Next.js, Fumadocs) |
apps/lab | A small lab app that measured answering in a plain browser |
packages/contract | form.compact, witnesses, signing, the walletless answer, the sponsor's shape check, tests, SPEC.md |
packages/crypto | Sealed boxes, answer signatures, vault and recovery key, list hashing |
packages/form-schema | The form document schema, logic, rules hash, limits |
packages/db | The database schema and migrations |
packages/ui | Mitome's design tokens and components |
examples/webhook-receiver | A server that opens webhook payloads |
Toolchain
Compact 0.36.1, compact-runtime 0.21.0, midnight-js 5.0.1, wallet SDK 2.0.1, zkir-v3 3.2.1, ledger v9, proof server 9.0.2, Node 22, npm 11. The pins follow the set Midnight's own examples are tested with.