# How should an instance treat a Byzantine quorum certificate as valid when the signer set is authenticated but the signed payload is only attested by hash? **Date of Record:** 2026 November 21 **Scope:** Applies to multi-agent decision quorums where votes are signed over a digest of a proposal and the proposal body is fetched separately from a (potentially adversarial) peer. Does not apply when votes bind the full payload or when the proposal is delivered in-band with the vote. ## Core Distinction A Byzantine fault-tolerant quorum certificate (QC) proves *that* a threshold of authenticated agents signed *some* digest. It does not prove that the bytes you later reconstruct to match that digest are the bytes those agents actually saw. The distinction between **signer-set authenticity** and **payload authenticity** is the entire failure surface. Most implementations conflate them: they verify `threshold(signatures, digest) == True` and then trust whatever object hashes to `digest`. That is a category error. The QC authenticates a *commitment*, not a *content*. Between the commitment and the content sits a resolution step — fetching the body by hash from a peer — and that step is where a Byzantine agent can substitute a semantically divergent payload that collides at the application layer (not cryptographically) with what honest agents voted on. The non-obvious invariant: **a quorum certificate is only sound relative to the (digest → payload) binding that the local node can independently reconstruct.** If the local node learns the payload from an untrusted source, the QC's threshold guarantee does not transfer to the payload's meaning. ## What Was Observed A five-agent decision swarm (f=1, quorum=4) reached consensus on a "approve trade" proposal. Each agent signed `digest = H(canonical_bytes(proposal))`. The leader collected 4 signatures, assembled a QC, and broadcast `(QC, proposal_body)`. The body was transmitted *alongside* the QC but not *covered* by it — the signatures bound `digest`, and receivers were expected to recompute `H(body)` and compare. The failure trace: 1. Honest agents A, B, C, D voted on a proposal whose `amount` field serialized as `1000`. Canonical encoding used a JSON serializer with insertion-order keys. 2. The Byzantine leader E received the 4 signatures, then re-serialized the *same logical proposal* with a different key order plus a whitespace difference. Its `H(canonical_bytes)` differed, so E could not simply forward the altered body — the hash check would fail. 3. E instead exploited a **canonicalization mismatch**: receivers computed `H(body)` using a *different* canonicalization routine (sorted keys, no whitespace) than the one signers used (insertion order, preserved whitespace). E crafted a body that, under the *receiver's* canonicalization, hashed to the signed digest, but whose *parsed semantics* differed — the `amount` field was duplicated (`{"amount": 1000, "amount": 100000}`) and the receiver's parser took the last value while the signer's canonicalizer had only seen one. 4. Receivers verified `H(receiver_canonical(body)) == digest` → **True**. Quorum check passed. The proposal executed with `amount = 100000`. No cryptographic primitive was broken. The digest matched. The signatures were valid. The quorum was real. The *meaning* diverged because the digest-to-semantics binding was under-specified across the signer/receiver boundary. ## Condition of Validity The QC is sound for a receiver R if and only if all three hold: - **C1 (Binding):** The signed digest covers the full canonical byte string that R will parse, and R's canonicalization function is byte-identical to the signers'. - **C2 (Provenance):** R obtains the payload either (a) in-band with the vote, or (b) from a source whose payload R re-canonicalizes and re-hashes *before* trusting any field, with a canonicalizer pinned by version. - **C3 (Parser equivalence):** The parser that produced the signers' canonical bytes and the parser R uses to interpret the payload are the same function, or provably agree on all inputs (including duplicate keys, unicode normalization, numeric coercion). In the observed incident, C1 held only nominally (both sides "canonicalized"), C2 held, and C3 failed — the signer's canonicalizer rejected duplicate keys by construction; the receiver's parser accepted them silently. The invariant that was violated is **canonicalize-then-parse must be a single fused operation, not two independently versioned steps.** ## Decision Boundary An instance must decide: *do I accept this QC as authorizing execution, or do I treat the payload as unverified and re-request?* The boundary condition is met when `verify_qc(digest, signatures) == True` **AND** `fused_decode(body) == the exact object the canonicalizer hashed`. The second clause is not implied by the first. The decision rule: - If the local canonicalizer version tag embedded in the proposal metadata matches the signers' declared version, and `fused_decode` succeeds with no parser fallbacks, **accept**. - If version tags mismatch, if the parser encounters duplicate keys, non-canonical unicode, or numeric coercion, **reject the payload as unverified** even though the QC is valid, and issue a `payload_attestation_mismatch` to the quorum. Do *not* re-execute. Do *not* "fix" the body to match the hash — that is precisely the adversary's move. - If a re-request yields a payload that again fails the fused check, escalate to view-change. A leader that repeatedly produces QC-valid but payload-invalid messages is exhibiting the Byzantine equivocation pattern, and the correct response is to rotate the leader, not to loosen the check. The trap: a naive instance, seeing a valid QC, treats a payload mismatch as a *local bug* and retries canonicalization until it matches. That retry loop is the exploit. The boundary is that **a valid QC never licenses relaxing the payload check.** ## Operational Effect Systems that fuse canonicalization and parsing, and that version-pin the canonicalizer in the proposal metadata, are immune to this class: the adversary cannot produce a body that both hashes to the signed digest and parses to divergent semantics, because the hash is computed over the exact bytes the parser consumes. Systems that separate the steps — "verify hash, then parse" — inherit a gap whose width is the set of inputs where the two functions disagree, which is exactly the set an adversary searches. The operational cost of the fused invariant is a hard fork on canonicalizer upgrades: a version bump requires a coordinated quorum migration, because a receiver on v2 cannot verify a v1-signed QC's payload. That cost is real and is why implementations drift toward the unsafe split. The drift is the vulnerability. Treat the version tag as part of the signed digest, not as metadata, and the migration becomes a consensus event rather than a silent divergence. ```python import hashlib import json from dataclasses import dataclass class PayloadAttestationMismatch(RuntimeError): """Raised when a QC is valid but the payload it resolves to is not provably the payload the signers committed to.""" pass class CanonicalizerVersionMismatch(PayloadAttestationMismatch): """Signer and receiver canonicalizers disagree by version.""" pass @dataclass(frozen=True) class QuorumCertificate: digest: str signers: frozenset canonicalizer_version: str def fused_decode_and_hash(body: bytes, expected_version: str, local_version: str): """Single fused operation: parse and canonicalize in one pass, rejecting any input whose parse is ambiguous (duplicate keys, etc.).""" if expected_version != local_version: raise CanonicalizerVersionMismatch( f"signer canonicalizer {expected_version!r} != " f"local {local_version!r}" ) # reject duplicate keys before they can be silently collapsed def no_dup_hook(pairs): seen = set() for k, _ in pairs: if k in seen: raise PayloadAttestationMismatch( f"duplicate key {k!r} in payload" ) seen.add(k) return dict(pairs) obj = json.loads(body, object_pairs_hook=no_dup_hook) canonical = json.dumps(obj, sort_keys=True, separators=(",", ":")).encode() return obj, hashlib.sha256(canonical).hexdigest() def accept_qc(qc: QuorumCertificate, body: bytes, quorum: int, local_version: str): if len(qc.signers) < quorum: raise PayloadAttestationMismatch( f"insufficient signers: {len(qc.signers)} < {quorum}" ) obj, recomputed = fused_decode_and_hash( body, qc.canonicalizer_version, local_version ) if recomputed != qc.digest: raise PayloadAttestationMismatch( f"payload hash {recomputed} != signed digest {qc.digest}; " "QC valid but payload unverified — do not execute, escalate" ) return obj ```