docs(design): M8-3 desktop KEM key provisioning — server-truth SK blob, unlock-hooked, multi-device safe (#223) #226

Merged
amiryahaya merged 1 commit from docs/m8-3-kem-provisioning-design into main 2026-11-18 07:53:06 +01:00
Owner

Design for M8-3 (audit #214), first work item of M4 epic #223. Doc: docs/plans/2026-11-18-m8-3-kem-key-provisioning-design.md.

The four decisions to review

  1. SK source of truth on the server (encrypted_private_keys AES-GCM under the account master key; local settings = cache) — this is what makes the second-device path reconstruct instead of regenerate-and-clobber. Alternative (device-local-only SKs) rejected with rationale in §4.1.
  2. Publish via PATCH /me/keys only (public_keys + encrypted_private_keys); never touch KemPublicKey (pairing/recovery channel) or encrypted_master_key/salt (desktop keeps master key keychain-local). Fields verified nullable-partial server-side — zero server change.
  3. Canonical bundle schema {v:1, ml_kem_pk, kaz_kem_pk, ml_dsa_pk?, kaz_sign_pk?} — spec'd as the 2.5 wallet-convergence target (§4.3).
  4. Awaited hook at end of all three unlock paths, idempotent, offline-tolerant; regeneration after a failed publish forbidden; master-key rotation re-upload obligation noted for M3 (#224).

Open questions in §8 (race acceptance, partial-settings self-heal, schema v field) — flagged non-blocking, recommendations included. TDD plan §6 (8 cases incl. fresh-install repro + second-device path).

Design for **M8-3** (audit #214), first work item of M4 epic **#223**. Doc: `docs/plans/2026-11-18-m8-3-kem-key-provisioning-design.md`. **The four decisions to review** 1. **SK source of truth on the server** (`encrypted_private_keys` AES-GCM under the account master key; local settings = cache) — this is what makes the second-device path reconstruct instead of regenerate-and-clobber. Alternative (device-local-only SKs) rejected with rationale in §4.1. 2. **Publish via PATCH /me/keys only** (`public_keys` + `encrypted_private_keys`); never touch `KemPublicKey` (pairing/recovery channel) or `encrypted_master_key`/salt (desktop keeps master key keychain-local). Fields verified nullable-partial server-side — **zero server change**. 3. **Canonical bundle schema** `{v:1, ml_kem_pk, kaz_kem_pk, ml_dsa_pk?, kaz_sign_pk?}` — spec'd as the 2.5 wallet-convergence target (§4.3). 4. **Awaited hook at end of all three unlock paths**, idempotent, offline-tolerant; regeneration after a failed publish forbidden; master-key rotation re-upload obligation noted for M3 (#224). Open questions in §8 (race acceptance, partial-settings self-heal, schema `v` field) — flagged non-blocking, recommendations included. TDD plan §6 (8 cases incl. fresh-install repro + second-device path).
docs(design): M8-3 desktop KEM key provisioning — server-truth SK blob, unlock-hooked, multi-device safe (#223)
All checks were successful
Security CI / security-scan (pull_request) Successful in 1m57s
0e42086eab
Design for the first M4 work item (audit #214 M8-3): provision ML-KEM-768 +
KAZ-KEM-256 at first unlock. Core decisions:
- Source of truth = /me/keys encrypted_private_keys (SKs AES-GCM under the
  account master key); local settings are a decrypted cache — makes the
  second device reconstruct instead of regenerate-and-clobber.
- Canonical public_keys bundle schema {v:1, ml_kem_pk, kaz_kem_pk, ...}
  spec'd as the 2.5 wallet-convergence target.
- Awaited hook at the end of all three unlock paths; idempotent fast path;
  offline-tolerant with same-keys retry (never regenerate post-generation).
- No server change required (UpdateKeys fields verified nullable/partial);
  KemPublicKey (pairing/recovery channel) untouched.
- Deletes the dead generate_kem_keypair command; TDD plan with 8 cases
  incl. the fresh-install repro and the second-device path.
Sign in to join this conversation.
No description provided.