Resolvers may implement any subset of the record types specified here. Where a record types specification requires a resolver to provide multiple functions, the resolver MUST implement either all or none of them.
Resolvers MUST specify a fallback function that throws.
Resolvers must implement ERC-165 interface detection standard. supportsInterface
method must return if the interfaceID
queried is simply equal to the signature hash of the function that resolves the desired resource record.
Currently standardized resolver interfaces are specified below.
Check out definitive resolver for implementation details.
Provides the contract address for the specified domain.
function addr(bytes32 node) returns (address);
node
: the namehash of the domain to query for.When updated emits
event AddrChanged(bytes32 indexed node, address a);
Interface ID: 0x3b3b57de
Specification: EIP-137
Resolution protocol:
addr
to the resolver contract.No modifications to the adoption of this protocol.
Add multiple addr
fields for resolvers, which permit resolution of addresses across multiple blockchains.
function addr(bytes32 node, uint coinType) external view returns(bytes memory);
node
: The name hash of the domain to query for.coinType
: The cryptocurrency coin type index from SLIP44.Detailed descriptions of the binary encodings for several popular chains are provided in the Address Encoding section of EIP-2304.
When updated emits
event AddressChanged(bytes32 indexed node, uint coinType, bytes newAddress);
Specification: EIP-2304
Interface ID: 0xf1cb7e06
Deprecates: RNSIP-03
Resolution protocol:
addr
to the resolver contract with the specified coin type.Resolvers implementing this interface may utilise a fallback strategy regarding backward compatibility.
addr
to the resolver contract with the specified coin type.chainAddr
to the resolver contract.System of mapping names to network and content addresses.
function contenthash(bytes32 node) external view returns (bytes memory);
node
: the namehash of the domain to query for.<protoCode uvarint><value []byte>
.
protoCode
s and their meanings are specified in the multiformats/multicodec repository.
When updated emits:
event ContenthashChanged(bytes32 indexed node, bytes hash);
Interface ID: 0xbc1c58d1
Specification: EIP-1577
Deprecates: content
and multihash
fields.
Resolution protocol:
contenthash
to the resolver contract.Resolvers implementing this interface may utilise a fallback strategy regarding backward compatibility.
contenthash
to the resolver contract.multihash
to the resolver contract.content
to the resolver contract.Easy lookup of contract interfaces by callers
function ABI(bytes32 node, uint256 contentType) constant returns (uint256, bytes memory);
node
: the namehash of the domain to query for.contentType
: a bitwise OR of the ABI formats accepted by the caller.(0, "")
is returned if the domain has no ABI specified, or does not support any of the requested formats.The currently recognised encodings are described in ABI encodings section EIP-205.
When updated emits:
event ABIChanged(bytes32 indexed node, uint256 indexed contentType);
Notice that the updated content is not emitted. It requires an extra query to get the resource record when logged, but saves gas setting it.
Interface ID: 0x2203ab56
Specification: EIP-205
Resolution protocol:
ABI
to the resolver contract with a bitwise OR of the ABI formats accepted by the caller.(0, "")
.Permits the lookup of SECP256k1 public keys.
function pubkey(bytes32 node) constant returns (bytes32 x, bytes32 y);
node
: the namehash of the domain to query for.(0, 0)
value is returned if the domain has no pubkey specified.When updated emits:
event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y);
Interface ID: 0xc8690233
Specification: EIP-619
Resolution protocol:
pubkey
to the resolver contract.(0, 0)
response.Permits the lookup of arbitrary key-value text data.
function text(bytes32 node, string key) constant returns (string text);
node
: the namehash of the domain to query for.key
: the text data key to query.For supported keys refer to the initial recommended keys section of EIP-634.
When updated emits:
event TextChanged(bytes32 indexed node, string indexed indexedKey, string key);
Interface ID: 0x59d1d43c
Specification: EIP-634
Resolution protocol:
text
to the resolver contract with the specified key.Defines a method of associating contract interfaces with domains and addresses, and of discovering those interfaces.
function interfaceImplementer(bytes32 node, bytes4 interfaceID) external view returns (address);
node
: the namehash of the domain to query for.interfaceID
: The EIP 165 interface ID to query for.When updated emits:
event InterfaceChanged(bytes32 indexed node, bytes4 indexed interfaceID, address implementer);
Interface ID: 0xb8f2bbb4
Specifitcation: EIP-1844
Resolution protocol:
interfaceImplementer
to the resolver contract with the specified interface ID.Resolvers implementing this interface may utilise a fallback strategy. This strategy has nothing to do with backward compatibility.
interfaceImplementer
to the resolver contract with the specified interface ID.addr
to the resolver contract and query supportsInterface
to the given contract address.Go to top