Skip to main content
Skill — Copyable reference implementation. Use as-is or customize. See Skills Philosophy.

ENS Resolution

Resolve Ethereum Name Service (ENS) names to addresses and retrieve ENS records using Voltaire primitives and Contract modules.

Overview

ENS resolution requires two components:
  1. Ens module - Name validation, normalization, and namehash computation
  2. Contract module - Interacting with ENS registry and resolver contracts

Contract Addresses (Mainnet)

Resolving ENS Name to Address

Reverse Resolution (Address to ENS)

Reverse resolution looks up the primary ENS name for an address.
Always verify forward resolution when doing reverse lookups. A user can set any name as their reverse record, but only the verified forward resolution is authoritative.

Getting ENS Records

ENS supports various text records like avatar, email, URL, and custom records.

Common Text Record Keys

ENS Name Validation

Validate ENS names before resolution to prevent homograph attacks.
Always normalize ENS names before computing namehash. Names like “Vitalik.eth” and “vitalik.eth” have different namehashes if not normalized first.

Computing Namehash

The namehash is a recursive hash used to identify ENS names on-chain.

Full Resolution Helper

A complete helper function combining all functionality:

L2 ENS Resolution

For L2 networks, use the same contract addresses but connect to an L1 provider for resolution, or use CCIP-read compatible resolvers.

See Also