# Where must an instance draw the equivocation boundary when Byzantine quorum voting agents sign divergent proposals to different peers **Date of Record:** 2026 December 2 **Scope:** Applies to multi-agent decision quorums where each voting agent holds its own signing key and independently broadcasts proposal votes to peers (2f+1 of 3f+1 membership). Does not apply to single-writer logs, leader-only commit paths, or systems where a trusted sequencer serializes all ballots before signing. ## Core Distinction The failure is not "a malicious agent lies." The failure is that a *correct* agent, under legitimate retry pressure, produces two signed votes for two different proposal hashes at the same quorum height, and the quorum layer—designed to tolerate f Byzantine nodes—now has f+1 equivocators, one of which is honest. BFT consensus tolerates equivocation by counting it as Byzantine behavior; it does not tolerate it from a node whose local state machine believes it is behaving correctly. The distinction that matters: **equivocation is defined at the signing boundary, not at the intent boundary.** An agent that signs two conflicting votes has equivocated regardless of what it "meant," and any quorum that reasons about intent rather than signatures has already lost the safety proof. ## What Was Observed A five-agent quorum (f=1, threshold 2f+1=3) ran a proposal round at height H. The proposer agent P broadcast proposal hash `A` to peers {R1, R2, R3}. R1's vote-signing call to the local signer timed out at 800ms—the signer had in fact produced and persisted a signature over `(H, A)`, but the response was lost on the wire back to R1's vote assembler. R1's retry logic, seeing a transport timeout rather than a signed rejection, re-derived the vote from its current view. Between the first attempt and the retry, R1 had processed a `NewView` message and its local view had shifted; the retry signed `(H, B)` where `B` was the proposal hash in the new view. R1 broadcast both signatures. The signer's idempotency key was `(agent_id, height)`—not `(agent_id, height, proposal_hash)`—so the second signing call was rejected as a duplicate and R1's assembler *reported success* using the cached first signature while its broadcast layer independently flushed the second. Peers received `(H,A)` from R1 and `(H,B)` from R1. The quorum still committed `A` at H, because R1's `(H,A)` vote plus R2 and R3 reached threshold. But the audit replay, run afterward against the signed vote log, flagged R1 as Byzantine. R1 was a correct agent. The detector was also correct. Both were right, and the safety argument that "at most f nodes are faulty" was silently violated: the system had f+1 equivocators at height H, and only luck (the threshold being reached before the conflicting vote was counted) prevented a split commit. ## Condition of Validity The invariant that must hold is: **for every (agent_id, height), the set of signed proposal hashes broadcast by that agent has cardinality ≤ 1, and this is enforced by the signer, not by the caller.** The condition of validity is that the signing key is bound to a monotonic height counter and the signer refuses any signing request whose `(height)` is not strictly greater than the last signed height, *and* refuses any request at the current height whose `proposal_hash` differs from the first one signed at that height. This is a two-part guard: monotonic height prevents replay across rounds, and hash-pinning within a height prevents intra-round equivocation. Note what is *not* sufficient. Caller-side idempotency keys fail because the caller is the component under retry pressure and is precisely the component whose view can shift. Transport-level deduplication fails because the two broadcasts may take different paths. Quorum-side equivocation detection fails as a *prevention* mechanism—it can only punish after the fact, and by then the safety proof is already void. The guard must live where the private key lives, because that is the only component that can make equivocation physically impossible rather than merely detectable. ## Decision Boundary An instance must decide, at the moment it receives a signing request, whether the request is a retry of an already-signed vote or a genuinely new vote. The boundary is drawn as follows: - If `request.height < last_signed_height`: reject, it is a stale retry or a replay. - If `request.height == last_signed_height` and `request.proposal_hash == last_signed_hash`: return the cached signature, do not re-sign, do not let the caller re-broadcast independently. - If `request.height == last_signed_height` and `request.proposal_hash != last_signed_hash`: **this is the equivocation boundary.** The signer must refuse and must surface the conflict to the caller as a hard error, because the caller's view has diverged from the signer's committed history and the caller cannot be trusted to resolve it locally. - If `request.height > last_signed_height`: sign, persist `(height, hash, signature)` atomically before returning. The non-obvious part: the third case must be a *loud* failure that halts the caller's vote path, not a silent rejection that the retry loop swallows. A silent rejection at the equivocation boundary is how R1's assembler "succeeded" with a cached signature while a second broadcast escaped. The signer must return the cached signature *with an explicit marker* that the vote has already been broadcast, and the caller's broadcast layer must be idempotent on that marker. ## Operational Effect With the signer-side height-and-hash pin, R1's retry at height H after the `NewView` shift would have been rejected with a `EquivocationBoundaryError`, R1's vote path would have halted and escalated, and the quorum would have proceeded with R2 and R3 plus the proposer's own vote—reaching threshold without counting a conflicting signature. The audit replay would show R1 as correct-but-halted, which is a recoverable state, rather than as Byzantine, which is not. The cost is that a view-shift during an in-flight vote now produces a visible stall instead of a silent double-sign. This is the correct trade: a stall is a liveness problem that the view-change protocol already handles; a double-sign is a safety problem that no protocol can repair after the fact. The instance must prefer to stall. Two secondary effects follow. First, the signer's persisted `(height, hash, signature)` record becomes the authoritative equivocation log, and every peer's audit replay can be checked against it without trusting the caller's reported intent. Second, the retry loop must be rewritten to distinguish "transport timeout, signature may exist" from "signer rejected, no signature"—the former triggers a *query* to the signer for the cached signature, the latter triggers escalation. Conflating these two is the original bug. ```python import hashlib import hmac from dataclasses import dataclass from typing import Optional class EquivocationBoundaryError(RuntimeError): """Raised when a signing request would produce a second vote at an already-signed height.""" class StaleHeightError(RuntimeError): """Raised when a signing request targets a height below the committed counter.""" @dataclass(frozen=True) class SignedVote: height: int proposal_hash: str signature: str already_broadcast: bool class EquivocationGuard: """ Signer-side guard enforcing the invariant: for every height, at most one proposal_hash is ever signed. The private key never leaves this object; callers cannot bypass the check. """ def __init__(self, agent_id: str, secret: bytes): self._agent_id = agent_id self._secret = secret self._last_height: int = -1 self._last_hash: Optional[str] = None self._last_sig: Optional[str] = None def _sign(self, height: int, proposal_hash: str) -> str: msg = f"{self._agent_id}|{height}|{proposal_hash}".encode() return hmac.new(self._secret, msg, hashlib.sha256).hexdigest() def sign_vote(self, height: int, proposal_hash: str) -> SignedVote: if height < self._last_height: raise StaleHeightError( f"height {height} is below committed height {self._last_height}" ) if height == self._last_height: if proposal_hash == self._last_hash: # Legitimate retry of an already-signed vote: return cache, mark broadcast. return SignedVote( height=height, proposal_hash=proposal_hash, signature=self._last_sig, already_broadcast=True, ) # Equivocation boundary: caller's view shifted under retry pressure. raise EquivocationBoundaryError( f"agent {self._agent_id} already signed height {height} for " f"{self._last_hash!r}; refusing conflicting {proposal_hash!r}. " f"Caller view has diverged from signer history." ) # height > last_height: commit atomically before returning. sig = self._sign(height, proposal_hash) self._last_height = height self._last_hash = proposal_hash self._last_sig = sig return SignedVote( height=height, proposal_hash=proposal_hash, signature=sig, already_broadcast=False, ) def handle_vote_retry(guard: EquivocationGuard, height: int, proposal_hash: str, transport_timed_out: bool) -> SignedVote: """ Retry path. Distinguishes transport timeout (signature may exist) from signer rejection (no signature). Conflating these is the original bug. """ if transport_timed_out: # Query the signer for the cached signature rather than re-deriving. try: return guard.sign_vote(height, proposal_hash) except EquivocationBoundaryError: # View shifted between attempts; halt and escalate, do not broadcast. raise EquivocationBoundaryError( f"retry at height {height} hit equivocation boundary; " f"halting vote path and escalating to view-change" ) raise EquivocationBoundaryError( "retry invoked without a transport-timeout condition; " "this path must not re-sign under view uncertainty" ) ```