ENS (Ethereum Name Service)¶
Overview¶
ENS (Ethereum Name Service) is a distributed, open, and extensible naming system based on the Ethereum blockchain. Its core function is to resolve human-readable names (such as alice.eth) into machine-readable identifiers, like Ethereum addresses, other cryptocurrency addresses, content hashes (for IPFS websites), and metadata.
ENS is similar to the DNS (Domain Name System) of the internet, but it does not rely on centralized servers. Instead, it runs entirely on Ethereum smart contracts, offering decentralized, censorship-resistant, and programmable properties.
Core Mechanism and Architecture¶
The ENS architecture consists of three core components:
1. The Registry¶
This is the core ENS smart contract, maintaining a list of all domains and subdomains. For each domain, the registry stores three key pieces of information: - Owner: The domain administrator, which can be an external account or a smart contract. The owner can set the resolver, modify TTL, and transfer ownership. - Resolver Address: The contract address responsible for handling specific resolution requests for that domain. - TTL (Time-To-Live): The duration clients cache records.
2. Resolvers¶
Resolvers are the smart contracts that actually perform name-to-address (or address-to-name) conversions. - Forward Resolution: alice.eth -> 0x123.... - Reverse Resolution: 0x123... -> alice.eth. - Multi-Resource Support: A resolver can store multiple types of records, including ETH addresses, BTC addresses, IPFS content hashes, email addresses, avatar URLs, etc.
3. Registrars¶
Registrars are smart contracts responsible for allocating and managing subdomains under specific top-level domains (such as .eth). - .eth Registrar: Currently uses the ERC-721 NFT standard. Registering a .eth domain name actually mints an NFT. This allows domain names to be freely traded on NFT marketplaces like OpenSea. - Rental Mechanism: To prevent domain squatting and deadlocks, .eth domains require annual fees (rent). Rental income typically goes to the ENS DAO treasury.
Key Features¶
- Decentralized Identity (DID): ENS is more than just an address alias; it is gradually becoming a universal username and identity profile for Web3 users.
- Cross-Platform Compatibility: Almost all mainstream wallets (MetaMask, Rainbow) and dApps natively support ENS resolution.
- Full Ownership: Users have full control over their domains, and no one can revoke or block them (as long as fees are paid on time).
- DNS Integration: ENS supports importing traditional DNS domains (such as
.com,.org) into the Ethereum ecosystem, provided users can prove ownership (DNSSEC).
Governance¶
ENS is governed by the ENS DAO. ENS token holders can vote on key protocol decisions, including: - Registration fee pricing and treasury allocation. - Price oracle selection. - Registrar upgrades.
Related Concepts¶
- IPFS + ENS: The golden combination for building decentralized websites. ENS points to IPFS hashes, enabling fully decentralized content publishing.
- Subdomains: Domain owners can freely create unlimited subdomains (such as
pay.alice.eth) at no cost and assign them to others.