Overview
Resolver profiles are modular components that implement specific functionality as defined by various EIPs (Ethereum Improvement Proposals). The PublicResolver combines all these profiles to provide a complete resolver solution. Each profile inherits fromResolverBase and implements a specific interface, providing both read and write functions for a particular type of data.
Profile Architecture
All profiles follow this pattern:- Inherit from ResolverBase: Gets versioning and authorization support
- Implement specific interface: Defines the data type’s read functions
- Use versioned storage: Data is stored by version to prevent stale reads
- Require authorization: Write functions use the
authorised(node)modifier
ABIResolver
EIP-205
ENS support for contract ABIs
Description
Stores contract ABIs (Application Binary Interfaces) associated with ENS names. ABIs can be stored in multiple formats (JSON, Solidity, etc.) identified by content type.Interface: IABIResolver.sol:contracts/resolvers/profiles/IABIResolver.sol
Functions
ABI (Read)
ABI (Read)
node: The ENS node to querycontentTypes: Bitwise OR of accepted ABI formats (e.g., 1 for JSON, 2 for zlib-compressed JSON)
contentType: The content type of the returned ABIdata: The ABI data in the returned format
setABI (Write)
setABI (Write)
node: The node to updatecontentType: The content type identifier (must be a power of 2)data: The ABI data
Usage Example
AddrResolver
EIP-137
Ethereum Domain Name Service
EIP-2304
Multichain address resolution
Description
Resolves ENS names to cryptocurrency addresses. Supports Ethereum addresses (coin type 60) and addresses for other blockchains using SLIP-44 coin type identifiers.Interface: IAddrResolver.sol, IAddressResolver.sol:contracts/resolvers/profiles/IAddrResolver.sol
Functions
addr (Ethereum - Read)
addr (Ethereum - Read)
node: The ENS node to query
- Ethereum address associated with the node
addr(node, 60).addr (Multicoin - Read)
addr (Multicoin - Read)
node: The ENS node to querycoinType: SLIP-44 coin type identifier (e.g., 0 for Bitcoin, 60 for Ethereum, 118 for Cosmos)
- Address bytes in the format appropriate for the coin type
setAddr (Ethereum - Write)
setAddr (Ethereum - Write)
node: The node to updateaddr: The Ethereum address to set
setAddr (Multicoin - Write)
setAddr (Multicoin - Write)
node: The node to updatecoinType: SLIP-44 coin type identifieraddressBytes: The address in bytes format
hasAddr (Check - Read)
hasAddr (Check - Read)
node: The ENS node to querycoinType: The coin type to check
trueif an address is set for the given coin type
Usage Example
Common Coin Types
| Blockchain | Coin Type | Example Usage |
|---|---|---|
| Bitcoin | 0 | resolver.addr(node, 0) |
| Litecoin | 2 | resolver.addr(node, 2) |
| Dogecoin | 3 | resolver.addr(node, 3) |
| Ethereum | 60 | resolver.addr(node, 60) or resolver.addr(node) |
| Cosmos | 118 | resolver.addr(node, 118) |
| BNB Smart Chain | 60 | resolver.addr(node, 60) (EVM chain) |
ContentHashResolver
EIP-1577
ENS support for contenthash
Description
Stores content hashes for decentralized storage systems like IPFS, Swarm, Arweave, and others. This enables ENS names to resolve to decentralized websites and content.Interface: IContentHashResolver.sol:contracts/resolvers/profiles/IContentHashResolver.sol
Functions
contenthash (Read)
contenthash (Read)
node: The ENS node to query
- Content hash in binary format (includes codec identifier)
setContenthash (Write)
setContenthash (Write)
node: The node to updatehash: The content hash to set (with codec prefix)
Usage Example
Supported Protocols
- IPFS:
0xe3codec prefix - Swarm:
0xe4codec prefix - Arweave:
0xe5codec prefix - Onion:
0xbccodec prefix (Tor) - Onion3:
0xbdcodec prefix (Tor v3)
TextResolver
EIP-634
ENS support for text records
Description
Stores arbitrary key-value text data associated with ENS names. Commonly used for email addresses, URLs, social media handles, avatars, and more.Interface: ITextResolver.sol:contracts/resolvers/profiles/ITextResolver.sol
Functions
text (Read)
text (Read)
node: The ENS node to querykey: The text record key
- The text value associated with the key
setText (Write)
setText (Write)
node: The node to updatekey: The text record keyvalue: The text value to set
Usage Example
Standard Text Record Keys
While any key can be used, these are commonly recognized:| Key | Description | Example |
|---|---|---|
email | Email address | [email protected] |
url | Website URL | https://example.com |
avatar | Avatar image URL | https://example.com/avatar.png |
description | Profile description | Web3 developer |
notice | Legal notice | © 2024 Example Corp |
keywords | Keywords | web3,ens,ethereum |
com.twitter | Twitter handle | @username |
com.github | GitHub username | username |
com.discord | Discord handle | user#1234 |
com.reddit | Reddit username | u/username |
com.telegram | Telegram username | @username |
org.telegram | Telegram username | @username |
PubkeyResolver
EIP-619
ENS support for SECP256k1 public keys
Description
Stores SECP256k1 public keys for encryption and signature verification. Useful for encrypted messaging and other cryptographic operations.Interface: IPubkeyResolver.sol:contracts/resolvers/profiles/IPubkeyResolver.sol
Functions
pubkey (Read)
pubkey (Read)
node: The ENS node to query
x: The X coordinate of the public key curve pointy: The Y coordinate of the public key curve point
setPubkey (Write)
setPubkey (Write)
node: The node to updatex: The X coordinate of the public keyy: The Y coordinate of the public key
Usage Example
NameResolver
EIP-181
ENS support for reverse resolution
Description
Stores canonical names for reverse resolution. Used primarily by the reverse registrar to map addresses back to ENS names.Interface: INameResolver.sol:contracts/resolvers/profiles/INameResolver.sol
Functions
name (Read)
name (Read)
node: The ENS node to query (typically a reverse record node)
- The canonical name associated with the node
setName (Write)
setName (Write)
node: The node to updatenewName: The name to set
Usage Example
InterfaceResolver
EIP-165
Standard Interface Detection
Description
Allows ENS names to specify which contract addresses implement specific EIP-165 interfaces. If not explicitly set, automatically checks if the address returned byaddr() supports the interface.
Interface: IInterfaceResolver.sol:contracts/resolvers/profiles/IInterfaceResolver.sol
Functions
interfaceImplementer (Read)
interfaceImplementer (Read)
node: The ENS node to queryinterfaceID: The EIP-165 interface ID to check
- Address of the contract implementing the interface, or
address(0)if not found
addr() to see if it supports the interface.setInterface (Write)
setInterface (Write)
node: The node to updateinterfaceID: The EIP-165 interface IDimplementer: The contract address that implements this interface (oraddress(0)to use default)
Usage Example
DNSResolver
DNS-ENS Integration
Experimental support for DNS records in ENS
Description
Provides support for storing DNS records in ENS, enabling DNS-over-ENS functionality. This allows ENS names to serve DNS records and enables DNS domains to be hosted on Ethereum.Interface: IDNSRecordResolver.sol, IDNSZoneResolver.sol:contracts/resolvers/profiles/IDNSRecordResolver.sol
Functions
dnsRecord (Read)
dnsRecord (Read)
node: The ENS node to queryname: The keccak-256 hash of the fully-qualified DNS nameresource: The DNS resource type (e.g., 1 for A, 28 for AAAA, 16 for TXT)
- DNS record in wire format
setDNSRecords (Write)
setDNSRecords (Write)
node: The node to updatedata: DNS records in wire format
zonehash (Read)
zonehash (Read)
node: The ENS node to query
- Content hash pointing to a complete zone file
setZonehash (Write)
setZonehash (Write)
node: The node to updatehash: The zone hash to set (EIP-1577 format)
hasDNSRecords (Check)
hasDNSRecords (Check)
node: The ENS node to queryname: The DNS name hash to check
trueif DNS records exist for the name
Usage Example
Common DNS Resource Types
| Type | Value | Description |
|---|---|---|
| A | 1 | IPv4 address |
| AAAA | 28 | IPv6 address |
| CNAME | 5 | Canonical name |
| MX | 15 | Mail exchange |
| TXT | 16 | Text record |
| NS | 2 | Name server |
ResolverBase
All resolver profiles inherit fromResolverBase, which provides:
Record Versioning
Authorization
authorised modifier protects write functions, deferring to the implementation’s isAuthorised() logic.
Interface Detection
Complete Integration Example
Summary Table
| Profile | EIP | Primary Function | Use Case |
|---|---|---|---|
| ABIResolver | 205 | ABI() | Store contract ABIs |
| AddrResolver | 137, 2304 | addr() | Resolve to addresses (ETH and multicoin) |
| ContentHashResolver | 1577 | contenthash() | Link to IPFS/decentralized content |
| TextResolver | 634 | text() | Store key-value text data |
| PubkeyResolver | 619 | pubkey() | Store encryption public keys |
| NameResolver | 181 | name() | Reverse resolution |
| InterfaceResolver | 165 | interfaceImplementer() | Interface detection |
| DNSResolver | - | dnsRecord() | DNS integration |
Next Steps
PublicResolver
Learn about the PublicResolver implementation
Resolvers Overview
Back to resolvers overview