Jul 24, 2024

What is ENS (Ethereum Name Service)? A Beginners Guide

What is ENS (Ethereum Name Service)? A Beginners Guide

The Ethereum Name Service (ENS) is a chain naming system based on the Ethereum blockchain. Its primary purpose is simplifying interactions within the Ethereum ecosystem by mapping human-readable names to machine-readable identifiers. Put simply, ENS lets you use a memorable name like ‘example.eth’ in situations where you’d previously have used a long, hard-to-remember crypto address.

ENS has many uses. It simplifies cryptocurrency transactions and can serve as an onchain identity service. Most useful for website owners, ENS domains play a pivotal role in onchain web hosting, where they do the same job as the traditional domain name system. It allows web users to enter a domain name in their browser to load an onchain website hosted on a distributed file storage platform, like the Interplanetary File System (IPFS).

However, unlike DNS domains, ENS is onchain, resistant to censorship, and resilient. In this article, we’ll explore what ENS is, how it works, and its role in secure, onchain hosting.

ENS: The Building Blocks

To understand how an ENS domain name works, you should be aware of the system’s key components. These components include the Ethereum blockchain, smart contracts, the ENS Registry, and ENS Resolvers. Let’s explore each of these elements in more detail.

Ethereum Blockchain

You may be familiar with the Ethereum blockchain because of its native cryptocurrency, Ether, or the many other crypto tokens based on the blockchain. However, unlike the Bitcoin blockchain, Ethereum is a general-purpose distributed computing platform. It can run many distributed applications besides crypto tokens, including a name service.

The blockchain ensures ENS records are immutable and secure, making them resistant to tampering, censorship, and downtime.

Smart Contracts

Smart contracts are self-executing programs that run code on the Ethereum network. They are stored on the blockchain and automatically execute when predetermined conditions are met. ENS uses smart contracts to manage the registration and resolution of domain names.

ENS Registry

The ENS Registry is a smart contract that records the domain names and subdomains of the Ethereum name service. It stores information such as the domain owner (the owner’s public key) and, most importantly, the resolver responsible for processing lookups.

ENS Resolvers

Resolvers translate human-readable names into machine-readable addresses, such as Ethereum addresses, content hashes, and metadata. When a name like ‘example.eth’ is queried, a resolver returns the correct Ethereum address associated with that name, or, in the case of onchain hosting, the correct IPFS CID or IPNS address—more on that in the next section.

ENS DAO

The ENS system is governed by a Decentralized Autonomous Organization (DAO) called the ENS DAO. This community-driven entity makes decisions regarding the development, management, and operation of the ENS protocol.

The ENS DAO is composed of ENS token holders who participate in the governance process by proposing and voting on various initiatives, such as protocol upgrades, fee adjustments, and resource allocation. Each member’s voting power is proportional to the number of ENS tokens they hold.

How ENS Translates Names to Addresses

When a user wants to resolve an ENS name to an Ethereum address, the following process takes place:

This process ensures that ENS names can be efficiently translated into their corresponding Ethereum addresses and other records, making it easier for users to interact with the Ethereum network.

ENS and Onchain Hosting

In the case of onchain hosting, we use ENS to translate the human-readable address into a machine-readable address that points to a website’s content. To achieve this, ENS is used with IPFS, a distributed file storage system.

Each site stored on IPFS has a unique content identifier (CID). With the CID, you can retrieve the site from any node in the IPFS network that has a copy. CIDs are immutable, which means you need a new CID every time the site’s content changes. To get around this inconvenience, IPFS has its own name service called the Interplanetary Name System (IPNS).

Here’s how it works with ENS:

Onchain hosting providers oversee the hosting, domain management, and IPNS updates. A compatible browser (or browser plugin) takes care of the lookup. From a site user’s perspective, the experience is much the same as on the traditional web—they enter an address, and the browser loads the page.

By combining ENS with IPFS, users can create and access onchain websites resistant to censorship and single points of failure. The ENS domain acts as a human-readable pointer to the website’s content, while IPFS ensures that the content is stored and distributed.

Comparing ENS with Traditional DNS

To better understand ENS, it’s helpful to compare it with the traditional Domain Name System (DNS) used on the internet.

DNS is a hierarchical system that maps human-readable domain names (e.g., www.example.com) into IP addresses (e.g., 192.0.2.1). When a user types a DNS name into their web browser, DNS servers are queried to resolve the domain name to an IP address, enabling the browser to connect to the correct server and load the requested website.

DNS is a complex, hierarchical network, but the basics of how the domain name system works are as follows.

While a DNS works similarly to ENS, the main difference is the dependence on centralized registrars, registries, and DNS hosting providers. Such dependence can make a site inaccessible if its DNS servers fail or it declines to provide the correct IP address. Because ENS is entirely onchain, it does not have this limitation.

Here are the key differences between ENS and DNS.

Deploy an Onchain Website Today

Fleek makes it easy to host fully onchain websites using an ENS domain and IPFS file storage. We provide everything you need to host censorship-resistant, secure, and resilient sites based on modern web frameworks. Deploy a site onchain today and add an ENS domain.