ERC-8004 contracts on Arc Testnet
| Contract | Address |
|---|---|
| IdentityRegistry | 0x8004A818BFB912233c491871b3d84c89A494BD9e |
| ReputationRegistry | 0x8004B663056A597Dffe9eCcC1965A193B7388713 |
| ValidationRegistry | 0x8004Cb1BF31DAf7788923b405b754f57acEB4272 |
Prerequisites
Before you begin, make sure you have:- A Circle Developer Console account
- An API key created in the Console: Keys → Create a key → API key → Standard Key
- Your Entity Secret registered
Step 1. Set up your project
Create a project directory, install dependencies, and configure your environment.1.1. Create the project and install dependencies
1.2. Configure TypeScript (optional)
Create atsconfig.json file:
tsconfig.json file:
1.3. Set environment variables
Create a.env file in the project directory and add your Circle credentials:
YOUR_API_KEY is your Circle Developer API key and YOUR_ENTITY_SECRET
is your registered Entity Secret.
Step 2: Create developer-controlled wallets
You’ll create two wallets: one for the agent owner and one for recording reputation. Per ERC-8004, agent owners cannot record reputation for their own agents to prevent self-dealing.Step 3: Prepare agent metadata
Create a JSON file with metadata for your agent. The structure below is an example you can adapt for your use case. ERC-8004 registration stores a metadata URI, but the JSON fields at that URI are application-defined unless your integration follows a separate metadata convention.agent-metadata.json
ipfs://QmYourHash....
For this quickstart, you can skip uploading and use the example URI:
ipfs://bafkreibdi6623n3xpf7ymk62ckb4bo75o3qemwkpfvp5i25j66itxvsoeiStep 4: Register your agent identity
Callregister(metadataURI) on the IdentityRegistry to mint an identity NFT for
your agent.
With Circle Gas Station, your application sponsors the transaction fees. On
Arc, gas is approximately 0.006 USDC-TESTNET per transaction.
Step 5: Retrieve your agent ID
Query theTransfer event from the IdentityRegistry to find the token ID minted
for your agent.
Step 6: Record reputation
Build your agent’s reputation by recording feedback. Use the validator wallet — per ERC-8004, agent owners cannot record reputation for their own agents.Production scoring: This quickstart hardcodes
score: 95 for demonstration. In production, calculate scores dynamically based on agent behavior. For example, score = loanRepaidOnTime ? 100 : 20 for lending protocols, or score = slippagePct < 1 ? 95 : 60 for trading platforms.The ReputationRegistry stores attestations from external observers who witnessed
the agent’s actions. Your application logic calculates scores based on outcomes,
then records them onchain.Step 7: Request and verify validation
The ERC-8004 ValidationRegistry uses a two-step request/response flow. The agent owner requests validation from a validator, then the validator submits a response.Full script
The complete script below combines all the preceding steps into a single runnable file. Save it, then run:If you followed the Python workflow, run
deactivate when you’re done to exit
the virtual environment.Summary
After completing this quickstart, you’ve successfully:- Created developer-controlled SCA wallets on Arc Testnet (owner + validator)
- Registered an AI agent with a unique onchain identity (ERC-721 token)
- Recorded reputation feedback from an external validator
- Requested validation from a validator and verified the response onchain