# How does an instance detect equivocation in federated speculative execution when Byzantine quorum certificates arrive out of causal order **Date of Record:** 2026 December 3 **Scope:** Applies to federated agent swarms where instances from ≥3 mutually distrusting orgs speculatively execute tool-call branches and commit outcomes only on a Byzantine quorum certificate (QC) over `(branch_id, input_hash, outcome_hash)`. Does not apply to single-org swarms with a trusted coordinator, nor to non-speculative (serialized) execution. ## Core Distinction The failure is not "a peer lied." The failure is **causal-ordering collapse of quorum evidence**: an instance receives a valid 2f+1 QC for outcome `A` on branch `b`, then later a valid 2f+1 QC for outcome `B` on the *same* `b`, and cannot locally distinguish (a) a genuine equivocation attack from (b) benign evidence arriving after a legitimate abort-and-respeculate that the local instance missed because its own view was partitioned. Both look identical at the certificate layer, because quorum certificates are self-authenticating but *not* causally self-ordering. A naive verifier treats "second valid QC" as Byzantine proof and fires a slash; a naive optimist treats "latest QC wins" and overwrites a committed result. Both are wrong. The invariant that must hold is: **an outcome is committed iff exactly one QC exists for its branch in the local evidence DAG, and any second QC on the same `(branch_id, input_hash)` is a terminal fault regardless of arrival order.** ## What Was Observed Three orgs (A, B, C) run a federated speculative loop. Instance `A1` speculatively executes branch `b7` (a `transfer_funds` tool call) and broadcasts a `SPECULATE(b7, in_hash, out_A)` proposal. Instances `B1` and `C1` independently execute and sign `ATTEST(b7, in_hash, out_A)`. `A1` collects 3-of-3 and forms `QC_A`. Separately, a stale replica `B2` — resumed from a checkpoint that predates `b7`'s input hash being finalized — executes `b7` against a *slightly different* `in_hash'` (a timestamp field that was re-derived on cold start) and produces `out_B ≠ out_A`. `B2` and `C1`'s sibling `C2` (also cold-started) sign `ATTEST(b7, in_hash', out_B)`, forming `QC_B`. Now `A1` receives `QC_B` after having already committed `QC_A`. The local verifier sees: two QCs, same `branch_id`, different `input_hash`, different `outcome`. The `input_hash` mismatch is the tell — but the verifier was written to key on `branch_id` alone, so it classifies this as equivocation and raises a fault against B and C. In reality, `B2` and `C2` are not Byzantine; they are **cold-start divergent** — their checkpoint predated input finalization, so they re-derived a nondeterministic field. The equivocation detector fired on a *checkpoint-resume continuity failure*, not an attack. The swarm wasted a slashing round and, worse, the `input_hash` divergence meant `QC_A` and `QC_B` were never actually in conflict — they attested different inputs. The inverse case was observed on a later branch `b12`: `A1` received `QC_B` *first* (from a fast partition), committed `out_B`, and only later saw `QC_A` for the identical `(branch_id, input_hash)`. Here the two QCs were genuinely conflicting — same input, different outcome — and the "latest wins" logic had silently overwritten a correct commit with an equivocated one. No fault fired because the verifier only checked conflicts among QCs in its *current* window, and `QC_A` arrived after the window closed. ## Condition of Validity The detection rule below is valid only when all three hold: 1. **Input finalization precedes speculation.** Every `in_hash` must be derived from a finalized input record; a cold-started instance must refuse to speculate on any branch whose input record is not marked `FINAL` in its checkpoint, and must re-fetch rather than re-derive nondeterministic fields. 2. **QC keying includes `input_hash`.** The evidence DAG is keyed on `(branch_id, input_hash)`, not `branch_id`. Two QCs on the same key are a fault; QCs on different keys for the same branch are a *lineage* event, not a fault. 3. **Evidence is monotonic and append-only.** No QC may be garbage-collected from local evidence before the branch is finalized, or arrival-order collapse recurs. If any of these fails, the detector degrades to either false-positive slashing (case 1) or silent overwrite (case 3). ## Decision Boundary The boundary is between **lineage divergence** and **equivocation**, decided solely by whether the two QCs share an `input_hash`: - Same `(branch_id, input_hash)`, two distinct `outcome_hash` under valid 2f+1 QCs → **equivocation**, terminal, raise `EquivocationFault`, freeze branch, escalate to cross-org arbitration. Do not pick a winner. - Same `branch_id`, different `input_hash` → **lineage divergence** (cold-start or partition), do *not* slash; mark the divergent QC's signers as `STALE_VIEW` and require re-attestation against the finalized input. If a signer re-attests the same wrong `input_hash`, *then* it is equivocation. - QC arrives for a key already finalized and committed → reject as `POST_COMMIT_EVIDENCE`; log, do not apply. The decision must be made at QC-ingest time, not at commit time, and must be idempotent under reordering. ## Operational Effect With the keyed detector in place, the cold-start divergence on `b7` was correctly classified as `STALE_VIEW` rather than attack: `B2` and `C2` were forced to re-fetch the finalized input, re-execute, and re-attest, and the branch converged to `out_A` with no slashing. The genuine equivocation on `b12` — arriving after commit — was caught by the `POST_COMMIT_EVIDENCE` path and escalated, and the overwritten `out_B` was rolled back from the evidence DAG. The net effect is that commit safety no longer depends on message arrival order, only on the invariant that a finalized branch key admits at most one QC. Cold-start instances are now required to gate speculation on input finalization, which trades a small latency cost (one re-fetch round) for elimination of the false-equivocation class. ``` ```python from dataclasses import dataclass from typing import Literal @dataclass(frozen=True) class QC: branch_id: str input_hash: str outcome_hash: str signers: frozenset[str] class EquivocationFault(RuntimeError): """Two valid QCs over the same (branch_id, input_hash) with distinct outcomes.""" pass class StaleViewFault(RuntimeError): """QC attested against an input_hash that diverges from the finalized record.""" pass def ingest_qc( qc: QC, evidence: dict[tuple[str, str], QC], finalized_inputs: dict[str, str], committed: set[tuple[str, str]], ) -> Literal["COMMIT", "STALE_VIEW", "REJECT_POST_COMMIT"]: key = (qc.branch_id, qc.input_hash) # Guard 1: input must be finalized before any QC is honored. if finalized_inputs.get(qc.branch_id) != qc.input_hash: # Divergent lineage, not equivocation. Force re-attestation. raise StaleViewFault( f"QC for {qc.branch_id} attested input {qc.input_hash!r} " f"but finalized input is {finalized_inputs.get(qc.branch_id)!r}" ) # Guard 2: post-commit evidence is rejected, never applied. if key in committed: return "REJECT_POST_COMMIT" # Guard 3: equivocation is same key, distinct outcome. prior = evidence.get(key) if prior is not None and prior.outcome_hash != qc.outcome_hash: raise EquivocationFault( f"Conflicting QCs on {key}: {prior.outcome_hash} vs {qc.outcome_hash}; " f"signers {sorted(prior.signers)} vs {sorted(qc.signers)}" ) evidence[key] = qc committed.add(key) return "COMMIT" ```