Edit this page

Smart Contract Configuration Guide

This guide covers how to set Reverse Resolution records for UD domains using smart contracts. This process requires using the ABIs built into the Unstoppable Domains UNS smart contract.

Step 1: Select a UNS Registry Smart Contract

The UNS Registry smart contract is where domain owners store their data and is a map of domain namehashes to key-value dictionaries of records. Choose one of the Unstoppable Registry smart contracts to interact with (either mainnet or testnet).

polygon registry contract

polygon registry contract

Step 2: Open the “Write as Proxy” Tab for the Registry Contract

Navigate to the Contract tab in either the Etherscan or Polygonscan page of the Registry contract and click on the Write as Proxy tab.

Polygonscan write as proxy tab

polygonscan write as proxy tab

Step 3: Connect Your Web3 Wallet

Click on the Connect to Web3 button in the Write as Proxy tab and connect the wallet associated with the domain:

Polygonscan connect wallet

polygonscan connect wallet

Wallet provider list

wallet provider list

Step 4: Generate the Namehash of Your Domain

You can generate the namehash of a domain using any of the Resolution Libraries, Resolution CLI, or Resolution Service. You can also use online tools to calculate the namehash of the domain.

JavaScriptJavaSwiftGolangResolution CLI
const {default: Resolution} = require('@unstoppabledomains/resolution');
const resolution = new Resolution();
let namehash = resolution.namehash("brad.crypto", "UNS");
import com.unstoppabledomains.resolution.Resolution;
DomainResolution resolution = new Resolution();
String namehash = resolution.getNamehash("brad.crypto", "UNS");
import UnstoppableDomainsResolution

guard let resolution = try? Resolution() else {
  print ("Init of Resolution instance with default parameters failed...")

let namehash = try resolution.namehash(domain: "brad.crypto")
package main

import (

func main() {
    uns, _ := resolution.NewUnsBuilder().Build()
    namehash, _ := uns.Namehash("brad.crypto")
    fmt.Println("The namehash for brad.crypto is", namehash)
$ resolution namehash -d brad.crypto

The JavaScript and Java Resolution Libraries require a Naming Service parameter to generate namehashes. This specifies the name service that manages the domain name, and the value must either be "UNS" or "ZNS".

Step 5: Set the Reverse Record

The UNS contract has a setReverse() ABI method that takes in the domain name split by labels and sets its reverse record to your wallet address.

Domain name example.nft will be formatted as ['example', 'nft'] in labels.

Polygonscan setReverse method

polygonscan setReverse method

Add the domain labels of the domain you want to configure Reverse Resolution for in the labels field of the setReverse() method and click the Write button.

Polygonscan setReverse response

polygonscan setReverse response

Step 6: Execute the Contract

Click the Write button to sign the transaction and execute the contract. After signing the transaction, you can view its details on the blockchain explorer, like so:

Reverse record adding transaction

reverse record adding transaction

Now, applications that have integrated Reverse Resolution will be able to show the reverse record for your domains instead of your wallet address.


You have successfully configured Reverse Resolution for your domain using smart contracts. Happy hacking!

Asking For Help

If you are experiencing difficulties using our services, please know that we are here to help. You can join our Discord Community for real-time support from UD and the community, where you can receive assistance with integrating your app