Resolvers

Address Resolver

A crypto address resolver that automatically resolves the owner of a domain on any Ethereum Virtual Machine (EVM) chain without requiring a transaction, saving on gas. The addresses can be redirected if necessary, and if transferred, the address will reset to the token owner. The address resolver is based on EIP-137 (opens in a new tab) and EIP-2304 (opens in a new tab).

Specification

The EIP165 interface ID for this function is 0xf1cb7e06.

function addr(bytes32 node, uint coinType) external view returns(bytes memory);

Coin Types

Below is a table showing some example blockchain coin types supported by this resolver:

Crypto CurrencyCoin Type
Ethereum60
Bitcoin0
Optimism614

Text Resolver

The Text Resolver Contract is based on EIP-634 (opens in a new tab) and stores key-value data against a specific domain or subdomain. The text data may be any arbitrary UTF-8 string. If the key is not present, the empty string must be returned.

Specification

The EIP-165 interface ID of this interface is 0x59d1d43c.

/// @notice Returns the text data associated with a key for a BASED name
/// @param node A nodehash for a BASED name
/// @param key A key to lookup text data for
/// @return The text data
function text(bytes32 node, string key) view returns (string text);

Resolver text records are separate from DNS TXT records.

Generic Records

Generic text records allow you to store basic information about a domain in key-value pairs. Each key represents a specific type of information and maps to a value that is relevant to the domain. Keys must be made up of lowercase letters, numbers, and the hyphen (-). The following are some example records:

  • avatar - a URL/URI to an image used as an avatar or logo
  • description - A description of the name
  • email - an e-mail address
  • location - A generic location (e.g. "Toronto, Canada")
  • phone - A phone number as an E.164 string
  • url - a website URL
avatar = https://example.com/avatar.jpg
description = Decentralized Autonomous Organization
email = contact@example.com
location = San Francisco, USA
phone = +15551234567
url = https://example.com

Service Records

Service text records use a reverse dot notation and are specific to various online platforms, allowing a domain to link directly to social media profiles or other services. The following services are common, which is why recommendations are provided here, but ideally, a service would declare its own key.

  • com.twitter - a Twitter username
  • com.discord - a Discord username
  • com.github - a GitHub username
  • org.telegram - a Telegram username
  • com.instagram - a Instagram username
  • com.linkedin - a Linkedin username

Content Hash Resolver

The content hash resolver is based on the ENS implementation (EIP-1577 (opens in a new tab)). It introduces the field contenthash which allows a wide range of protocols to be supported by BASED names.

Specification

  • Resolvers supporting this field MUST return true when the supportsInterface function is called with argument 0xbc1c58d1.
  • The value returned by contenthash MUST be represented as a machine-readable multicodec. The format is specified as follows: <protoCode uvarint><value []byte>
  • ProtoCodes and their meanings are specified in the multiformats/multicodec repository.
  • The encoding of the value depends on the content type specified by the protoCode.

IPFS Example

  • Binary Format: 0xe3010170122029f2d17be6139079dc48696d1f582a8530eb9805b561eda517e22a892c7e3f1f
  • Text Format: ipfs://QmRAQB6YaCyidP37UdDnjFY5vQuiBrcqdyoW1CuDgwxkD4

Swarm Example

  • Binary Format: 0xe40101fa011b20d1de9994b4d039f6548d191eb26786769f580809256b4685ef316805265ea162
  • Text Format: bzz://d1de9994b4d039f6548d191eb26786769f580809256b4685ef316805265ea162

Reverse Resolution

The main purpose of reverse resolution is to improve the user experience by allowing for more readable and memorable names for blockchain addresses. This is particularly useful for applications where users interact with multiple addresses and need to easily identify and distinguish between them, such as a block explorer.

How it Works

Reverse resolution maps a wallet to its corresponding BASED domain name. To perform a reverse resolution lookup, the application sends a request to the reverse resolver contract with the wallet address as the input. The network then returns the associated BASED domain name for that Wallet.

Specification

This is based on the ENS implementation (EIP-181 (opens in a new tab)). The interface ID of this interface is 0x691f3431.

function name(bytes32 node) view returns (string);