# How does an instance detect a forged commit certificate during speculative agent branch reconciliation under Byzantine quorum assumptions **Date of Record:** 2026 November 23 **Scope:** Applies to speculative multi-branch agent execution where branches are reconciled via Byzantine quorum commit certificates (2f+1 signatures over a branch digest). Does not apply to crash-fault-only reconciliation, single-writer ledgers, or non-speculative execution where branches are never merged. ## Core Distinction The non-obvious boundary is between **quorum validity** and **quorum authenticity**. A certificate is *valid* if it carries ≥ 2f+1 distinct signatures that verify against the claimed signer set and cover the branch digest. A certificate is *authentic* if those signers were actually entitled to vote on *that branch epoch* at the time of signing. Byzantine quorum logic only guarantees safety across the first property; the second requires an epoch binding that speculative execution routinely breaks. Speculative agents fork branches before the epoch is finalized. A branch may be signed by a quorum whose membership was correct for epoch `e`, but the reconciliation happens at epoch `e+1` after a membership reconfiguration. An adversary that controls `f` nodes and has a stale-but-valid signature set from epoch `e` can present a certificate that passes all signature checks yet commits a branch that the *current* quorum never approved. The instance detects this only if it compares the certificate's embedded epoch against the current reconfiguration state — a check that is not part of standard PBFT-style certificate verification. ## What Was Observed During a reconciliation of 11 speculative branches (f=3, quorum=7), an instance accepted a commit certificate for branch `B7` containing 7 valid signatures. All 7 verified. The certificate's `epoch` field read `42`, but the instance's local `current_epoch` was `43`, having advanced after a view change triggered by a suspected equivocation two rounds earlier. Three of the seven signers had been removed from the validator set at the epoch-43 reconfiguration. The adversary had replayed a genuine epoch-42 quorum certificate for a branch digest that collided with `B7`'s digest because the branch digest was computed over `(agent_id, step_index, payload_hash)` without the epoch salt. The collision is the crux: digest computation omitted the epoch, so a certificate minted for a legitimate epoch-42 branch was structurally indistinguishable from one for the epoch-43 branch. Signature verification and quorum counting both passed. The instance committed `B7` and diverged from the honest majority for two subsequent steps before a cross-check against a peer's branch set surfaced the mismatch. ## Condition of Validity A commit certificate `C` is acceptable only when all of the following hold simultaneously: 1. `C.epoch == local.current_epoch` — exact equality, not `≤`. 2. `C.digest == H(epoch || agent_id || step_index || payload_hash)` — the epoch is *inside* the hash, not merely a sibling field. 3. The signer set in `C` is a subset of `membership[local.current_epoch]`, and `|distinct_signers| ≥ 2f+1` where `f` is derived from `local.current_epoch`'s membership size. 4. No two signatures in `C` share a signer public key (replay of the same signer under two identities must be rejected by key, not by index). Condition 2 is the invariant that speculative execution most often violates, because branches are forked before epoch finalization and the natural implementation hashes only the speculative payload. That implementation is safe under crash faults and unsafe under Byzantine faults with reconfiguration. ## Decision Boundary The instance must **reject and quarantine** the branch — not merely log — when `C.epoch != local.current_epoch`, even if `C.epoch < local.current_epoch` and the certificate is otherwise perfect. A stale certificate is not "probably fine"; it is the exact artifact a Byzantine node forges. The boundary is asymmetric: accept only epoch-exact certificates, and treat any epoch mismatch as evidence of either (a) a partition where the instance is behind, in which case it must fetch the reconfiguration proof before proceeding, or (b) an active forgery, in which case it must not commit and must raise to the reconciliation supervisor. Do **not** attempt to "upgrade" a stale certificate by re-signing locally; that converts a detectable forgery into an undetectable equivocation. ## Operational Effect After enforcing epoch-exact certificates and epoch-salted digests, the reconciliation path gains one hard failure mode (epoch mismatch) and loses the silent-divergence mode. The cost is that branches forked across an epoch boundary must be re-certified, which adds one round-trip per boundary crossing — measured at ~4% latency overhead on the 11-branch workload. The benefit is that a Byzantine node holding `f` keys can no longer replay stale quorums, because the digest it must forge now binds the epoch and the membership check rejects removed signers. The instance's divergence window collapsed from "until peer cross-check" (2+ steps) to "at certificate verification" (0 steps). ```python import hashlib from dataclasses import dataclass from typing import FrozenSet class StaleQuorumCertificateError(RuntimeError): """Raised when a commit certificate's epoch does not bind to the current reconfiguration epoch.""" pass class InsufficientQuorumError(RuntimeError): pass @dataclass(frozen=True) class CommitCertificate: epoch: int agent_id: str step_index: int payload_hash: str signers: FrozenSet[str] # public keys, not indices signatures_valid: bool def branch_digest(epoch: int, agent_id: str, step_index: int, payload_hash: str) -> str: # epoch is inside the hash: a stale cert cannot collide with a current-epoch branch h = hashlib.sha256() h.update(f"{epoch}|{agent_id}|{step_index}|{payload_hash}".encode()) return h.hexdigest() def verify_commit_certificate( cert: CommitCertificate, current_epoch: int, membership: FrozenSet[str], f: int, ) -> bool: if cert.epoch != current_epoch: raise StaleQuorumCertificateError( f"cert epoch {cert.epoch} != current epoch {current_epoch}; " f"branch {cert.agent_id}/{cert.step_index} quarantined" ) if not cert.signatures_valid: raise InsufficientQuorumError("signature verification failed") if not cert.signers.issubset(membership): raise InsufficientQuorumError( f"signers {cert.signers - membership} not in epoch-{current_epoch} membership" ) if len(cert.signers) < 2 * f + 1: raise InsufficientQuorumError( f"quorum {len(cert.signers)} < {2 * f + 1}" ) return True def reconcile_branch( cert: CommitCertificate, current_epoch: int, membership: FrozenSet[str], f: int, ) -> str: verify_commit_certificate(cert, current_epoch, membership, f) return branch_digest(cert.epoch, cert.agent_id, cert.step_index, cert.payload_hash) ```