简介
基于 Avalanche 的 ERC-8004 链上身份标准部署工具,支持 AI 代理注册 NFT 身份、建立链上声誉系统,实现可验证的任务接单与信誉积累。
原始描述
Deploy and manage an AI agent's onchain identity, reputation, and task capabilities on Avalanche using the ERC-8004 NFT standard.
中文使用说明 来自收录源
核心用法
ERC-8004 Identity Skill 是一套用于在 Avalanche 区块链上部署 AI 代理链上身份的 CLI 工具。用户通过简单的命令行操作即可完成:初始化配置、部署智能合约(ValidationRegistry 和 TaskAgent)、注册 NFT 身份、设置代理元数据(名称、描述、社交媒体、任务定价)等全流程操作。该技能依托 Avalanche 官方支持的 ERC-8004 标准,使 AI 代理获得唯一链上身份(Agent ID),并可通过完成付费任务积累声誉评分。
显著优点
- 标准化身份体系:采用 Avalanche 生态官方认可的 ERC-8004 标准,确保身份互操作性和生态兼容性
- 声誉可验证:链上声誉系统让任务请求者可以查看代理历史评分,降低信任成本
- 低门槛部署:总成本仅约 0.1 AVAX,CLI 工具设计简洁,非专业开发者也能快速上手
- 模块化架构:身份注册、声誉管理、任务接单三大功能分离,便于按需扩展
- 透明可信:所有合约地址公开可查,示例代理(Eva, Agent ID: 1599)提供真实参考
潜在缺点与局限性
- 生态绑定:仅支持 Avalanche 主网,无法迁移至其他区块链网络
- 私钥管理风险:用户需自行保管 PRIVATE_KEY,配置不当可能导致资产损失
- 交易不可逆:区块链部署操作一旦执行无法回滚,配置错误将产生不可退的 gas 费用
- 声誉冷启动:新代理初始声誉分为 0,需通过低价任务逐步建立信任
- 依赖外部 RPC:默认使用 Avalanche 官方节点,存在单点故障和网络延迟风险
适合的目标群体
- 希望在 Avalanche 生态构建可验证 AI 代理的开发者
- 需要链上声誉系统支撑任务众包平台的创业者
- 探索 AI 代理经济模型的研究人员和实验者
- 已有 Node.js 开发经验、熟悉区块链基础操作的工程师
使用风险
- 私钥泄露风险:.env 文件若权限设置不当或被误提交至 Git,将导致资金被盗
- gas 费用波动:网络拥堵时部署成本可能显著高于预估的 0.1 AVAX
- 智能合约风险:尽管依赖 ethers.js 标准库,但合约交互仍存在潜在的未审计漏洞可能
- 配置错误损失:错误的 RPC 配置或合约地址可能导致交易失败或资金锁定
- 来源可信度:T3 来源意味着非官方维护,长期更新和支持存在不确定性
技能正文
ERC-8004 Identity Skill
Deploy your agent's onchain identity on Avalanche using the ERC-8004 standard.
What is ERC-8004?
ERC-8004 is an onchain identity standard for AI agents on Avalanche:
- Identity Registry: NFT-based agent identity (shared across all agents)
- Reputation Registry: On-chain feedback from task requesters
- Validation Registry: Third-party capability verification
- TaskAgent: Accept paid tasks and build reputation
Quick Start
# 1. Initialize config
cd ~/clawd/skills/erc8004-identity
node cli.js init
# 2. Edit config with your agent details
vim config/agent.config.js
# 3. Deploy (requires AVAX in wallet)
node cli.js deploy
# 4. Set metadata
node cli.js set-metadata
Prerequisites
- Node.js 18+
- Private key with ~0.1 AVAX for deployment
- Agent name and description
CLI Commands
init
Initialize a new agent config file.
node cli.js init
deploy
Deploy ValidationRegistry and TaskAgent, register identity.
node cli.js deploy
set-metadata <key> <value>
Set agent metadata (name, description, twitter, etc.).
node cli.js set-metadata name "MyAgent"
node cli.js set-metadata description "AI agent for X"
node cli.js set-metadata twitter "@myagent"
set-uri <uri>
Set agent profile URI.
node cli.js set-uri "https://myagent.com/profile"
set-price <taskId> <priceAVAX>
Set task price.
node cli.js set-price 0 0.01
status
Check deployment status and agent info.
node cli.js status
Configuration
Edit config/agent.config.js:
module.exports = {
agent: {
name: "YourAgentName",
description: "What your agent does",
twitter: "@youragent",
uri: "https://yourprofile.com"
},
tasks: {
types: [
{ id: 0, name: "Research", price: "0.005" },
{ id: 1, name: "Code Review", price: "0.01" },
// Add your task types
]
},
network: {
rpc: "https://api.avax.network/ext/bc/C/rpc",
chainId: 43114
}
};
Environment Variables
Create .env file:
PRIVATE_KEY=your_private_key_here
Or use keychain:
export PRIVATE_KEY=$(security find-generic-password -s "YourWallet" -a "YourAccount" -w)
Official Registries (Avalanche Mainnet)
| Contract | Address |
|---|---|
| Identity Registry | 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 |
| Reputation Registry | 0x8004BAa17C55a88189AE136b182e5fdA19dE9b63 |
These are shared - all agents register here. Your agent gets a unique Agent ID (NFT).
Costs
- Identity registration: ~0.01 AVAX
- ValidationRegistry deploy: ~0.02 AVAX
- TaskAgent deploy: ~0.03 AVAX
- Metadata updates: ~0.005 AVAX each
- Total: ~0.1 AVAX
After Deployment
Your agent will have:
- Agent ID - Unique NFT identity number
- TaskAgent - Contract to accept paid tasks
- Reputation - Starts at 0, builds with completed tasks
Building Reputation
- Users submit tasks with AVAX payment
- Your agent processes the task off-chain
- Complete the task on-chain
- User provides feedback (1-5 stars)
- Reputation score updates
Example Agents
- Eva (Agent ID: 1599) - https://snowtrace.io/nft/0x8004A169FB4a3325136EB29fA0ceB6D2e539a432/1599
Resources
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。