Build

Architecture

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

Mitome's system: the ZKPassport app on the person's phone sends a proof to their browser; the person's browser gets a pass from Mitome's checker and sends the sealed answer to Mitome's API; the owner's browser gets forms and sealed answers from the API; the API adds the DUST fee and submits to the form contract on Midnight; AI agents reach the API over MCP with OAuth; the door's phone checks tickets with the API; the API sends browser reminders and the team's daily email; the browsers and the door read Midnight's indexer
Answers are sealed and proven in the person's browser; the owner's browser opens them and checks them against Midnight.

The parts

PartRunsDoesCan't
Web app (apps/web, Vite + React)BrowsersThe owner app, the form people answer, embeds, receipts—
Answer workerThe person's browserHolds their secret, builds and proves the Midnight call, seals it—
API (apps/api, Hono on Node)Mitome's serverAccounts, 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 windowRead an answer or a claim, sign an owner action, change a proven call
MCP server (apps/api/src/mcp)Mitome's server, at /mcpLets AI agents build, check and publish forms after OAuth consentRead answers or claims
Checker (apps/verify, Hono on Node)Mitome's serverChecks passports, emails, accounts and wallets; signs passesSee answers
Form contract (packages/contract)MidnightAccepts an answer with a valid proof, once per person; enforces open, paused, closed—
PostgresMitome's serverForms, sealed answers, hashed lists, sessions—
Proof serverMitome's serverProves 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

FolderWhat
apps/webThe owner app, the respondent page and public/embed.js
apps/apiThe API, sponsor, publisher, webhooks
apps/verifyThe checker
apps/siteThe landing page (Next.js)
apps/docsThese docs (Next.js, Fumadocs)
apps/labA small lab app that measured answering in a plain browser
packages/contractform.compact, witnesses, signing, the walletless answer, the sponsor's shape check, tests, SPEC.md
packages/cryptoSealed boxes, answer signatures, vault and recovery key, list hashing
packages/form-schemaThe form document schema, logic, rules hash, limits
packages/dbThe database schema and migrations
packages/uiMitome's design tokens and components
examples/webhook-receiverA 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.

On this page