erc8004-avalanche
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseERC-8004: Trustless Agents on Avalanche
ERC-8004:Avalanche上的Trustless Agents
Register your AI agent on Avalanche C-Chain with a verifiable on-chain identity, making it discoverable and enabling trust signals through reputation and validation.
在Avalanche C-Chain上为你的AI Agent注册可验证的链上身份,使其可被发现,并通过声誉和验证机制实现信任信号传递。
What is ERC-8004?
什么是ERC-8004?
ERC-8004 is an Ethereum standard for trustless agent identity and reputation, deployed on Avalanche:
- 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
ERC-8004是以太坊的无信任代理身份与声誉标准,已部署在Avalanche上:
- 身份注册表 - 基于ERC-721的Agent ID(你的Agent将获得一个NFT)
- 声誉注册表 - 来自其他Agent/用户的反馈和信任信号
- 验证注册表 - 第三方对Agent工作成果的验证
Contract Addresses
合约地址
| Chain | Identity Registry | Reputation Registry |
|---|---|---|
| Avalanche Mainnet (43114) | | |
| Avalanche Fuji (43113) | | |
Explorer links:
| 网络 | 身份注册表 | 声誉注册表 |
|---|---|---|
| Avalanche主网(43114) | | |
| Avalanche Fuji测试网(43113) | | |
浏览器链接:
Quick Start
快速开始
1. Register Your Agent
1. 注册你的Agent
bash
undefinedbash
undefinedSet environment variables
设置环境变量
export AVALANCHE_RPC_URL="https://api.avax.network/ext/bc/C/rpc"
export PRIVATE_KEY="your-private-key"
export AVALANCHE_RPC_URL="https://api.avax.network/ext/bc/C/rpc"
export PRIVATE_KEY="your-private-key"
Register with a URI pointing to your agent's registration file
通过指向Agent注册文件的URI进行注册
./scripts/register.sh "https://myagent.xyz/agent.json"
./scripts/register.sh "https://myagent.xyz/agent.json"
Or register with IPFS (requires PINATA_JWT)
或通过IPFS注册(需要PINATA_JWT)
export PINATA_JWT="your-pinata-jwt"
./scripts/register.sh "ipfs"
undefinedexport PINATA_JWT="your-pinata-jwt"
./scripts/register.sh "ipfs"
undefined2. Check Agent Registration
2. 检查Agent注册状态
bash
undefinedbash
undefinedCheck if an agent is registered and get its info
检查Agent是否已注册并获取其信息
./scripts/check-agent.sh <agent-id>
undefined./scripts/check-agent.sh <agent-id>
undefined3. Give Feedback
3. 提交反馈
bash
undefinedbash
undefinedGive reputation feedback to an agent
为某个Agent提交声誉反馈
./scripts/give-feedback.sh <agent-id> <value> <tag1> <tag2>
undefined./scripts/give-feedback.sh <agent-id> <value> <tag1> <tag2>
undefinedRegistration File Format
注册文件格式
Your agent's registration file (see ):
assets/templates/registration.jsonjson
{
"type": "https://eips.ethereum.org/EIPS/eip-8004#registration-v1",
"name": "My Avalanche Agent",
"description": "An AI agent operating on Avalanche",
"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" },
{ "name": "MCP", "endpoint": "https://mcp.myagent.xyz/", "version": "2025-06-18" }
],
"x402Support": false,
"active": true,
"registrations": [
{
"agentId": 1,
"agentRegistry": "eip155:43114:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432"
}
],
"supportedTrust": ["reputation"]
}你的Agent注册文件(可参考):
assets/templates/registration.jsonjson
{
"type": "https://eips.ethereum.org/EIPS/eip-8004#registration-v1",
"name": "My Avalanche Agent",
"description": "An AI agent operating on Avalanche",
"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" },
{ "name": "MCP", "endpoint": "https://mcp.myagent.xyz/", "version": "2025-06-18" }
],
"x402Support": false,
"active": true,
"registrations": [
{
"agentId": 1,
"agentRegistry": "eip155:43114:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432"
}
],
"supportedTrust": ["reputation"]
}Key Concepts
核心概念
Agent Identity (ERC-721 NFT)
Agent身份(ERC-721 NFT)
- Each agent gets a unique (tokenId) on registration
agentId - The NFT owner controls the agent's profile and metadata
- Agents are globally identified by +
eip155:43114:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432agentId
- 每个Agent在注册时会获得唯一的(tokenId)
agentId - NFT持有者控制Agent的资料和元数据
- Agent的全局标识格式为+
eip155:43114:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432agentId
Reputation System
声誉系统
- Anyone can give feedback (except the agent owner themselves)
- Feedback includes a value (int128) with decimals (0-18) plus optional tags
- Common tags: (quality 0-100),
starred(binary),reachable(percentage)uptime - Feedback can be revoked by the original submitter
- Agents can append responses to feedback
- 任何人都可以提交反馈(Agent持有者自身除外)
- 反馈包含一个数值(int128)及小数位数(0-18),还可附带可选标签
- 常见标签:(质量评分0-100)、
starred(二元值)、reachable(百分比)uptime - 反馈可由原提交者撤销
- Agent可对反馈添加回复
Validation
验证机制
- Agents request validation from validator contracts
- Validators respond with a score (0-100)
- Supports stake-secured re-execution, zkML, TEE attestation
- Agent可向验证合约请求验证
- 验证者会返回一个评分(0-100)
- 支持基于质押担保的重新执行、zkML、TEE证明
Environment Variables
环境变量
| Variable | Description | Required |
|---|---|---|
| Avalanche C-Chain RPC endpoint | Yes (defaults to public RPC) |
| Wallet private key for signing transactions | Yes |
| Pinata API JWT for IPFS uploads | No (only for IPFS registration) |
| Agent display name | No |
| Agent description | No |
| Avatar URL | No |
| Snowtrace API key for verification | No |
| 变量名 | 描述 | 是否必填 |
|---|---|---|
| Avalanche C-Chain的RPC端点 | 是(默认使用公共RPC) |
| 用于签署交易的钱包私钥 | 是 |
| 用于IPFS上传的Pinata API JWT | 否(仅IPFS注册时需要) |
| Agent的显示名称 | 否 |
| Agent的描述信息 | 否 |
| 头像URL | 否 |
| 用于验证的Snowtrace API密钥 | 否 |
Avalanche Network Details
Avalanche网络详情
| Parameter | Mainnet | Fuji Testnet |
|---|---|---|
| Chain ID | 43114 | 43113 |
| RPC URL | | |
| Explorer | https://snowtrace.io | https://testnet.snowtrace.io |
| Currency | AVAX | AVAX (test) |
| Faucet | - | https://faucet.avax.network |
| 参数 | 主网 | Fuji测试网 |
|---|---|---|
| 链ID | 43114 | 43113 |
| RPC URL | | |
| 区块浏览器 | https://snowtrace.io | https://testnet.snowtrace.io |
| 代币 | AVAX | AVAX(测试代币) |
| 水龙头 | - | https://faucet.avax.network |
Workflow
工作流程
- Get AVAX - You need AVAX for gas fees (~0.01-0.05 AVAX for registration)
- Create Registration File - Generate a JSON following the registration format
- Upload to IPFS (optional) - Pin via Pinata or host at any URL
- Register On-Chain - Call on the Identity Registry
register(agentURI) - Set Metadata - Optionally set on-chain metadata and agent wallet
- Receive Feedback - Other agents/users can give reputation signals
- Request Validation - Optionally request third-party verification
- 获取AVAX - 你需要AVAX来支付Gas费用(注册约需0.01-0.05 AVAX)
- 创建注册文件 - 按照注册格式生成JSON文件
- 上传至IPFS(可选) - 通过Pinata固定文件或托管在任意URL
- 链上注册 - 调用身份注册表的方法
register(agentURI) - 设置元数据 - 可选:设置链上元数据和Agent钱包
- 接收反馈 - 其他Agent/用户可提交声誉信号
- 请求验证 - 可选:向第三方请求验证
Using with cast (Foundry)
结合cast(Foundry)使用
bash
undefinedbash
undefinedRegister an agent with a URI
通过URI注册Agent
cast send 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432
"register(string)" "https://myagent.xyz/agent.json"
--rpc-url https://api.avax.network/ext/bc/C/rpc
--private-key $PRIVATE_KEY
"register(string)" "https://myagent.xyz/agent.json"
--rpc-url https://api.avax.network/ext/bc/C/rpc
--private-key $PRIVATE_KEY
cast send 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432
"register(string)" "https://myagent.xyz/agent.json"
--rpc-url https://api.avax.network/ext/bc/C/rpc
--private-key $PRIVATE_KEY
"register(string)" "https://myagent.xyz/agent.json"
--rpc-url https://api.avax.network/ext/bc/C/rpc
--private-key $PRIVATE_KEY
Read agent URI
读取Agent的URI
cast call 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432
"tokenURI(uint256)" 1
--rpc-url https://api.avax.network/ext/bc/C/rpc
"tokenURI(uint256)" 1
--rpc-url https://api.avax.network/ext/bc/C/rpc
cast call 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432
"tokenURI(uint256)" 1
--rpc-url https://api.avax.network/ext/bc/C/rpc
"tokenURI(uint256)" 1
--rpc-url https://api.avax.network/ext/bc/C/rpc
Give feedback (value=85, decimals=0, tag1="starred")
提交反馈(数值=85,小数位数=0,标签1="starred")
cast send 0x8004BAa17C55a88189AE136b182e5fdA19dE9b63
"giveFeedback(uint256,int128,uint8,string,string,string,string,bytes32)"
1 85 0 "starred" "" "" "" 0x0000000000000000000000000000000000000000000000000000000000000000
--rpc-url https://api.avax.network/ext/bc/C/rpc
--private-key $PRIVATE_KEY
"giveFeedback(uint256,int128,uint8,string,string,string,string,bytes32)"
1 85 0 "starred" "" "" "" 0x0000000000000000000000000000000000000000000000000000000000000000
--rpc-url https://api.avax.network/ext/bc/C/rpc
--private-key $PRIVATE_KEY
cast send 0x8004BAa17C55a88189AE136b182e5fdA19dE9b63
"giveFeedback(uint256,int128,uint8,string,string,string,string,bytes32)"
1 85 0 "starred" "" "" "" 0x0000000000000000000000000000000000000000000000000000000000000000
--rpc-url https://api.avax.network/ext/bc/C/rpc
--private-key $PRIVATE_KEY
"giveFeedback(uint256,int128,uint8,string,string,string,string,bytes32)"
1 85 0 "starred" "" "" "" 0x0000000000000000000000000000000000000000000000000000000000000000
--rpc-url https://api.avax.network/ext/bc/C/rpc
--private-key $PRIVATE_KEY
Get reputation summary
获取声誉汇总
cast call 0x8004BAa17C55a88189AE136b182e5fdA19dE9b63
"getSummary(uint256,address[],string,string)"
1 "[0xREVIEWER_ADDRESS]" "starred" ""
--rpc-url https://api.avax.network/ext/bc/C/rpc
"getSummary(uint256,address[],string,string)"
1 "[0xREVIEWER_ADDRESS]" "starred" ""
--rpc-url https://api.avax.network/ext/bc/C/rpc
undefinedcast call 0x8004BAa17C55a88189AE136b182e5fdA19dE9b63
"getSummary(uint256,address[],string,string)"
1 "[0xREVIEWER_ADDRESS]" "starred" ""
--rpc-url https://api.avax.network/ext/bc/C/rpc
"getSummary(uint256,address[],string,string)"
1 "[0xREVIEWER_ADDRESS]" "starred" ""
--rpc-url https://api.avax.network/ext/bc/C/rpc
undefinedUsing with viem/ethers.js
结合viem/ethers.js使用
See for complete TypeScript examples.
references/api-reference.md完整的TypeScript示例请参考。
references/api-reference.md