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:- Compute the namehash - Convert the human-readable name to a unique hash
- Query the Registry - Ask the registry who owns this name and which resolver handles it
- 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
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. ThePublicResolver 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?
Flexibility
Flexibility
Domain owners can change where their name points without changing ownership. You can update your address, add new record types, or switch resolvers entirely.
Upgradeability
Upgradeability
New resolver implementations can support new record types without modifying the core registry. This allows ENS to evolve over time.
Security
Security
The registry provides strong ownership guarantees. Controllers (registrars) can issue new names but cannot modify or revoke existing ones.
Decentralization
Decentralization
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:alice.eth can create pay.alice.eth, www.alice.eth, etc.
Next Steps
Architecture Details
Deep dive into the ENS registry and contract interactions
Namehash Algorithm
Learn how ENS converts names to unique identifiers