Skip to main content

Type a word from a question or an article title.

2 · Practice

ENS - readable names instead of long Ethereum addresses

What ENS and .eth names are, how a name turns into an address, why it is convenient yet risky, how reverse resolution works and how to verify an address.

4 min readUpdated:
In this article

The address 0x6462DDDc0a3D893A7C17f94410e2d27162a390aD is impossible to remember, and a mistake in one character costs money. ENS (Ethereum Name Service) solves this the way DNS does on the ordinary internet: instead of a numeric address you use a name like anna.eth. The basics about addresses are in the article wallet and keys.

The DNS analogy

When you open a website, the browser asks the DNS service: "what is the IP of example.com?" ENS does the same for the blockchain: "what is the address of anna.eth?" The difference is that the name registry is a smart contract, and a name is owned by whoever controls the corresponding wallet, not by a registrar.

How it works

  1. The Registry - a contract that stores an owner and a "resolver" for each name.
  2. The Resolver - a contract that answers "what is the address for the name?" It also stores other records: addresses on other networks, text, a website link, an avatar.
  3. The Registrar - a contract that sells .eth names for a term (usually by the year) for a fee.

A name is turned into an identifier through namehash - the recursive application of a hash function: so anna.eth becomes a 32-byte number by which the registry finds the record.

.eth names are NFTs (tokens overview): a name can be transferred, sold or gifted.

What a name can store

  • an address for receiving ETH and tokens;
  • addresses on other networks;
  • text records: email, website, Twitter, description;
  • an avatar;
  • a content hash for a decentralised website.

Reverse resolution

Besides "name to address" there is a reverse record: "address to name". Thanks to it block explorers and apps show anna.eth instead of a long string. The address owner picks the primary name for it.

Subdomains

The owner of company.eth can hand out anna.company.eth, bob.company.eth without repeated registration. Companies use this for employees and projects.

Convenience and risks

Convenient:

  • easy to remember and dictate;
  • less chance of a typing error;
  • one profile across different services.

Risks:

  • A name can be changed. The owner can change the address it points to. If you saved anna.eth in an address book, today and tomorrow it may lead to different addresses.
  • Expiry. If the owner did not renew, the name expires and someone else can take it.
  • Lookalike names. anna.eth and a version in which one letter is swapped for an identical-looking one from another alphabet look the same. This is a homograph attack; good wallets show warnings, but not all do.
  • Interface-side substitution. If you work through an untrusted site, it can show one name and send to another address.

How to get a name and what it costs

.eth names are registered through the official ENS app (check the site address against a bookmark or documentation: fakes are common here, see phishing).

  1. Check whether the name is available.
  2. Choose the registration term (from one year).
  3. Confirm two transactions: first a "commitment" (commit), then, after a short wait of about a minute, the registration itself (register). This scheme is needed so that an observer in the mempool cannot grab the desired name (MEV and front-running).
  4. Set the primary name for your address (the reverse record) - one more transaction.

The cost depends on the name's length: the shorter, the more expensive per year. By the latest known data, names of five or more characters cost on the order of a few dollars a year, while very short ones cost much more; check exact prices in the app. Gas for each transaction comes on top. Do not forget to renew the name: after the term and a grace period end it becomes available to everyone.

ENS and deals

The escrow contract always stores addresses, not names (how an offer works). A name is merely a convenient wrapper in the interface. So when agreeing a deal, it helps the parties to compare the final addresses of the counterparty and the guarantor.

Example

Anna and Boris agree on a deal. Boris dictates his address by phone: forty-two characters is almost a guaranteed mistake. Instead he says: "My address is boris.eth". Anna enters the name, her wallet shows the address 0x3b1…, and Boris checks it in his own wallet: it matches. The deal can be created.

More on how scammers exploit lookalike addresses is in the article phishing and address poisoning. To find an address on the blockchain quickly - a block explorer.

Mentioned in

Ready to try it?

Create your first deal in a couple of minutes. The money is locked in a smart contract and paid out by rules you can see in advance.