What is the Ethereum Name Service (ENS)?

0
760
Ethereum Name Service Logo

What is the Ethereum Name Service (ENS)?

The Ethereum Name Service (ENS) is the decentralized equivalent to DNS, providing domain names managed by smart contracts on the Ethereum blockchain. ENS domains end in .eth (or .test for testnet resources) and can be registered by anyone through interaction with the contracts deployed on the Ethereum main network. In contrast to DNS, this is possible without relying on intermediaries and trusted third parties.

Addressing Decentralized Content

Addressable resources in computer networks are usually represented as numbers at the protocol level. For example, hosts on the Internet are identified by a 32-bit number (or a 128-bit number in the newer IPv6 protocol). We typically come across this addressing scheme in the form of point-separated IP numbers with each number representing a byte of the four-byte address, for example, 192.168.0.1. 

Numbered addressing schemes are very efficient for machines but are not very userfriendly. For this reason, so-called naming services are used to map human-readable names to low-level addresses. For the Internet, the Domain Name System (DNS) provides a centralized service to attach domain names, such as mycryptopedia.com to IP addresses. DNS, built on 1980’s technology, has made browsing the world wide web, sending e-mail, and many other Internet services much more comfortable, but suffers from a number of drawbacks, including security concerns and lack of censorship resistance.

The decentralized web (or Web 3.0), consisting of decentralized services powered by blockchain protocols, is no different to other protocols, in that the underlying addressing schemes are not friendly for human consumption. For instance, interacting with smart contracts using addresses, such as 0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359, is extremely cumbersome. This is also true for other resources in the decentralized ecosystem, such as user wallets and content hashes used to address data on the Swarm or IPFS decentralized storage networks. Therefore, a way to address these resources by human-readable names is required.

Naming Decentralized Resources

The Ethereum Name Service (ENS) is the decentralized equivalent to DNS, providing domain names managed by smart contracts on the Ethereum blockchain. ENS domains end in .eth (or .test for testnet resources) and can be registered by anyone through interaction with the contracts deployed on the Ethereum main network. In contrast to DNS, this is possible without relying on intermediaries and trusted third parties.

.eth domains are most commonly registered for Ethereum addresses, which may be externally owned wallets or smart contracts. However, it is also common to use ENS to address off-chain resources, such as data stored on Swarm. Recently, support for privacy-focused .onion addresses used by the Tor network has been added. Eventually, the team behind ENS plans to support a large number of resources outside the Ethereum ecosystem, including resources on other blockchains and fullying mirroring DNS.

Architecture

ENS Registry
Source: https://github.com/ensdomains/docs

ENS is implemented as a set of smart contracts on the Ethereum blockchain. Its architecture has been deliberately kept simple. A single registry smart contract keeps track of all domain names and links to a resolver contract in charge of interpreting the domain name’s mapped resource address. Apart from the link to the resolver contract, the registry also keeps track of the owner of each domain its time to live for domain name caching. The registry contract’s interface allows domain name owners to perform actions, such as transferring domain ownership, setting resolvers or modifying the time to live property.

Resolver contracts can implement any logic as long as they implement a specific set of standards. Straightforward resolvers simply implement the required methods for the particular resource type. 

One aspect to note is that handling strings is inherently inefficient, particularly in smart contracts. For this reason, ENS uses a hashing algorithm, called Namehash. The actual smart contracts use the hashes of domain names, rather than the human-readable string names. Namehash has been purposely designed to allow for subdomain name derivation. It is hierarchical in nature and knowing the hash of a domain name allows deriving the hashes of its subdomains.

Obtaining .eth Domain Names

Until recently .eth domains could be obtained through an auctioning process. However, since May 2019 the process has been simplfied for domain names with a length of at least seven characters. These domains can be “rented” by paying the equivalent of 5 USD in ETH to the smart contract. 

Shorter domain names, which are considered of high value, are being made available through a reservation system, followed by an auctioning process. The idea is to allow the owners of short DNS domains to secure their claim to the equivalent .eth domain before it is auctioned off. After both, the reservation and auction process, have ended, the remaining short names will become publicly available. 

ENS Governance 

ENS, like many other projects in the blockchain ecosystem, is open source and community-driven. However, it is essentially just another decentralized application, maintained by individuals. This means, that funds received through domain renting have to be managed by someone and rules have to be defined and evolved through certain processes. Currently, ENS governance is achieved through a multi-signature smart contract. Signatures are held by a number of well-known Ethereum community members.