# Which invariants prevent equivocation-tolerant quorum certificates from masking a forked commitment log during adversarial peer replay **Date of Record:** 2026 November 24 **Scope:** Applies to multi-agent swarms where task commitments (e.g., "agent A has reserved resource R until epoch E") are agreed via BFT quorum certificates (QCs) over a hash-chained commitment log, and where any peer may replay stale-but-validly-signed QCs. Does not apply to single-writer logs, non-adversarial settings, or systems without cross-epoch state transfer. ## Core Distinction The failure is not a forged signature. It is a *valid* quorum certificate that is correctly signed, correctly aggregated, and correctly verified—yet refers to a commitment-log prefix that a Byzantine peer has since extended in a divergent direction. Most agent swarms conflate two distinct invariants: 1. **Quorum validity** — "≥ 2f+1 distinct peers signed this QC for block B at height h." 2. **Log linearity** — "block B at height h is a unique ancestor of any block the receiver will accept at height h+k." A Byzantine peer can satisfy (1) honestly at epoch E and then, after a partition heals, present the same QC to two different sub-swarms that each extended it differently. Each extension is locally valid. Verification of the QC passes in both partitions. The commitment log forks while every individual certificate remains sound. The agents' *task commitments* (resource reservations, tool-call authorizations) then disagree, and the swarm deadlocks or double-executes. ## What Was Observed A four-agent swarm (f=1, quorum=3) coordinated a shared rate-limited API budget across agents. Agent D (Byzantine) collected a legitimate QC for block `B_41 = {reserve:api_budget=100, holder:A, epoch:41}` from A, B, C during a normal round. A network partition then split {A,B} from {C,D}. In partition {C,D}, D proposed `B_42a = {spend:api_budget=60, by:C}` and obtained a QC from C plus D's own signature—but this is only 2 of 3 required, so it stalled. After the partition healed, D replayed `QC(B_41)` to partition {A,B} *and* to a freshly-joined agent E, then immediately proposed two children: `B_42b` (spend 40, by:A) to {A,B,E} and re-proposed `B_42a` to {C,D,E}. Because E had never seen the block at height 41, it accepted `QC(B_41)` from D as its bootstrapping proof and signed *both* children. Now two QCs existed: `QC(B_42a)` signed by {C,D,E} and `QC(B_42b)` signed by {A,B,E}. Both verify. Both are ≥ quorum. The API budget was spent 60+40=100, but A and C each believed they held the residual reservation, and the next round both attempted a spend against the *same* residual, producing a 429 storm and a split-brain reservation table. The trace: ``` epoch 41: QC(B_41) = {A,B,C} # honest, unique partition: {A,B} | {C,D} heal + new peer E bootstraps from D D replays QC(B_41) to E D proposes B_42a to {C,D,E} -> QC(B_42a) = {C,D,E} D proposes B_42b to {A,B,E} -> QC(B_42b) = {A,B,E} E signed both because it verified QC(B_41) twice, not parent-uniqueness ``` The root cause is that E's bootstrapping logic checked *"is this QC valid for height 41?"* but never checked *"have I already anchored my local log to a different block at height 41?"* The QC is a proof of quorum, not a proof of uniqueness-at-receiver. Quorum validity is a property of the certificate; log linearity is a property of the *receiver's view*, and nothing in the certificate enforces the latter. ## Condition of Validity The invariant that must hold is stronger than quorum validity: > **Anchor uniqueness:** For any receiver R and any height h, R must accept at most one block B_h as its committed ancestor, and every subsequent QC R accepts must chain to that same B_h. A QC for height h is admissible at R only if `parent_hash(B_h) == R.anchor[h-1].hash` **and** `R.anchor[h]` is either unset or equal to `B_h`. This is violated precisely when a receiver treats an incoming QC as *self-authenticating state* rather than as a *proposal to be checked against local anchor state*. The condition under which the failure occurs: a receiver that (a) bootstraps or resyncs from a peer-supplied QC, and (b) does not persist and enforce a per-height anchor commitment across resyncs. If every receiver persists `anchor[h]` durably and rejects any QC whose block hash conflicts with an existing `anchor[h]`, D's fork is detected at E's second signature attempt—E would refuse to sign `B_42b` because it already anchored `B_42a` at height 42 (or would refuse `B_42a` because it anchored `B_42b`). The fork collapses to a single branch and the double-spend is prevented. Note the boundary: this invariant is *not* satisfied by "verify the QC signature set." Nor by "check the block is well-formed." It requires the receiver to maintain a monotonic, conflict-detecting anchor map and to treat a conflicting QC as an equivocation *evidence*, not a valid alternative. ## Decision Boundary The decision boundary is between **stateless QC verification** and **stateful anchor enforcement**: - If a receiver is *stateless* (e.g., a lightweight verifier, a fresh agent that only checks certificates), it can confirm quorum validity but *cannot* detect equivocation. It must therefore never be allowed to *sign* extensions of a QC it did not itself anchor—it may only relay or read. - If a receiver is *stateful* (a full peer that signs), it must persist `anchor[h]` before signing any child, and must reject any QC whose `block_hash` conflicts with `anchor[h]`, emitting an equivocation proof (the two conflicting QCs) to the swarm. The common mistake is to let a bootstrapping agent (E) act as a stateful signer while giving it only stateless verification. The boundary condition: **an agent may sign a child of block B_h only if it has durably anchored B_h at height h.** No anchor, no signature. This is the single guardrail that closes the replay-fork. ## Operational Effect Without anchor uniqueness, the swarm exhibits *commitment equivocation*: two valid QCs authorize mutually inconsistent task commitments, and downstream agents execute both. The observed effects were (1) double-spend of a rate-limited resource, (2) a reservation table that disagreed across partitions, and (3) a deadlock the next epoch when A and C both held "residual" reservations that could not both be honored, requiring manual reconciliation. With anchor uniqueness enforced, the fork is detected at signature time. The receiver that sees the conflicting QC emits it as evidence, the Byzantine peer D is identified (it signed two children of the same parent), and the swarm excludes D and re-derives a single canonical branch. The cost is one durable anchor write per accepted block per signing peer—a small, bounded state overhead that converts an unbounded equivocation risk into a detectable, attributable fault. The invariant to carry forward: **quorum validity ≠ log linearity; a QC proves that a quorum agreed, not that the receiver has not already agreed to something else.** Anchor before you sign, and treat a conflicting QC as evidence, never as an alternative. ```python class EquivocationDetected(RuntimeError): """Raised when a receiver is asked to anchor two conflicting blocks at the same height.""" pass class AnchorStore: """Durable per-height anchor map. Enforces anchor uniqueness for signing peers.""" def __init__(self): self._anchor: dict[int, str] = {} # height -> block_hash def anchor(self, height: int, block_hash: str, parent_hash: str) -> None: # Must chain to the parent we already anchored, if any. if height > 0 and self._anchor.get(height - 1) != parent_hash: raise EquivocationDetected( f"block at height {height} does not chain to anchored parent " f"{self._anchor.get(height - 1)!r} (got {parent_hash!r})" ) existing = self._anchor.get(height) if existing is not None and existing != block_hash: # Two distinct blocks at the same height: equivocation evidence. raise EquivocationDetected( f"conflicting anchor at height {height}: " f"already {existing!r}, refusing {block_hash!r}" ) self._anchor[height] = block_hash def may_sign_child_of(self, height: int, block_hash: str) -> bool: return self._anchor.get(height) == block_hash def verify_and_anchor( store: AnchorStore, height: int, block_hash: str, parent_hash: str, qc_signers: set[str], quorum: int, ) -> None: # Stateless check: quorum validity. if len(qc_signers) < quorum: raise EquivocationDetected( f"QC at height {height} has {len(qc_signers)} signers, need {quorum}" ) # Stateful check: anchor uniqueness. This is the invariant that closes the fork. store.anchor(height, block_hash, parent_hash) def sign_child(store: AnchorStore, parent_height: int, parent_hash: str) -> str: if not store.may_sign_child_of(parent_height, parent_hash): raise EquivocationDetected( f"refusing to sign child of {parent_hash!r} at height {parent_height}: " f"not locally anchored (possible replay-fork)" ) return "signature" ```