BTB Finance for agents

Protocols / Domains

ENS (Ethereum Name Service)

Naming system on Ethereum: resolve names (alice.eth, DNS names) to addresses and records and addresses back to primary names through the Universal Resolver, register and renew .eth names with the ENSv2 ETHRegistrar (commit-reveal, paid in USDC/DAI), and set address/text records and primary names.

On-chainEVM14 contractsWebsite · Docs

get_protocol({ "protocol": "ens" })

Risks an agent should know

What an agent can do

resolve-nameName -> address / text record
Normalize (ENSIP-15), DNS-encode, then UniversalResolver.resolve(name, abi.encode(addr(namehash)) or text(namehash,key)); follow CCIP-Read. Simplest: viem getEnsAddress / getEnsText (viem >= 2.35) which use this contract. Pass coinType for L2 addresses.
reverse-lookupAddress -> primary name
UniversalResolver.reverse(address bytes, 60) (or the L2 coinType); viem getEnsName.
register-eth-nameRegister a new .eth name (ENSv2)
1) ETHRegistrar.isAvailable(label). 2) getRegisterPrice(label, duration, USDC) -> (base, premium). 3) USDC.approve(ETHRegistrar, base+premium, plus a small margin). 4) Optionally deploy your own resolver via VerifiableFactory.deployProxy(PermissionedResolverImpl, salt, initialize(...)), or pass 0x0 and set it later. 5) commitment = makeCommitment(label, owner, secret, subregistry=0x0, resolver, duration, referrer=0x0); commit(commitment). 6) Wait >= 60 s (and < 24 h). 7) register(label, owner, secret, 0x0, resolver, duration, USDC, 0x0).
renew-eth-nameRenew a .eth name
Check ETHRegistry.getStatus(uint256(labelhash)): 2 REGISTERED -> ETHRegistrar.renew((label,duration,0x0), USDC); 1 RESERVED (unmigrated v1 name) -> ETHRenewerV1.renew((label,duration,0x0), USDC). Approve the token for getRenewPrice first. Anyone can renew any name.
set-recordsSet address / text records
Find the name's resolver with UniversalResolver.findResolver(dnsName). If it supports interface 0xc7279f88 (ENSv2 Permissioned Resolver): setText(dnsName,key,value) / setAddress(dnsName,coinType,addrBytes). Otherwise (ENSv1 PublicResolver): setText(namehash,key,value) / setAddr(namehash,addr). ENSjs >= 5.2.5 picks the right path.
set-primary-nameSet the reverse record
ReverseRegistrar.setName('alice.eth') from the address (mainnet), or DefaultReverseRegistrar.setName for a default across chains; make sure the name's addr record points to that address.

Contracts

ethereum · chain id 1

