Try it Live
Run ENS examples in the interactive playground
Conceptual Guide - For API reference and method documentation, see ENS API.
What is ENS?
ENS provides human-readable names for Ethereum addresses, content hashes, and other resources. Instead of0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb2, use vitalik.eth.
ENS operates on-chain via smart contracts - no centralized DNS servers. Names are NFTs (ERC-721) that can be owned, transferred, and renewed.
Why ENS Exists
Addresses are hostile to humans:- 42 hex characters are error-prone
- No way to verify correctness by inspection
- Difficult to share verbally or remember
alice.eth→0x1234...token.uniswap.eth→ Contract addressdao.eth→ IPFS content hash
Name Structure
ENS names are hierarchical labels separated by dots, read right-to-left:Labels
- Separated by
.(U+002E FULL STOP) - Can contain letters, numbers, emoji, non-Latin scripts
- Maximum 255 characters per label
- Must be normalized before use (see below)
Hierarchy
.eth- Primary ENS TLD (controlled by ENS DAO)name.eth- Second-level domain (what users register)subdomain.name.eth- Unlimited subdomains (owner controls)
Normalization
Critical: ENS names must be normalized to prevent homograph attacks and ensure canonical representation.- Why Normalize
- ENSIP-15
Normalization Process
- Lowercase - Convert ASCII uppercase to lowercase (
A-Z→a-z) - Unicode NFC - Normalize to composed form (
énote+´) - UTS-46 Processing - Map/disallow characters per Unicode standard
- Script Validation - Reject mixed scripts (e.g., Latin + Cyrillic)
- Confusable Detection - Reject characters that look identical
Name Resolution
ENS resolution is a multi-step process from human-readable name to on-chain data:1. Normalize Name
2. Compute Namehash
Namehash converts names to deterministic 32-byte identifiers:3. Lookup Resolver
Query ENS registry for resolver contract address:4. Query Records
Call resolver contract for specific data:Complete Example
Common Use Cases
Wallet Addresses
Most common ENS usage - map names to Ethereum addresses:Content Hashes
Point names to IPFS content:Text Records
Store arbitrary key-value data:Reverse Resolution
Resolve addresses back to primary ENS name:Security
Homograph Attacks
Problem: Visually identical characters from different scriptsConfusable Characters
Problem: Characters that look similar (I vs l vs 1)Best Practices
-
Always normalize before use
-
Display normalized form to users
-
Validate on both client and server
-
Use beautify for display, normalize for logic
Resources
- ENS Documentation - Official ENS docs
- ENSIP-1 - ENS specification
- ENSIP-10 - Wildcard resolution
- ENSIP-15 - Name normalization standard
- UTS-46 - Unicode IDNA compatibility processing
- ENS App - Register and manage ENS names
Next Steps
- Overview - Type definition and API reference
- normalize() - Name normalization details
- Security - Homograph attack prevention
- ENSIP Standards - ENS improvement proposals

