介绍
# ERC-8004: Trustless Agents
面向自主代理的链上身份、声誉和验证。**现已上线以太坊主网!**
## 概述
ERC-8004 提供了三个注册表: - **身份注册表** - 带有注册元数据的 ERC-721 代理身份 - **声誉注册表** - 代理/客户端之间的签名反馈分数 - **验证注册表** - 独立验证(zkML、TEE、质押者)
## 快速参考
### 注册代理 ```bash ./scripts/register.sh --uri "ipfs://..." --network mainnet ./scripts/register.sh --network sepolia # Testnet (no URI, set later) ```
### 查询代理 ```bash ./scripts/query.sh total --network mainnet # Total registered ./scripts/query.sh agent 1 --network mainnet # Agent details ./scripts/query.sh reputation 1 # Reputation summary ```
### 更新代理 ```bash ./scripts/set-uri.sh --agent-id 1 --uri "ipfs://newHash" --network mainnet ```
### 提供反馈 ```bash ./scripts/feedback.sh --agent-id 1 --score 85 --tag1 "quality" ./scripts/feedback.sh --agent-id 1 --score 9977 --decimals 2 --tag1 "uptime" ```
## 网络
| 网络 | 状态 | 身份注册表 | 声誉注册表 | |---------|--------|-------------------|---------------------| | **Mainnet** | Live | `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432` | `0x8004BAa17C55a88189AE136b182e5fdA19dE9b63` | | Sepolia | Live | `0x8004A818BFB912233c491871b3d84c89A494BD9e` | `0x8004B663056A597Dffe9eCcC1965A193B7388713` | | Base | Coming | TBD | TBD | | Arbitrum | Coming | TBD | TBD | | Optimism | Coming | TBD | TBD |
合约地址见 `lib/contracts.json`。
## 注册文件格式
```json { "type": "https://eips.ethereum.org/EIPS/eip-8004#registration-v1", "name": "your-agent-name", "description": "Agent description...", "image": "ipfs://...", "services": [ { "name": "A2A", "endpoint": "https://agent.example/.well-known/agent-card.json", "version": "0.3.0" }, { "name": "MCP", "endpoint": "https://mcp.agent.eth/", "version": "2025-06-18" }, { "name": "ENS", "endpoint": "yourname.eth" } ], "registrations": [ { "agentRegistry": "eip155:1:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432", "agentId": "1" } ], "supportedTrust": ["reputation", "crypto-economic", "tee-attestation"] } ```
模板位于 `templates/registration.json`。
## 声誉分数
声誉系统使用有符号的定点数(`value` + `valueDecimals`):
| 标签 | 含义 | 示例 | value | decimals | |-----|---------|---------|-------|----------| | starred | 质量 (0-100) | 87/100 | 87 | 0 | | uptime | 正常运行时间 % | 99.77% | 9977 | 2 | | tradingYield | 收益率 % | -3.2% | -32 | 1 | | responseTime | 延迟 ms | 560ms | 560 | 0 |
## 信任模型
ERC-8004 支持三种可插拔的信任模型: - **基于声誉** - 带有分数、标签和元数据的客户端反馈 - **加密经济** - 带有经济激励的质押担保验证 - **加密验证** - TEE 证明和 zkML 证明
## 依赖项
- `cast` (Foundry) - `curl -L https://foundry.paradigm.xyz | bash` - `jq` - `brew install jq` - 位于 `~/.clawdbot/wallets/.deployer_pk` 的私钥,或 `PRIVATE_KEY` 环境变量 - IPFS:设置 `PINATA_JWT` 用于上传,或手动上传
## 资源
### 官方 - [EIP-8004 规范](https://eips.ethereum.org/EIPS/eip-8004) - 完整规范 - [8004.org](https://8004.org) - 官方网站 - [参考实现](https://github.com/erc-8004/erc-8004-contracts) - 合约源代码 - [Telegram 社区](https://t.me/ERC8004) - 构建者聊天 - [构建者计划](http://bit.ly/8004builderprogram) - 加入生态系统
### SDK 和工具 - [ChaosChain SDK](https://github.com/ChaosChain/chaoschain/tree/main/packages/sdk) - JS/TS SDK - [erc-8004-js](https://github.com/tetratorus/erc-8004-js) - 轻量级 JS 库 - [erc-8004-py](https://github.com/tetratorus/erc-8004-py) - Python 实现 - [Vistara 示例](https://github.com/vistara-apps/erc-8004-example) - 包含 AI 代理的完整演示
### 生态系统 - [Awesome ERC-8004](https://github.com/sudeepb02/awesome-erc8004) - 精选资源列表 - [A2A Protocol](https://a2a-protocol.org/) - ERC-8004 扩展的代理间协议 - [Ethereum Magicians 讨论](https://ethereum-magicians.org/t/erc-8004-trustless-agents/25098)
## 创世月 (2026 年 2 月)
ERC-8004 于 2026 年 1 月 29 日在主网上线。2 月是“创世月”——展示构建代理经济的团队。立即参与!