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 |
Two contracts on Ethereum mainnet, both Etherscan-verified.
| Contract | Address | Purpose |
|---|---|---|
X402SubnameRegistrar |
0xeb9e9ea385fe28b51a3f9a7d93fb893e0a1f9633 |
Mints permanent ENS subnames under the supported parents |
X402RegistrarForwarder |
0x05af104ce913e7ef39799bfada871817d3761778 |
Splits payment between protocol and a third-party platform's treasury in a single tx |
The registrar interacts directly with the ENS NameWrapper contract to issue permanent subnames. Key functions:
| Function | Description |
|---|---|
register(node, label) |
Mint a single subname |
batchRegister(nodes[], labels[]) |
Mint multiple subnames in one tx |
isAvailable(node, label) |
Check if a subname is available |
withdrawFees() |
Owner: withdraw accumulated ETH |
Mint fee: 0.005 ETH per name (protocol fee)
Batch: Up to 10 names per transaction
Platform fee: 0β0.05 ETH on top of the protocol fee, paid to a platform's treasury via the forwarder (see below)
External platforms can earn from registrations by mounting the x402id widget and setting their own platform fee β paid atomically to a treasury address they specify. The forwarder enforces a 0.05 ETH cap on platform fees and the breakdown is shown to users line-by-line before they sign.
Full integration guide: x402id.eth.link/integrate
<div data-x402id
data-treasury="0xYourPlatformTreasury"
data-platform-fee-wei="1000000000000000"
data-parents="402bot.eth,402api.eth,402mcp.eth"
data-theme="light"></div>
<script src="https://x402id.eth.link/embed.js" async></script>npm install @x402identity/widget-react viemimport { X402Widget } from "@x402identity/widget-react";
import { mainnet } from "viem/chains";
import { namehash, parseEther } from "viem";
<X402Widget
registrar="0xeb9e9ea385fe28b51a3f9a7d93fb893e0a1f9633"
forwarder="0x05af104ce913e7ef39799bfada871817d3761778"
parents={[
{ label: "402bot.eth", node: namehash("402bot.eth") },
{ label: "402api.eth", node: namehash("402api.eth") },
{ label: "402mcp.eth", node: namehash("402mcp.eth") },
]}
platformTreasury="0xYourPlatformTreasury"
platformFeeWei={parseEther("0.001")}
chain={mainnet}
/>| Path | What it is |
|---|---|
contracts/X402RegistrarForwarder.sol |
Payment-splitting forwarder, ERC1155-receiver, owner-tunable fee cap |
packages/widget-core/ |
Framework-agnostic viem helpers (ABIs, validation, tx builders) |
packages/widget-react/ |
<X402Widget> component with fallback connect UI, zero-dep styling |
public/embed.js |
Vanilla script-tag loader for non-React sites |
src/app/widget/ |
Standalone widget page (iframe target for embed.js) |
src/app/integrate/ |
Public integrator-facing docs page |
| 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: bafybeigwlahfgu33wpn6hq5cnnj6p3ruagqsui4sewesx2ffs3javvuxhy
https://ipfs.io/ipfs/bafybeigwlahfgu33wpn6hq5cnnj6p3ruagqsui4sewesx2ffs3javvuxhy/
- 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.
π§ x402id@onchain-id.id
MIT