Part of #131. A cryptographic-soundness gut-check + proper documentation of the E2E design, grounded in prior art, validating N-peer P2P scaling.
Deliverables
- Design-level review (before more 3b code): multi-lens adversarial crypto review →
docs/E2E_ENCRYPTION.md v1 + findings list.
- Implementation-level review (after 3b/3c land, before 3d's confidentiality gate): verify the code
matches the reviewed design.
Lenses (each grounded in primary-source prior art)
- AEAD usage — XChaCha20-Poly1305, 24-byte random nonce collision-resistance, key sizes, AAD/binding.
- Key wrap — sealed box (ephemeral X25519 ECDH → SHA-256 KDF → AEAD), Ed25519→X25519 birational map, KDF domain-sep + pubkey binding.
- encrypt-then-sign ordering / verify-before-decrypt (ADR-036/037).
- Key distribution + trust — genesis anchor, latest-owner-wrap-wins, signed-op-log integrity, forge/inject resistance.
- Removal/rotation §D3 — forward exclusion; explicit absence of FS/PCS (one symmetric key per KB until rotation).
- Metadata leakage to the key-blind daemon — ciphertext, op-ids (=SHA-256 of ciphertext), epoch client-ids, counts, timing.
- N-peer P2P scaling — O(N) sealed-box wraps per enable/rotation, op-set YMap merge at N, membership-DAG cost, rekey-on-churn.
Prior-art benchmark
MLS/TreeKEM (RFC 9420), Signal Sender Keys, Matrix Megolm, Keyhive/BeeKEM (Ink & Switch, ADR-037 §D4), CRDT-E2E (Jazz, Y-Sweet). Position our "single per-KB symmetric content key, sealed-box-wrapped to each member, distributed via the signed membership log, rotated on removal" honestly; confirm v1 (Sender-Keys-style, no FS/PCS) is a sound documented starting point with TreeKEM/BeeKEM as the named next step.
Outcome
Real bugs block the relevant PR (3b/3c); design limitations documented (not silently shipped). docs/E2E_ENCRYPTION.md: threat model, primitives, key lifecycle, what-is/isn't-protected, scaling analysis, prior-art table, findings.
Part of #131. A cryptographic-soundness gut-check + proper documentation of the E2E design, grounded in prior art, validating N-peer P2P scaling.
Deliverables
docs/E2E_ENCRYPTION.mdv1 + findings list.matches the reviewed design.
Lenses (each grounded in primary-source prior art)
Prior-art benchmark
MLS/TreeKEM (RFC 9420), Signal Sender Keys, Matrix Megolm, Keyhive/BeeKEM (Ink & Switch, ADR-037 §D4), CRDT-E2E (Jazz, Y-Sweet). Position our "single per-KB symmetric content key, sealed-box-wrapped to each member, distributed via the signed membership log, rotated on removal" honestly; confirm v1 (Sender-Keys-style, no FS/PCS) is a sound documented starting point with TreeKEM/BeeKEM as the named next step.
Outcome
Real bugs block the relevant PR (3b/3c); design limitations documented (not silently shipped).
docs/E2E_ENCRYPTION.md: threat model, primitives, key lifecycle, what-is/isn't-protected, scaling analysis, prior-art table, findings.