Managing Names
Reverse Resolution
While 'regular' resolution involves mapping from a name to an address, reverse resolution maps from an address back to a name. EVMNS supports reverse resolution to allow applications to display EVMNS names in place of hexadecimal addresses.
Reverse resolution is accomplished via the special purpose domain addr.reverse and the resolver function name()
. addr.reverse is owned by a special purpose registrar contract that allocates subdomains to the owner of the matching address - for instance, the address 0x314159265dd8dbb310642f98f50c066173c1259b may claim the name 314159265dd8dbb310642f98f50c066173c1259b.addr.reverse, and configure a resolver and records on it. The resolver in turn supports the name()
function, which returns the name associated with that address.
EVMNS does not enforce the accuracy of reverse records - for instance, anyone may claim that the name for their address is '123.evm'. To be certain that the claim is accurate, you must always perform a forward resolution for the returned name and check it matches the original address.
Most libraries provide functionality for doing reverse resolution:
Transferring a Name
In EVMNS, each name has a designated owner. This owner, whether it is an account or a contract, is granted the exclusive authority to modify the name within the EVMNS registry. The owner of a name has the capability to transfer ownership to any other account, enabling a smooth transition of control.
Updating Records
To modify the resources associated with an address and the way it resolves, it is essential to update the records of that name in its respective resolver.
Each resolver may have its own mechanism for updating records, but a widely used standard method is implemented by the public resolver, along with many other resolvers. Several libraries offer built-in functionality to facilitate updating a resolver's records using this standardized interface.
Updating the Address Record
Updating Other Records
Some libraries - presently only web3.js - support updating other record types, such as content hashes and text records, using the same pattern. For example, to set or update a text record:
Updating multiple records in one transaction
Public Resolver has multicall
that permits users to set multiple records in a single operation.
Configuring Reverse Resolution
While 'regular' resolution involves mapping from a name to an address, reverse resolution maps from an address back to a name - or other metadata. EVMNS supports reverse resolution to allow applications to display EVMNS names in place of hexadecimal addresses.
Before this can be done, the owner of the address has to configure reverse resolution for their address. This is done by calling the claim()
method on the reverse resolver, found at the special name 'addr.reverse'.
Last updated