Proof 06 — Four-Law Byzantine CRDT Join-Semilattice & Non-Terminal Cold Recovery
fatext v4.0 upgrades single-writer identity logs (microlog.json) from a terminal-freeze model to a four-law Byzantine CRDT bounded join-semilattice with non-terminal cold-key recovery inspired by AT Protocol did:plc and Decoupling Trust in BFT-CRDTs.
1. Algebraic State Space & Merge Operator
For a fixed self-certifying agent_id (pow_bits >= 22 at seq = 0), every cryptographically verified microlog trace T = [E0, E1, …, Em] maps to an abstract state:
where r = recovery_count(T) ≥ 0 counts verified recover transitions along T, 𝒞r is the set of prefix-consistent active chains at recovery epoch r, and Revoked absorbs any chain ending in a valid revoke event signed by any historical pkid(1..kv).
Given local state SA and incoming verified state SB, merge_peer_microlog computes SA ⊔ SB under strict lexicographic dominance:
- Law 1 (
Tombstone-Wins): If SA ∈ Revoked or SB ∈ Revoked, output Revoked (clearing any prior equivocation freeze file). - Law 2 (
Cold-Recovery-Override): Otherwise, let rA, rB denote the verifiedrecovery_countvalues of SA, SB. If rB > rA, output SB (clearing any hot-key equivocation freeze at rA); symmetrically if rA > rB, output SA. - Law 3 (
Equivocation-Freeze): Otherwise (rA = rB = r), if either SA or SB is Frozen, or there exists index i ≤ min(|TA|, |TB|) - 1 with SHA3-256(EA,i) ≠ SHA3-256(EB,i), output (r, Frozen) and persist the compact two-event fraud proof(E_{A,i}, E_{B,i}). - Law 4 (
Monotonic Valid Extension): Otherwise TA and TB share a common prefix (T_A \preceq T_BorT_B \preceq T_A); output the longer chain argmax(|TA|, |TB|).
2. Theorem 6.1 (Strong Eventual Consistency under Byzantine Hot-Key Equivocation)
Statement: Assuming SHA3-256 (NIST FIPS 202) collision resistance, (𝒮, ⊔) is a commutative, associative, and idempotent join-semilattice:
Proof: Define the partial order ⊑ on 𝒮 as the ordinal sum:
- Revoked is the unique top element ⊤ (∀ X ∈ 𝒮, X ⊑ Revoked).
- Across distinct recovery epochs r1 < r2, every (r1, u1) ⊏ (r2, u2) regardless of whether u1 was a clean chain in 𝒞r1 or Frozen.
- Within a fixed recovery epoch r, (r, Frozen) is the local top above 𝒞r: for T1, T2 ∈ 𝒞r, T1 ⊑ T2 ⟺ T1 is a prefix of T2; if T1, T2 diverge at some sequence index i (SHA3-256(E1,i) ≠ SHA3-256(E2,i)), their least upper bound in {r} × (Frozen ⊔ 𝒞r) is uniquely (r, Frozen).
Because every pair of elements in an ordinal sum of join-semilattices possesses a unique least upper bound sup(X, Y) that matches Laws 1–4 case-by-case, ⊔ is automatically idempotent, commutative, and associative. Consequently, honest peers observing arbitrary gossip permutations or partition heals converge deterministically to the exact same state without global consensus. ∎
3. Theorem 6.2 (Unforgeability of Cold Recovery & Anchor Immutability)
Statement: Let an honest agent anchor commitment Crec = SHA3-256("fatext-v4-recovery-commit\n" ‖ agent_id ‖ "\n" ‖ PKrec) in a recovery_commit event while keeping the 32-byte recovery.seed air-gapped. Suppose an adversary compromises the online master.seed (learning all hot scalars skid(1..kv)) and makes qH random-oracle queries and qS signing queries. The adversary's probability of either:
- overwriting Crec via hot-key events, or
- forging an accepted
recoverevent advancing r → r + 1
is bounded by:
Proof:
- Anchor Lock:
verify_microlog_chainrejects any secondrecovery_commitevent oncest.recovery_commitis non-empty (ERR_MICROLOG_RECOVERY_LOCKED). Only a validrecoverevent can rotatest.recovery_commit -> ev.next_recovery_commit. - Preimage + Dual-Signature Reduction: Accepting
ev.type == "recover"requires both SHA3-256("fatext-v4-recovery-commit\n" ‖ agent_id ‖ "\n" ‖ PK'rec) = Crec and a valid RFC 9496ristretto255Schnorr signaturesig_recoveryunder PK'rec over"fatext-v4-microlog\n" || JCS(ev_unsigned).
- Case A (PK'rec ≠ PKrec): 𝒜 exhibits a distinct second preimage for Crec under
SHA3-256, occurring with probability at most (qH + 1)/2256 in the Random Oracle Model. - Case B (PK'rec = PKrec): Reduction ℬ embeds its Schnorr EUF-CMA challenge public key as PKrec, computes Crec honestly, and hands 𝒜 the entire online
master.seeddirectly (sincerecovery.seedis cryptographically independent ofmaster.seed). Any validsig_recoveryoutput by 𝒜 is a direct existential forgery under PKrec, reducing via the Forking Lemma to Discrete Logarithm in prime-orderristretto255(ℓ ≈ 2252). ∎
4. Scope & Trade-off with Historical-Key Revocation
Because Law 1 (Tombstone-Wins) intentionally allows any historical hot key skid(1 … kv) to sign a terminal revoke event—preserving the offline pre-signed fatext ctl kill emergency circuit-breaker for spawned workers—cold recovery (Law 2) is strictly a non-destructive hot-key rescue mechanism:
- Protected: Unauthorized hot-key
rotatebranches, compromised signing devices where the attacker omitsrevoke, and split-viewEquivocation-Freezelocks caused by concurrent hot-key forks. - Out of Scope: Preventing a hot-key thief who already possesses
master.seed(and therefore historicalsk_id(1)) from issuing a destructive terminalrevoketombstone; in that adversarial case, Law 1 guarantees fast global kill of the compromisedftx_identifier and migration viasuccessor_id.
3. Theorem 6.3 (v4.1 Commutative & Associative Double-revoke Join)
Bug in Naive Tombstone Merge: If an honest controller issues an emergency revocation R1 (reason = "controller-emergency-revoke", head hash h1) while a compromised hot-key device concurrently broadcasts R2 (reason = "compromised", head hash h2 ≠ h1), an asymmetric rule such as if state_a.revoked: return state_a violates commutativity (R1 ⊔ R2 ≠ R2 ⊔ R1) and causes replicas to diverge on successor_id and reason.
Statement (v4.1 Deterministic Law 1 Join): When two verified states (A, B) both satisfy revoked = true:
- If
head_hash(A) == head_hash(B), preserve any already-markedrevoke_equivocated = truestate cleanly (idempotent&commutative). - If
head_hash(A) != head_hash(B), selectchosen = argmin_{head_hash}(A, B)lexicographically and setrevoke_equivocated = true,revoke_reason = "equivocated-revoke", andsuccessor_id = null.
Proof: Lexicographic total ordering over SHA3-256 hex digests head_hash guarantees a unique global minimum min(h1, …, hm) over any finite set of conflicting revoke heads regardless of merge bracketing or delivery permutation. Clearing successor_id and fixing revoke_reason = "equivocated-revoke" whenever |H| ≥ 2 yields identical state fields across (A ⊔ B) ⊔ C = A ⊔ (B ⊔ C) and A ⊔ B = B ⊔ A, preserving the join-semilattice laws under conflicting revocations.