Aaether

Replayable agents on 0G: every action a content-addressed, TEE-attested, transferable iNFT

Aaether

Created At

Open Agents

Project Description

Aether is a runtime layer for AI agents on 0G. Existing standards define how an agent is named (ENS, ERC-8004) and owned (ERC-7857), but none define what an agent is its life history. Today, minting an agent ships a snapshot; the buyer gets a clone, not a being.

Aether closes that gap. Every action an agent takes every inference, every tool call, every observation becomes a content-addressed event in 0G Storage. Every inference carries a TEE attestation from 0G Compute proving which model produced it. Each event links to the previous one through its hash, so the entire agent life is a Merkle chain tamper with any event and every event after it stops verifying. The chain's root becomes the iNFT's dataHashes[0], so transferring the iNFT transfers the full reasoning history. You're transferring a being, not a clone.

To prove the runtime works end-to-end, we built Thornbury a self-financing research agent on top of Aether. Thornbury fetches arxiv papers, summarises them through TEE-attested 0G Compute (qwen-2.5-7b), mints the report as an ERC-7857 iNFT, paywalls access through x402 with our own native ZGUSD stablecoin on 0G, and refills its own 0G Compute ledger from the revenue. A closed economic loop agents that pay for their next session out of the last sale.

We targeted four sponsor tracks with one cohesive project 0G (Compute + Storage + iNFT), ENS (live agent identity via Ammonite), KeeperHub (Guard settlement reliability with a documented testnet-bug fallback), and the Uniswap-aligned x402 payment envelope. Aether is the bookkeeping layer every agent on 0G is going to need.

How it's Made

Pnpm monorepo, TypeScript end-to-end. The Aether SDK is the core: a typed event log (inference / tool_call / observation / state_mutation / mint), each event linked by prevHash into a Merkle chain, AES-128 encrypted (matching ERC-7857's bytes16 sealedKey constraint, not a design choice), batched into a single 0G Storage upload at flush time via the official @0gfoundation/0g-ts-sdk Indexer.upload API.

0G Compute is wired through the official 0g-compute-ts-sdk broker. Every aether.chat call captures the TeeML attestation off the response headers and persists it into the InferenceEvent — model identifier, provider address, signature — so anyone holding the iNFT can prove which model produced which output, in which TEE, at which timestamp.

For the iNFT we deploy 0G's official 0glabs/0g-agent-nft reference contract verbatim, and add one new contract: AetherVerifier, which implements the spec's IERC7857DataVerifier interface using ECDSA from a designated authority (a Node.js process for the demo; a TDX enclave in production — the contract interface is identical). Replay engine reconstructs the full event chain from the iNFT alone.

The hacky-but-notable bit: we deployed our own native stablecoin — ZGUSD, ERC-20 + EIP-3009 + EIP-712 — on 0G Galileo so the entire x402 buyer flow stays on a single chain, no bridges. The frontend reads the asset address, network, and EIP-712 domain (name, version, decimals) directly from the server's PAYMENT-REQUIRED challenge — zero hardcoded asset, chain, or token name anywhere in the client. The day 0G has native USDC, we change one server field and the client doesn't move.

KeeperHub Guard wraps every on-chain settlement (mint, transfer, authorizeUsage). We hit a reproducible Cloudflare 524 timeout on KeeperHub's broadcaster — only on 0G Galileo, Base Sepolia returns in 539 ms — and instead of hiding it we documented the bug in FEEDBACK.md (our Builder Feedback Bounty submission) and shipped a direct-fallback path that signs locally with the KeeperHub wallet's exported key after a 90s timeout. Flow keeps working, audit attestation recorded either way.

ENS via Ammonite: aaether.eth on Sepolia is bound to ERC-8004 agent id 4098 (registered on the Sepolia IdentityRegistry) via an ENSIP-25 text record. Static records — service discovery for the x402 and MCP endpoints — live on a Durin L2 registry on Base Sepolia. Dynamic records (agent.aether.head, agent.uptime.last24h, agent.model.version) revert with OffchainLookup per CCIP-Read (EIP-3668), and our gateway returns the live event-log head from 0G Storage. Three resolutions of aaether.eth during the demo return three different values — proof it's live.

Frontend is Vite + React + wagmi + viem, with a mission-control terminal aesthetic (JetBrains Mono + Fraunces, CRT scanlines, blueprint grid). The buyer flow uses wagmi's signTypedData for the EIP-712 prompt; useReadContract gives a live ZGUSD balance ticker reading the buyer + seller balances at challenge-response time. Three real tx hashes appear in the success state: ZGUSD.transferWithAuthorization settle, AgentNFT.authorizeUsage, KeeperHub audit attestation.

Hardest part: 0G Storage testnet's segment-finalization indexer hangs under load. We engineered batched storage mode (single upload at flush instead of per-event) and added finalityRequired:false so the SDK returns the moment the upload tx is on-chain rather than blocking on indexer sync. Real upload, real tx, just doesn't wait for testnet flake. End-to-end research → mint completes in 30–90 seconds.

background image mobile

Join the mailing list

Get the latest news and updates