Rootstock (RSK) Address Resolution guidelines
Resolving an Rootstock (RSK) address associated to a domain consist of 4 steps:
-
Obtain the identifier of the domain.
-
Get the domain's resolver contract.
-
Detect if contract supports
addr(bytes32)
interface via ERC-165 interface detection.Use
supportsInterface(bytes4)
with interface ID:0x3b3b57de
-
Query for address resolution.
Use
addr(bytes32)
with the domain identifier.
function getAddr(domain) {
const node = namehash(domain)
const resolver = rns.resolver(node)
if (!resolver.supportsInterface('0x3b3b57de'))
throw;
return resolver.addr(node);
}