Forward Resolution
You can integrate BNS into your project by following this two step resolution process:
Find the resolver: Every resolution process starts by querying the BNS registry to get the resolver address for the name.
where node
is the namehash (as specified in EIP 137#namehash-algorithm) of the domain name.
Query the resolver: Use the resolver to lookup the resource records associated with the name.
Universal Resolver
As you have seen above, the resolver is the one responsible for resolving the domain name to the desired data. The resolution though is a two step process, and as such, you can use the universal resolver to resolve the domain name to its address in a single rpc call. This is also the way most of the client libraries expect that a resolution should be done.
where:
name
is the dnsEncoded name to resolve.data
is the ABI-encoded call data for the resolution function required - for example, the ABI encoding ofaddr(namehash(name))
when resolving theaddr
record.
Last updated