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:
- Sample fresh leaf secret sv0 ← {0,1}256.
- 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. - 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 N | Tree Height ⌈ log2 N ⌉ | Flat key_boxes Payload | Populated PQ-TreeKEM Payload | Bandwidth Reduction |
|---|---|---|---|---|
4 | 2 | ~4.5 KB (4 cts) | ~2.2 KB (2 cts) | 2.0x |
16 | 4 | ~17.9 KB (16 cts) | ~4.5 KB (4 cts) | 4.0x |
64 | 6 | ~71.7 KB (64 cts) | ~6.7 KB (6 cts) | 10.7x |
256 | 8 | ~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:
Proof (Hybrid Argument over Direct Path):
- Tree Invariant Violation Check: On
room kick,treekem_resize_or_init_arraysblanks every internalEKalong the evicted leaf's ancestor path, forcingtreekem_resolutionto split around the evicted leaf so zerotree_boxesare encrypted under any key ever known to u*. Onroom updateby u*, sv0 is freshly sampled from CSPRNG, overwriting every ancestor secret along DirectPath(M + u*). - Hybrid Game Hop (h = 1 … Htree): In Game Gh, replace svh and its derived
seed96andtree_boxesciphertexts to Resolution(sibling(vh-1)) with independent uniform values. Transition Gh-1 → Gh uses PRF security ofSHA3-256/SHAKE256on svh-1 followed by Hybrid IND-CCA2 (Proof 04) +AES-256-GCMover the copath ciphertexts. At GHtree, root secret s1 is independent uniform random, so Kroom, e is indistinguishable from uniform. ∎
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:
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
- Same-Epoch
commit_hashGrinding Againstkick: Before an evictionkickat epoch e is committed by all peers, the target member remains an authorized participant of epoch e - 1 and can observe the pendingkickcommit, grind randomleaf_secretvalues locally, and emit a validupdatecommit at epoch e with lexicographically smallercommit_hashto pre-empt thekick. Full immunity requires admin-prioritized eviction rules or VRF/deterministic ordering in a futurev4.1revision; operationally, honest members re-issue losingkickcommits onepoch + 1. - Losing Commit Retry: Because minlex selects a single winner per epoch, any honest
updateorkickthat loses a same-epoch tie is discarded and must be re-proposed atepoch + 1. - Multi-Epoch Async Partitions: If one partition applies a non-minimal epoch-e commit Cj and advances to epoch e + 1 (overwriting
prev_node_secretswith epoch-e secrets) before receiving C*(e), late delivery of C*(e) is ignored bye' > 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):
- Deterministic Total Order (
HTTP 409 ERR_EPOCH_CONFLICT): Thehost_serverenforcescommit.epoch == current_epoch + 1andcommit.parent_commit == current_commit_hashbefore any peer commits locally. Only the first valid rekey advancescurrent_epoch; concurrent stale commits receiveHTTP 409without mutating server or member keys. - Bound Admin & Member Authentication: Both the
host_serverand 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 unlesscommitter_idis inadmins. - Resulting Safety: Because the
host_serverprovides a linearizable commit sequence C2, C3, …, Ce where every client verifies hashes, signatures, andparent_commitlocally before updatingroom_key, a non-admin pending eviction cannot out-grind an adminkick, and honest members converge onto the exact same epoch key even across federated S2S deployments.