Components
The trustees, the auditor and the bidder’s wallet can each use a lightwallet server they choose. The coordinator’s own Zaino is just the default.Crate and package map
Pure means no network or disk I/O, no clock and no randomness. Pure code is what an auditor has to read to trust a result, and it can run unchanged in the coordinator, a CLI and a browser.Sequences
(a) DKG relay
(b) Bid, deposit mode
(c) Bid and reveal, sealed-reveal mode
(d) Close and publish
(e) Refund batch signing (2-of-3)
(f) Independent audit
DKG relay security
Status:Testnet. Code: crates/sealforge-coordinator/src/routes/dkg.rs, crates/sealforge-cli/src/trustee.rs, sealforge_api::auth::{sign_dkg_package, verify_dkg_package}.
- Round 1 is signed by the sender. Each package carries an Ed25519 signature over the auction code, round, sender slot, recipient slot and payload. The coordinator verifies it on receipt, and every trustee verifies it again before use (
checked_payload). - Round 2 is sealed and signed. Each per-recipient package is sealed to the recipient’s X25519 key (
crypto_boxsealed box) and then signed by the sender. The coordinator relays ciphertext it can’t read. - The escrow is derived only when all three trustees report the same public key package. A mismatch returns
409 dkg_mismatch, is written to the audit log, and requires a restart. Relayed packages are deleted once the escrow exists. - Out-of-band fingerprint. Each trustee prints a short fingerprint of the public key package (
trustee::fingerprint). Trustees MUST compare it over a separate channel. That’s what catches a coordinator that gave different trustees different views. - Concurrency (SECURITY-REVIEW F3). Joins and completions lock the auction row (
SELECT … FOR UPDATE), so trustees finishing at the same moment can’t deadlock or double-transition. Tests:dkg_e2e::three_trustees_run_the_dkg_through_the_coordinatorjoins and completes all three concurrently.
API authentication
Status:Testnet. Code: crates/sealforge-api/src/auth.rs (scheme), crates/sealforge-coordinator/src/auth.rs (clock, nonce store, role lookups).
- Ed25519 keys stay on the organiser’s or trustee’s machine. The server stores public keys only.
|ts − server time| ≤ 60 s(MAX_CLOCK_SKEW_SECS).- Each
(key, nonce)is accepted once (api_noncestable). Nonces older than 10 minutes are purged, which is safe because the timestamp window is much shorter. - Tests:
auth::tests::*,rejects_bad_signatures_and_stale_timestamps,organiser_registration_requires_invite_and_rejects_replays.
Data model
Postgres, forward-only migrations inmigrations/, applied when the coordinator starts. Schema reference: 05-BACKEND-SCHEMA.md (design history).
Encrypted columns (
pgp_sym_encrypt with SF_DATA_KEY): auctions.escrow_ufvk_enc, bids.refund_ua_enc, bids.memo_refund_ua_enc.
Retention. Thirty days after an auction is settled or cancelled, the coordinator’s retention job (crates/sealforge-coordinator/src/retention.rs, hourly) erases its escrow UFVK, deletes the escrow wallet file, and erases every bidder’s encrypted refund address. It records auctions.data_erased_at and an audit-log entry with counts, never values (THREAT-MODEL.md). The published result, the bids without addresses, the batches and the audit log stay as evidence, and the restore drill checks that erased auctions still audit from published data. The coordinator also purges relayed DKG packages once the escrow exists, used signature shares on a reset, and API nonces after 10 minutes.
Deployment
Status:Testnet (hosted instance at sealforge.auction).
- Compose:
infra/docker-compose.yml: Postgres; Zebra, Zaino and Envoy (profilenode); coordinator and Caddy (profileapp). Coordinator image:infra/coordinator.Dockerfile. Runbook:infra/README.md. - Caddy (
infra/Caddyfile): TLS, and access logs withremote_ip,client_ipandX-Forwarded-Fordeleted. Caddy redactsAuthorizationby default (SECURITY-REVIEW AC14). - Envoy (
infra/envoy.yaml,infra/envoy-tls.yaml): gRPC-web to gRPC in front of Zaino, CORS limited to the gRPC-web headers. - Backups:
scripts/backup.sh(custom-format dump plus the wallet directory),scripts/restore-drill.sh(restores into a scratch database and checks migrations, row counts, and that every UFVK and refund address decrypts). Drill record: evidence/backup-drill.md. Encryption withageand the off-site copy are not drilled yet. - If
SF_DATA_KEYis lost, the coordinator can’t spend the escrows. Its copy of the FVK (nk,rivk) is inside the encrypted UFVK. Each trustee also keeps the FVK with its key share and in its backup string (#52), so two trustees still hold everything a spend needs; building that spend without the coordinator isn’t automated yet (#64). KeepSF_DATA_KEYoutside every backup, in a password manager plus an offline copy.
Browser supply chain
- WASM provenance. Each module in
apps/web/public/{auditor,scanner,signer,wallet}/ships aBUILD.jsonwith the crate, git commit, whether the tree was clean,rustc, clang (for modules with C code),wasm-bindgenand the module’s SHA-256. Modules are built withscripts/build-wasm.sh, inside a pinned container (infra/wasm-build/Dockerfile: the Rust image by digest, clang 19, wasm-bindgen 0.2.129), always forlinux/amd64(Cargo mixes the host CPU into crate hashes that reach the.wasm; Apple silicon runs it under emulation), so any machine with Docker gets the same bytes. - Checked on every pull request (
.github/workflows/ci.yml, jobwasm):scripts/check-wasm-builds.shrequires eachBUILD.jsonto record a clean build and the committed module’s SHA-256; then CI rebuilds all four in the same container and fails if any committed.wasmor.jsdiffers from the fresh build. - To check a module yourself: check out the commit, run
scripts/build-wasm.sh, and compare with what the site serves (/auditor/BUILD.jsonand the.wasmnext to it). - Before #61 (stated plainly): modules were built on developers’ machines, the wallet from a dirty tree, and CI’s own builds differed from the committed ones. All four were rebuilt in the container from clean trees.
- CSP (production;
apps/web/src/lib/csp.ts, applied byapps/web/src/proxy.ts): every page response carries a fresh nonce, andscript-src 'self' 'nonce-…' 'strict-dynamic' 'wasm-unsafe-eval'lets only scripts with that nonce, or loaded by one, run; no'unsafe-inline', no eval beyond compiling WebAssembly.worker-src 'self';connect-src 'self' https:plus the configured lightwalletd origin, so the browser rescan can reach the auditor’s chosen server;object-src 'none';base-uri 'none';frame-ancestors 'none'; plusX-Frame-Options: DENYandX-Content-Type-Options: nosniff. Styles keep'unsafe-inline', since the motion system animates through style attributes and CSS can’t run code. Workers and the WebAssembly modules’ files get a fixed policy without inline scripts (next.config.ts). Pages render per request, as nonces require. - No third-party requests: fonts and scripts are self-hosted. The only cross-origin traffic is to the lightwallet server the user chooses.