[vault] Domi identity: the root key in the vault; v0.7.0 #9

Manually merged
mnovak merged 3 commits from feature/domi-identity into main 2026-11-03 19:04:40 +01:00
Owner

The Domi identity's root key in the vault (Fundamentum day 1). Version 0.7.0.

  • custos-vault::identity: a typestate for creating the identity (Enrollment::begin → show → confirm → import). The 24 words are shown once, three are typed back, then the root is imported and the entropy wiped. Importing before showing does not compile: there are three compile_fail doctests, and I checked that each fails with E0599 "no method named …", not by accident.
  • A new optional body member, identity (root secret, public key, created, issued certs). Old vaults open as before.
  • Vault::domi_root_public, domi_sign_cert (only TSC1 ‖ this root ‖ …, prefixed with tessera cert v1\0), domi_issued, domi_record, domi_created. Nothing returns the root secret.
  • custos-wasm: a domi_pair op seals a phone's device public key and name to the waiting PC for domi-pair:<id>.
  • docs/IDENTITY.md (written first), plus a note in docs/FORMAT.md.

Tests (release)

  • custos-vault tests/identity.rs: 10. They cover the zero vector shared with Fundamentum (vCrwX9p4…), same mnemonic → same root, words shown before anything is imported, wrong words refused and retryable, one identity per vault, signing certs only, survival across save/open in v1 and v2, Debug redaction, and a locked public surface.
  • custos-vault doctests: 1 runnable plus 3 compile_fail order traps.
  • custos-wasm tests/factors.rs: +1 (a_phone_pairs_as_a_domi_device).
  • The whole workspace is green; clippy has no new warnings (custos-keys has one older warning).

Self-review: what could still be wrong

  • An older Custos drops identity when it saves the vault, because readers ignore unknown members and do not round-trip them. I chose not to bump the vault version, since that would lock the phone's web vault out until the server is rebuilt. Every Custos that saves the vault must be ≥ 0.7.0, and the words recover the root anyway. This is documented in IDENTITY.md and FORMAT.md.
  • The root's derivation is implemented twice: here (to import) and in Fundamentum's tessera (for recovery and tests). A shared pinned vector guards against drift, but there are still two implementations.
  • Enrollment::with_entropy is public, for vectors. Custos uses begin(); nothing stops a careless caller from passing weak entropy.
  • cargo fmt reflowed one older line in lib.rs.

Not verified

  • The wasm32 build was not compiled here (this machine has no wasm32 target). The Custos flake build in WSL is the first real compile of domi_pair for the browser.
The Domi identity's root key in the vault (Fundamentum day 1). Version 0.7.0. - `custos-vault::identity`: a typestate for creating the identity (`Enrollment::begin → show → confirm → import`). The 24 words are shown once, three are typed back, then the root is imported and the entropy wiped. Importing before showing does not compile: there are three `compile_fail` doctests, and I checked that each fails with E0599 "no method named …", not by accident. - A new optional body member, `identity` (root secret, public key, created, issued certs). Old vaults open as before. - `Vault::domi_root_public`, `domi_sign_cert` (only `TSC1 ‖ this root ‖ …`, prefixed with `tessera cert v1\0`), `domi_issued`, `domi_record`, `domi_created`. Nothing returns the root secret. - `custos-wasm`: a `domi_pair` op seals a phone's device public key and name to the waiting PC for `domi-pair:<id>`. - `docs/IDENTITY.md` (written first), plus a note in `docs/FORMAT.md`. ## Tests (release) - custos-vault `tests/identity.rs`: **10**. They cover the zero vector shared with Fundamentum (`vCrwX9p4…`), same mnemonic → same root, words shown before anything is imported, wrong words refused and retryable, one identity per vault, signing certs only, survival across save/open in v1 and v2, Debug redaction, and a locked public surface. - custos-vault doctests: 1 runnable plus 3 `compile_fail` order traps. - custos-wasm `tests/factors.rs`: +1 (`a_phone_pairs_as_a_domi_device`). - The whole workspace is green; clippy has no new warnings (custos-keys has one older warning). ## Self-review: what could still be wrong - **An older Custos drops `identity` when it saves the vault**, because readers ignore unknown members and do not round-trip them. I chose not to bump the vault version, since that would lock the phone's web vault out until the server is rebuilt. Every Custos that saves the vault must be ≥ 0.7.0, and the words recover the root anyway. This is documented in IDENTITY.md and FORMAT.md. - The root's derivation is implemented twice: here (to import) and in Fundamentum's `tessera` (for recovery and tests). A shared pinned vector guards against drift, but there are still two implementations. - `Enrollment::with_entropy` is public, for vectors. Custos uses `begin()`; nothing stops a careless caller from passing weak entropy. - `cargo fmt` reflowed one older line in `lib.rs`. ## Not verified - **The wasm32 build was not compiled here** (this machine has no wasm32 target). The Custos flake build in WSL is the first real compile of `domi_pair` for the browser.
mnovak added 3 commits 2026-11-03 19:04:15 +01:00
mnovak manually merged commit 73d9de2304 into main 2026-11-03 19:04:40 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mnovak/CustosPublic#9