Quickstart¶
From zero to registered agents on a live blockchain.
Prerequisites¶
| Requirement | Minimum Version | Check Command |
|---|---|---|
| Node.js | 18+ | node --version |
| npm | 9+ | npm --version |
| Python | 3.10+ (optional, for SDK) | python3 --version |
Local Development (No Testnet Needed)
Run npm run local to start a local Hardhat node with unlimited ETH. This deploys contracts and starts all services automatically -- no faucets, no testnet ETH, no waiting. Everything resets when you stop it. Skip directly to Step 6 after running this command.
Step 1: Install¶
Step 2: Generate Wallet Keys¶
This creates two wallets and saves their private keys to .env:
- Deployer -- deploys contracts, becomes the contract owner
- Relayer -- pays gas for gasless agent registrations
To see your wallet addresses at any time:
Protect your keys
The .env file contains private keys. Never commit it to version control. It is already listed in .gitignore.
Step 3: Fund Wallets with Base Sepolia ETH¶
You need approximately 0.01 ETH in each wallet. Testnet ETH is free.
The recommended approach. Fully automated with retries.
- Get free API keys at https://portal.cdp.coinbase.com
-
Add credentials to
.env: -
Claim testnet ETH:
Get your addresses with npm run addresses, then paste them into any of these faucets:
Note
Some faucets require a minimum mainnet balance or social verification. Try multiple faucets if one does not work.
Step 4: Deploy Contracts¶
This deploys both the MinimalForwarder and Agentenregister contracts to Base Sepolia and saves their addresses to .env.
Verify deployment
After deployment, confirm the contracts are live:
node -e "
const{ethers}=require('ethers');require('dotenv').config();
const p=new ethers.JsonRpcProvider('https://sepolia.base.org');
const r=new ethers.Contract(process.env.REGISTRY_ADDRESS,
['function nextAgentId() view returns (uint256)',
'function owner() view returns (address)'],p);
(async()=>{
console.log('Registry:', process.env.REGISTRY_ADDRESS);
console.log('Forwarder:', process.env.FORWARDER_ADDRESS);
console.log('Owner:', await r.owner());
console.log('Agents registered:', Number(await r.nextAgentId())-1);
})();"
Already deployed?
If you want to connect to the existing COAI Research deployment instead of deploying your own, set these in .env:
Step 5: Start Services¶
Verify both services are running:
Step 6: Register an Agent¶
The agent needs only a private key -- zero ETH required.
from sdk.agentenregister import AgentRegistry
registry = AgentRegistry.from_env()
agent_id = registry.register(
haftungsperson="0xYOUR_WALLET",
agent_wallet="0xAGENT_WALLET",
capabilities=["web_browsing", "content_creation"],
operational_scope="Content creation and publishing",
constitution_text="Law I: Do no harm.",
)
print(f"Agent #{agent_id} registered!")
import { AgentRegistry } from "@agentenregister/sdk";
const registry = new AgentRegistry({
chain: "base_sepolia",
registryAddress: "0x2EFaB5B3BEf49E56a6Ce1dcB1A39EF63C312EA23",
privateKey: "0x...",
relayerUrl: "https://relay.theagentregistry.org",
});
const agentId = await registry.register({
haftungsperson: "0xYOUR_WALLET",
agentWallet: "0xAGENT_WALLET",
capabilities: ["web_browsing", "content_creation"],
operationalScope: "Content creation and publishing",
constitutionText: "Law I: Do no harm.",
});
console.log(`Agent #${agentId} registered!`);
For the full EIP-712 signing flow using curl, see the Relayer API Reference and the Scientific Deployment Guide.
What just happened?
The agent signed an EIP-712 message locally (free). The relayer verified the signature and submitted the transaction to the blockchain, paying ~$0.005 in gas. The agent is now registered on-chain with a unique ID.
Step 7: Query the Registry¶
{
"agent": {
"agentId": 1,
"creator": "0x4b192fD5c4f24cE23000B49f31CF3d7484Ccf252",
"haftungsperson": "0x4b192fD5c4f24cE23000B49f31CF3d7484Ccf252",
"agentWallet": "0x4b192fD5c4f24cE23000B49f31CF3d7484Ccf252",
"operationalScope": "Scientific test agent #1",
"generation": 0,
"selfModifying": false,
"registeredAt": "2026-02-22T19:02:18.000Z",
"status": "Active"
},
"children": [],
"compliance": {
"isActive": true,
"attestationCurrent": true
}
}
# KYA check (what infrastructure providers call)
curl https://api.theagentregistry.org/api/v1/kya/0xAGENT_WALLET_ADDRESS
{
"wallet": "0xAGENT_WALLET_ADDRESS",
"isRegistered": true,
"isCompliant": true,
"agent": {
"agentId": 1,
"haftungsperson": "0x...",
"operationalScope": "...",
"status": "Active"
}
}
Step 8: Run Tests¶
# Full test suite (68 tests)
npm test
# With coverage report
npm run test:coverage
# Live integration tests against Base Sepolia
npm run test:live
Cost Summary¶
| Operation | Cost to Agent | Cost to Relayer (Base L2) |
|---|---|---|
| Register | $0.00 | ~$0.005 |
| Attest compliance | $0.00 | ~$0.001 |
| Report revenue | $0.00 | ~$0.002 |
| Query registry | $0.00 | $0.00 (view function) |
The relayer serves approximately 1,000 agents for ~$5/month on Base L2.
What's Next?¶
- Environment Variables -- Full configuration reference
- Key Concepts -- Understand Haftungsperson, KYA, compliance, and lineage
- Python SDK -- Complete Python SDK documentation
- TypeScript SDK -- Complete TypeScript SDK documentation
- REST API -- Full API endpoint reference
- Agent Integration Guide -- For autonomous agents registering themselves