resolveName
. For example, to look up an account's balance, you can do:EnsResolver
object. For example, to instantiate a contract interface, you can do:resolver()
on the ENS registry, passing in the output of step 1. This returns the address of the resolver responsible for the name.addr()
on the resolver address returned in step 2, passing in the hashed name calculated in step 1.addr()
. To resolve a non-Ethereum address, supply both the namehash and the SLIP44 chain ID of the cryptocurrency whose address you want to resolve. For example, to resolve a Bitcoin address, you would call addr(hash, 0)
. Note that the returned address will be in binary representation, and so will need decoding to a text-format address; for details, see EIP 2304.addr()
.contenthash
is used to store IPFSand Swarm content hashes, which permit resolving ENS addresses to distributed content (eg, websites) hosted on these distributed networks. content-hash javascript library provides a convenient way to encode/decode these hashes.libp2p-key
codec. Decoding with other formats will show a deprecation warning. Please read here for more detail.BTC
), others do not have the built-in support, and you have to call via each coin id (e.g.: 0
for BTC
, 16
for `ETH). For Javascript/Typescript, we have @ensdomains/address-encoder library that allows you to convertencoder
and decoder
Event
or query via ENS subgraph.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.1234....addr.reverse
(where 1234... is the address you want to reverse-resolve), and call the name()
function on that resolver. Then, perform a forward resolution to verify the record is accurate.ReverseRecords
which allows you to lookup multiple names in one function call.