Ethereum Name Service (ENS) is now available for the Energy Web

Adam Z. Nagy
Apr 23, 2020 · 6 min read
Allie Smith | Unsplash

We believe that in order to achieve mainstream adoption of decentralized solutions, they should be as user-friendly and down-to-earth as possible. But if we’re honest, the blockchain sector still largely caters to a niche of tech savvy people who are comfortable juggling things like hexadecimal addresses and private keys. It’s a landscape where a seemingly simple typo in an address could cause all sorts of potential problems.

For starters, good luck explaining to your grandma-level end user (or conservative energy-industry corporate executive) that ‘0x17E639952c6F98039E75D11Be884792209F26170’ is now their account… And no, it’s not opened in a bank. It’s a... umm… hash thingy, whatever, and you have to save long, scary strings of characters somewhere safe otherwise ‘bad things’ will happen.

Oh, they want to send funds or interact with a dApp? And that process works with something called Metamask?

You get the idea.

Ethereum account management problems | Source

UX is king, regardless of technology. If you want to build successful products you have to understand that. Nowhere does that become more apparent than the difference between alphanumeric addresses and people-friendly names. This is true for blockchain-based solutions, too.

It is really unconventional how we interact with a blockchain compared to what we are used to. This is why we are constantly on the lookout for projects that try to bridge this gap and welcome it with open arms: multisig wallets, mobile wallets, recoverable accounts, safes, gas relays, and now... the Ethereum Name Service (ENS).

What is ENS for?

ENS lets you name things. Things that can be stored in smart contracts — addresses, keys, hashes, texts, and links — so you can refer to them in the ‘friendly’ name of your choice instead of what they really are: inhumanly long character strings. 😃 In other words, ENS allows you to put ‘ugly’ stuff in nicer packaging, thus boosting user experience and on-boarding with blockchain-based solutions.

ENS is to decentralized web3 what the Domain Name System (DNS) is to traditional web2. For example, to navigate to our website you can type the friendly energyweb.org address into your web browser instead of its hard-to-remember, not-people-friendly IP address 104.26.12.227. Similarly, if an Ethereum-based blockchain supports ENS, you can type adam.ewc in your wallet to send me tokens instead of ‘0x74dd76E24B2CFB43C1b1a4498295d553D0843746’. Friendlier, isn’t it? This is just a simple example. Naming addresses is not the only use case.

What does ENS look like?

I would describe ENS as encompassing two things: 1) a system of smart contracts and 2) a protocol that describes how resources are managed, stored, and named. It is an awesome open-source project that has been in development for a few years now and it is one of the most-popular projects on Ethereum.

We ported it to our two chains—our Volta testnet and our production Energy Web Chain. Moreover, we also forked the original ENS manager app to add support for them and make name management a breeze. On our chains you can buy names that end with .ewc, which is our chosen supported top level domain (TLD).

ENS in a nutshell

How to use ENS?

Using ENS is the same on all Ethereum-based networks. In essence you have to interact with the ENS registry contracts. The easiest approach is to use our aforementioned Energy Web ENS manager app with a very intuitive, nice UI. You need a Metamask account to do so, which you also use to select the chain to connect to.

  1. Buy a name. You pay with the chain’s native tokens. Prices go from around $5 to $650 (except on the testnet, of course). Short three-letter names are more expensive. Under the hood, Chainlink oracles feed in token prices to the ENS system, which determine how many tokens you pay.
  2. Manage the name. You get plenty of hints and links on how to do it in the manager app. Once you take ownership of the name, you can map resources to it. The manager app allows you to put multiple coin addresses, text-based resources (metadata, URLs, email, Twitter handle, etc.), and content hashes like IPFS. Note that for each name there is a registrant and controller, which do not have to be the same. The registrant is the true owner (aka the admin superuser), but it can delegate the management responsibilities to another account. This is especially useful in corporate environments where the owner account can be kept somewhere secure and management of the name can be delegated to an expert dev team.
  3. Use the name. Once done, you can use your name in dApps. This is the tricky part because registering in the ENS system doesn’t mean that names automatically get resolved to addresses or resources everywhere. dApp developers have to support it and integrate with ENS. This part is their responsibility but there is no reason not to support it. ENS only helps.
The ENS manager app

Subdomains

If you buy a name, let’s say ‘domain.ewc’, you own all of its subdomains too and can configure each one of them as a separate name. Feel free to create as many as you’d like for free, e.g., ‘subdomain.domain.ewc’ or ‘donate.domain.ewc’. You can get creative.

Tip: Let’s say you have a dApp project and acquire ‘myproject.ewc’ for it. When a user registers, you can automatically create ‘<username>.myproject.ewc’ for her, which can already be used as an account for your dApp.

Subdomains page in the ENS manager

How to support ENS in dApps?

ENS is an enabler to create user-friendly dApps. The goal is simple: wherever there is a user input field for a data type that is supported by ENS (Ethereum address, email, etc.):

  1. Detect if the input is an ENS name or not, then…
  2. If an ENS name was entered ,you perform an ENS lookup to resolve it to the appropriate resource.

Technically, resolution of ENS names is a three-step process (described in the original ENS documentation here). As an example, you can look at how our online wallet https://wallet.energyweb.org supports ENS. Typed in an address? Cool! Typed in an ENS name instead? It tries to resolve it to an address. Also cool! Both work.

Why not do the same with email, or user name fields on login pages? This way a user’s ENS name can be like a “universal passport” for many things at once and all they have to do is to remember the name they chose.

Leeloo from 5th Element using ENS

If you want to integrate with Energy Web’s ENS system, or you want to get involved with some more-advanced use cases, you will find all the info and tools you need on our wiki page about ENS.

What are we doing with the funds generated from ENS?

  1. Maintaining ENS infrastructure. Hosting the ENS manager app has costs and Chainlink nodes need to eat.
  2. Reinvesting in projects like ENS (potentially via the EW community fund) to make our chains more useful and user friendly.

What’s next?

Having ENS on our chains unlocks some interesting possibilities. Since you can use it to manage public keys and arbitrary texts, we are looking for ways to connect it with our Decentralized Digital Identities (DID) system. Other than that, we will add support for it in all our dApps. We will also open PRs to various ENS client libraries so they find our ENS contract addresses out of the box.

ENS Resouces

Energy Web Insights

News and articles from the Energy Web community