Reverse Registrar
Reverse resolution, the process of mapping an address (e.g., 0x1234...) to a .vet name, is managed through a special namespace, .addr.reverse
. This namespace is controlled by a specialized registrar, as outlined in EIP 181, which assigns subdomains to callers based on their address.
For instance, the account 0x314159265dd8dbb310642f98f50c066173c1259b
can claim the subdomain 314159265dd8dbb310642f98f50c066173c1259b.addr.reverse
. Upon claiming, it can set up a resolver to reveal metadata, including a canonical name for the address.
The reverse registrar offers functions to claim
a reverse record and a convenience function (setName
) for setting up the record. The latter is primarily used to assign a canonical name to an address.
Interface
pragma solidity >=0.8.4;
interface IReverseRegistrar {
function claim(address owner) external returns (bytes32);
function claimForAddr(
address addr,
address owner,
address resolver
) external returns (bytes32);
function claimWithResolver(
address owner,
address resolver
) external returns (bytes32);
function setName(string memory name) external returns (bytes32);
function setNameForAddr(
address addr,
address owner,
address resolver,
string memory name
) external returns (bytes32);
function node(address addr) external pure returns (bytes32);
}