ENS Logo

Resolver Interface Standards

This page is a collection of methods that a resolver MAY implement.

UsageFunction Definition
Check Interface SupportsupportsInterface(bytes4 interfaceID) external pure returns (bool)
Read Ethereum Addressaddr(bytes32 node) view returns (address)
Read Multicoin Addressaddr(bytes32 node, uint coinType) view returns (bytes memory)
Read Content Hashcontenthash(bytes32 node) view returns (bytes memory)
Read Text Recordtext(bytes32 node, string key) view returns (string memory)
Read Contract ABIABI(bytes32 node, uint256 contentTypes) view returns (uint256, bytes memory)
Read Public Keypubkey(bytes32 node) view returns (bytes32 x, bytes32 y)
Read Name (for reverse records)name(bytes32 node) view returns (string memory)
Wildcard Resolutionresolve(bytes memory name, bytes memory data) view returns (bytes memory)
Write Ethereum AddresssetAddr(bytes32 node, address a)
Set Multicoin AddresssetAddr(bytes32 node, uint256 coinType, bytes calldata a)
Write Content HashsetContenthash(bytes32 node, bytes calldata hash)
Write Text RecordsetText(bytes32 node, string calldata key, string calldata value)
Write Contract ABIsetABI(bytes32 node, uint256 contentType, bytes calldata data)
Write Public KeysetPubkey(bytes32 node, bytes32 x, bytes32 y)
Write Name (for reverse records)setName(bytes32 node, string calldata name)
Batch Read/Writemulticall(bytes[] calldata data) view returns (bytes[] memory results)

Check Interface Support

Function
supportsInterface(bytes4 interfaceID) external pure returns (bool)
EIP-165
  • Interface ID: 0x01ffc9a7

Parameters

  • interfaceID (bytes4): The interface identifier, as specified in ERC-165

Returns

  • bool: True if the contract supports the specified interface.

Read Ethereum Address

Function
addr(bytes32 node) view returns (address)
ENSIP-1 / EIP-137
  • Interface ID: 0x3b3b57de

Parameters

  • node (bytes32): The ENS node to query.

Returns

  • address: Ethereum address or the zero address if no address is set.

Read Multicoin Address

Function
addr(bytes32 node, uint coinType) view returns (bytes memory)
ENSIP-9 / EIP-2304
  • Interface ID: 0xf1cb7e06

Parameters

  • node (bytes32): The ENS node to query.
  • coinType (uint): The ENSIP-9 coin type to query.

Returns

  • bytes: Cryptocurrency address in its native binary format. For example, the Bitcoin address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa base58check decodes to the 21 bytes 0062e907b15cbf27d5425399ebf6f0fb50ebb88f18 then scriptPubkey encodes to 25 bytes 76a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac whereas the BNB address bnb1grpf0955h0ykzq3ar5nmum7y6gdfl6lxfn46h2 Bech32 decodes to the binary representation 40c2979694bbc961023d1d27be6fc4d21a9febe6. A zero-length string ("") will be returned if the specified coin type is not set.

Read Content Hash

Function
contenthash(bytes32 node) view returns (bytes memory)
ENSIP-7 / EIP-1577
  • Interface ID: 0xbc1c58d1

Parameters

  • node (bytes32): The ENS node to query.

Returns

  • bytes: The contenthash set for the name, encoded in binary format.

Read Text Record

Function
text(bytes32 node, string key) view returns (string memory)
ENSIP-5 / EIP-634
  • Interface ID: 0x59d1d43c

Parameters

  • node (bytes32): The ENS node to query.
  • key (string): The text data key to query.

Returns

  • string: The value of the text record associated with key, or the empty string if no such record exists.

Read Contract ABI

Function
ABI(bytes32 node, uint256 contentTypes) view returns (uint256, bytes memory)
ENSIP-4 / EIP-205
  • Interface ID: 0x2203ab56

Parameters

  • node (bytes32): The ENS node to query.
  • contentTypes (uint256): A bitwise OR of the ABI formats accepted by the caller.

Returns

  • (uint256, bytes): ABI returns a two-tuple of the content type ID and the ABI data. If no data of the appropriate content type ID was found, 0 is returned for the content type ID, and the ABI data will be the empty string.

Read Public Key

Function
pubkey(bytes32 node) view returns (bytes32 x, bytes32 y)
  • Interface ID: 0xc8690233

Parameters

  • node (bytes32): The ENS node to query.

Returns

  • (bytes32, bytes32): The ECDSA SECP256k1 public key for node, as a 2-tuple (x, y). If no public key is set, (0, 0) is returned.

Read Name (for reverse records)

Function
name(bytes32 node) view returns (string memory)
Implemented by Public Resolver
  • Interface ID: 0x691f3431

Parameters

  • node (bytes32): The ENS node to query.

Returns

  • string: The associated name.

Wildcard Resolution

Function
resolve(bytes memory name, bytes memory data) view returns (bytes memory)
ENSIP-10
  • Interface ID: 0x9061b923

Parameters

  • name (bytes): DNS-encoded name
  • data (bytes): Encoded function data for other resolver calls like addr(), text(), etc.

Write Ethereum Address

Function
setAddr(bytes32 node, address a)
Emitted Events
event AddrChanged(bytes32 indexed node, address a);
Implemented by Public Resolver
  • Interface ID: 0xd5fa2b00

