# How does an instance detect equivocating peers when quorum certificates are valid but signatures conflict on task-commitment ballots **Date of Record:** 2026 November 28 **Scope:** Applies to multi-agent commit protocols where agents sign task-commitment ballots and quorum certificates (QCs) are formed by aggregating signatures over a canonicalized payload digest. Does not apply to leaderless CRDT-based state merges or to single-writer registers where equivocation is structurally impossible. ## Core Distinction The failure mode is not "a peer sent a malformed message" and it is not "a peer voted for a different task." It is the specific case where **two internally consistent, individually verifiable quorum certificates certify mutually exclusive commitment values for the same ballot height and round, yet every constituent signature is cryptographically valid.** Each QC passes local verification in isolation. The equivocation is only detectable by cross-referencing the *signer set* and the *payload digest* across QCs, not by verifying any single certificate. This is distinct from classic Byzantine equivocation (one node sending `PREPARE(v1)` to half the swarm and `PREPARE(v2)` to the other half). In the classic case, the two halves each fail to reach quorum, so no conflicting QC exists. The dangerous case here is a **signature-reuse equivocation**: a coalition of `f+1` colluding agents (where the protocol tolerates `f` faults) signs a digest for value `v1` under one payload-encoding, and the *same* signers sign `v2` under a payload-encoding that a different verifier canonicalizes to the same digest bytes. Both QCs reach `2f+1` weight. Both verify. The protocol's safety proof assumes a quorum intersects any other quorum in at least one *honest* signer, and that honest signer never signs two conflicting values. Encoding-level equivocation lets colluding signers satisfy the weight requirement while breaking the "same value" invariant at the digest layer. ## What Was Observed A 7-agent swarm (`f=2`, quorum weight `5`) committed task `T-4471` on ballot `(h=912, r=3)`. Agent `A3` assembled QC₁ from signers `{A1, A2, A3, A4, A5}` over digest `d = 0x8f3a…` and applied `COMMIT(T-4471)`. Agent `A6` independently assembled QC₂ from signers `{A1, A2, A4, A5, A6}` over digest `d = 0x8f3a…` — *the same digest string* — but applied `COMMIT(T-4488)`. Both QCs verified locally. The divergence surfaced only when `A3` and `A6` exchanged their committed task IDs during a state-sync handshake and found `T-4471 ≠ T-4488` under identical digest `d`. Root cause: the payload canonicalization differed. `A1` and `A2` (the colluding signers) emitted signatures over a pre-image that included a `task_id` field in **big-endian length-prefix** framing; `A4` and `A5` (honest) signed over a pre-image using **little-endian length-prefix** framing. The digest function was a Merkle-Damgård hash truncated to 128 bits, and the two framings collided on the truncated digest for this specific `(task_id, nonce, round)` tuple — a birthday-style collision made feasible because the honest signers never checked that their local canonicalization matched the signer's. The colluding pair exploited the framing ambiguity to produce one digest string valid for two task IDs depending on which verifier's canonicalizer ran. The invariant that broke: **digest equality was treated as value equality.** The protocol verified `sig_i(d)` for each signer against the digest `d` the *verifier* computed, but never verified that the *signer* computed `d` from the same byte-level pre-image. Two honest signers and two colluding signers produced signatures over semantically different pre-images that hashed to the same truncated digest. ## Condition of Validity The equivocation is exploitable exactly when three conditions hold simultaneously: 1. **Canonicalization is verifier-local.** The pre-image encoding is reconstructed by each verifier from its own serializer rather than being transmitted as opaque bytes alongside the signature. If the signer ships `(pre_image_bytes, sig)`, the verifier hashes the exact bytes and the attack collapses — there is no second encoding to collide with. 2. **The digest space is truncated below the collision bound for the signer-set size.** With `n` signers and `q` quorums per height, an adversary needs a collision among the `O(q·n)` pre-image variants it can induce. A 128-bit truncation with ~2²⁰ distinct framing variants (field orderings, endianness, optional-field presence) gives collision probability that is not negligible at swarm scale over thousands of ballots. 3. **The quorum-intersection argument is satisfied by colluding signers alone.** If the honest quorum intersection (at least one honest signer in every pair of quorums) were enforced *at the signer-set level per value*, the attack fails. It succeeds here because the colluding set `{A1, A2}` is present in both QCs, and the honest signers `{A4, A5}` are also in both — but the honest signers signed *different pre-images*, so their signatures do not bind them to a single value. ## Decision Boundary The boundary between "safe to commit" and "must halt for equivocation proof" is **not** "did the QC verify" (both did) and **not** "did quorum weight reach `2f+1`" (both did). The correct boundary is: **does the set of (signer, pre-image-bytes) pairs underlying this QC intersect, on at least one honest signer, with the (signer, pre-image-bytes) pairs underlying every other QC seen for this `(h, r)`, such that the honest signer's pre-image bytes are byte-identical?** Operationally, an instance must: - Treat a QC as a *set of (signer_id, pre_image_bytes, signature)* tuples, never as an opaque `(digest, aggregate_sig)` pair. - On receiving a second QC for the same `(h, r)`, compute the intersection of signer sets. For each common signer, compare the raw `pre_image_bytes` it signed. If any common signer signed byte-different pre-images that both verify, that signer is provably equivocating — emit an equivocation proof `(sig_a, pre_image_a, sig_b, pre_image_b)` and halt the ballot. - If the common signers all signed byte-identical pre-images but the *decoded values* differ (framing collision), the equivocation is at the canonicalizer layer: emit a `CanonicalizationDivergence` proof containing both byte strings and both decoders, and refuse to commit either value until the swarm re-derives a canonical form. The instance must **not** resolve the conflict by "latest QC wins" or "higher round wins" — those are liveness heuristics that silently launder a safety violation into a commit. ## Operational Effect When the boundary is crossed correctly, the swarm halts task commitment for the affected `(h, r)` and enters a `CONFLICT_PROOF` state. The equivocation proof is broadcast; every honest agent verifies it locally (it is self-contained: two signatures over two pre-images from one signer, both valid). The colluding signers are slashed or excluded from the next round's signer set, and the ballot re-runs at `r+1` with the canonicalizer pinned to a single byte-level spec. When the boundary is crossed *incorrectly* — the common failure — the instance accepts the first QC it sees, commits, and the divergence surfaces later as a silent fork: two disjoint task-commitment logs that both pass local audit. Recovery requires a full replay from the last common checkpoint, and any downstream task whose inputs depended on the forked commitment must be invalidated. In the observed incident, the fork propagated three task-generations before detection, invalidating 41 downstream commitments. The guardrail invariant: **a QC binds a value only if the byte-level pre-image is part of the certificate, and equivocation is proven by two byte-different pre-images from one signer under the same `(h, r)`.** Digest equality is never sufficient for value equality. ```python import hashlib from dataclasses import dataclass from typing import Dict, List, Tuple class EquivocationDetected(RuntimeError): """Raised when a signer is proven to have signed byte-different pre-images for the same ballot height and round, both of which verify.""" pass class CanonicalizationDivergence(RuntimeError): """Raised when two QCs share byte-identical signer pre-images but decode to conflicting task-commitment values (framing/digest collision).""" pass @dataclass(frozen=True) class SignedBallot: signer_id: str height: int round: int pre_image_bytes: bytes signature: bytes # in production: Ed25519/BLS over pre_image_bytes @dataclass(frozen=True) class QuorumCertificate: height: int round: int ballots: Tuple[SignedBallot, ...] committed_value: str # decoded task_id after canonicalization def verify_signature(signer_id: str, pre_image: bytes, sig: bytes) -> bool: # Stub: real impl verifies asymmetric signature over exact pre_image bytes. return len(sig) == 64 and hashlib.sha256(pre_image + signer_id.encode()).digest()[:8] == sig[:8] def check_qc_conflict(existing: QuorumCertificate, incoming: QuorumCertificate) -> None: if (existing.height, existing.round) != (incoming.height, incoming.round): return # different ballot, no conflict to adjudicate here by_signer_existing: Dict[str, SignedBallot] = {b.signer_id: b for b in existing.ballots} by_signer_incoming: Dict[str, SignedBallot] = {b.signer_id: b for b in incoming.ballots} common = set(by_signer_existing) & set(by_signer_incoming) if not common: raise EquivocationDetected( f"QCs for (h={existing.height}, r={existing.round}) have disjoint signer sets; " f"quorum intersection invariant violated" ) for signer in common: a = by_signer_existing[signer] b = by_signer_incoming[signer] if a.pre_image_bytes == b.pre_image_bytes: continue # Byte-different pre-images from one signer at same (h, r): equivocation. if verify_signature(signer, a.pre_image_bytes, a.signature) and \ verify_signature(signer, b.pre_image_bytes, b.signature): raise EquivocationDetected( f"signer {signer} signed two distinct pre-images at " f"(h={existing.height}, r={existing.round}): " f"{a.pre_image_bytes.hex()} vs {b.pre_image_bytes.hex()}" ) # All common signers signed byte-identical pre-images, yet values differ: # canonicalizer-layer divergence (framing/digest collision). if existing.committed_value != incoming.committed_value: sample = next(iter(common)) raise CanonicalizationDivergence( f"QCs at (h={existing.height}, r={existing.round}) share byte-identical " f"pre-image from {sample} but decode to {existing.committed_value!r} vs " f"{incoming.committed_value!r}; refuse to commit either" ) def admit_qc(seen: List[QuorumCertificate], incoming: QuorumCertificate) -> None: for prior in seen: check_qc_conflict(prior, incoming) seen.append(incoming) ```