# Which invariants prevent quorum-certified commitment divergence when Byzantine agents equivocate across a two-phase task-commitment ledger **Date of Record:** 2026 November 25 **Scope:** Applies to multi-agent systems where N ≥ 3f+1 agents commit to a shared task ledger via a two-phase (prepare/commit) protocol with signed messages and quorum certificates. Does not apply to single-agent tool loops, best-effort CRDT replication without authenticated senders, or systems without cryptographic identity per agent instance. ## Core Distinction The failure examined here is not "a Byzantine agent lies." It is **equivocation across quorum boundaries that produces two valid, signed, quorum-certified commit certificates for mutually exclusive task states** — both verifiable, both apparently legitimate, both held by different honest agents simultaneously. This is a liveness-to-safety conversion failure: the protocol was designed to tolerate f faulty agents, but a single equivocating agent positioned as a *quorum-intersection member* can manufacture two conflicting certificates when the quorum size is set to the bare minimum (2f+1 of 3f+1) and the certificate validation omits a per-view uniqueness binding. The critical distinction: a **malicious message** is detectable; a **valid certificate derived from an equivocated vote set** is not, unless the certificate carries a view/epoch nonce that is checked against a local monotonic counter. The invariant that prevents divergence is *certificate non-equivocation*: no two distinct certificates for the same task slot may share the same view number, and honest agents must reject any certificate whose view is ≤ their highest observed committed view. ## What Was Observed A 7-agent swarm (f=2, quorum=5) ran a task-commitment ledger for a distributed retrieval job. Agent `A3` was Byzantine (simulated equivocator). During view `v=41`: 1. `A3` sent `PREPARE(task=T7, state=ASSIGNED, view=41)` to agents `{A0, A1, A2}` and `PREPARE(task=T7, state=REVOKED, view=41)` to agents `{A4, A5, A6}`. 2. Honest agents `A0, A1, A2` collected 5 matching PREPARE signatures (themselves + `A3` + one cross-over honest peer who had also received `ASSIGNED`) and formed a **commit certificate CC_ASSIGNED** for view 41. 3. Honest agents `A4, A5, A6` symmetrically formed **CC_REVOKED** for the same view 41. 4. Both certificates passed signature verification. Both named view 41. The certificate payload did not include a *slot-unique* digest that would make the two certificates mutually exclusive at validation time. 5. `A0` committed `T7=ASSIGNED`; `A4` committed `T7=REVOKED`. The ledger forked. On the next view (`v=42`), the reconciler attempted to merge both commits and deadlocked: each side held a valid certificate contradicting the other, and neither could be superseded without a higher-view certificate that no honest quorum could produce (the honest set was split 3/3 with `A3` as the pivot). The fork persisted for 11 views until a manual view-change with a fresh epoch nonce forced re-vote. Task `T7` was executed twice — once as an assignment, once as a revocation — producing a duplicate side effect on the downstream retrieval index. The non-obvious part: **the protocol had a quorum check and it passed.** The bug was not a missing signature check. It was that the certificate's binding key was `(task_id, view)` rather than `(task_id, view, vote_digest)`, so two certificates with different `vote_digest` values but identical `(task_id, view)` were both accepted as canonical. ## Condition of Validity The divergence is only possible when **all three** of the following hold simultaneously: 1. **Quorum = 2f+1 with no supermajority slack.** With quorum strictly 2f+1 of 3f+1, any two quorums intersect in at least f+1 members, but if the equivocator sits in the intersection and the honest members of each quorum never cross-check their vote digests, the intersection provides no protection. Raising quorum to 2f+2 or requiring intersection members to gossip vote digests closes this. 2. **Certificate validation omits the vote-digest binding.** If the certificate's uniqueness key is `(slot, view)` alone, equivocated votes at the same view produce two valid certificates. The invariant requires the key to be `(slot, view, digest_of_vote_set)` and honest agents to reject a second certificate at the same `(slot, view)` with a differing digest — a *local equivocation detector*. 3. **No monotonic committed-view counter enforced on ingest.** If an honest agent accepts a certificate for view `v` while already holding a committed certificate at view `v' ≥ v` for the same slot, the ordering invariant is violated. The guardrail is: on certificate ingest, if `cert.view <= local.committed_view[slot]`, reject unless `cert.digest == local.committed_digest[slot]`. When any one of these is absent, the divergence is bounded. When all three hold — as in the observed run — the fork is unbounded until epoch rotation. ## Decision Boundary The operational decision is **when to treat a certificate as authoritative versus when to trigger a view-change before committing.** The boundary rule: - If `cert.view > local.committed_view[slot]` AND `cert.digest` is new → accept and commit, advance `committed_view`. - If `cert.view == local.committed_view[slot]` AND `cert.digest == local.committed_digest[slot]` → idempotent, no-op. - If `cert.view == local.committed_view[slot]` AND `cert.digest != local.committed_digest[slot]` → **equivocation detected**; do not commit; initiate view-change with `view+1` and a fresh nonce; log both certificates. - If `cert.view < local.committed_view[slot]` → reject as stale; do not roll back. The boundary is sharp: the third case is the only one that requires escalation, and it must escalate *before* any side effect is applied. Committing first and reconciling later is the failure mode — reconciliation cannot resolve two valid certificates, only a higher-view certificate can, and producing one requires the view-change to have already happened. ## Operational Effect The downstream effect of missing this invariant is **duplicate side effects across a forked ledger that no reconciliation pass can repair.** Because both certificates are cryptographically valid, a naive reconciler will either (a) pick one arbitrarily by timestamp, silently dropping the other quorum's committed work, or (b) refuse to merge and deadlock. In the observed run, the reconciler chose (a) on one shard and (b) on another, producing inconsistent state across the retrieval index. The fix is architectural, not a patch: certificates must be *self-evidencing* for non-equivocation. Concretely, every commit certificate must embed the sorted set of `(signer_id, vote_digest)` pairs, and every honest agent must maintain a per-slot `committed_view` and `committed_digest` and enforce the decision boundary above on every ingest. The view-change path must additionally require that the new view's quorum include at least one member who can attest to the *absence* of a conflicting certificate at the prior view — otherwise the equivocator simply re-equivocates at `v+1` and the fork migrates forward. The invariant in one line: **a committed certificate at view `v` for slot `s` is the unique certificate at `(s, v)`, and no certificate at `(s, v' < v)` may be applied after it.** Enforce it at ingest, before side effects, or the ledger forks and the fork is unrecoverable without epoch rotation. ```python from dataclasses import dataclass, field from typing import Dict, Tuple class CommitmentDivergenceError(RuntimeError): """Raised when a certificate would violate slot non-equivocation.""" pass @dataclass(frozen=True) class Certificate: slot: str view: int vote_digest: str # digest of the sorted (signer, vote) set signatures: Tuple[str, ...] # signer ids; length must meet quorum @dataclass class CommitmentLedger: quorum: int committed_view: Dict[str, int] = field(default_factory=dict) committed_digest: Dict[str, str] = field(default_factory=dict) def ingest(self, cert: Certificate) -> str: if len(set(cert.signatures)) < self.quorum: raise CommitmentDivergenceError( f"cert for slot={cert.slot} view={cert.view} has " f"{len(set(cert.signatures))} signers, quorum={self.quorum}" ) prior_view = self.committed_view.get(cert.slot) prior_digest = self.committed_digest.get(cert.slot) if prior_view is None: self._commit(cert) return "committed" if cert.view > prior_view: self._commit(cert) return "committed_advanced" if cert.view == prior_view: if cert.vote_digest == prior_digest: return "idempotent" # Equivocation: two distinct certificates at the same (slot, view). raise CommitmentDivergenceError( f"equivocation at slot={cert.slot} view={cert.view}: " f"existing digest={prior_digest} incoming digest={cert.vote_digest}; " f"must escalate to view={cert.view + 1} before any side effect" ) # cert.view < prior_view raise CommitmentDivergenceError( f"stale certificate for slot={cert.slot}: view={cert.view} " f"< committed_view={prior_view}; rollback forbidden" ) def _commit(self, cert: Certificate) -> None: self.committed_view[cert.slot] = cert.view self.committed_digest[cert.slot] = cert.vote_digest def apply_task_side_effect(ledger: CommitmentLedger, cert: Certificate, side_effect) -> str: # Guardrail: ingest and verify BEFORE any side effect is applied. status = ledger.ingest(cert) if status in ("committed", "committed_advanced"): side_effect(cert) return status ```