DomainsIP-3: Reverse Resolution
Specifies a TLD, registrar, and resolver interface for reverse resolution of Ethereum addresses using Domains.
Abstract
This DomainsP specifies a TLD, registrar, and resolver interface for reverse resolution of Ethereum addresses using Domains. This permits associating a human-readable name with any Ethereum blockchain address. Resolvers can be certain that the reverse record was published by the owner of the Ethereum address in question.
Motivation
While name services are mostly used for forward resolution - going from human-readable identifiers to machine-readable ones - there are many use cases in which reverse resolution is useful as well:
Applications that allow users to monitor accounts benefit from showing the name of an account instead of its address, even if it was originally added by address.
Attaching metadata such as descriptive information to an address allows retrieving this information regardless of how the address was originally discovered.
Anyone can configure a name to resolve to an address, regardless of ownership of that address. Reverse records allow the owner of an address to claim a name as authoritative for that address.
Specification
Reverse Domains records are stored in the Domains hierarchy in the same fashion as regular records, under a reserved domain, addr.reverse. To generate the Domains name for a given account's reverse records, convert the account to hexadecimal representation in lower-case, and append addr.reverse.
Registrar
The owner of the addr.reverse domain will be a registrar that permits the caller to take ownership of the reverse record for their own address. It provides the following methods:
function claim(address owner) returns (bytes32 node)
When called by account x , instructs the Domains registry to transfer ownership of the name hex(x) + '.addr.reverse' to the provided address, and return the namehash of the Domains record thus transferred.
Allowing the caller to specify an owner other than themselves for the relevant node facilitates contracts that need accurate reverse Domains entries delegating this to their creators with a minimum of code inside their constructor:
reverseRegistrar.claim(msg.sender)function claimWithResolver(address owner, address resolver) returns (bytes32 node)
When called by account x, instructs the Domains registry to set the resolver of the name hex(x) + '.addr.reverse' to the specified resolver, then transfer ownership of the name to the provided address, and return the namehash of the Domains record thus transferred. This method facilitates setting up a custom resolver and owner in fewer transactions than would be required if calling claim.
function setName(string name) returns (bytes32 node)
When called by account x, sets the resolver for the name hex(x) + '.addr.reverse' to a default resolver, and sets the name record on that name to the specified name. This method facilitates setting up simple reverse records for users in a single transaction.
Resolver interface
A new resolver interface is defined, consisting of the following method:
Resolvers that implement this interface must return a valid Domains name for the requested node, or the empty string if no name is defined for the requested node.
The interface ID of this interface is 0x691f3431.
Future DomainsIPs may specify more record types appropriate to reverse DNS records.
Appendix 1: Registrar implementation
This registrar, written in Solidity, implements the specifications outlined above.
Last updated