Introduction to ENS
Ethereum Name Service (ENS) is a distributed, open, and extensible naming system built on the Ethereum blockchain. It translates human-readable domain names (e.g., alice.eth) into machine-readable identifiers like:
- Ethereum addresses
- Content hashes
- Metadata
ENS also supports reverse resolution, enabling the association of metadata (e.g., canonical names or interface descriptions) with Ethereum addresses.
How ENS Compares to DNS
While ENS shares DNS’s hierarchical structure (domains separated by dots), its architecture diverges due to Ethereum’s blockchain capabilities:
- Top-level domains (e.g.,
.eth) are owned by smart contracts called registrars, which govern subdomain allocation. - Any user can claim a domain by following registrar rules.
Example: Alice owns alice.eth → Can create subdomains like pay.alice.eth.
ENS Architecture: Core Components
1. ENS Registry
A smart contract that tracks domains and stores:
- Owner of the domain
- Resolver responsible for the domain
- Time-to-Live (TTL) for cached records
Owners (users or contracts) can:
- Set resolvers/TTL
- Transfer ownership
- Modify subdomains
2. Resolvers
Smart contracts that convert domain names into addresses. Key features:
- Supports multiple record types (addresses, hashes, etc.).
- New record types can be added via EIP standards without altering the registry.
Resolution Process:
- Query the registry for the domain’s resolver.
- Ask the resolver for the target address.
Namehash: How ENS Handles Domains
ENS uses cryptographic hashes (256-bit) for efficiency:
- Namehash algorithm generates unique hashes while preserving hierarchy (e.g.,
alice.eth→0x787...). - Domains are normalized via UTS-46 standard (case-insensitive, invalid-character filtering).
Getting Started with ENS
For DApp Developers
- Enable ENS in your DApp
- Choose from available ENS libraries.
For Smart Contract Developers
API References
FAQ
1. What’s the cost of registering a .eth domain?
Prices vary based on domain length (e.g., 3+ characters). Annual renewal fees apply.
2. Can I transfer my ENS domain?
Yes! Owners can transfer domains to other addresses via the ENS Manager.
3. How does reverse resolution work?
It links Ethereum addresses to metadata (e.g., 0x123... → alice.eth).
4. Is ENS compatible with wallets like MetaMask?
Absolutely. Most Ethereum wallets support ENS domain inputs.
5. Where can I manage my ENS domains?
Use the ENS Manager or official ENS apps.
Documentation translated by Liubenben. Original version: ENS Docs. Last updated: 10/31/2019.
### Key SEO Keywords:
1. Ethereum Name Service
2. ENS domains
3. Blockchain naming system
4. .eth registration
5. Smart contract resolvers
6. Namehash algorithm
7. Decentralized domains
8. ENS registry