Parameters

  • node (bytes32): The ENS node to update.
  • a (address): The Ethereum address to set.

Set Multicoin Address

Function
setAddr(bytes32 node, uint256 coinType, bytes calldata a)
Emitted Events
event AddressChanged(bytes32 indexed node, uint coinType, bytes newAddress);
Implemented by Public Resolver
  • Interface ID: 0x8b95dd71

Parameters

  • node (bytes32): The ENS node to update.
  • coinType (uint256): The ENSIP-9 coin type to update.
  • a (bytes): The address to set.

Write Content Hash

Function
setContenthash(bytes32 node, bytes calldata hash)
Emitted Events
event ContenthashChanged(bytes32 indexed node, bytes hash);
Implemented by Public Resolver
  • Interface ID: 0x304e6ade

Parameters

  • node (bytes32): The ENS node to update.
  • hash (bytes): The contenthash to set.

Write Text Record

Function
setText(bytes32 node, string calldata key, string calldata value)
Emitted Events
event TextChanged(bytes32 indexed node, string indexed indexedKey, string key);
Implemented by Public Resolver
  • Interface ID: 0x10f13a8c

Parameters

  • node (bytes32): The ENS node to update.
  • key (string): The key to set.
  • value (string): The text data value to set.

Write Contract ABI

Function
setABI(bytes32 node, uint256 contentType, bytes calldata data)
Emitted Events
event ABIChanged(bytes32 indexed node, uint256 indexed contentType);
Implemented by Public Resolver
  • Interface ID: 0x623195b0

Parameters

  • node (bytes32): The ENS node to update.
  • contentType (uint256): The content type of the ABI.
  • data (bytes): The ABI data.

Write Public Key

Function
setPubkey(bytes32 node, bytes32 x, bytes32 y)
Emitted Events
event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y);
Implemented by Public Resolver
  • Interface ID: 0x29cd62ea

Parameters

  • node (bytes32): The ENS node to update.
  • x (bytes32): The X coordinate of the curve point for the public key.
  • y (bytes32): The Y coordinate of the curve point for the public key.

Write Name (for reverse records)

Function
setName(bytes32 node, string calldata name)
Emitted Events
event NameChanged(bytes32 indexed node, string name);
Implemented by Public Resolver
  • Interface ID: 0x77372213

Parameters

  • node (bytes32): The ENS node to update.
  • name (string): The associated name.

Batch Read/Write

Function
multicall(bytes[] calldata data) view returns (bytes[] memory results)
Implemented by Public Resolver
  • Interface ID: 0xac9650d8

Parameters

  • data (bytes[]): An array of ABI-encoded resolver function calls.

Returns

  • results (bytes[]): An array of data for each resolver call result.

Examples

Set two different text records:
  • name: myname.eth
  • key1: value1
  • key2: value2
The corresponding function call is: setText(bytes32 node, string calldata key, string calldata value).
So the input parameters would be:
  • node: 0x6cbc8d00d20a89e588f430e62b937a6402557bf0bc2127fb1378457331aa463d
  • key: key1
  • value: value1
Therefore the ABI-encoded call (for key1/value1) would be:

0x10f13a8c

6cbc8d00d20a89e588f430e62b937a6402557bf0bc2127fb1378457331aa463d

0000000000000000000000000000000000000000000000000000000000000060

00000000000000000000000000000000000000000000000000000000000000a0

0000000000000000000000000000000000000000000000000000000000000004

6b65793100000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000006

76616c7565310000000000000000000000000000000000000000000000000000

The second the ABI-encoded call (for key2/value2) would be very similar:

0x10f13a8c

6cbc8d00d20a89e588f430e62b937a6402557bf0bc2127fb1378457331aa463d

0000000000000000000000000000000000000000000000000000000000000060

00000000000000000000000000000000000000000000000000000000000000a0

0000000000000000000000000000000000000000000000000000000000000004

6b65793200000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000006

76616c7565320000000000000000000000000000000000000000000000000000

Both of those byte arrays would be passed into the two-dimensional bytes[] input parameter.
The full ABI-encoded multicall call would therefore be (with proper padding):

0xac9650d8

0000000000000000000000000000000000000000000000000000000000000020

0000000000000000000000000000000000000000000000000000000000000002

0000000000000000000000000000000000000000000000000000000000000040

0000000000000000000000000000000000000000000000000000000000000160


00000000000000000000000000000000000000000000000000000000000000e4


10f13a8c

6cbc8d00d20a89e588f430e62b937a6402557bf0bc2127fb1378457331aa463d

0000000000000000000000000000000000000000000000000000000000000060

00000000000000000000000000000000000000000000000000000000000000a0

0000000000000000000000000000000000000000000000000000000000000004

6b65793100000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000006

76616c7565310000000000000000000000000000000000000000000000000000

00000000000000000000000000000000000000000000000000000000


00000000000000000000000000000000000000000000000000000000000000e4


10f13a8c

6cbc8d00d20a89e588f430e62b937a6402557bf0bc2127fb1378457331aa463d

0000000000000000000000000000000000000000000000000000000000000060

00000000000000000000000000000000000000000000000000000000000000a0

0000000000000000000000000000000000000000000000000000000000000004

6b65793200000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000006

76616c7565320000000000000000000000000000000000000000000000000000


00000000000000000000000000000000000000000000000000000000

Contributors
Last Modified
9 hours ago