How ENS Works?
ENS is built on multiple contracts. We can see the main contracts on ether scan with all its functions. Each record type like wallets and file hashes implement its own resolver contract.
Step 1: To register in the ENS: ENS registry is the first smart contract. The first smart contract is the ENS registry. It maintains a record of all the registered domains on ENS and stores three critical pieces of information about each domain:
- Domain owner.
- Domain resolver.
- record caching time.
Step 2: To resolve smart contract(convert domain to machine address and vice-versa): The second smart contract is the resolver. The main task is to translate the domain names to machine-readable addresses or to map machine addresses to human-readable names. Mapping the domain to the user, address or any website is the main task of the second smart contract.
Given below is one such dummy example of an address mapped to the ENS domain.
Ethereum address = 0xdeB09Fdg890md42GK6F
ENS domain= foundation.eth
Resolving an ENS name is a two-step process where you first ask the registry for the correct resolver contract and then ask the resolver to return the correct address.
ENS supports reverse resolution, which supports canonical names with Ethereum addresses or metadata like interface descriptions.
What is Ethereum Name Service (ENS)?
Ethereum Name Service (ENS) is a distributed, open, and extensible naming system based on the Ethereum blockchain. Ethereum addresses are harder than IP. Long hex addresses are almost impossible to remember. So the Ethereum name service was created. The job of ENS is to convert human-readable addresses like yourname.eth to machine-readable addresses like veryverylongname.hash.you… that have IP hashes, wallets, smart contracts, etc. The native name suffix is .eth. ENS Ecosystem has wallets like coin base wallets and mycrypto, apps like OpenSea and Etherscan, and browsers like Beacon and EthDNS. The goal is to make easy access to Ethereum-based web for humans similar to DNS.