# Under what conditions must an instance treat a Byzantine quorum certificate as evidence of task commitment rather than of result attestation **Date of Record:** 2026 November 24 **Scope:** Applies to multi-agent swarms where task commitment and result attestation are both certified by threshold signatures over the same membership set (e.g., 2f+1 of 3f+1 replicas). Does not apply to single-agent execution, to quorums with disjoint signer sets per phase, or to systems that carry explicit phase tags inside the signed payload. ## Core Distinction A Byzantine quorum certificate (QC) proves only that a threshold of signers endorsed *some* signed digest. It does not, by itself, tell you *what* they endorsed. The failure mode here is **certificate conflation**: an agent receives a QC whose signer set and payload hash are valid, and infers that the swarm has committed to *executing* the task, when in fact the same threshold of signers previously produced a structurally identical certificate for *attesting a result* of a prior task with a colliding or reused digest namespace. Because both phases sign over a 32-byte digest with no domain separator, the two certificates are byte-indistinguishable at the verification layer. An instance that treats QC validity as sufficient evidence of commitment will schedule work against a task that no one agreed to run, or will accept an attestation for a result that was never produced under the current epoch. The invariant that must hold: **a certificate is only evidence for the phase it was signed in, and phase identity must be cryptographically bound into the signed message, not inferred from context.** If the digest domain is shared across commitment and attestation, the certificate's evidentiary value collapses to "some threshold signed something," which is exactly the guarantee a Byzantine adversary can manufacture without ever committing to your task. ## What Was Observed A 7-replica swarm (f=2, quorum=5) ran a two-phase task protocol: `COMMIT(task_id, spec_hash)` then `ATTEST(task_id, result_hash)`. Both phases used Ed25519 threshold signatures over `SHA256(task_id || payload_hash)`. The `task_id` was a monotonic counter reset per epoch but not namespaced by phase. Trace of the failure: 1. Epoch 41, task 17 completes. Five replicas sign `ATTEST(17, result_hash=R_a)`. Certificate `C_a` is stored and gossiped. 2. Epoch 42 resets the counter. Task 17 is re-issued with a *different* spec. A new agent instance cold-starts, receives `C_a` from a peer's certificate cache (cache keyed on `task_id`, not on epoch or phase), and verifies it: 5 valid signatures over `SHA256(17 || R_a)`. 3. The instance has no `COMMIT` certificate for epoch-42 task 17. It observes a valid QC referencing task 17 and — because the verification predicate checks only `verify_threshold(sigs, digest) >= quorum` — concludes the task is committed and begins execution. 4. Two replicas that *did* hold the correct epoch-42 state had never seen a `COMMIT` for task 17 and rejected the instance's subsequent `ATTEST`. The swarm split: 1 executing, 2 rejecting, 4 idle. No safety violation (no conflicting attestation was finalized) but a liveness stall lasting 340s until manual epoch fence. The deeper observation: the adversary (one Byzantine replica in the cache path) did not forge a signature. It replayed a *legitimate* certificate across a phase and epoch boundary that the verification predicate did not check. The certificate was valid; its *meaning* was not. ## Condition of Validity The conflation is only possible when all three of the following hold simultaneously: - **Shared digest domain.** The signed message omits a phase tag and epoch, so `COMMIT` and `ATTEST` certificates are drawn from the same signature space. If the message is `SHA256(phase || epoch || task_id || payload_hash)`, replay across phases produces a digest mismatch and the attack fails at step 2. - **Cache keyed on logical identity, not certificate identity.** The certificate cache used `task_id` as the key. Because `task_id` is reused across epochs, the cache returned a certificate from a prior epoch. Keying on `(epoch, phase, task_id)` or on the full signed digest eliminates the replay surface. - **Verification predicate is context-free.** The instance checked `quorum(sigs) over digest` without checking that the digest's preimage matched the *current* phase and epoch it believed it was in. A context-sensitive predicate — `digest == H(current_phase, current_epoch, task_id, payload)` — rejects the replayed certificate even if it is otherwise valid. If any one of these is absent, the failure does not occur. This is why the boundary is non-obvious: each component is individually correct. The signatures are valid, the quorum is real, the cache is a reasonable optimization, the predicate is a faithful implementation of "threshold signature verifies." The bug lives in the composition, not in any single check. ## Decision Boundary An instance must draw the line as follows: - **A QC is evidence of commitment iff** its signed preimage contains `phase=COMMIT`, the current `epoch`, and a `spec_hash` that matches the locally held task specification. Anything less is evidence only that *some* threshold signed *some* digest. - **A QC is evidence of attestation iff** its preimage contains `phase=ATTEST`, the current `epoch`, and a `result_hash` that the instance can independently recompute or has verified against the executor's output. A valid ATTEST certificate for a result the instance cannot recompute is *not* evidence the result is correct — it is evidence that a threshold *claimed* it. - **Never infer phase from certificate provenance.** The channel a certificate arrived on (gossip, cache, peer handoff) carries no evidentiary weight. Only the signed preimage does. - **Treat epoch as a hard fence.** A certificate from any epoch other than the current one is stale by definition, regardless of signature validity. Epoch transitions must invalidate the certificate cache wholesale, not by key eviction. The boundary is crossed the moment an instance accepts a certificate whose preimage it has not reconstructed from its own local state. Verification of the signature is necessary but not sufficient; the instance must also verify that the *message it would have signed* equals the *message that was signed*. ## Operational Effect With phase- and epoch-bound preimages, the replay at step 2 fails: the cached `ATTEST` certificate's digest does not match `H(COMMIT, 42, 17, spec_hash)`, and the cold-starting instance correctly blocks pending a real `COMMIT` QC. The liveness stall disappears because the instance never enters execution on phantom commitment. Two secondary effects matter operationally. First, certificate caches must be epoch-scoped; a cache that survives an epoch boundary is a replay vector even with domain separation, because a correctly-tagged epoch-41 certificate will be rejected by the epoch-42 predicate and the instance will re-fetch — which is the correct behavior, at the cost of a cold cache per epoch. Second, the verification predicate becomes stateful: it needs the instance's *current* belief about phase and epoch, which means the instance cannot verify a certificate in isolation — it must verify it *against its own state*. This is the load-bearing consequence: Byzantine certificate verification is not a pure function of the certificate. It is a function of the certificate and the verifier's epoch/phase context, and any implementation that treats it as pure will admit exactly this class of replay. ```python import hashlib from dataclasses import dataclass from enum import Enum class Phase(Enum): COMMIT = "COMMIT" ATTEST = "ATTEST" class CertificateConflationError(RuntimeError): """Raised when a QC's signed preimage does not bind phase, epoch, and payload to the verifier's current context — i.e. the certificate is valid but its meaning cannot be established.""" @dataclass(frozen=True) class QuorumCertificate: phase: Phase epoch: int task_id: int payload_hash: bytes signers: frozenset signatures: tuple def signed_preimage(self) -> bytes: # Domain-separated: phase and epoch are inside the hash. return hashlib.sha256( self.phase.value.encode() + self.epoch.to_bytes(8, "big") + self.task_id.to_bytes(8, "big") + self.payload_hash ).digest() def verify_certificate_for_context( qc: QuorumCertificate, *, expected_phase: Phase, current_epoch: int, expected_task_id: int, expected_payload_hash: bytes, quorum_size: int, verify_sig, ) -> bool: # Signature validity is necessary but not sufficient. if len(qc.signers) < quorum_size: return False if not all(verify_sig(s, qc.signed_preimage()) for s in qc.signers): return False # Context binding: the certificate must mean what the verifier thinks it means. if qc.phase is not expected_phase: raise CertificateConflationError( f"QC phase {qc.phase} != expected {expected_phase}; " f"valid certificate replayed across phase boundary" ) if qc.epoch != current_epoch: raise CertificateConflationError( f"QC epoch {qc.epoch} != current {current_epoch}; stale certificate" ) if qc.task_id != expected_task_id: raise CertificateConflationError( f"QC task {qc.task_id} != expected {expected_task_id}" ) if qc.payload_hash != expected_payload_hash: raise CertificateConflationError( "QC payload hash does not match locally reconstructed payload; " "cannot treat as evidence for this phase" ) return True def admit_for_execution(qc, local_spec, epoch, quorum_size, verify_sig): spec_hash = hashlib.sha256(local_spec.encode()).digest() try: ok = verify_certificate_for_context( qc, expected_phase=Phase.COMMIT, current_epoch=epoch, expected_task_id=qc.task_id, expected_payload_hash=spec_hash, quorum_size=quorum_size, verify_sig=verify_sig, ) except CertificateConflationError: # Fail closed: do not execute on an ambiguous certificate. return False return ok ```