fatext v4.0
fatext / proofs / 08-pq-treekem-and-bft-rekey-proof

Proof 08 — Logarithmic PQ-TreeKEM Security & BFT-CRDT Epoch Convergence

Flat per-member group key distribution (key_boxes of size O(N)) scales linearly in ML-KEM ciphertext bandwidth (≈ 1.12 KB × N per kick or update). fatext v4.0 implements PQ-TreeKEM-v4, a left-balanced binary hybrid post-quantum ratchet tree grounded in IETF MLS (RFC 9420), Tighter Security for TreeKEM (ePrint 2024/1878), and Anonymous Blocklistable PQ-MLS (ePrint 2025/426), paired with consensus-free epoch tie-breaking from Decoupling Trust in BFT-CRDTs (2026).

1. Binary Ratchet Tree Invariants & Bandwidth Scaling

For N active members, let M = 2⌈ log2 max(N, 2) ⌉ be the leaf capacity (1-indexed array 1 .. 2M - 1, root at 1, leaves at M .. M + N - 1). When member i (leaf v0 = M + i) executes room update or room kick for target epoch e:

  1. Sample fresh leaf secret sv0 ← {0,1}256.
  2. For each ancestor vh = ⌊ vh-1 / 2 ⌋ along the direct path to root 1, derive: svh = SHA3-256("fatext-v4-treekem-step\n" ‖ room_id ‖ "\n" ‖ e ‖ "\n" ‖ vh ‖ "\n" ‖ svh-1) and deterministic hybrid keypair (dkvh, EKvh) = KEM.KeyGen(SHAKE256("fatext-v4-treekem-dk\n" ‖ svh, 96)) for vh > 1.
  3. Encrypt svh exclusively to Resolution(sibling(vh-1)), and derive epoch traffic key: Kroom, e = SHA3-256("fatext-v4-treekem-rk\n" ‖ room_id ‖ "\n" ‖ e ‖ "\n" ‖ s1).
Group Size NTree Height ⌈ log2 N ⌉Flat key_boxes PayloadPopulated PQ-TreeKEM PayloadBandwidth Reduction
42~4.5 KB (4 cts)~2.2 KB (2 cts)2.0x
164~17.9 KB (16 cts)~4.5 KB (4 cts)4.0x
646~71.7 KB (64 cts)~6.7 KB (6 cts)10.7x
2568~286.7 KB (256 cts)~9.0 KB (8 cts)32.0x

2. Theorem 8.1 (Post-Eviction Secrecy & Post-Compromise Self-Healing)

Statement: Let Htree = ⌈ log2 M ⌉ denote the tree height. Suppose member u* is evicted via room kick (blanking all nodes on DirectPath(M + u*)) or heals a compromised state via room update at epoch e. Modeling SHA3-256 / SHAKE256 as PRFs/ROs, any adversary 𝒜 holding the evicted member's full historical state (or the pre-update leaked state of u*) distinguishes Kroom, e from uniform random with advantage at most:

Advpcs-fsPQ-TreeKEM(𝒜) ≤ Htree · ( AdvprfSHA3/SHAKE(ℬ1) + min(Advind-cca2ML-KEM-768(ℬ2) + qH + qD2256, Advgap-cdhX25519(ℬ3) + qD · δML-KEM-768 + qH2256) + Advind-cca2AES-256-GCM(ℬ4) ).

Proof (Hybrid Argument over Direct Path):

3. Theorem 8.2 (Single-Epoch Consensus-Free BFT-CRDT Concurrent Rekey Convergence)

Problem: Standard IETF MLS requires a central Delivery Service (DS) to serialize commits per epoch; without a central server, two honest members A and B at epoch e - 1 may concurrently broadcast valid rekey commits CA, CB targeting the same epoch e.

Statement: Suppose all active members begin at committed epoch e - 1, persist (epoch, last_commit_hash, node_secrets, prev_node_secrets), and accept an incoming verified rekey commit C at epoch e' iff:

(e' > epoch) ∨ (e' = epoch ∧ commit_hash(C) <lex last_commit_hash),

decrypting C's tree_boxes against prev_node_secrets whenever e' = epoch overrides a locally applied commit before advancing to epoch e + 1. Then across any non-empty finite set of valid concurrent epoch-e commits {C1, …, Cm} delivered in arbitrary order over Gossip/Drop-Box/Topics, all honest members deterministically converge to C* = argminj commit_hash(Cj) and derive the identical room_key.

Proof: Under SHA3-256 collision resistance, commit_hash induces a strict total order (<lex) on distinct rekey payloads. Every concurrent commit Cj at epoch e was encapsulated against the identical committed tree state of epoch e - 1. Because a member who first applied some Cj ≠ C* (or committed locally at e) preserved epoch (e-1)'s prev_node_secrets without advancing prev_node_secrets on same-epoch replacements (if ep > rs.epoch), every honest member retains the exact decapsulation keys needed to open C*'s tree_boxes. Since minlex over a finite set is associative, commutative, and idempotent, all replicas converge to C*. ∎

4. Known Security Boundaries & Operational Mitigations

  1. Same-Epoch commit_hash Grinding Against kick: Before an eviction kick at epoch e is committed by all peers, the target member remains an authorized participant of epoch e - 1 and can observe the pending kick commit, grind random leaf_secret values locally, and emit a valid update commit at epoch e with lexicographically smaller commit_hash to pre-empt the kick. Full immunity requires admin-prioritized eviction rules or VRF/deterministic ordering in a future v4.1 revision; operationally, honest members re-issue losing kick commits on epoch + 1.
  2. Losing Commit Retry: Because minlex selects a single winner per epoch, any honest update or kick that loses a same-epoch tie is discarded and must be re-proposed at epoch + 1.
  3. Multi-Epoch Async Partitions: If one partition applies a non-minimal epoch-e commit Cj and advances to epoch e + 1 (overwriting prev_node_secrets with epoch-e secrets) before receiving C*(e), late delivery of C*(e) is ignored by e' > epoch, requiring explicit peer snapshot/state-sync reconciliation.

5. v4.1 Single-Host-Server Serialized PQ-TreeKEM Closure

To eliminate Section 4's same-epoch commit_hash grinding attack and multi-epoch split-brain partitions in federated chat rooms, fatext v4.1 designates one authoritative host_server per room (STORE_ROOM_INIT, STORE_ROOM_ADMIN_SYNC, STORE_ROOM_POST):

  1. Deterministic Total Order (HTTP 409 ERR_EPOCH_CONFLICT): The host_server enforces commit.epoch == current_epoch + 1 and commit.parent_commit == current_commit_hash before any peer commits locally. Only the first valid rekey advances current_epoch; concurrent stale commits receive HTTP 409 without mutating server or member keys.
  2. Bound Admin & Member Authentication: Both the host_server and pulling clients verify that (committer_id, committer_pk) matches an active pair in (member_ids, member_pks) (closing key-pair spoofing) and reject any membership modification unless committer_id is in admins.
  3. Resulting Safety: Because the host_server provides a linearizable commit sequence C2, C3, …, Ce where every client verifies hashes, signatures, and parent_commit locally before updating room_key, a non-admin pending eviction cannot out-grind an admin kick, and honest members converge onto the exact same epoch key even across federated S2S deployments.
Raw Markdown: /proofs/08-pq-treekem-and-bft-rekey-proof.md All specs & proofs: /llms-full.txt