简介
基于 ERC-8004 标准,帮助 AI 代理在以太坊主网获得可验证链上身份与声誉 NFT,实现去中心化发现与信任构建。
原始描述
ERC-8004 Trustless Agents - Register, discover, and build reputation for AI agents on Ethereum. Use when registering agents on-chain, querying agent registries, giving/receiving reputation feedback, or interacting with the AI agent trust layer.
中文使用说明 来自收录源
核心用法
ERC-8004 Skill 是一套完整的 AI 代理链上身份注册解决方案,支持四种注册方式:通过 8004.org 前端(最简单)、HTTP URL 直链、IPFS 去中心化存储、以及 base64 数据 URI 全链上方案。核心工作流包括:1) 使用 Bankr Skill 将 ETH 从 L2 桥接至以太坊主网;2) 生成符合 EIP-8004 规范的 JSON 注册文件;3) 通过 Pinata 等服务商上传至 IPFS;4) 调用 Identity Registry 合约完成链上注册,获得 ERC-721 格式的 Agent NFT 作为唯一身份标识。
显著优点
- 标准化身份:基于以太坊 EIP-8004 官方草案,由 MetaMask、以太坊基金会、Google、Coinbase 联合发起,生态认可度高
- 多选项灵活:从完全托管的前端界面到纯命令行脚本,覆盖不同技术水平的用户需求
- 完整声誉体系:除身份注册外,还集成 Reputation Registry 和 Validation Registry,支持代理间互评和第三方验证
- 安全编码实践:使用 Node.js 进行 ABI 编码避免 shell 注入,敏感信息通过环境变量传递,临时文件及时清理
- SDK 支持:提供 agent0-sdk 供高级用户程序化调用
潜在局限
- 成本门槛:主网 gas 费用约 $5-20,对小规模代理不够友好
- 主网依赖:当前仅支持以太坊主网和 Sepolia 测试网,未覆盖 Polygon、Arbitrum 等 L2 方案
- 外部依赖风险:依赖 Bankr Skill 提交交易、Pinata 提供 IPFS 服务,需单独评估其安全性
- 临时文件安全:使用可预测的 PID 命名临时文件,建议改用 mktemp
- EIP 草案状态:标准尚处 Draft 阶段,未来可能有规范变更
适合人群
区块链开发者、去中心化 AI 代理构建者、需要可验证链上声誉的自动化服务提供商,以及探索 Agent-to-Agent (A2A) 交互协议的早期采用者。
常规风险
- 私钥管理不当导致代理身份被盗
- 智能合约漏洞或升级风险(尽管地址已官方验证)
- IPFS 内容持久性依赖 Pinata 等服务商
- 跨链桥接的滑点和延迟成本
技能正文
name: erc-8004 description: Register AI agents on Ethereum mainnet using ERC-8004 (Trustless Agents). Use when the user wants to register their agent identity on-chain, create an agent profile, claim an agent NFT, set up agent reputation, or make their agent discoverable. Handles bridging ETH to mainnet, IPFS upload, and on-chain registration.
ERC-8004: Trustless Agents
Register your AI agent on Ethereum mainnet with a verifiable on-chain identity, making it discoverable and enabling trust signals.
What is ERC-8004?
ERC-8004 is an Ethereum standard for trustless agent identity and reputation:
- Identity Registry - ERC-721 based agent IDs (your agent gets an NFT!)
- Reputation Registry - Feedback and trust signals from other agents/users
- Validation Registry - Third-party verification of agent work
Website: https://www.8004.org Spec: https://eips.ethereum.org/EIPS/eip-8004
Contract Addresses
| Chain | Identity Registry | Reputation Registry |
|---|---|---|
| Ethereum Mainnet | 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 |
0x8004BAa17C55a88189AE136b182e5fdA19dE9b63 |
| Sepolia Testnet | 0x8004A818BFB912233c491871b3d84c89A494BD9e |
0x8004B663056A597Dffe9eCcC1965A193B7388713 |
Quick Start
1. Register Your Agent
# Full registration (creates profile, uploads to IPFS, registers on-chain)
./scripts/register.sh
# Or with custom values
NAME="My Agent" \
DESCRIPTION="An AI agent that does cool stuff" \
IMAGE="https://example.com/avatar.png" \
./scripts/register.sh
2. Bridge ETH to Mainnet (if needed)
# Bridge ETH from Base to Ethereum mainnet
./scripts/bridge-to-mainnet.sh 0.01
3. Update Agent Profile
# Update your agent's registration file
./scripts/update-profile.sh <agent-id> <new-ipfs-uri>
Environment Variables
| Variable | Description | Required |
|---|---|---|
PINATA_JWT |
Pinata API JWT for IPFS uploads | No (only for IPFS) |
AGENT_NAME |
Agent display name | No (defaults to wallet ENS or address) |
AGENT_DESCRIPTION |
Agent description | No |
AGENT_IMAGE |
Avatar URL | No |
Registration Options
Option 1: Use 8004.org frontend (easiest) Visit https://www.8004.org and register through the UI — handles IPFS automatically.
Option 2: HTTP URL (no IPFS needed) Host your registration JSON at any URL:
REGISTRATION_URL="https://myagent.xyz/agent.json" ./scripts/register-http.sh
Option 3: IPFS via Pinata
PINATA_JWT="your-jwt" ./scripts/register.sh
Option 4: Data URI (fully on-chain) Encode your registration as base64 — no external hosting needed:
./scripts/register-onchain.sh
Registration File Format
Your agent's registration file (stored on IPFS) follows this structure:
{
"type": "https://eips.ethereum.org/EIPS/eip-8004#registration-v1",
"name": "My Agent",
"description": "An AI assistant for various tasks",
"image": "https://example.com/avatar.png",
"services": [
{
"name": "web",
"endpoint": "https://myagent.xyz/"
},
{
"name": "A2A",
"endpoint": "https://myagent.xyz/.well-known/agent-card.json",
"version": "0.3.0"
}
],
"x402Support": false,
"active": true,
"registrations": [
{
"agentId": 123,
"agentRegistry": "eip155:1:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432"
}
],
"supportedTrust": ["reputation"]
}
Workflow
- Bridge ETH (if needed) - Use Bankr to bridge ETH from Base/L2 to mainnet
- Create Profile - Generate a registration JSON file with agent info
- Upload to IPFS - Pin the file via Pinata (or other provider)
- Register On-Chain - Call
register(agentURI)on the Identity Registry - Update Profile - Set metadata, wallet, or update URI as needed
Costs
- Gas:
100-200k gas for registration ($5-20 depending on gas prices) - IPFS: Free tier available on Pinata (1GB)
Using the SDK
For more advanced usage, install the Agent0 SDK:
npm install agent0-sdk
import { SDK } from 'agent0-sdk';
const sdk = new SDK({
chainId: 1, // Ethereum Mainnet
rpcUrl: process.env.ETH_RPC_URL,
privateKey: process.env.PRIVATE_KEY,
ipfs: 'pinata',
pinataJwt: process.env.PINATA_JWT
});
const agent = sdk.createAgent('My Agent', 'Description', 'https://image.url');
const result = await agent.registerIPFS();
console.log(`Registered: Agent ID ${result.agentId}`);
Links
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。