How does ENS work?
Updated over a week ago

How does ENS work?

The ENS Registry

At the heart of the ENS protocol lies the Registry, which is where all ENS lookups start.

The Registry is a smart contract on Ethereum which keeps track of the Manager and the Resolver for all names.

As you can see, the Registry can have entries not just for .eth names, but all DNS names (like domain.com or domain.xyz) and subnames too (like sub.name.eth or sub.domain.xyz).

The Manager, as the name implies, is the account that controls that name.

By interacting with the Registry contract, the Manager can update the Resolver, create or update subnames, or transfer the Manager to a new account.

The first step in making an ENS lookup is to retrieve the resolver from the Registry.

Resolvers

A Resolver is a smart contract that “resolves” or “points” an ENS name to records. These records can include an ETH address, other coin addresses like BTC/LTC/etc., text records, and more.

For more information on the various records that can be set, see:

So together, the Registry and the Resolver allow records to be looked up for an ENS name. It is a two-step process. For example, to look up the ETH address for “name.eth”:

User CodeENS RegistryResolver @ 0x1234...1. Retrieve the Resolver fromthe Registry for node "name.eth"2.

Call the Resolver contract to retrievethe ETH address record for node “name.eth”resolver('foo.eth')0x12342...addr('foo.eth)0x2345...User CodeENS RegistryResolver @ 0x1234...

If no Resolver is set in the Registry for the name, then it does not resolve or point to any records.

The .eth Registrar

A Registrar is a smart contract that is given control of a name and issues subnames for it. A registrar can be created with custom rules around registration, like what fees to charge or how many characters a subname is limited to.

The .eth Registrar owns the “eth” node and issues subnames such as “name.eth”. This is also commonly referred to as the “NFT contract” for ENS names, because when a .eth name is registered, the contract will issue an NFT to the Owner.

The Owner is the owner of the .eth name, and the owner of the issued NFT.

The Expiry or Expiration Date is the date and time at which the .eth name will expire.

When a new .eth name is registered, the Registrar will also set the Manager in the Registry to the desired address. Usually this is the same address as the Owner (the owner of the NFT).

However, the Manager may be set to a different address, or perhaps the NFT is later transferred to a different address. If the Owner of a .eth name is different from the Manager, then the .eth Registrar allows the Owner to reclaim (in other words, overwrite) the Manager in the Registry.

The .eth Registrar currently allows names of at least 3 characters to be registered, and has a custom fee structure based on the length of the name. It also allows names to be renewed (in other words, extending the expiration date).

For more information on registering .eth names, fees, and renewals, see:

Did this answer your question?