Skip to main content

What is ENS?

The Ethereum Name Service (ENS) is a distributed, open, and extensible naming system based on the Ethereum blockchain. ENS’s job is to map human-readable names like ‘alice.eth’ to machine-readable identifiers such as Ethereum addresses, content hashes, and metadata.

Core Architecture Pattern

ENS uses a separation of concerns architecture built on three primary components:

Registry

The central contract that stores domain ownership and points to resolvers

Registrar

Controls domain allocation and manages registration/renewal for specific namespaces

Resolver

Stores and returns the actual records (addresses, content hashes, text records, etc.)

How ENS Resolution Works

The resolution process follows these steps:
  1. Compute the namehash - Convert the human-readable name to a unique hash
  2. Query the Registry - Ask the registry who owns this name and which resolver handles it
  3. Query the Resolver - Ask the resolver for the specific record (address, content hash, etc.)
This separation allows domain owners to change their records (via resolver) without transferring ownership, and permits innovation in how records are stored and managed.

Key Components

ENS Registry

The registry is the core contract of ENS. It maintains:
  • Owner - The address that controls the domain
  • Resolver - The contract that stores records for the domain
  • TTL - Time-to-live for caching purposes
function owner(bytes32 node) external view returns (address);
function resolver(bytes32 node) external view returns (address);
function ttl(bytes32 node) external view returns (uint64);

Registrars

Registrars are responsible for allocating subdomains. Different TLDs can have different registrar implementations:
  • BaseRegistrar - Manages .eth domain registrations
  • ETHRegistrarController - Handles the registration process with commit/reveal
  • ReverseRegistrar - Manages reverse resolution (.addr.reverse)
  • FIFSRegistrar - Simple first-in-first-served registrar for testing
The registrar pattern allows different registration rules for different namespaces. For example, .eth uses an auction/registration system, while test domains use a simple claim system.

Resolvers

Resolvers are responsible for translating names to addresses and other resources. The PublicResolver is the most commonly used resolver and supports:
  • Ethereum addresses (EIP-137)
  • Multi-chain addresses (EIP-2304)
  • Content hashes for IPFS/Swarm (EIP-1577)
  • Text records (EIP-634)
  • Public keys (EIP-619)
  • ABI definitions (EIP-205)

Why This Architecture?

Domain owners can change where their name points without changing ownership. You can update your address, add new record types, or switch resolvers entirely.
New resolver implementations can support new record types without modifying the core registry. This allows ENS to evolve over time.
The registry provides strong ownership guarantees. Controllers (registrars) can issue new names but cannot modify or revoke existing ones.
Anyone can deploy their own registrar for a namespace they control, or create custom resolver implementations for specialized use cases.

Name Hierarchy

ENS names are hierarchical, similar to DNS:
root (.)
 └── eth
     ├── alice.eth
     │   └── pay.alice.eth
     └── bob.eth
The owner of a domain has full control over its subdomains. For example, the owner of alice.eth can create pay.alice.eth, www.alice.eth, etc.
Subdomain owners do NOT automatically gain control of their parent domain. The owner of pay.alice.eth cannot modify alice.eth settings.

Next Steps

Architecture Details

Deep dive into the ENS registry and contract interactions

Namehash Algorithm

Learn how ENS converts names to unique identifiers

Build docs developers (and LLMs) love