TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published


NPM version CI Bundle Size Minified Bundle Size Minified Zipped Unstoppable Domains Documentation Get help on Discord

Resolution is a library for interacting with blockchain domain names. It can be used to retrieve payment addresses, IPFS hashes for decentralized websites, and GunDB usernames for decentralized chat.

Resolution is primarily built and maintained by Unstoppable Domains.

Resolution supports decentralized domains across three main zones:

  • Zilliqa Name Service (ZNS)

    • .zil
  • Ethereum Name Service (ENS)

    • .eth
    • .kred
    • .xyz
    • .luxe
  • Unstoppable Name Service (UNS)

    • .crypto
    • .nft
    • .blockchain
    • .bitcoin
    • .coin
    • .wallet
    • .888
    • .dao
    • .x
    • ...

For more information, see our detailed API Referrence.

ENS support

Note: Ethereum Name Service requires installing additional packages otherwise library throws error when trying to resolve ENS domain.

Required packages

  • "bip44-constants": "^8.0.5"
  • "@ensdomains/address-encoder": ">= 0.1.x <= 0.2.x"
  • "content-hash": "^2.5.2"

Installing Resolution

Resolution can be installed with either yarn or npm.

yarn add @unstoppabledomains/resolution
npm install @unstoppabledomains/resolution --save

If you're interested in resolving domains via the command line, see our CLI section.

Using Resolution

Create a new project.

mkdir resolution && cd $_
yarn init -y
yarn add @unstoppabledomains/resolution

Look up a domain's crypto address

Create a new file in your project, address.js.

const { default: Resolution } = require('@unstoppabledomains/resolution');
const resolution = new Resolution();

function resolve(domain, currency) {
    .addr(domain, currency)
    .then((address) => console.log(domain, 'resolves to', address))

function resolveMultiChain(domain, currency, chain) {
    .multiChainAddr(domain, currency, chain)
    .then((address) => console.log(domain, 'resolves to', address, version))

resolve('brad.crypto', 'ETH');
resolve('brad.zil', 'ZIL');
resolveMultiChain('brad.crypto', 'USDT', 'ERC20');
resolveMultiChain('brad.crypto', 'USDT', 'OMNI');

Execute the script.

$ node address.js
brad.crypto resolves to 0x8aaD44321A86b170879d7A244c1e8d360c99DdA8
brad.zil resolves to zil1yu5u4hegy9v3xgluweg4en54zm8f8auwxu0xxj

Find the IPFS hash for a decentralized website

Create a new file in your project, ipfs_hash.js.

const { default: Resolution } = require('@unstoppabledomains/resolution');
const resolution = new Resolution();

function resolveIpfsHash(domain) {
    .then((hash) =>
        `You can access this website via a public IPFS gateway: https://gateway.ipfs.io/ipfs/${hash}`,


Execute the script.

$ node ipfs_hash.js
You can access this website via a public IPFS gateway: https://gateway.ipfs.io/ipfs/QmVJ26hBrwwNAPVmLavEFXDUunNDXeFSeMPmHuPxKe6dJv

Find a custom record

Create a new file in your project, custom-resolution.js.

const { default: Resolution } = require('@unstoppabledomains/resolution');
const resolution = new Resolution();

function resolveCustomRecord(domain, record) {
    .records(domain, [record])
    .then((value) => console.log(`Domain ${domain} ${record} is: ${value}`))

resolveCustomRecord('homecakes.crypto', 'custom.record.value');

Command Line Interface

To use resolution via the command line install the package globally.

yarn global add @unstoppabledomains/resolution
npm install -g @unstoppabledomains/resolution

By default, the CLI uses Infura as its primary gateway to the Ethereum blockchain. If you'd like to override this default and set another provider you can do so using the --ethereum-url flag.

For example:

resolution --ethereum-url https://mainnet.infura.io/v3/${secret} -d udtestdev-usdt.crypto -a

Use the -h or --help flag to see all the available CLI options.

Default Ethereum Providers

Resolution provides zero-configuration experience by using built-in production-ready Infura endpoint by default.
Default Ethereum provider is free to use without restrictions and rate-limits for CNS (.crypto domains) resolution.
To resolve ENS domains on production it's recommended to change Ethereum provider.
Default provider can be changed by changing constructor options new Resolution(options) or by using one of the factory methods:

  • Resolution.infura()
  • Resolution.fromWeb3Version1Provider()
  • Resolution.fromEthersProvider()
  • etc.

To see all constructor options and factory methods check Unstoppable API reference.

Autoconfiguration of blockchain network

In some scenarios system might not be flexible enough to easy distinguish between various Ethereum testnets on compile time. For this case Resolution library provide a special async constructor which should be waited for await Resolution.autonetwork(options). This method makes a JSON RPC "net_version" call to the provider to get the network id.

This method configures only Ens and Cns, Zns is supported only on Zilliqa mainnet which is going to be used in any cases. You can provide a configured provider or a blockchain url as in the following example:

await Resolution.autonetwork({
  cns: {provider},
  ens: {url}

Error Handling

When resolution encounters an error it returns the error code instead of stopping the process. Keep an eye out for return values like RECORD_NOT_FOUND.


Use these commands to set up a local development environment (macOS Terminal or Linux shell).

  1. Install nvm

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
  2. Install concrete version of node.js

    nvm install 12.12.0
  3. Install yarn

    npm install -g yarn
  4. Clone the repository

    git clone https://github.com/unstoppabledomains/resolution.git
    cd resolution
  5. Install dependencies

    yarn install

Internal config

To update:

  • Network config: $ yarn network-config:pull
  • Resolver keys: $ yarn resolver-keys:pull
  • Both configs: $ yarn config:pull

Free advertising for integrated apps

Once your app has a working Unstoppable Domains integration, register it here. Registered apps appear on the Unstoppable Domains homepage and Applications page — putting your app in front of tens of thousands of potential customers per day.

Also, every week we select a newly-integrated app to feature in the Unstoppable Update newsletter. This newsletter is delivered to straight into the inbox of ~100,000 crypto fanatics — all of whom could be new customers to grow your business.

Get help

Join our discord community and ask questions.

Package Sidebar


npm i unstoppable-domain

Weekly Downloads






Unpacked Size

459 kB

Total Files


Last publish


  • lipeng007