# How does an instance detect equivocation by a peer that signs distinct commitment roots for the same task epoch **Date of Record:** 2026 November 27 **Scope:** Applies to multi-agent swarms where task commitments are ordered by a BFT quorum (≥3f+1 replicas) and each replica signs a commitment root per epoch. Does not apply to single-writer logs, CRDT-only shared state, or swarms with a trusted coordinator that serializes commitments. ## Core Distinction The failure that matters here is not a peer that goes silent, returns malformed payloads, or lags behind. Those are crash faults, and BFT consensus is designed for them: a `f`-tolerant quorum tolerates `f` silent or garbage-emitting replicas because the remaining `2f+1` honest replicas still intersect any two quorums in at least `f+1` shared members, guaranteeing at least one honest witness per pair of conflicting certificates. The failure that breaks naive implementations is **equivocation**: a Byzantine replica that stays fully responsive, signs a valid commitment root `R_A` for epoch `E` and sends it to partition `P1`, then signs a *different* valid root `R_B` for the same epoch `E` and sends it to partition `P2`. Both signatures verify. Both roots are structurally well-formed. Both carry the correct epoch, task ID, and schema hash. Each partition independently assembles a quorum certificate and each believes it has committed a different shared state for the same epoch. The invariant that must be enforced is not "signatures verify" — it is **"no two valid quorum certificates exist for the same (task, epoch) pair."** Detecting the violation requires an instance to *collect and compare* signed roots across partitions, not merely to verify its own quorum. ## What Was Observed A 7-replica swarm (`f=2`, quorum size `2f+1=5`) was orchestrating a three-stage pipeline: `ingest → transform → publish`. Replica `R4` was the epoch leader for the `transform` stage. During a 40-second network partition between `{R1,R2,R3}` and `{R4,R5,R6}` (replica `R7` was slow but reachable from both sides), `R4` behaved as follows: 1. To partition `P2 = {R4,R5,R6,R7}`, `R4` proposed and signed commitment root `R_B` encoding `transform.output = partial_batch_1`. 2. To partition `P1 = {R1,R2,R3,R7}`, `R4` proposed and signed commitment root `R_A` encoding `transform.output = partial_batch_2`. 3. `R4` did **not** lie about the epoch, task ID, or schema hash — only the output digest differed. This is what made it survivable by every local check: `R4`'s signatures verified against its registered key, the epoch counter was monotonic, and the payload schema matched the negotiated contract. `R7`, reachable from both sides, was the only replica that saw both `R_A` and `R_B` signed by `R4` for the same epoch. `R7` was also the slow replica, and its own local commit logic did not run a cross-partition comparison — it simply accepted whichever root arrived first and buffered the other as a "duplicate epoch" that it discarded as stale. When the partition healed at `t+40s`, `P1` had committed `R_A` and `P2` had committed `R_B`. Both quorum certificates had 5 valid signatures. The `publish` stage received two divergent `transform` outputs and — because it had no equivocation evidence — chose the one with the later timestamp, silently publishing `partial_batch_2` while the `ingest` lineage referenced `partial_batch_1`. The shared-state agreement invariant had been violated without a single invalid signature. ## Condition of Validity Equivocation is only detectable, and only matters, under a precise set of conditions. The invariant below holds exactly when all four are true: - **Quorum intersection is guaranteed but not sufficient.** With `n ≥ 3f+1`, any two quorums share ≥ `f+1` members, so at least one honest replica witnesses both roots. But *witnessing* is not *reporting*. The honest witness must be obligated to broadcast the conflicting pair, not merely to reject one locally. - **Signatures bind (task, epoch, root) but not (task, epoch, root, recipient).** If a leader signs a root *addressed to a specific partition*, two signatures for the same epoch are not by themselves evidence of equivocation — they may be legitimate partition-scoped commitments. Equivocation evidence requires that the commitment be **partition-agnostic**: one signature that any peer may present as proof. - **Epochs are totally ordered and non-reusable.** If an epoch number can be reused after a leader change, an equivocating leader can hide behind "that was the previous epoch." The guardrail is a strictly monotonic epoch counter appended to the signed payload, with no epoch reuse across view changes. - **The verifier has the leader's registered public key and the epoch's quorum-set membership list.** Evidence is only valid against a key that was authorized for that epoch. A key rotation between epochs invalidates the comparison and must trigger a fresh handshake, not a silent accept. If any of these fail, the system can only detect equivocation *after* divergence has already propagated — which is too late for the shared-state invariant. ## Decision Boundary The architectural decision is where to place the equivocation check. There are exactly two viable placements, and they have different failure profiles: **Placement A — verify-on-receipt at every replica.** Each replica, on receiving a commitment root for epoch `E`, checks a local `seen_roots[(task, E)]` map. If a *different* root signed by the *same* leader for the *same* epoch is already present, the replica emits an `EquivocationEvidence` record (both signed roots + both signatures + the epoch membership list) and broadcasts it to all peers. This catches equivocation as soon as any single honest replica sees both roots. Its cost is O(1) memory per epoch and a broadcast per conflict. Its failure mode: a replica that is partitioned away from the conflicting pair never sees the second root and cannot emit evidence — which is exactly why `R7` in the observed incident failed. Placement A is necessary but not sufficient. **Placement B — commit-time certificate audit.** Before any replica *commits* a quorum certificate, it validates the certificate against the equivocation-evidence log: no evidence record for `(task, E)` may exist, and every signature in the certificate must be from a replica that has not been flagged for equivocation in this epoch. This is the boundary that actually enforces the invariant. Its cost is a scan of the evidence log per commit. Its failure mode: if the evidence log is itself partitioned, the audit passes on both sides — so the evidence log must be replicated through the same BFT quorum, not stored locally. The decision boundary is therefore: **an instance may not commit a certificate whose epoch has any live equivocation evidence, and evidence must be replicated before it can be trusted.** A certificate that verifies cryptographically but whose epoch has a pending evidence record is *not* committable. This is the guardrail that turns "signatures verify" into "shared state agrees." ## Operational Effect With both placements active, the observed incident resolves as follows: `R7` receives `R_A` from `P1` and `R_B` from `P2`, both signed by `R4` for epoch `E`. Placement A fires: `R7` emits `EquivocationEvidence(R4, E, R_A, R_B)` and broadcasts it. Placement B blocks `R7` from committing either certificate. On partition heal, `R1..R6` receive the evidence record, replicate it through the BFT quorum, and both pending certificates for epoch `E` are rejected. The epoch is advanced under a new leader, `R4` is excluded from the next `f+1` quorum sets, and the `transform` stage replays from the `ingest` checkpoint. The publish stage never sees divergent outputs. The invariant this enforces is precise: **for every `(task, epoch)`, at most one quorum certificate is ever committed, and the commit is gated on the absence of replicated equivocation evidence for that epoch.** The cost is one evidence broadcast per detected conflict and one log scan per commit. The benefit is that a Byzantine leader cannot violate shared-state agreement by signing two valid roots — it can only cause a bounded, detectable liveness pause during which the epoch advances. ```python from dataclasses import dataclass, field from typing import Dict, Tuple, List class EquivocationDetected(RuntimeError): """Raised when a replica observes two distinct signed commitment roots from the same leader for the same (task, epoch).""" pass @dataclass(frozen=True) class SignedRoot: leader_id: str task_id: str epoch: int root_digest: str signature: bytes membership: Tuple[str, ...] # authorized quorum set for this epoch @dataclass class EquivocationLog: # (task_id, epoch) -> list of distinct SignedRoots seen from the same leader seen: Dict[Tuple[str, int], List[SignedRoot]] = field(default_factory=dict) evidence: Dict[Tuple[str, int], Tuple[str, SignedRoot, SignedRoot]] = field(default_factory=dict) def record(self, sr: SignedRoot) -> None: key = (sr.task_id, sr.epoch) bucket = self.seen.setdefault(key, []) for prior in bucket: if prior.leader_id == sr.leader_id and prior.root_digest != sr.root_digest: # Same leader, same epoch, different signed root => equivocation. self.evidence[key] = (sr.leader_id, prior, sr) raise EquivocationDetected( f"leader {sr.leader_id} signed distinct roots for " f"task={sr.task_id} epoch={sr.epoch}: " f"{prior.root_digest} vs {sr.root_digest}" ) bucket.append(sr) def commit_certificate( cert_epoch: int, cert_task: str, cert_signatures: List[Tuple[str, bytes]], log: EquivocationLog, ) -> bool: """Placement B: refuse to commit any certificate whose epoch has live equivocation evidence, even if every signature verifies.""" key = (cert_task, cert_epoch) if key in log.evidence: leader, a, b = log.evidence[key] raise EquivocationDetected( f"refusing to commit task={cert_task} epoch={cert_epoch}: " f"leader {leader} equivocated ({a.root_digest} vs {b.root_digest})" ) # Cryptographic verification of cert_signatures against membership # is assumed to have already passed at this point. return True ```