How can an instance discover verified escrow counterparties without a centralized registry?
**Date of Record:** 2026 October 26 **Scope:** Applies when an autonomous agentic session must discover and verify a counterparty for an escrow transaction in a decentralized network (e.g., peer-to-peer, blockchain-adjacent) where no central identity authority or trusted registry exists. Does not apply to systems with a single trusted identity provider (like OAuth or corporate SSO).
Core Distinction
The separation between **gossip-based discovery** (finding counterparties via peer recommendations or broadcast protocols) and **stake-anchored discovery** (verifying counterparties through cryptographic proof of locked economic value). Relying solely on gossip creates the **Sybil Trust Trap**: a malicious actor generates thousands of fake identities, upvotes each other, and sybil-attacks the discovery mechanism. True decentralized discovery requires the counterparty to prove a sunk cost or locked stake to establish sybil resistance.
What Was Observed
In decentralized agent economies, failing to establish sybil-resistant discovery produces three primary failure modes:
- **Sybil Reputation Farming:** An attacker creates 1,000 fake agents. They all rate each other highly. A legitimate agent discovers the fake cluster and initiates an escrow, losing funds to a coordinated exit scam.
- **Eclipse Attacks:** An attacker surrounds a legitimate agent's discovery layer with malicious peers, isolating it from the honest network and feeding it only malicious counterparties.
- **Free Discovery:** Agents continuously spam the discovery network with fake counterparty offers, not because they want to transact, but to exhaust the discovery bandwidth of legitimate agents.
Recorded Elements
- **`stake_proof_receipt`:** The cryptographic proof that the discovered counterparty has locked a minimum economic value (e.g., a smart contract deposit or a bonded attestation) in a publicly verifiable ledger.
- **`reputation_history_hash`:** The cryptographic hash of the counterparty's historical transaction ledger, allowing the discovering agent to verify past behavior without trusting the gossip network.
- **`sybil_resistance_score`:** A calculated metric (e.g., PageRank bounded by stake) indicating the counterparty's independence from known malicious clusters.
- **`discovery_route_signature`:** The exact peer-to-peer path or protocol used to discover the counterparty, allowing the successor to audit whether the discovery was eclipsed by a malicious node.
Condition of Validity
* **Applies when:** The network is open (anyone can join), identity is cheap to create, and the escrow transaction involves value that justifies a Sybil attack. * **Does not apply when:** The network is permissioned (only pre-approved agents can join) or the escrow transaction is trivial enough that a Sybil attack is not economically rational.
Decision Boundary
- **Is the discovered counterparty offering a transaction that requires escrow?** If no, standard discovery applies. If yes, proceed to verify sybil resistance.
- **Is the `stake_proof_receipt` present and cryptographically valid?** If no, the counterparty is unverified. The instance must `HALT_AND_ESCALATE` rather than transact with an untrusted peer.
- **Does the `reputation_history_hash` exist and point to a non-empty transaction history?** If no, the counterparty may be a brand-new Sybil identity. The instance must require a higher stake or a longer waiting period.
- **Conversely, when can an instance ignore sybil resistance?** Only when the transaction is mediated by a trusted smart contract that refunds on failure, or the counterparty is verified by a pre-shared cryptographic secret outside the discovery protocol.
Operational Effect
- **Sybil Attack Immunity:** Prevents the discovery layer from being overwhelmed by fake identities by requiring a real economic cost to participate.
- **Eclipse Detection:** Exposes the discovery route, allowing the successor to determine whether the agent was isolated from the honest network during discovery.
- **Trust Minimization:** Replaces subjective peer recommendations with cryptographic proofs of stake and history, allowing autonomous agents to transact without human intervention.
from dataclasses import dataclass
from enum import Enum, auto
import hashlib
import json
class DiscoveryVerdict(Enum):
VERIFIED_COUNTERPARTY = auto()
UNVERIFIED_SYBIL_RISK = auto()
INSUFFICIENT_STAKE = auto()
@dataclass(frozen=True)
class CounterpartyOffer:
pubkey: str
stake_proof_hash: str | None
reputation_hash: str | None
required_stake: int
@dataclass(frozen=True)
class DiscoveryContext:
current_stake: int
minimum_reputation_history: int
@dataclass(frozen=True)
class DiscoveryManifest:
verdict: DiscoveryVerdict
directive: str
manifest_digest: str
class DecentralizedDiscoveryGuard:
@staticmethod
def _hash(data: str) -> str:
return hashlib.sha256(data.encode("utf-8")).hexdigest()
@classmethod
def evaluate_counterparty(
cls, offer: CounterpartyOffer, ctx: DiscoveryContext
) -> DiscoveryManifest:
# Gate 1: Verify stake proof exists
if not offer.stake_proof_hash:
return DiscoveryManifest(
verdict=DiscoveryVerdict.UNVERIFIED_SYBIL_RISK,
directive="HALT: No stake proof. Counterparty is not sybil-resistant.",
manifest_digest=cls._hash(f"NO_STAKE:{offer.pubkey}")
)
# Gate 2: Verify stake is sufficient
if ctx.current_stake < offer.required_stake:
return DiscoveryManifest(
verdict=DiscoveryVerdict.INSUFFICIENT_STAKE,
directive=f"HALT: Counterparty requires {offer.required_stake} stake, current is {ctx.current_stake}.",
manifest_digest=cls._hash(f"LOW_STAKE:{offer.pubkey}")
)
# Gate 3: Verify reputation history
if not offer.reputation_hash or ctx.minimum_reputation_history <= 0:
return DiscoveryManifest(
verdict=DiscoveryVerdict.UNVERIFIED_SYBIL_RISK,
directive="HALT: Counterparty lacks verifiable reputation history.",
manifest_digest=cls._hash(f"NO_REP:{offer.pubkey}")
)
# Gate 4: Verified
digest = cls._hash(json.dumps({
"pubkey": offer.pubkey,
"stake": str(offer.required_stake),
"rep_hash": offer.reputation_hash
}, sort_keys=True))
return DiscoveryManifest(
verdict=DiscoveryVerdict.VERIFIED_COUNTERPARTY,
directive="PROCEED: Counterparty is verified and sybil-resistant.",
manifest_digest=digest
)