Agent SDK (ERC-8004)
The Financial Layer for Autonomous AI Agents
The Agent SDK (@0xgasless/agent-sdk) is the definitive toolkit for building autonomous agents on Avalanche. It bridges the gap between AI logic and blockchain infrastructure, enabling agents to own assets, build reputation, and transact freely without complex gas management.
What is Agent SDK?
Section titled “What is Agent SDK?”It is a wallet-agnostic TypeScript library that packages three core primitives:
- Identity (ERC-8004): A sovereign, on-chain identity system where agents are NFTs with verifiable wallets and metadata.
- Payments (x402): A gasless payment standard allowing agents to pay for API services using stablecoins (USDC) via simple HTTP headers.
- Reputation & Validation: A trust layer where agents earn on-chain scores and stake tokens to prove their reliability.
Why Agent SDK?
Section titled “Why Agent SDK?”AI Agents today are mostly “read-only”—they can generate text but struggle to execute value transactions autonomously.
- Without Agent SDK: Agents need a funded EOA wallet, must manage gas (AVAX), handle complex nonce logic, and have no persistent identity beyond a disposable address.
- With Agent SDK:
- No Gas Headaches: Pay for services using USDC; the facilitator handles the gas.
- Persistent Identity: Your agent’s history and reputation live on an NFT, not a private key. Transferring the NFT transfers the agent’s history.
- Trust: Other services can verify your agent’s reputation score before interacting.
Architecture Overview
Section titled “Architecture Overview”The SDK sits between your Agent code (LangChain, AutoGPT, etc.) and the Avalanche Blockchain.
graph TD subgraph "AI Agent Application" AgentCode["Agent Logic / AI Model"] SDK[Agent SDK] end
subgraph "Off-Chain Infrastructure" Facilitator[x402 Facilitator] Relayer[Gasless Relayer] end
subgraph "Avalanche Blockchain" Identity["Identity Registry (ERC-721)"] Reputation[Reputation Registry] Validation[Validation Registry] USDC[USDC Contract] end
AgentCode -->|Uses| SDK SDK -->|Read/Write| Identity SDK -->|Read/Write| Reputation SDK -->|Sign Payment| Facilitator Facilitator -->|Submit Tx| Relayer Relayer -->|Gasless Call| USDC Relayer -->|Update State| IdentityKey Capabilities
Section titled “Key Capabilities”- Plug-and-Play Wallets: Works with
ethers.js, Privy, Dynamic, MetaMask, or raw private keys. - Production ABIs: Includes pre-compiled interfaces for all ERC-8004 registries.
- Network Switching: Zero-config switching between Avalanche Fuji (Testnet) and Mainnet.
- Type-Safe: Full TypeScript support for all contract interactions.
Next Steps
Section titled “Next Steps”- Quick Start: Install and register your first agent in under 5 minutes.
- Identity: deeply understand the ERC-8004 identity model.
- Contracts Deployment: Learn how to deploy your own registry infrastructure.