What are Resolvers?
Resolvers are smart contracts that store and return information associated with ENS names. When you look up an ENS name, the ENS registry points to a resolver contract, which then provides the actual data (addresses, content hashes, text records, etc.). The resolver system is designed to be flexible and extensible through a profile-based architecture, where each profile implements specific functionality defined in various EIPs (Ethereum Improvement Proposals).PublicResolver
ThePublicResolver is the most commonly used resolver implementation in ENS. It provides a general-purpose resolver suitable for most standard ENS use cases. The PublicResolver permits updates to ENS records by the owner of the corresponding name.
Key Features
- Multi-profile support: Implements multiple resolver profiles for different data types
- Authorization system: Supports operators and delegates for managing records
- Multicallable: Batch multiple operations in a single transaction
- Versioning: Records are versioned to prevent stale data
Authorization
The PublicResolver includes a sophisticated authorization system:- Operators: An address authorized for an owner may make any changes to names owned by that address
- Delegates: A delegate authorized by an owner for a specific name may make changes to that name’s resolver records
- Trusted controllers: Special addresses (ETH Registrar Controller, Reverse Registrar) that have elevated permissions
Resolver Profiles
The PublicResolver implements the following profiles, each corresponding to specific EIPs:ABIResolver
EIP-205: Store contract ABIs
AddrResolver
EIP-137, EIP-2304: Address resolution and multicoin support
ContentHashResolver
EIP-1577: IPFS and other content hashes
DNSResolver
DNS record support for ENS names
InterfaceResolver
EIP-165: Interface detection
NameResolver
EIP-181: Reverse resolution
PubkeyResolver
EIP-619: SECP256k1 public keys
TextResolver
EIP-634: Arbitrary text records
Basic Usage
Setting a Resolver
Before using a resolver, you must set it in the ENS registry:Reading from a Resolver
Writing to a Resolver
ResolverBase
All resolver profiles inherit fromResolverBase, which provides:
- Record versioning: Each node has a version number that increments when records are cleared
- Authorization: Abstract
isAuthorised()method that implementations must define - EIP-165 support: Interface detection capability
Clearing records increments the version number, effectively invalidating all previous records for that name without explicitly deleting them.
Supported EIPs
The ENS resolver system implements the following Ethereum Improvement Proposals:- EIP-137: Ethereum Domain Name Service
- EIP-165: Standard Interface Detection
- EIP-181: Reverse ENS resolution
- EIP-205: ENS support for contract ABIs
- EIP-619: ENS support for SECP256k1 public keys
- EIP-634: ENS support for text records
- EIP-1577: ENS support for content hashes
- EIP-2304: ENS support for multichain addresses
Next Steps
PublicResolver
Learn about the PublicResolver contract in detail
Resolver Profiles
Explore each resolver profile and its functions