The primary purpose of the Ethereum Name Service (ENS) is to convert machine-readable identifiers such as Ethereum addresses into human-readable names.
The web started out as a decentralized system based on DNS, where anyone could buy, own and manage their domain name and move it from one host to another as needed, with full control and ownership of all underlying data. But how does a decentralized Web3 name service work?
The community has shown a lot of interest in ENS, a new naming service built on top of Ethereum. The Ethereum Name Service is a Web3 blockchain system that allows users to set their own unique and memorable usernames.
Therefore, ENS plans to provide an additional solution to DNS by using Ethereum smart contracts to handle domain name registration and resolution. Using the service, you can give a single name to all your wallet addresses and decentralized websites (DWebs). “alex.eth”, for example, allows you to recognize and quickly locate wallet addresses in a distributed environment.
The registry, registrars, and resolvers are three types of smart contracts in ENS as explained in the sections below.
A single smart contract manages the ENS registry and keeps track of all domains and subdomains. The system has deliberately been kept basic and its sole purpose is to link a name to the resolver that is responsible for it. It also stores the following three crucial data:
The owner of the domain: An external account or smart contract can be the domain owner. The domain owner can update the domain’s resolver and TTL, transfer ownership of the domain to another address, and change the entitlement of subdomains. Domain name resolver: The process of resolving names into addresses is handled by resolvers. Any contract can become a solver if it meets specific guidelines. ENS Namehash: ENS stores names as hashes, which are produced using the “namehash” method. The name hash is calculated by combining the hash of the highest part of ENS domain names (known as “label hash”) with the name hash of the other parts and then doing another hash on it.
A registrar is a smart contract that contains a domain name and can assign subdomain names to users depending on rules (e.g. payment). The ENS team used the Vickrey Auction Registrar and the Permanent Registrar for .eth name registrations.
On May 4, 2017, the ENS team released a smart contract that implemented a Vickrey auction to register names longer than six characters. The Vickrey auction is a type of sealed bid auction where buyers bid without knowing how many other bidders have bid, and the auction winner is the highest bidder who only has to pay the next highest amount.
On May 4, 2019, the ENS team introduced the “permanent registrar” instead of the auction registrar for registering names longer than six characters. The perpetual registrar is designed to operate indefinitely until the registrar contract is replaced due to a serious error. Billing for .eth names has been adapted to an annual rental payment model, where each name is charged $5 per year.
Together with the permanent registrar, the idea of the registrar controller was created to enable name owners to delegate name management. As a result, a name registered by the registrar controller can configure resolver and name records as part of the registration transaction, simplifying the procedure.
Another auction, the Short Name Auction for Remaining Short Names 3–6 in length, started in September 2019. The ENS team used OpenSea, a well-known marketplace for crypto assets, as its auction platform, using the UK auction as its auction method. .
Bids in an English auction are public and bidders can place many bids. The highest bidder will be named and the number of deposits will be the freshman registration fee, which is significantly different from the Vickrey auction period.
The name-to-record mapping is stored in the resolver. The “public resolvers” implemented by the ENS team pre-set eight categories of records (see image below), but ENS can contain all records.
The procedure for resolving ENS names consists of two steps. First, the user who wants to resolve the name must search the registry for the relevant resolver and then get the resolution results from the resolver.