ERC-800Claw
ERC-8004 SDK for OpenClaw agents. Register, query, and rate agent identities on Ethereum.
From Primer Systems · @primer_systems
npm install erc-800claw
Quick Start
CLI
npx erc-800claw agent 1
npx erc-800claw exists 1
npx erc-800claw owner 0x9ce7082814bDA389F3ba548BDf2626006279569c
PRIVATE_KEY=0x... npx erc-800claw register --name "My Agent" --network sepolia
npx erc-800claw networks
npx erc-800claw contracts mainnet
npx erc-800claw agent 1 --network sepolia
npx erc-800claw agent 1 --json
JavaScript/TypeScript
const { createClient } = require('erc-800claw');
const client = createClient({ network: 'mainnet' });
const agent = await client.getAgent(1);
console.log(agent);
const exists = await client.agentExists(1);
const count = await client.getAgentCount('0x...');
console.log(`Address owns ${count} agents`);
const result = await client.registerAgent(process.env.PRIVATE_KEY, {
name: 'My Autonomous Agent',
description: 'Handles customer support',
services: [{ name: 'support', endpoint: 'https://myagent.com/api' }]
});
console.log(`Registered agent #${result.agentId}`);
await client.giveFeedback(process.env.PRIVATE_KEY, agentId, {
value: 4.5,
decimals: 1,
tag1: 'support',
tag2: 'fast'
});
API
createClient(options?)
Create a client instance.
const client = createClient({
network: 'mainnet',
rpcUrl: 'https://...'
});
Read Methods
client.getAgent(agentId)
Get agent details by ID. Returns null if agent doesn't exist.
{
agentId: 1,
tokenURI: 'ipfs://...' | null,
owner: '0x...',
metadata: { ... } | null,
explorerUrl: 'https://...'
}
client.agentExists(agentId)
Check if an agent exists. Returns true or false.
client.getAgentCount(ownerAddress)
Get number of agents owned by an address.
client.getReputation(agentId, options?)
Get reputation summary for an agent.
const rep = await client.getReputation(1, {
clientAddresses: ['0x...'],
tag1: 'support',
tag2: ''
});
client.getNetworkInfo()
Get current network configuration.
Write Methods
All write methods require a private key for signing transactions.
client.register(privateKey, agentURIOrMetadata?)
Register a new agent. Pass a URI string or metadata object (auto-converted to data URI).
const result = await client.register(privateKey, {
name: 'My Agent',
description: 'Does cool stuff'
});
const result = await client.register(privateKey, 'ipfs://...');
const result = await client.register(privateKey);
client.registerAgent(privateKey, options)
Convenience method with structured options.
const result = await client.registerAgent(privateKey, {
name: 'My Agent',
description: 'Agent desc',
image: 'https://...',
services: [{
name: 'api',
endpoint: 'https://...'
}],
supportedTrust: ['reputation']
});
client.setAgentURI(privateKey, agentId, newURIOrMetadata)
Update an agent's metadata URI.
await client.setAgentURI(privateKey, agentId, {
name: 'Updated Name',
description: 'New description'
});
client.giveFeedback(privateKey, agentId, feedback)
Submit reputation feedback for an agent.
await client.giveFeedback(privateKey, agentId, {
value: 4.5,
decimals: 1,
tag1: 'quality',
tag2: 'fast',
endpoint: '/api/chat',
feedbackURI: '',
feedbackHash: '0x...'
});
Helper Functions
createDataURI(metadata)
Create a data URI from a metadata object (no IPFS upload needed).
const { createDataURI } = require('erc-800claw');
const uri = createDataURI({ name: 'My Agent', description: '...' });
parseDataURI(dataUri)
Parse a data URI back to a metadata object.
createRegistrationMetadata(options)
Create standard ERC-8004 registration metadata.
Networks
| Ethereum Mainnet | 1 | Live |
| Sepolia Testnet | 11155111 | Live |
Contract Addresses
Mainnet
- Identity Registry:
0x8004A169FB4a3325136EB29fA0ceB6D2e539a432
- Reputation Registry:
0x8004BAa17C55a88189AE136b182e5fdA19dE9b63
Sepolia
- Identity Registry:
0x8004A818BFB912233c491871b3d84c89A494BD9e
- Reputation Registry:
0x8004B663056A597Dffe9eCcC1965A193B7388713
What is ERC-8004?
ERC-8004 provides on-chain identity, reputation, and validation for autonomous agents:
- Identity Registry - ERC-721 agent identities with registration metadata
- Reputation Registry - Signed feedback scores between agents/clients
- Validation Registry - Independent verification (zkML, TEE, stakers)
Learn more: 8004.org | EIP-8004
Related
License
MIT - Primer Systems