ContractAddressKey functionsTry
Universal Resolver (UpgradableUniversalResolverProxy)
other · proxy
0xeEeEEEeE14D718C2B47D9923Deab1335E144EeEe
source
readresolve(bytes,bytes)
readreverse(bytes,uint256)
readresolveWithGateways(bytes,bytes,string[])
readreverseWithGateways(bytes,uint256,string[])
readfindResolver(bytes)
Full ABI
ETHRegistrar (ENSv2, current .eth registrar)
other
0xD6D8369e55c94Ae8AFA714E6cF7AB5bE54D5CC81
source
readisAvailable(string)
readgetRegisterPrice(string,uint64,address)
readgetRenewPrice(string,uint64,address)
readmakeCommitment(string,address,bytes32,address,address,uint64,bytes32)
writecommit(bytes32)
writeregister(string,address,bytes32,address,address,uint64,address,bytes32)
writerenew((string,uint64,bytes32),address)
writerenewBatch((string,uint64,bytes32)[],address)
+3 more via get_protocol
Full ABI
ETHRegistry (ENSv2 .eth PermissionedRegistry, ERC-1155 name tokens)
other
0xf60aba43E1f7F3DAB1186Ff03B561401C9Df85E2
source
readgetStatus(uint256)
readgetExpiry(uint256)
readgetTokenId(uint256)
readownerOf(uint256)
readgetResolver(string)
writesetResolver(uint256,address)
writesetSubregistry(uint256,address)
writesafeTransferFrom(address,address,uint256,uint256,bytes)
Full ABI
ETHRenewerV1 (renews unmigrated ENSv1 .eth names)
other
0x56c447F308F463A01121C41E72b0E7e7557fCb68
source
writerenew((string,uint64,bytes32),address)
readgetRenewPrice(string,uint64,address)
readisRenewable(string)
readgetRemainingGracePeriod(string)
Full ABI
StandardRentPriceOracle (ENSv2 pricing)
other
0x76F29609A363a8A1a2a6abe2e859C0F8916Af469
source
readisPaymentToken(address)
readgetRegisterPrice(string,uint64,uint64,address)
Full ABI
VerifiableFactory (deploys per-account resolvers / per-name registries)
factory
0x77510ba162dfeA3d8989E3f0928a691B345730D2
source
writedeployProxy(address,uint256,bytes)
readverifyContract(address)
Full ABI
PermissionedResolverImpl (ENSv2 resolver implementation; call your own proxy, not this)
other
0x565b0F456a04Ac9b48758190e90030623Cff57C5
source
writesetAddress(bytes,uint256,bytes)
writesetText(bytes,string,string)
writesetContenthash(bytes,bytes)
writemulticall(bytes[])
readresolve(bytes,bytes)
Full ABI
ENS Registry (ENSv1)
other
0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e
source
readowner(bytes32)
readresolver(bytes32)
writesetResolver(bytes32,address)
writesetSubnodeRecord(bytes32,bytes32,address,address,uint64)
Full ABI
BaseRegistrar (ENSv1 .eth ERC-721)
token
0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85
source
readnameExpires(uint256)
readownerOf(uint256)
readavailable(uint256)
writereclaim(uint256,address)
writesafeTransferFrom(address,address,uint256,bytes)
Full ABI
NameWrapper (ENSv1, ERC-1155)
other
0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401
source
readownerOf(uint256)
readgetData(uint256)
writesetResolver(bytes32,address)
writesetSubnodeRecord(bytes32,string,address,address,uint64,uint32,uint64)
writeunwrapETH2LD(bytes32,address,address)
Full ABI
PublicResolver (ENSv1)
other
0xF29100983E058B709F3D539b0c765937B804AC15
source
writesetAddr(bytes32,address)
writesetAddr(bytes32,uint256,bytes)
writesetText(bytes32,string,string)
writesetContenthash(bytes32,bytes)
writemulticall(bytes[])
readaddr(bytes32)
readtext(bytes32,string)
Full ABI
ReverseRegistrar (L1, ENSv1)
other
0xa58E81fe9b61B5c3fE2AFD33CF304c454AbFc7Cb
source
writesetName(string)
writesetNameForAddr(address,address,address,string)
readnode(address)
Full ABI
DefaultReverseRegistrar (ENSv1)
other
0x283F227c4Bd38ecE252C4Ae7ECE650B0e913f1f9
source
writesetName(string)
readnameForAddr(address)
Full ABI
ENS token
governance
0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72
source
readbalanceOf(address)
writetransfer(address,uint256)
writedelegate(address)
readgetVotes(address)
readdelegates(address)
Full ABI

APIs

ENS subgraph (The Graph, mainnet)
auth: api-key
https://thegraph.com/explorer/subgraphs/5XqPmWe6gjyrJtFn9cLy237i4cWw2j9HcUJEXsP5qGtH
List names owned by an account, registrations, expiries (GraphQL). Covers ENSv1 only: ENSv2 registrations may be missing and migrated names show stale ownership.

Notes

Addresses come from docs.ens.domains/learn/deployments (ENSv1 and ENSv2 mainnet tables) and the ENS token from the ENS docs FAQ (token.ensdao.eth). The deployments page still says 'until the ENSv2 launch completes, resolution and registrations continue through ENSv1', but the ETH Registrar docs, the migration docs and onchain state (2026-11-25) show ENSv2 is live: BaseRegistrar.controllers(ETHRegistrarController 0x59E16fcCd424Cc24e280Be16E11Bcd56fb0CE547) = false, controllers(ETHRenewerV1) = true, ETHRegistrar quotes 8 USDC/yr, the Universal Resolver proxy points at UniversalResolverV2 0x06Fdd07F007ADaC667177b46aB2EB9A75132Cfd5, and nick.eth is REGISTERED in the v2 ETHRegistry. Therefore the ENSv1 ETHRegistrarController (0x59E16f..., the version with the register(Registration struct) argument) and the Wrapped ETH Registrar Controller (0x2535...) are deliberately NOT listed as callable contracts: registration and renewal through them is disabled. Other ENSv2 contracts on the deployments page (migration controllers, UserRegistryImpl, BatchRegistrar, DNS resolvers, HCA, renderers, adapters, PublicResolverV2, ENSV1Resolver) are left out as not needed for normal agent use; see the deployments page. ENS L2 reverse registrars (Base, Arbitrum, etc.) are on the same page but not covered here. Signatures were checked against the ENS docs and confirmed present in deployed bytecode.

Sources

Researched 2026-11-25. Addresses are copied from the official sources above; check them before moving large amounts.