ens

Implements ENS name resolution, registration, and record management on Ethereum using viem.

6|20|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/andresdefi/cryptoskills --skill ens-andresdefi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ens
Source: https://github.com/andresdefi/cryptoskills/tree/main/skills/ens
Command: npx skills add https://github.com/andresdefi/cryptoskills --skill ens-andresdefi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires viem.

What problem does it solve? AI agents and developers frequently get ENS integration wrong: passing raw strings instead of namehash, confusing the registry with resolvers and registrars, skipping the 60-second commit-reveal wait during registration, or assuming every address has a reverse record. This Skill provides correct, up-to-date patterns for ENS development so integrations resolve names, register domains, and manage records without costly mistakes. ## Core Features & Use Cases - Name Resolution: Forward resolution (name to address), reverse resolution (address to primary name), avatar retrieval, text records, and multi-chain addresses via SLIP-44 coin types, all using viem's built-in ENS actions. - Registration & Renewal: Full commit-reveal registration flow with the ETH Registrar Controller, price estimation with buffers, renewal, and atomic record-setting at registration time. - Subdomains & Offchain Resolution: Onchain subdomain creation via the registry, Name Wrapper subdomains with fuses, and CCIP-Read (ERC-3668) offchain resolver patterns for gasless subdomains like cb.id. - Use Case: A wallet app needs to display human-readable names instead of hex addresses. Use this Skill to implement reverse resolution with forward-verification, avatar display, and graceful null handling for addresses without primary names. ## Quick Start Ask the agent to resolve vitalik.eth to an address and fetch its avatar and text records using viem on Ethereum mainnet.

Frequently Asked Questions about ens

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I resolve an ENS name to an address with viem?

Use client.getEnsAddress({ name }) on a viem public client connected to Ethereum mainnet. It returns the address or null if no record is set, and handles namehash, normalization, and CCIP-Read automatically.

How does ENS name registration work with commit-reveal?

Registration requires two transactions: first commit() with a hash from makeCommitment(), wait at least 60 seconds, then call register() with the same parameters and payment. Waiting over 24 hours expires the commitment.

Why does getEnsName return null for an address that owns an ENS name?

Reverse resolution is opt-in; the owner must explicitly call setName() on the Reverse Registrar. Owning a name does not automatically create a reverse record, so always handle null returns.

Can ENS store addresses for Bitcoin or Solana?

Yes, resolvers support multi-chain addresses via SLIP-44 coin types (EIP-2304). Pass coinType to getEnsAddress, for example 0 for Bitcoin or 501 for Solana. EVM chains use 0x80000000 OR chainId per ENSIP-11.

Why does my ENS registration transaction revert with CommitmentTooNew?

CommitmentTooNew means register() was called less than 60 seconds after commit(). Wait at least 60 seconds (65 is safer) between the two transactions, and keep the same secret across both calls.

How do offchain ENS subdomains like cb.id resolve?

They use CCIP-Read (ERC-3668): the resolver reverts with OffchainLookup pointing to a gateway that returns signed data verified onchain. viem handles this transparently, so offchain names resolve like onchain ones.