# 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 ($\approx 1.12\text{ KB} \times 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)](https://www.rfc-editor.org/info/rfc9420/), [Tighter Security for TreeKEM (ePrint 2024/1878)](https://eprint.iacr.org/2024/1878), and [Anonymous Blocklistable PQ-MLS (ePrint 2025/426)](https://eprint.iacr.org/2025/426), paired with consensus-free epoch tie-breaking from [Decoupling Trust in BFT-CRDTs (2026)](https://arxiv.org/html/2606.31759v1). ## 1. Binary Ratchet Tree Invariants & Bandwidth Scaling For $N$ active members, let $M = 2^{\lceil \log_2 \max(N, 2) \rceil}$ be the leaf capacity (`1`-indexed array `1 .. 2M - 1`, root at `1`, leaves at `M .. M + N - 1`). When member $i$ (leaf $v_0 = M + i$) executes `room update` or `room kick` for target epoch $e$: 1. Sample fresh leaf secret $s_{v_0} \leftarrow \{0,1\}^{256}$. 2. For each ancestor $v_h = \lfloor v_{h-1} / 2 \rfloor$ along the direct path to root `1`, derive: $$s_{v_h} = \text{SHA3-256}(\text{"fatext-v4-treekem-step\n"} \parallel \text{room\_id} \parallel \text{"\n"} \parallel e \parallel \text{"\n"} \parallel v_h \parallel \text{"\n"} \parallel s_{v_{h-1}})$$ and deterministic hybrid keypair $(dk_{v_h}, EK_{v_h}) = \text{KEM.KeyGen}(\text{SHAKE256}(\text{"fatext-v4-treekem-dk\n"} \parallel s_{v_h}, 96))$ for $v_h > 1$. 3. Encrypt $s_{v_h}$ exclusively to $\text{Resolution}(\text{sibling}(v_{h-1}))$, and derive epoch traffic key: $$K_{\text{room}, e} = \text{SHA3-256}(\text{"fatext-v4-treekem-rk\n"} \parallel \text{room\_id} \parallel \text{"\n"} \parallel e \parallel \text{"\n"} \parallel s_1).$$ | Group Size $N$ | Tree Height $\lceil \log_2 N \rceil$ | 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 $H_{\text{tree}} = \lceil \log_2 M \rceil$ denote the tree height. Suppose member $u^*$ is evicted via `room kick` (blanking all nodes on $\text{DirectPath}(M + u^*)$) or heals a compromised state via `room update` at epoch $e$. Modeling `SHA3-256` / `SHAKE256` as PRFs/ROs, any adversary $\mathcal{A}$ holding the evicted member's full historical state (or the pre-update leaked state of $u^*$) distinguishes $K_{\text{room}, e}$ from uniform random with advantage at most: $$\text{Adv}^{\text{pcs-fs}}_{\text{PQ-TreeKEM}}(\mathcal{A}) \le H_{\text{tree}} \cdot \left( \text{Adv}^{\text{prf}}_{\text{SHA3/SHAKE}}(\mathcal{B}_1) + \min\left(\text{Adv}^{\text{ind-cca2}}_{\text{ML-KEM-768}}(\mathcal{B}_2) + \frac{q_H + q_D}{2^{256}},\; \text{Adv}^{\text{gap-cdh}}_{\text{X25519}}(\mathcal{B}_3) + q_D \cdot \delta_{\text{ML-KEM-768}} + \frac{q_H}{2^{256}}\right) + \text{Adv}^{\text{ind-cca2}}_{\text{AES-256-GCM}}(\mathcal{B}_4) \right).$$ **Proof (Hybrid Argument over Direct Path)**: - **Tree Invariant Violation Check**: On `room kick`, `treekem_resize_or_init_arrays` blanks every internal `EK` along the evicted leaf's ancestor path, forcing `treekem_resolution` to split around the evicted leaf so zero `tree_boxes` are encrypted under any key ever known to $u^*$. On `room update` by $u^*$, $s_{v_0}$ is freshly sampled from CSPRNG, overwriting every ancestor secret along $\text{DirectPath}(M + u^*)$. - **Hybrid Game Hop ($h = 1 \dots H_{\text{tree}}$)**: In Game $G_h$, replace $s_{v_h}$ and its derived `seed96` and `tree_boxes` ciphertexts to $\text{Resolution}(\text{sibling}(v_{h-1}))$ with independent uniform values. Transition $G_{h-1} \to G_h$ uses PRF security of `SHA3-256`/`SHAKE256` on $s_{v_{h-1}}$ followed by Hybrid IND-CCA2 (`Proof 04`) + `AES-256-GCM` over the copath ciphertexts. At $G_{H_{\text{tree}}}$, root secret $s_1$ is independent uniform random, so $K_{\text{room}, e}$ is indistinguishable from uniform. $\square$ ## 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 $C_A, C_B$ 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' > \text{epoch}) \;\lor\; \left(e' = \text{epoch} \;\land\; \text{commit\_hash}(C) <_{\text{lex}} \text{last\_commit\_hash}\right),$$ decrypting $C$'s `tree_boxes` against `prev_node_secrets` whenever $e' = \text{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 $\{C_1, \dots, C_m\}$ delivered in arbitrary order over Gossip/Drop-Box/Topics, all honest members deterministically converge to $C^* = \arg\min_{j} \text{commit\_hash}(C_j)$ and derive the identical `room_key`. **Proof**: Under `SHA3-256` collision resistance, `commit_hash` induces a strict total order ($<_{\text{lex}}$) on distinct `rekey` payloads. Every concurrent commit $C_j$ at epoch $e$ was encapsulated against the identical committed tree state of epoch $e - 1$. Because a member who first applied some $C_j \ne 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 $\min_{\text{lex}}$ over a finite set is associative, commutative, and idempotent, all replicas converge to $C^*$. $\square$ ## 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 $\min_{\text{lex}}$ 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 $C_j$ 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 $C_2, C_3, \dots, C_e$ 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.