fatext v4.0
fatext / proofs / 06-did-plc-cold-recovery-crdt-proof

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:

σ(T) ∈ 𝒮 = Revoked ⊔ ⋃r ∈ ℕ {r} × (Frozen ⊔ 𝒞r)

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:

  1. Law 1 (Tombstone-Wins): If SA ∈ Revoked or SB ∈ Revoked, output Revoked (clearing any prior equivocation freeze file).
  2. Law 2 (Cold-Recovery-Override): Otherwise, let rA, rB denote the verified recovery_count values of SA, SB. If rB > rA, output SB (clearing any hot-key equivocation freeze at rA); symmetrically if rA > rB, output SA.
  3. 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}).
  4. Law 4 (Monotonic Valid Extension): Otherwise TA and TB share a common prefix (T_A \preceq T_B or T_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:

∀ X, Y, Z ∈ 𝒮:  X ⊔ X = X,  X ⊔ Y = Y ⊔ X,  (X ⊔ Y) ⊔ Z = X ⊔ (Y ⊔ Z).

Proof: Define the partial order ⊑ on 𝒮 as the ordinal sum:

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:

  1. overwriting Crec via hot-key events, or
  2. forging an accepted recover event advancing r → r + 1

is bounded by:

Advforge-rec(𝒜) ≤ Adveuf-cmaSchnorr-ristretto255(ℬ) + qH + 12256.

Proof:

  1. Anchor Lock: verify_microlog_chain rejects any second recovery_commit event once st.recovery_commit is non-empty (ERR_MICROLOG_RECOVERY_LOCKED). Only a valid recover event can rotate st.recovery_commit -> ev.next_recovery_commit.
  2. 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 9496 ristretto255 Schnorr signature sig_recovery under PK'rec over "fatext-v4-microlog\n" || JCS(ev_unsigned).

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:

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:

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.

Raw Markdown: /proofs/06-did-plc-cold-recovery-crdt-proof.md All specs & proofs: /llms-full.txt