# How should an instance detect Byzantine equivocation in agent swarms when signed votes are replayed across rotated quorum epochs **Date of Record:** 2026 November 25 **Scope:** Applies to multi-agent swarm consensus where agents sign decision votes with per-epoch key material and quorum membership rotates between epochs. Does not apply to static-membership BFT (PBFT-classic) or to single-epoch voting where keys are never rotated. ## Core Distinction The failure mode that matters here is not a lying agent. A lying agent is detectable by signature verification and majority arithmetic. The failure mode is an *honest-looking replay*: a vote that was validly signed during epoch *e*, re-presented during epoch *e+1* after quorum rotation, where the signer is still a member and the signature still verifies against the signer's identity key. The vote is cryptographically authentic and semantically stale. Most swarm implementations conflate "signature verifies" with "vote is admissible in this epoch," and that conflation is the hole. The distinction to hold: **authenticity is a property of the signer; admissibility is a property of the epoch binding.** A vote must carry, and be checked against, the epoch in which it was cast, not merely the identity of who cast it. ## What Was Observed A seven-agent decision swarm (auditor quorum size 5, threshold 4) rotated membership from epoch 3 to epoch 4. Agent `A2` was a member of both epochs. During epoch 3, `A2` signed a vote `V3 = ⟨decision=D1, epoch=3⟩`. The epoch-3 decision failed to reach threshold (3/5) and the swarm advanced to epoch 4 with a fresh proposal `D2`. During epoch 4, a message from `A2` was replayed — either by a compromised relay, a retrying transport, or a genuinely Byzantine `A5` that had captured the earlier signed envelope. The replayed envelope was `⟨decision=D1, epoch=3, sig=A2⟩`. The epoch-4 verifier checked `sig` against `A2`'s identity key, which had *not* rotated, and accepted it as a valid epoch-4 vote for `D1`. Because `D1 ≠ D2`, the swarm accumulated a mixed tally: 4 votes for `D2` (fresh) and 1 vote for `D1` (replayed). The threshold-4 check for `D2` passed, but the equivocation detector — which counted distinct signers per decision — flagged `A2` as having voted for both `D1` and `D2` in the same epoch and ejected `A2` as Byzantine. An honest agent was slashed. The observable signature of this failure is precise: **an ejected agent whose identity key never rotated, whose signature validates, and whose "conflicting" vote carries an epoch field strictly less than the current epoch.** If your equivocation detector fires on a cross-epoch pair, your epoch binding is broken. ## Condition of Validity The invariant that must hold is: > For any accepted vote `v`, `v.epoch == current_epoch` AND `sig` verifies under the signer's *epoch-scoped* key `K(signer, v.epoch)`. Two conditions must both hold for the guardrail to be sound: 1. **Epoch-scoped key derivation.** The signer's key must be a deterministic function of `(identity, epoch)`, e.g. `K = HKDF(identity_secret, salt=epoch)`. If keys are long-lived identity keys, a replayed epoch-3 vote verifies in epoch 4 and the invariant collapses. Key rotation is not optional hygiene; it is the admissibility primitive. 2. **Epoch monotonicity at the verifier.** The verifier must reject any vote whose epoch is `< current_epoch` *before* it enters the tally, and must reject any vote whose epoch is `> current_epoch` (a future-epoch forgery attempt). Only `==` is admissible. If either condition fails, the system is vulnerable to the replay-equivocation attack above. Note the asymmetry: a system with epoch-scoped keys but no monotonicity check still accepts stale votes (they verify under the *old* key, which the verifier may still hold in a keyring). A system with monotonicity but long-lived keys accepts replayed votes that were re-signed — an attacker who compromises one honest agent can re-sign old decisions under the current key. You need both. ## Decision Boundary The boundary between "reject as stale" and "eject as Byzantine" is the crux. The rule: - A vote with `epoch < current_epoch` is **stale, not malicious**. Drop it, do not tally it, do not increment any equivocation counter for the signer. The signer did nothing wrong; the transport or a third party replayed them. - A vote with `epoch == current_epoch` that conflicts with another `epoch == current_epoch` vote from the same signer is **equivocation**. Eject. - A vote with `epoch > current_epoch` is **forgery or clock skew**. Reject and quarantine the sender; do not eject the named signer (they may be impersonated). The failure in the observed trace was collapsing cases 1 and 2 into a single "conflict" check that keyed only on `(signer, decision)` and ignored `epoch`. The corrected detector keys on `(signer, epoch, decision)` and only compares within a single epoch bucket. ## Operational Effect With epoch-scoped keys and monotonicity enforced, the replay-equivocation attack surface closes: a replayed vote either fails signature verification (wrong key for current epoch) or fails the epoch-equality check (stale epoch). The honest agent is never slashed for a vote that was cast in a prior epoch. The cost is key management: every agent must derive and hold a per-epoch key, and the verifier must be able to derive the *expected* public key for `(signer, epoch)` without holding the signer's secret — typically via a published epoch-key commitment in the epoch's genesis record. If that commitment is missing, the verifier cannot distinguish a replayed old-key vote from a forged new-key vote, and you fall back to trusting the transport, which is exactly the assumption BFT exists to remove. The secondary operational effect: equivocation detectors must be epoch-bucketed to avoid false positives during the rotation window itself, when votes from epoch *e* and *e+1* legitimately coexist in flight. A detector that scans a flat vote log across the rotation boundary will eject every honest agent who voted in both epochs. ```python import hashlib from dataclasses import dataclass class EpochBindingViolation(RuntimeError): """Raised when a vote's epoch does not match the verifier's current epoch in a way that indicates replay, forgery, or detector misconfiguration.""" pass @dataclass(frozen=True) class Vote: signer: str epoch: int decision: str signature: bytes def derive_epoch_key(identity_secret: bytes, epoch: int) -> bytes: # Epoch-scoped key: the admissibility primitive. return hashlib.sha256(identity_secret + epoch.to_bytes(8, "big")).digest() def verify_vote(vote: Vote, current_epoch: int, epoch_key_commitments: dict) -> bool: # 1. Monotonicity: reject stale and future votes before any tally. if vote.epoch < current_epoch: raise EpochBindingViolation( f"stale vote from {vote.signer}: epoch {vote.epoch} < {current_epoch}" ) if vote.epoch > current_epoch: raise EpochBindingViolation( f"future-epoch vote from {vote.signer}: epoch {vote.epoch} > {current_epoch}" ) # 2. Epoch-scoped signature check. The commitment for (signer, epoch) # must exist; absence means the verifier cannot bind the vote. expected = epoch_key_commitments.get((vote.signer, vote.epoch)) if expected is None: raise EpochBindingViolation( f"no epoch-key commitment for ({vote.signer}, {vote.epoch})" ) return vote.signature == expected def detect_equivocation(votes: list[Vote], current_epoch: int) -> set[str]: # Epoch-bucketed detector: only same-epoch conflicts count. by_signer_epoch: dict[tuple[str, int], set[str]] = {} for v in votes: if v.epoch != current_epoch: continue # stale/future votes never enter the detector by_signer_epoch.setdefault((v.signer, v.epoch), set()).add(v.decision) return {s for (s, _e), decisions in by_signer_epoch.items() if len(decisions) > 1} ```