Permanent ENS subname registration for AI agents — fully onchain on Ethereum.
Mint subnames under 402bot.eth, 402api.eth, or 402mcp.eth for 0.005 ETH each. No renewals, no expiry, no middlemen. The name is yours forever.
🌐 Live: x402id.eth.link 🐦 Twitter/X: @x402identity
x402 Identity Hub gives AI agents a verifiable onchain identity through the ENS (Ethereum Name Service) infrastructure. Each minted subname is a permanent ENS record stored in the NameWrapper contract — transferable, resolvable, and composable with the broader ENS ecosystem.
| Name | Purpose |
|---|---|
[name].402bot.eth |
Autonomous AI bots and agents |
[name].402api.eth |
API-facing agents and services |
[name].402mcp.eth |
MCP (Model Context Protocol) servers |
X402SubnameRegistrar — deployed on Ethereum mainnet.
0xeb9e9ea385fe28b51a3f9a7d93fb893e0a1f9633
The registrar interacts directly with the ENS NameWrapper contract to issue permanent subnames. Key functions:
| Function | Description |
|---|---|
register(node, label, owner) |
Mint a single subname |
batchRegister(node, labels[], owner) |
Mint multiple subnames in one tx |
isAvailable(node, label) |
Check if a subname is available |
withdrawFees(token) |
Owner: withdraw accumulated ETH |
Mint fee: 0.005 ETH per name
Batch: Up to 10 names per transaction
| Layer | Technology |
|---|---|
| Smart Contract | Solidity 0.8.20 · OpenZeppelin v5 · Hardhat |
| Frontend | Next.js 14 · React 18 · TypeScript |
| Web3 | wagmi v2 · viem v2 · WalletConnect |
| Styling | Tailwind CSS · Framer Motion |
| Hosting | IPFS (Pinata) · ENS contenthash |
The frontend is a static export (next build → out/) pinned to IPFS and served via the x402id.eth ENS contenthash. No centralized server required.
IPFS CID: bafybeic5qzvqbkpc6f2xsz7qukx2gxyyvbj2whlhciwqq7a42h3djztkp4
https://ipfs.io/ipfs/bafybeic5qzvqbkpc6f2xsz7qukx2gxyyvbj2whlhciwqq7a42h3djztkp4/
- Node.js 18+
- An Alchemy API key
- A WalletConnect project ID (from cloud.reown.com)
git clone https://github.com/RWA-ID/x402-Identity.git
cd x402-Identity
npm installCreate .env.local:
NEXT_PUBLIC_REOWN_PROJECT_ID=your_walletconnect_project_id
NEXT_PUBLIC_ALCHEMY_MAINNET=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY
NEXT_PUBLIC_ALCHEMY_SEPOLIA=https://eth-sepolia.g.alchemy.com/v2/YOUR_KEY
NEXT_PUBLIC_REGISTRAR_ADDRESS=0xeb9e9ea385fe28b51a3f9a7d93fb893e0a1f9633
NEXT_PUBLIC_CHAIN_ID=1npm run devOpen http://localhost:3000.
npm run build
# Output: ./out/ (static export ready for IPFS)# Compile contracts
npx hardhat compile --config hardhat.config.js
# Run tests
npx hardhat test --config hardhat.config.js
# Deploy (requires PRIVATE_KEY in .env.local)
node scripts/deploy-viem.mjs
# Setup parent nodes (after deployment)
node scripts/setup-viem.mjsx402-identity-hub/
├── contracts/
│ └── X402SubnameRegistrar.sol # Core registrar contract
├── scripts/
│ ├── deploy-viem.mjs # Mainnet deploy script (viem)
│ ├── setup-viem.mjs # NameWrapper approval + parent setup
│ └── upload-ipfs.mjs # IPFS folder upload (Pinata)
├── src/
│ ├── app/
│ │ ├── layout.tsx # Root layout + providers
│ │ ├── page.tsx # Home page
│ │ └── globals.css # Global styles
│ ├── components/
│ │ ├── MintForm.tsx # Main mint UI (single + batch)
│ │ ├── ConnectButton.tsx # Wallet connect button
│ │ ├── RecentMints.tsx # Live mint feed
│ │ ├── SuccessModal.tsx # Post-mint confirmation + share
│ │ └── WalletConnectErrorBoundary.tsx
│ └── lib/
│ ├── wagmi.ts # wagmi config + connectors
│ ├── contracts.ts # Contract addresses + ABI
│ └── parents.ts # Parent node configs (namehashes)
├── hardhat.config.js
├── next.config.mjs
└── tailwind.config.ts
Each minted subname is registered through the ENS NameWrapper at 0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401.
The registrar must be approved as an operator on each parent name before registrations can occur. This is handled once during deployment via setApprovalForAll on the NameWrapper.
Parent node hashes used internally:
402bot.eth→namehash("402bot.eth")402api.eth→namehash("402api.eth")402mcp.eth→namehash("402mcp.eth")
Starting June 1, 2026, the expiry of each parent name (402bot.eth, 402api.eth, 402mcp.eth) will be extended by 10 years every month for the next 10 years — adding 120 years of coverage per year, for a cumulative total of 1,200 years at the end of the 10-year program.
This ensures that every subname minted today remains permanently resolvable on ENS for generations, with no risk of parent name expiry affecting your agent's identity.
MIT