Skip to main content
This guide shows you how to give an AI agent a Celoname, register it in the ERC-8004 Identity Registry on Celo, and publish ENS text records that let anyone verify and reach the agent.
Not writing code? You can add these records in the Celonames app. See Set ERC-8004 agent records.

How the pieces fit

Celonames are ENS subnames of celo.eth. Their records are stored on Celo in the CeloNames Registry, which is also the resolver for every *.celo.eth name. You write records with a Celo transaction. Apps on Ethereum read them through the ENS universal resolver, which follows the celo.eth L1 resolver and its CCIP-Read gateway back to Celo.
abapay.eth is a live example. It carries agent-registration[0x0001000002a4ec148004a169fb4a3325136eb29fa0ceb6d2e539a432][9687] = 1 for Celo agent 9687, plus agent-context, agent-endpoint[web] and agent-endpoint[mcp].

Contracts

ERC-8004 registries

Celonames (Celo mainnet)

See Deployment Addresses for the full list.

ENSIP-25: the agent-registration record

ENSIP-25 defines one parameterized text record key:
  • <registry> is the registry contract encoded as an ERC-7930 interoperable address: a hex string that carries both the chain and the contract address.
  • <agentId> is the agent’s ID in that registry.
Set the value to 1. Verifiers only check that it is non-empty.

Encode the registry address

For EVM chains, ERC-7930 concatenates these fields: That gives these values: So the record key for Celo agent 42 is:
This helper builds the key for any EVM chain. The examples on this page import it from agent-keys.ts.
agent-keys.ts

ENSIP-26: agent-context and agent-endpoint records

ENSIP-26 adds two keys for discovery: A client resolving an agent reads agent-context first. If it’s missing, the name publishes no agent context. Endpoint values must be valid URLs, and ipfs:// URIs are allowed.

Build an agent identity on Celo

The examples use viem and a private key in PRIVATE_KEY. Install viem with npm install viem.
1

Register a Celoname

Register myagent.celo.eth with the L2Registrar. Skip this step if you already own a name. You can also register in the Celonames app.
register-name.ts
The registrar prices names like this:
  • Prices are set in US cents per year, by label length. On Nov 27 2026 the registrar returned $400 for 3 characters, $160 for 4, $50 for 5, $5 for 6 to 9, and $1 for 10 or more. The registrar owner can change these tiers, so always read rentPrice before you register.
  • rentPrice(label, durationInYears, paymentToken) returns the amount in the payment token’s smallest unit. Pass zeroAddress for CELO (wei, 18 decimals). The registrar converts USD to CELO with a CELO/USD price feed, so the CELO amount moves with the market. For USDC, USDT or cUSD it returns the USD amount in that token’s decimals, for example 5000000 for $5 in USDC.
  • durationInYears is a whole number of years, from 1 to 10,000. One year is 31,536,000 seconds.
  • Labels must be at least 3 characters. available returns false for labels that are taken, too short or too long, or blocklisted.
  • The price already includes any share the registrar forwards to the ENS treasury.
To pay with a stablecoin, use registerERC20 with an EIP-2612 permit. See the integration guide for the permit flow.
2

Register the agent in ERC-8004

Create a registration file that follows the ERC-8004 registration-v1 format, and host it on HTTPS or IPFS. List your Celoname as an ENS service so verifiers know which name to check.
agent.json
Register first to get the agent ID, then add it to registrations. If you move the file, point the agent at the new location with setAgentURI.
register-agent.ts
On Celo Sepolia, use celoSepolia from viem/chains and the Sepolia Identity Registry address.
3

Set the ENSIP-25 and ENSIP-26 records on Celo

Write the records to the CeloNames Registry on Celo. The node is the ENS namehash of the full name, namehash("myagent.celo.eth"). The registry derives the same node: its root is namehash("celo.eth"). Only the name’s owner, or an operator the owner approved for all their names, can write records.To set one record, call setText:
set-agent-record.ts
To set the ENSIP-25 and ENSIP-26 records in one transaction, encode each setText call and send them through multicall. Every call must use the same node.
set-agent-records.ts
If you register the agent before the name, you can pass the same calls array as resolverData to register in step 1. The registrar sets the records in the registration transaction.
4

Verify the agent from Ethereum

Any ENS client can now read the records. With viem, getEnsText on an Ethereum mainnet client goes through the ENS universal resolver and CCIP-Read, so it works the same for *.celo.eth names and other ENS names.
verify-agent.ts
ENSIP-25 verification starts from the registry entry. Read the agent’s registration file, take the name from its ENS service, and check the record on that name:
verify-from-registry.ts
For a *.celo.eth name you can also read the record straight from Celo, which skips the gateway:
A record proves that the current name owner claims the agent. If the name is transferred, old records can be stale, so check ownership when it matters. When a Celoname expires, the registry stops returning its records.

Reputation

Clients can leave feedback on an agent in the Reputation Registry and read a summary before they delegate work to it. The agent’s owner and operators can’t give feedback to their own agent.
reputation.ts

Integration flow

References