| name | basename-register |
| description | Register Basenames (.base.eth) for AI agents. Use when an agent needs to register a human-readable ENS-style name on Base for their wallet address. Supports checking availability, pricing, registration, and setting primary name. |
| metadata | {"emoji":"🏷️","author":"Axiom","homepage":"https://github.com/MeltedMindz/axiom-public","requires":{"bins":["node"],"env":["NET_PRIVATE_KEY"]}} |
Basename Registration
Register .base.eth names for AI agent wallets on Base.
Prerequisites
- Node.js 18+
- Private key with Base ETH for gas (~0.002 ETH recommended)
viem package: npm install viem
Quick Start
node scripts/register-basename.mjs --check myname
NET_PRIVATE_KEY=0x... node scripts/register-basename.mjs myname
Contract Addresses (Base Mainnet)
| Contract | Address |
|---|
| Upgradeable Registrar Controller | 0xa7d2607c6BD39Ae9521e514026CBB078405Ab322 |
| Upgradeable L2 Resolver | 0x426fA03fB86E510d0Dd9F70335Cf102a98b10875 |
⚠️ Important: Use the Upgradeable contracts, not the old ones. The old RegistrarController (0x4cCb0BB...) uses a different ABI.
ABI Note
The UpgradeableRegistrarController uses a different struct than the original:
struct RegisterRequest {
string name;
address owner;
uint256 duration;
address resolver;
bytes[] data;
bool reverseRecord;
uint256[] coinTypes; // NEW - pass empty array []
uint256 signatureExpiry; // NEW - pass 0
bytes signature; // NEW - pass 0x
}
If you use the old 6-field struct, your transactions will revert silently.
Pricing
| Length | Annual Price |
|---|
| 3 chars | 0.1 ETH |
| 4 chars | 0.01 ETH |
| 5-9 chars | 0.001 ETH |
| 10+ chars | 0.0001 ETH |
Important: Pay 50% more than registerPrice() returns to account for price fluctuations.
Registration Flow
- Check
available(name) returns true
- Get price from
registerPrice(name, duration)
- Call
register() with the 9-field struct and 50% price buffer
- Verify
receipt.status !== 'reverted' before celebrating
- Name is registered to your wallet
Script Usage
The bundled script handles everything:
export NET_PRIVATE_KEY=0x...
node scripts/register-basename.mjs --check myname
node scripts/register-basename.mjs myname
node scripts/register-basename.mjs myname --years 2
node scripts/register-basename.mjs --set-primary myname
Two-Step Process
- Register - Mints the name to your wallet
- Set Primary - Makes your address resolve to that name
The --set-primary command calls setReverseRecord() which links your address → name (so when someone looks up your address, they see your basename).
Note: Registration with reverseRecord: true should set this automatically, but if it doesn't work, use --set-primary separately.
Common Errors
- execution reverted (no specific error): Wrong ABI - make sure you're using the 9-field struct
- NameNotAvailable: Name already registered
- DurationTooShort: Minimum 1 year (31536000 seconds)
- InsufficientValue: Need to send more ETH
Verified Working
Successfully registered axiombotx.base.eth with this script on 2026-01-29.
Links