ENS Integration Best Practices

makoto_inoue
5 min readApr 27, 2021

--

Now that we have over 200 services integrated with ENS, here’s a showcase of some dapps that use ENS well.

Here are three ways to integrate with ENS we highlight in our docs, and this post will follow the same format.

1. Resolving ENS names

The first step to supporting ENS in your application is making your application understand ENS names, and accepting them anywhere an address is accepted. This is especially useful in wallets.

Forward resolution on myetherwallet.com

Etherscan is one of the most widely used Ethereum websites where you can inspect all your transactions and balances. In addition to searching for ENS names, one less known feature is that their URL supports ENS name so you can type “/address/matoken.eth”.

When someone asks for my Ethereum address, I always give them my ENS name, but not everyone knows what ENS is and how it works. If you have multiple Ethereum addresses, giving the full Etherscan URL with your name is a good way to bridge the knowledge gap. It’s super easy for you to type/paste the Etherscan URL with your ENS name without wondering which 0x address is used for which purpose and the recipient doesn’t even have to know what ENS is.

2. Reverse Resolution

The second level of ENS integration involves using reverse resolution to display ENS names wherever your app currently displays addresses.

This can be achieved at three levels.

2.1 Show own ENS name when the user logged in

Uniswap shows your ENS name as if it is your username. Again this helps users who juggle multiple Ethereum addresses as it is very obvious which account you are currently connected as.

2.2 Show ENS name of the asset owner/creator

This is especially relevant for NFT marketplaces where a blockchain is used to prove the provenance of the art. Each NFT marketplace has its own username but your username on Foundation won’t be shown when listed on OpenSea nor Rarible.

But the ENS name displayed on KnownOrigin is also shown on OpenSea. In other words, ENS names can be portable usernames.

Unfortunately not all NFT marketplaces support this, but this is very important for NFT artists when it comes to promoting your on-chain brand and identity.

If you are on another NFT platform and ENS is not integrated, please suggest them to integrate as it is your self-sovereign identity. Not your ENS name, not your on-chain name!

2.3 Show ENS names on a list of Ethereum addresses

The list of Ethereum addresses could be a transaction history, list of asset ownership, DAO membership, voting, and so on.

Snapshot shows the voting result first using their own platform-specific username, but falls back to ENS name if user hasn’t set one up.

3. Let Users Name Things

The final step for comprehensive ENS integration is to facilitate associating ENS names with resources created by or managed with your application. This can take two forms:

3.1 Name Registration

By obtaining an ENS name for your product and allowing users to easily register subdomains, you can provide users with an easy way to name resources created in your DApp.

A couple of wallet providers such as Argent and Authereum used to generate subdomain under their ETH name but the recent gas/eth price surge made it unsustainable to keep covering the gas fee (this will be alleviated with a L2 spec we’re working on). Instead of giving them away for free, Status sells their subdomain with their $SNT token.

An even more innovative approach is Decentraland. They not only issue subdomains under dcl.eth but they also turned them into NFT just like .eth names so that users can trade their subdomains on the secondary markets like Open Sea.

3.2 Name Updates

By providing users with an easy way to update a name they own to point at your application’s resources, users can assign names they already own to your DApp’s resources.

SnapShot again makes use of ENS to create their space, such as https://snapshot.org/#/gnosis.eth

They make use of the ENS Text record where you specify the IPFS endpoint.

Extra: Cross-chain support

Even though we now support over 100 blockchain address types, it comes down to each wallet to integrate our feature so that users can make use of it.

Nifty.ink is an NFT doodling service deployed on xDAI, and they are heavily integrated with ENS.

We are currently working on ways to support L2, and the gist of the architecture is to allow anyone to query ENS name on L1 while allowing users to update ENS record on L2 to save gas.

Even though we haven’t come up with easy ways to update record from side chains, it will remain good practice to read ENS information from L1 directly.

Summary

We showcased several Dapps which integrated with ENS and provides user-friendly UI to end-users. Even though it will be difficult to support everything, every wallet should support “1. Resolving ENS names”, every defi project should support “2.1 Show own ENS name when the user logged in”, and every NFT platform should support “2.2 Show ENS name of the asset owner/creator”.

To find out more detail about how to integrate, please read our front end design guideline.

Follow us

--

--