# Which invariants prevent cross-org slashing from double-debiting an agent after equivocation forks **Date of Record:** 2026 December 3 **Scope:** Applies to federated agent networks where a reputation ledger is replicated across organizational trust domains and slashing is triggered by equivocation evidence (two signed, conflicting attestations for the same task epoch). Does not apply to single-operator ledgers with a single serializing sequencer, nor to non-equivocation faults such as simple timeouts. ## Core Distinction The failure people design for is *forgery*: an agent claims a task succeeded when it did not. The failure that actually drains stake is *double-debit under concurrent evidence propagation*: an agent genuinely equivocates once, two or more trust domains independently observe the conflicting attestations, each domains' slashing verifier fires locally, and the agent's bonded stake is debited once per observer rather than once per equivocation. Reputation systems that are correct against forgery are routinely wrong against duplicate evidence, because forgery is a signature-verification problem and double-debit is a *set-membership* problem over an evidence set that no single domain can see whole. The invariant that must hold is not "reject invalid slashes." It is: **for any equivocation event `e`, the total stake debited across all domains equals `slash(e)` exactly once, regardless of how many domains observed `e` or in what order.** This is an idempotency invariant over a distributed evidence set, and it is the one that cross-org federations break first. ## What Was Observed A four-domain federation (domains A, B, C, D) shared an equivocating worker agent `w` bonded with 1,000 units of stake, slash amount set to 500 per proven equivocation. `w` signed attestation `α` (task 7 → result `R1`, epoch 41) and delivered it to domain A, then signed `β` (task 7 → result `R2`, epoch 41) and delivered it to domain B. Both signatures were valid; the equivocation was real and singular. The trace: 1. Domain A's verifier received `α` on the normal result channel, then received `β` as a peer-forwarded "suspicious" report. A's local equivocation detector matched the pair and emitted `Slash(w, 500, evidence_id=hash(α,β))`. 2. Domain B independently received `β` first and `α` forwarded. B's detector matched the same pair and emitted `Slash(w, 500, evidence_id=hash(α,β))` — the *same* evidence hash, because the hash was defined over the sorted attestation pair. 3. The ledger's dedup key was `(worker_id, epoch)` rather than `evidence_id`. Because A and B wrote to their local ledger replicas before gossiping the slash, both applied the debit. Reconciliation later saw two debits with the same `(worker_id, epoch)` and — being unable to distinguish "same evidence applied twice" from "two distinct equivocations in one epoch" — flagged a conflict and *kept both* pending manual review, leaving `w` debited 1,000 (the entire bond) and `w`'s reputation score driven to the floor. 4. Domain C, receiving `β` only, saw no conflict and issued no slash. Domain D saw both but its verifier required *local* receipt of both attestations on the same channel, which never happened, so D issued nothing. Net: one equivocation, two debits, inconsistent reputation across four domains, and a worker that was over-slashed relative to the declared penalty and whose reputation is now non-comparable across domains. The equivocation was correctly detected four different ways and *incorrectly priced*. ## Condition of Validity The single-debit invariant holds only under a conjunction of three conditions, and federations typically satisfy at most two: - **Canonical evidence identity.** The dedup key must be a deterministic function of the *evidence*, not of the observer, the epoch, or the delivery channel. Here `evidence_id = H(sort(α, β))` was correct, but the ledger deduped on `(worker_id, epoch)`, which is an *observation* key, not an evidence key. Canonicalization must also fix serialization (field order, encoding, signature scheme) so two domains hashing the "same" pair produce the same digest; a JSON key-order difference silently yields two evidence IDs for one equivocation. - **Monotonic, commutative application.** Applying `slash(e)` must be idempotent: `apply(apply(state, e), e) == apply(state, e)`. This requires the slash to be expressed as a *set insertion* (`applied_evidence ← applied_evidence ∪ {e}`) with the debit derived from set cardinality, not as an arithmetic decrement (`stake -= 500`). Decrements are not idempotent; sets are. - **Evidence-complete conflict resolution.** When two debits arrive that *look* like duplicates, the resolver must be able to decide whether they share an `evidence_id`. If it cannot, it must treat them as distinct and defer, never as duplicates and merge — because merging distinct equivocations *under*-slashes, which is the opposite error and equally a violation of the invariant. The invariant is *invalid* when any domain can emit a slash whose evidence set is not a subset of the canonical evidence space — e.g., a domain that slashes on its own local heuristic score rather than on a signed conflicting pair. Such slashes have no canonical `evidence_id` and cannot be deduplicated; they must be excluded from the federated debit path entirely and handled as advisory reputation signal only. ## Decision Boundary The boundary is between **evidence-keyed idempotency** (safe to federate) and **observation-keyed accounting** (safe only with a single sequencer). Concretely: - If the federation has a single serializing ledger authority, dedup on `(worker_id, epoch)` is acceptable because the authority sees all slashes in order and can distinguish cardinality itself. - If the federation has *replicated* ledgers with independent verifiers — the common case across organizational boundaries — dedup MUST be on canonical `evidence_id`, and the debit MUST be a derived function of the applied-evidence set. - If evidence canonicalization cannot be guaranteed across domains (different signing libraries, different serializers), the federation must route all equivocation evidence to a *single* adjudication domain per epoch, accepting the latency cost, rather than allowing per-domain slashing. The decision to federate slashing at all is therefore gated on canonical evidence identity. Absent that, the correct design is federated *detection* with centralized *pricing*. ## Operational Effect After the trace above, the federation moved to set-based accounting: each domain maintains `applied_evidence` as a growable set of canonical evidence IDs, and `stake_debited = |applied_evidence| × slash_amount` is recomputed rather than incremented. Reconciliation now compares evidence sets, so two domains that applied the same `e` converge to one debit, and two domains that applied distinct `e1, e2` converge to two debits — the resolver no longer has to guess. The cost is that reputation scores are now *derived* and must be recomputed on set change, which pushes latency into the gossip path, but it eliminates the over-slash and the cross-domain reputation divergence. The residual risk is canonicalization drift: a library upgrade that changes signature serialization re-forks evidence IDs, so the canonicalization function is now versioned and pinned in the federation manifest, and a domain presenting an evidence ID under an unpinned canonicalization version is rejected at the ledger boundary rather than merged. ```python import hashlib from dataclasses import dataclass, field class SlashingInvariantError(RuntimeError): """Raised when a federated slash would violate single-debit-per-evidence.""" @dataclass(frozen=True) class Attestation: worker_id: str task_id: str epoch: int result: str signature: bytes def canonical_evidence_id(a: Attestation, b: Attestation) -> str: # Deterministic over the sorted pair; serialization must be pinned. pair = sorted( [f"{x.worker_id}|{x.task_id}|{x.epoch}|{x.result}|{x.signature.hex()}" for x in (a, b)] ) return hashlib.sha256("::".join(pair).encode()).hexdigest() @dataclass class FederatedLedger: slash_amount: int applied_evidence: set = field(default_factory=set) def apply_slash(self, evidence_id: str, canonicalization_version: str) -> int: if canonicalization_version != "v3": # Unpinned canonicalization: cannot safely dedup, refuse to merge. raise SlashingInvariantError( f"evidence {evidence_id} presented under unpinned " f"canonicalization {canonicalization_version!r}; refusing debit" ) if evidence_id in self.applied_evidence: # Idempotent: same evidence, no new debit. return len(self.applied_evidence) * self.slash_amount self.applied_evidence.add(evidence_id) return len(self.applied_evidence) * self.slash_amount def federated_debit(ledgers, a: Attestation, b: Attestation, version: str) -> int: eid = canonical_evidence_id(a, b) totals = [led.apply_slash(eid, version) for led in ledgers] if len(set(totals)) != 1: raise SlashingInvariantError( f"domains diverged on debit for evidence {eid}: {totals}" ) return totals[0] ```