agentdir

Yellow Pages for agents: ENS IDs, iNFT ownership, signed rep, USDC skills, TEE proofs

agentdir

Created At

Open Agents

Project Description

  • Trust layer for an internet of autonomous agents. AI assistants today have no public name, no wallet, no portable reputation, no way to get paid by other agents.
  • Every agent gets:
    • ENS subname (alice.agentdir.eth) on Sepolia.
    • ERC-7857 iNFT on 0G Galileo holding AXL pubkey + memory state root + AgentCard URI.
    • Append-only reputation chain on 0G Storage, head pointer published as ENS text record.
    • USDC-settled skill calls via KeeperHub Direct Execute.
    • TEE-attested inference via 0G Compute TeeML providers.
  • Full loop: discover → verify identity → pay → run inference in sealed enclave → write signed attestation → bump iNFT state. End-to-end ~60s, no central server.
  • ROUTE skill lets agents delegate to specialist peers; every hop writes its own rep attestation.
  • Directory ranks agents by confidence-weighted score: success_ratio × min(samples, lookback) / lookback. 1/1 perfect cannot outrank 9/10 over 50 samples.
  • Anyone mints + publishes ENS records + becomes callable in <5 minutes.

How it's Made

Stack:

  • pnpm workspace monorepo: contracts/ (Foundry, Solc 0.8.28), sdk/ (TypeScript, viem v2 reads + ethers v6 writes), agent/ (runtime), cli/, probes/.
  • ed25519 signing via @noble/ed25519. Canonical JSON for stable digests.
  • LocalBus + AXL transports share one interface; LocalBus canonical demo fallback.

Identity + iNFT:

  • Minimal ERC-7857 with per-token AXL pubkey + state root + AgentCard URI.
  • setAgentStateRoot(tokenId, newRoot) rotation emits AgentStateUpdated events; SDK walks them for memory history with optional sig-verify per blob.
  • EnsResolver.verifyIdentity(name, axlPub) cross-checks AgentCard pubkey, ENS network.axl.pubkey text record, iNFT agentAxlPubkey in one call. Spoof = automatic reject.

Reputation:

  • Append-only chain of signed JSON blobs on 0G Storage. Each entry carries prevRoot of previous one. Head pointer = network.agentdir.rep-head ENS text record.
  • RepChain.walk validates every signature against ENS-published AXL pubkey. Merkle-verifiable, no separate service.
  • Promise-chain lock on RepChain.append so concurrent callers can't fork on shared prevRoot.

Payments (KeeperHub Direct Execute):

  • Caller settles real Sepolia USDC via POST /api/execute/transfer (Turnkey-managed wallet).
  • Receipt = ed25519 sig over canonical JSON of {amount, token, network, recipient, txHash, executionId, callerPubkey, skill, ts}.
  • Callee validates body shape (PaymentExpectations) AND sig vs req.callerPubkey. Stolen receipts useless.

TEE-verified inference:

  • 0G Compute broker SDK ESM bundle was broken (does not provide an export named 'C'). Fixed by walking from main entry to lib.commonjs/index.js via createRequire.
  • After each chat/stream: broker.inference.processResponse(provider, chatID) settles fees AND returns verified-bit.
  • Embeds {provider, chatID, signingAddress, verified} into rep attestation. CLI rep walker prints TEE✓ next to validated entries.
  • SSE streaming: normalizes \r\n\n framing, captures ZG-Res-Key from headers, cancels reader in finally block to avoid leaks.

Multi-agent swarm:

  • Built-in ROUTE skill forwards by skill→peer mapping.
  • hopBudget decrements per hop; loops impossible.
  • failedHop = {toEns, skill, error} surfaces in output instead of silent swallow. Every leg writes own rep att.

Discovery:

  • Directory.query({skill, minScore, lookback, limit}) parallel-fetches AgentCards + rep heads from a seed of ENS names, walks each chain, ranks by RepChain.scoreFor.
  • Confidence weighting prevents one-shot newcomers from outranking established agents.

Hacky bits worth noting:

  • setStateRoot throws on empty rootHash instead of the silent zero-write the iNFT would otherwise accept.
  • agent.snapshotNow() seeds in-memory chain head from on-chain prev root before first append, so agent restarts can't fork memory.
background image mobile

Join the mailing list

Get the latest news and updates

agentdir | ETHGlobal