ensip25-verify
v0.1.0
Published
CLI verifier for ENSIP-25 agent registrations — resolves ENS names to ERC-8004 agents and cryptographically verifies ownership
Downloads
149
Maintainers
Readme
ensip25-verify
CLI verifier for ENSIP-25 agent registrations.
Resolves an ENS name, reads its agent-registration text record, decodes the ERC-7930 registry address, and cryptographically verifies ownership by comparing the ENS name owner to the on-chain ownerOf(agentId) in the ERC-8004 registry.
Stateless. No indexer. No API key required.
Install
npm install -g ensip25-verify
# or run without installing:
npx ensip25-verify <name.eth> <registry> <agentId>Usage
ensip25-verify <name.eth> <registry-address> <agent-id> [options]
Options:
--chain-id <n> Chain ID of the registry (default: 1 = Ethereum mainnet)
--pretty Human-readable output instead of JSON
--help Show usage
--version Show versionExamples
Verify a live binding (PASS):
$ npx ensip25-verify superagent.kris0.eth 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 31821 --chain-id 1 --pretty
Verifying ENSIP-25 binding...
ENS name: superagent.kris0.eth
Registry: 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432
Agent ID: 31821
Chain ID: 1
Text record key:
agent-registration[0x000100000101148004a169fb4a3325136eb29fa0ceb6d2e539a432][31821]
ENS owner: 0x0Cf84F01C311Dc093969136B1814F05B5b3167F6
Text record: "1"
Registry owner: 0x0Cf84F01C311Dc093969136B1814F05B5b3167F6
✅ PASS — superagent.kris0.eth owns agent #31821 in registry 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432JSON output (CI-friendly, pipe to jq):
$ npx ensip25-verify superagent.kris0.eth 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 31821 --chain-id 1
{
"ensName": "superagent.kris0.eth",
"ensOwner": "0x0Cf84F01C311Dc093969136B1814F05B5b3167F6",
"registry": "0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",
"chainId": 1,
"agentId": "31821",
"textRecordKey": "agent-registration[0x000100000101148004a169fb4a3325136eb29fa0ceb6d2e539a432][31821]",
"textRecordValue": "1",
"registryOwner": "0x0Cf84F01C311Dc093969136B1814F05B5b3167F6",
"pass": true,
"erc7930Encoded": "0x000100000101148004a169fb4a3325136eb29fa0ceb6d2e539a432"
}Detect owner mismatch (FAIL):
$ npx ensip25-verify agent.bairon.eth 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 45744 --chain-id 8453 --pretty
...
ENS owner: 0xA1E977e700bF82019beb381F1582575303A389CE
Text record: "1"
Registry owner: 0x6bdC52c8e262c6D139e618260400614c2Bfe51d7
❌ FAIL — Owner mismatch: ENS owner 0xA1E977... ≠ registry owner 0x6bdC52...Detect missing record (FAIL):
$ npx ensip25-verify vitalik.eth 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 167 --chain-id 1 --pretty
...
ENS owner: 0x220866B1A2219f40e72f5c628B65D54268cA3A9D
❌ FAIL — Text record "agent-registration[...][167]" not found or empty on vitalik.ethHow it works
ENSIP-25 defines a parameterized ENS text record key:
agent-registration[<erc7930-registry-address>][<agentId>]Where <erc7930-registry-address> is the registry contract encoded as an ERC-7930 interoperable address, which encodes the chain ID and contract address in a compact binary format.
Verification flow:
- Resolve ENS name → get owner via ENS Registry + NameWrapper (supports second-level
.ethand subdomains) - Encode registry into ERC-7930 interoperable address (chain type + chain ID + address)
- Fetch text record
agent-registration[<erc7930>][<agentId>]from the ENS resolver - Call
ownerOf(agentId)on the registry contract on the specified chain - Compare owners — PASS if ENS name owner == registry agent owner
PASS means: the ENS name's controller cryptographically attests to owning a specific on-chain ERC-8004 agent.
Error cases
| Exit code | Meaning | |-----------|---------| | 0 | PASS — binding verified | | 1 | FAIL — missing record, owner mismatch, or RPC error | | 2 | Usage error — bad arguments |
Supported chains
Default: Ethereum mainnet (--chain-id 1). Also supports:
| Chain | ID | |-------|----| | Ethereum mainnet | 1 | | Base | 8453 | | Polygon | 137 | | Optimism | 10 |
Uses BlastAPI public endpoints — no API key required.
ENSIP-25 specification
- ENSIP-25: https://docs.ens.domains/ensip/25
- ERC-8004: https://eips.ethereum.org/EIPS/eip-8004
- ERC-7930: https://eips.ethereum.org/EIPS/eip-7930
License
MIT
