Encryption and keys
How answers are sealed to a team, signed so nobody can change them, and how owners keep and recover their keys.
All cryptography is in packages/crypto, built only on @noble's audited libraries (ciphers, curves, hashes 2.4.0).
Sealing an answer
An answer is sealed once to every key on the form's answerKeys set (1 to 8 team members), read from Midnight (on Preprod through Mitome's read-only window onto Midnight's indexer):
A random 32-byte content key encrypts the answers with XChaCha20-Poly1305.
For each team key, an ephemeral X25519 exchange and HKDF-SHA256 give a key that wraps the content key.
Everything is bound to the form's contract address and the answer's one-time public key, so a sealed answer can't be moved to another form or another receipt.
0x01 ‖ ephemeral key (32) ‖ n (1) ‖ n × [ fingerprint (8) ‖ nonce (24) ‖ wrapped key (48) ] ‖ nonce (24) ‖ answersAnswers are padded to a multiple of 256 bytes so the stored size doesn't reveal how long they are; files are sealed the same way and padded to a multiple of 4,096 bytes. The sealed box format is adapted from Midnight's voting example.
Signing it
Each answer gets a one-time Ed25519 key. Its public half is recorded on chain in the answer's receipt; its private half signs "mitome:answer-signature:v1" ‖ form address ‖ SHA-256(box) and stays in the person's browser. The API refuses an answer whose signature doesn't match, and the owner's browser checks every one again against the key on chain.
The same key signs a deletion (valid for 5 minutes), a rebuilt proof, the entry's ticket codes (a fresh one every 20 seconds, accepted for 3 minutes) and a draw winner's claim. Every signature has its own domain string, so one can never be passed off as another.
Owners' keys
| Key | Kind | Where it lives |
|---|---|---|
| Answer key | X25519 | Your vault; its public half goes on each form you publish, and on the rest when someone runs Update access |
| Workspace key | Jubjub (Schnorr) | Shared by the team, each copy sealed to that member's answer key; signs owner actions (pause, close, team keys, sealing a draw) and updates to everyone who entered |
| Recovery key | 32 random bytes + 3-byte checksum | Only with you: 56 characters in 14 groups of 4 |
Your vault (your keys, sealed with your recovery key through HKDF-SHA256 and XChaCha20-Poly1305) is stored by Mitome, which can't open it. On a device you've unlocked, the keys are kept in IndexedDB encrypted with a non-extractable WebCrypto AES-GCM key. The recovery key accepts any case, spaces and dashes, and reads O as 0 and I or L as 1; its checksum catches typos.
Lists
Each list has a 32-byte salt. Entries are hashed as HMAC-SHA256(salt, "mitome:list:" + entry) in the owner's browser; the checker hashes what a person proves the same way.
Webhook payloads
Webhooks carry the sealed box, never plaintext. Export your answer key from Settings → Webhooks and your server can open them; Webhooks has a receiver ready to run.