project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

ENSEverywhere

Buy, trade, and bridge ENS domains on L2s with the same cheap gas fees you would expect from L2s

ENSEverywhere

Created At

ETHOnline 2022

Winner of

🏆 ETHOnline Finalist

🏗 Optimism — 🥇 Best NFT Infrastructure

🔟 Optimism — Top 10

🗿 ENS — Obelisk

🏊‍♂️ NFTPort — Pool Prize

🏊‍♂️ XMTP — Pool Prize

Project Description

One of the most successful products on Ethereum is ENS domains. Not only has it proven itself as a key piece of the future of the internet and decentralized usernames, but it's also one of the products capturing the most fees on Ethereum.

As more activity is moving onto L2s, the one thing that has not moved with them is ENS. There's currently no way to register and trade ENS domains on L2s, therefore users must continue paying L1 gas fees to interact with ENS. Although ENS is already working on supporting L2s using off chain data lookups and wildcard domain names, this doesn't solve the use case of registering top-level domains. This is important, as top-level domains are the most popular use-case of ENS, as well as the primary driver of ENS revenue.

To solve this problem we've built ENS Everywhere, which aims to make ENS domains first-class citizens on Ethereum L2s. Users can request domain purchases on Polygon, Optimism, or potentially more chains in the future. Relayers register these domains on L1, and bridge the ENS NFTs back to L2. And by using our new Bulk Registrar contract (described in detail below), we can provide up to 34% savings.

We believe this project can help make ENS domains more accessible to everyone, and continue to grow Ethereum's L2 ecosystem!

How it's Made

ENSEverywhere is built around a relatively simple idea: users make a "bid" to purchase an ENS domain on L2, then a relayer fills that "bid" by purchasing it on L1 and bridging the domain to L2.

However, this leaves one major issue: if the relayer has to purchase the domain on L1, won't they incur the same L1 transaction fees, which must then be passed along to the purchasers? This is indeed true, however we were able to come up with a solution to significantly reduce the L1 fees, allowing cost savings for users.

When a user normally registers an ENS domain, they must send two transactions: a "commitment", which is just a hash stored on-chain, as well as a "reveal" transaction which completes the registration. This process involves many storage operations, which are the most expensive operations to perform on Ethereum.

We were able to develop a "Bulk Registrar" smart contract, which allows a single commitment to register many ENS domain names. By bundling many domain registrations together in a single transaction, we can significantly decrease the gas costs. For example, if we register 10 domains in a single batch, there's a 25.7% cost savings compared to registering all 10 individually. In fact, even registering 2 domains together has a 9.3% savings!

To be used in production, our registrar would need to be approved by the ENS DAO as a supported registrar. We plan on proposing this to the DAO following the hackathon.

The rest of our system is build on-top of this registrar contract. A domain registration follows the following process:

  • A user submits a request to purchase a domain to the L2 smart contract. This request includes a "commitment" hash, and deposits some funds for fee payment. The ENS domain isn't revealed at this time.
  • A relayer sees this request, and creates a commitment on L1 using the L1 ENSEverywere smart contract (which calls the Bulk Registrar contract)
  • The ENSEverywhere smart contract sends the commitment data to L2 using the ENSEverywhere bridge smart contract. We currently support the Polygon bridge (FXPortal) and the Optimism Bridge, but could theoretically build support for any chain with an arbitrary message bridge to Ethereum
  • The L2 ENSEverywhere contract receives the commitment, and processes the first payment from the user to the relayer
  • At this time, the user must share a signature with the relayer, which contains the actual domain name to be registered. This signature is transferred encrypted, off-chain using the XMTP messaging protocol.
  • The relayer sends a second L1 transaction to the L1 ENSEverywhere smart contracts. This transaction registers all domain names, and transfers ownership to the ENSEverywhere smart contract.
  • The ENSEverywhere smart contract sends the registration contracts across the ENSEverywhere bridge to L2
  • The L2 smart contract confirms the domain registrations, processes the second payment from the user to the relayer, and mints an L2 NFT representing the ENS domain!

And that's it! The user now has ownership of an ENS domain on L2, and was able to save money when purchasing the name. If the user wishes, they can redeem this L2 NFT for the primary L1 ENS NFT (although this is not implemented yet).

To facilitate this process we build a simple dapp that walks the user through the process of registereing the domain. The dapp also shows the user all their existing L1 ENS domains (using the NFTPort API), which will allow the user to bridge existing domain names to L2.

One limitation of this protocol in it's current implementation is that, while it allows a user to "own" a domain name on L2, it doesn't allow the user to set values such as the resolved Etheruem address. We plan on solving this using the new EIP-3668 off-chain data lookup standard, which will allow us to store this data on L2.

background image mobile

Join the mailing list

Get the latest news and updates