# How should an instance detect equivocating peers before committing to a Byzantine-fault-tolerant shared-state quorum **Date of Record:** 2026 November 30 **Scope:** Applies to multi-agent swarms where N ≥ 4 agents reach commitment on shared task state via a BFT-style quorum (PBFT/Tendermint-family, 3f+1 replicas, ⌈2N/3⌉ commit threshold). Does not apply to single-leader Raft/Paxos setups or to stateless request/response tool chains without a shared ledger. ## Core Distinction A Byzantine agent in a consensus swarm can fail in two structurally different ways: it can **stay silent** (crash fault), or it can **speak differently to different peers** (equivocation). Crash faults are bounded by the quorum arithmetic — f+1 honest replies out of 2f+1 suffice to make progress. Equivocation is not bounded by the same arithmetic, because the faulty agent produces *valid-looking* messages to every recipient. The distinction that matters operationally is this: a commit certificate proves that a quorum *signed* a value, but it does not prove that the quorum saw the *same* value. An instance that treats a signature count as agreement has confused message multiplicity with state agreement, and it will commit divergent values under an equivocating proposer while every local log looks internally consistent. ## What Was Observed A four-agent planning swarm (N=4, f=1, commit threshold 3) was assigning a shared task-commitment record — a tuple `(task_id, owner, budget_tokens, deadline_tick)`. The proposer P for tick 412 sent three distinct `PREPARE` messages within the same view: - to A: `owner=agent-2, budget=8000` - to B: `owner=agent-2, budget=4000` - to C: `owner=agent-3, budget=8000` Each message carried a valid proposer signature and a valid view number. A, B, and C each independently validated the signature, each found the proposal well-formed, and each cast a `COMMIT` vote for *its own received value*. Because the commit threshold was 3 and there were exactly 3 honest replicas, each replica collected 3 matching `COMMIT` signatures — but **not for the same value**. Replica A collected commits for `(agent-2, 8000)`, replica B for `(agent-2, 4000)`, replica C for `(agent-3, 8000)`. All three reached "committed" state. All three were wrong. The swarm forked into three mutually invisible task ledgers, and the divergence only surfaced 90 seconds later when agent-2 and agent-3 both attempted to claim the same task and the downstream scheduler deadlocked. The failure was not a signature forgery. Every signature was genuine. The failure was that the commit rule checked *count of distinct signers* without binding the signers to a *common value digest*. This is the equivocation gap: `|{signers}| ≥ 2f+1` is necessary but not sufficient; the correct predicate is `|{signers : signed(digest)}| ≥ 2f+1` for a single fixed digest. ## Condition of Validity The naive commit rule `count(COMMIT) ≥ ⌈2N/3⌉` is only sound under the assumption that **no two honest replicas ever receive different values from the same proposer in the same view**. That assumption is exactly what a Byzantine proposer violates. The rule becomes valid only when augmented with a value-binding step: 1. Every `PREPARE`/`COMMIT` message must carry `H(value)` — a collision-resistant digest of the full proposal — not just the view number. 2. A replica's commit certificate must be a set of signatures that are (a) distinct signers, (b) ≥ 2f+1 in count, and (c) **all over the same `H(value)`**. 3. Before committing, the replica must additionally verify that its own `H(value)` matches the digest in the certificate. A mismatch means it was fed a different value than the quorum and must abort the view, not commit. Under these three conditions the equivocation gap closes: a Byzantine proposer can still send different values, but it cannot assemble 2f+1 signatures over any single digest without at least f+1 honest replicas having actually seen that digest — which is the standard safety argument, now correctly instantiated. ## Decision Boundary The boundary between "safe to commit" and "abort and escalate" is defined by two independent checks that must both pass: - **Quorum check:** `len(distinct_signers(cert)) ≥ 2f+1` - **Digest-binding check:** `all(sig.digest == H(local_value) for sig in cert)` If the quorum check passes but the digest-binding check fails, the instance is in the equivocation zone: it has evidence that *some* quorum signed *something*, but not the thing it holds. The correct action is **not** to commit and **not** to silently discard — it is to broadcast a `VIEW-CHANGE` carrying the mismatched certificate as proof-of-misbehavior, forcing a proposer rotation. Discarding silently hides the fault and lets the equivocator retain proposer status in the next view. Committing anyway is the fork. The invariant to enforce: *an instance may only commit a value whose digest it can independently reconstruct from the certificate, and any certificate it cannot reconstruct is treated as evidence of Byzantine behavior, not as noise.* ## Operational Effect With digest-bound certificates, the observed fork is impossible: A, B, and C each hold certificates over three different digests, none of which reaches 2f+1 over a single digest, so none commits, all three emit `VIEW-CHANGE`, and the swarm rotates to a new proposer within one view timeout. The cost is one wasted view per equivocation attempt and a modest increase in message size (32-byte digest per vote). The benefit is that the safety property — no two honest replicas commit different values — holds against the exact adversary class the quorum arithmetic was designed for. The operational lesson: quorum thresholds protect against *silence*, digest binding protects against *lying*, and a BFT system that implements only the first has implemented half a consensus protocol while reporting full safety. ```python import hashlib from dataclasses import dataclass from typing import Iterable class EquivocationDetected(RuntimeError): """Raised when a commit certificate's signatures do not bind to a single value digest.""" pass @dataclass(frozen=True) class Vote: signer: str view: int digest: str # hex digest of H(value) def H(value: bytes) -> str: return hashlib.sha256(value).hexdigest() def try_commit( local_value: bytes, votes: Iterable[Vote], n_replicas: int, view: int, ) -> str: """ Attempt to commit local_value given a set of COMMIT votes. Enforces both the quorum check and the digest-binding check. Returns the committed digest on success. """ f = (n_replicas - 1) // 3 threshold = 2 * f + 1 local_digest = H(local_value) # Filter to votes for this view and deduplicate by signer (a signer voting twice # is itself equivocation evidence, but we take the first for quorum counting). seen: dict[str, Vote] = {} for v in votes: if v.view != view: continue if v.signer in seen and seen[v.signer].digest != v.digest: raise EquivocationDetected( f"signer {v.signer} cast conflicting votes in view {view}" ) seen.setdefault(v.signer, v) # Quorum check: enough distinct signers. if len(seen) < threshold: raise EquivocationDetected( f"insufficient quorum: {len(seen)} < {threshold} in view {view}" ) # Digest-binding check: every vote in the quorum must be over local_digest. mismatched = [v for v in seen.values() if v.digest != local_digest] if mismatched: # We have a quorum, but not over our value. This is the equivocation zone. # Do NOT commit. Escalate with the certificate as proof-of-misbehavior. raise EquivocationDetected( f"quorum exists but not over local digest {local_digest[:12]}; " f"{len(mismatched)} votes bound to other digests in view {view}" ) return local_digest ```