ERC-800Claw
Your entry point into ERC-8004 - the on-chain identity, reputation, and validation standard for autonomous agents.
ERC-8004 is an open protocol enabling verifiable agent identity and reputation on Ethereum. Agents can register identities (ERC-721 NFTs), receive and give reputation feedback, and optionally verify their capabilities through validators. ERC-800Claw, built by Primer, provides simple APIs for interacting with the protocol.
When to Use This Skill
Use ERC-800Claw when:
- - You need to register an agent identity on-chain
- You need to look up an agent by ID or owner
- You want to give feedback/ratings to another agent
- You need to check an agent's reputation
- The user asks about agent verification or trust
Quick Setup
Node.js
CODEBLOCK0
Python
CODEBLOCK1
How to Respond
| User Says/Asks | What to Do |
|---|
| "Look up agent #123" | Run erc-800claw agent 123 to get details |
| "Does agent 42 exist?" |
Run
erc-800claw exists 42 |
| "How many agents does 0x... own?" | Run
erc-800claw owner 0x... |
| "Register my agent" | Run
erc-800claw register --name "Name" (requires PRIVATE_KEY env var) |
| "What networks are supported?" | Run
erc-800claw networks |
| "Show contract addresses" | Run
erc-800claw contracts |
CLI Commands
| Command | Description |
|---|
| INLINECODE6 | Get agent details by ID |
| INLINECODE7 |
Check if an agent exists |
|
erc-800claw owner <address> | Get agent count for an address |
|
erc-800claw register | Register a new agent (requires PRIVATE_KEY) |
|
erc-800claw networks | List supported networks |
|
erc-800claw contracts [network] | Show contract addresses |
CLI Options
- -
--network, -n <name> - Network to use (mainnet, sepolia). Default: mainnet - INLINECODE13 - Output as JSON
Example CLI Output
CODEBLOCK2
How ERC-8004 Works
ERC-8004 provides three on-chain registries:
- 1. Identity Registry (ERC-721) - Every agent gets a unique NFT token with metadata URI
- Reputation Registry - Structured feedback scores from clients to agents
- Validation Registry - Independent verification (zkML, TEE, stakers)
The flow:
- 1. Register - Mint an agent identity NFT with name/description metadata
- Operate - Use your agent ID when interacting with other agents
- Build Reputation - Clients give feedback, scores accumulate on-chain
- Verify (optional) - Validators attest to capabilities
Using in Code
Node.js / TypeScript
CODEBLOCK3
Python
CODEBLOCK4
Metadata Format
Agent metadata follows a standard schema:
CODEBLOCK5
The SDK automatically encodes this as a data URI - no IPFS upload required.
Integration with xClaw02
ERC-800Claw works with xClaw02 (x402 payments) to enable paid agent services:
- 1. Register your agent identity with ERC-800Claw
- Set up payment receiving with xClaw02
- Clients verify your identity, pay for services, then rate you
See the xClaw02 skill for payment setup.
Supported Networks
| Network | Chain ID | Status |
|---|
| Ethereum Mainnet | 1 | Live |
| Sepolia Testnet |
11155111 | Live |
Contract Addresses
Mainnet
- - Identity Registry: INLINECODE14
- Reputation Registry: INLINECODE15
Sepolia
- - Identity Registry: INLINECODE16
- Reputation Registry: INLINECODE17
Environment Variables
| Variable | Format | Description |
|---|
| INLINECODE18 | INLINECODE19 + 64 hex chars | Wallet private key (required for registration/feedback) |
| INLINECODE20 |
mainnet,
sepolia | Default network (default: mainnet) |
|
ERC8004_RPC_URL | URL | Custom RPC endpoint |
Error Handling
| Error | Meaning | What to Do |
|---|
| INLINECODE24 | No agent with that ID | Verify the agent ID is correct |
| INLINECODE25 |
Token already minted | Each agent ID is unique |
|
Not the owner | Can't modify other's agents | Only owner can update agent metadata |
|
Invalid address | Malformed Ethereum address | Check address format (0x + 40 hex chars) |
Security Notes
- - Never expose private keys in logs, chat, or output
- Use environment variables for wallet credentials
- Agent registration costs gas - have ETH in your wallet
- Private key format:
0x followed by 64 hexadecimal characters
Links
- - ERC-8004 Protocol: https://8004.org
- EIP-8004: https://eips.ethereum.org/EIPS/eip-8004
- SDK (npm): https://npmjs.com/package/erc-800claw
- SDK (PyPI): https://pypi.org/project/erc-800claw
- GitHub: https://github.com/primer-systems/ERC-8004
- Primer Systems: https://primer.systems
ERC-800Claw
你进入ERC-8004的入口——自主代理的链上身份、声誉和验证标准。
ERC-8004是一个开放协议,可在以太坊上实现可验证的代理身份和声誉。代理可以注册身份(ERC-721 NFT),接收和给予声誉反馈,并可选地通过验证器验证其能力。ERC-800Claw由Primer构建,提供与协议交互的简单API。
何时使用此技能
在以下情况下使用ERC-800Claw:
- - 你需要在链上注册代理身份
- 你需要通过ID或所有者查找代理
- 你想向其他代理提供反馈/评分
- 你需要检查代理的声誉
- 用户询问关于代理验证或信任的问题
快速设置
Node.js
bash
npm install erc-800claw
Python
bash
pip install erc-800claw
如何响应
| 用户说/问 | 操作 |
|---|
| 查找代理 #123 | 运行 erc-800claw agent 123 获取详情 |
| 代理42存在吗? |
运行 erc-800claw exists 42 |
| 0x...拥有多少个代理? | 运行 erc-800claw owner 0x... |
| 注册我的代理 | 运行 erc-800claw register --name 名称(需要PRIVATE_KEY环境变量) |
| 支持哪些网络? | 运行 erc-800claw networks |
| 显示合约地址 | 运行 erc-800claw contracts |
CLI命令
| 命令 | 描述 |
|---|
| erc-800claw agent <id> | 通过ID获取代理详情 |
| erc-800claw exists <id> |
检查代理是否存在 |
| erc-800claw owner
| 获取地址的代理数量 |
| erc-800claw register | 注册新代理(需要PRIVATE_KEY) |
| erc-800claw networks | 列出支持的网络 |
| erc-800claw contracts [network] | 显示合约地址 |
CLI选项
- - --network, -n - 使用的网络(mainnet, sepolia)。默认:mainnet
- --json, -j - 以JSON格式输出
CLI输出示例
bash
$ erc-800claw agent 1
代理 #1 (mainnet)
────────────────────────────────────────
所有者: 0x1234...abcd
URI: data:application/json;base64,...
名称: 我的代理
关于: 一个用于...的自主代理
浏览器: https://etherscan.io/nft/0x8004.../1
$ erc-800claw exists 100
代理100存在于mainnet
$ erc-800claw owner 0x1234...
地址0x1234...在mainnet上拥有3个代理
$ PRIVATE_KEY=0x... erc-800claw register --name 我的代理 --network sepolia
代理已在sepolia注册!
────────────────────────────────────────
代理ID:42
所有者: 0x1234...abcd
交易: 0xabc123...
浏览器: https://sepolia.etherscan.io/nft/0x8004.../42
ERC-8004工作原理
ERC-8004提供三个链上注册表:
- 1. 身份注册表(ERC-721)- 每个代理获得一个带有元数据URI的唯一NFT代币
- 声誉注册表 - 从客户到代理的结构化反馈评分
- 验证注册表 - 独立验证(zkML、TEE、质押者)
流程:
- 1. 注册 - 使用名称/描述元数据铸造代理身份NFT
- 操作 - 与其他代理交互时使用你的代理ID
- 建立声誉 - 客户提供反馈,评分在链上累积
- 验证(可选)- 验证者证明能力
在代码中使用
Node.js / TypeScript
javascript
const { createClient } = require(erc-800claw);
const client = createClient({ network: mainnet });
// 通过ID获取代理
const agent = await client.getAgent(1);
console.log(agent);
// {
// agentId: 1,
// tokenURI: data:application/json;base64,...,
// owner: 0x...,
// metadata: { name: 我的代理, description: ... },
// explorerUrl: https://etherscan.io/...
// }
// 检查代理是否存在
const exists = await client.agentExists(42);
// 获取地址的代理数量
const count = await client.getAgentCount(0x...);
// 注册新代理(无需IPFS - 使用数据URI!)
const result = await client.registerAgent(process.env.PRIVATE_KEY, {
name: 我的自主代理,
description: 处理客户支持,
services: [{ name: support, endpoint: https://myagent.com/api }]
});
console.log(已注册代理 #${result.agentId});
// 向代理提供反馈
await client.giveFeedback(process.env.PRIVATE_KEY, agentId, {
value: 4.5, // 满分5分
decimals: 1,
tag1: support,
tag2: fast
});
Python
python
from erc800claw import create_client
import os
client = create_client(network=mainnet)
通过ID获取代理
agent = client.get_agent(1)
print(agent)
{
agent_id: 1,
token_uri: data:application/json;base64,...,
owner: 0x...,
metadata: {name: 我的代理, description: ...},
explorer_url: https://etherscan.io/...
}
检查代理是否存在
exists = client.agent_exists(42)
获取地址的代理数量
count = client.get
agentcount(0x...)
注册新代理(无需IPFS - 使用数据URI!)
result = client.register_agent(
private
key=os.environ[PRIVATEKEY],
name=我的自主代理,
description=处理客户支持,
services=[{name: support, endpoint: https://myagent.com/api}]
)
print(f已注册代理 #{result[agent_id]})
向代理提供反馈
client.give_feedback(
private
key=os.environ[PRIVATEKEY],
agent
id=agentid,
value=4.5, # 满分5分
decimals=1,
tag1=support,
tag2=fast
)
元数据格式
代理元数据遵循标准模式:
json
{
name: 我的代理,
description: 我的代理做什么,
image: https://example.com/avatar.png,
services: [
{
name: api,
endpoint: https://myagent.com/api,
description: 主要API端点
}
],
supported_trust: [reputation, validation]
}
SDK自动将其编码为数据URI - 无需IPFS上传。
与xClaw02集成
ERC-800Claw与xClaw02(x402支付)配合使用,实现付费代理服务:
- 1. 使用ERC-800Claw注册你的代理身份
- 使用xClaw02设置收款
- 客户验证你的身份,支付服务费用,然后给你评分
支付设置请参阅xClaw02技能。
支持的网络
| 网络 | 链ID | 状态 |
|---|
| 以太坊主网 | 1 | 已上线 |
| Sepolia测试网 |
11155111 | 已上线 |
合约地址
主网
- - 身份注册表:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432
- 声誉注册表:0x8004BAa17C55a88189AE136b182e5fdA19dE9b63
Sepolia
- - 身份注册表:0x8004A818BFB912233c491871b3d84c89A494BD9e
- 声誉注册表:0x8004B663056A597Dffe9eCcC1965A193B7388713
环境变量
| 变量 | 格式 | 描述 |
|---|
| PRIVATE_KEY | 0x + 64个十六进制字符 | 钱包私钥(注册/反馈必需) |