Day 3: Make your first web3 purchase on ENS

CORE CONCEPTS

Yesterday’s activity taught you about managing your own private keys - the first step to doing things with Ethereum apart from just holding it in a centralized exchange and hoping it goes up in value. Today we’re going to connect with Ethereum and purchase something on a decentralized app (“dapp”). You’ll also learn about gas - the cost of doing business on a decentralized blockchain.

Ethereum Naming Service (ENS)

ENS is a distributed, open, and extensible naming system based on the Ethereum blockchain. Its job is to map human-readable names like “cerv1.eth” to machine-readable identifiers such as Ethereum addresses.

ENS has similar goals to DNS, the Internet’s Domain Name Service, but has significantly different architecture due to the capabilities and constraints provided by the Ethereum blockchain.

In today’s activity, you will purchase your own ENS domain name. It’s a bit like buying a domain name on godaddy.com or domains.google.com. You want something that’s unique and meaningful to you. Most of the three-letter ENS domains (eg, “abc.eth”) and popular words (eg, “pizza.eth”) have already been snatched up.

I’m going to register the name “14days.eth”.

Connect with Ethereum

Using your browser that has the MetaMask extension, go to ens.domains.

[If you are doing this on mobile, then open MetaMask, tap on the app’s hamburger menu, and then tap “Browser”. A barebones browser will appear and you can type in the url ens.domains.]

You’ll get a landing page that looks like this. Click the “Go to app” button.

The ENS landing page
The ENS landing page

You will then be prompted with a button to “Connect” and a pop-up showing different wallets you can connect with.

Connect to your MetaMask Wallet
Connect to your MetaMask Wallet

Select MetaMask. Then, your browser extension will send you a notification that should look like the left screenshot below. This is a request from the ens.domains site to interact with your wallet address.

Connect and "sign" your first transaction
Connect and "sign" your first transaction

Click “Next” and “Connect”. This is a way of signing your transaction and giving the ENS app access to your wallet data for as long as you remain connected to the site.

🎉 Congratulations 🎉

You have just logged in with Ethereum to your first decentralized app! No email, no username/password - just your wallet address.

You should also see on the top left of the landing page that your are connected to the network. (Refresh the page if you need to.)

Your wallet is connected to the site
Your wallet is connected to the site

Now you just need to choose a domain name. In my case, I will use “14days.eth” which is still available. I’m going to register it for three years for a price of 0.005 ETH.

Prepare to register your ENS domain
Prepare to register your ENS domain

What you’ll see is that the cost of registering looks cheap - but there’s a 0.020 ETH max gas fee.

What are gas fees?

Here’s a short detour on gas fees, starting with this explanation from the Ethereum Foundation docs:

Gas fees help keep the Ethereum network secure. By requiring a fee for every computation executed on the network, we prevent bad actors from spamming the network. In order to avoid accidental or hostile infinite loops or other computational wastage in code, each transaction is required to set a limit to how many computational steps of code execution it can use. The fundamental unit of computation is "gas".

High gas fees are due to the popularity of Ethereum. Performing any operation on Ethereum requires consuming gas, and gas space is limited per block. Fees include calculations, storing or manipulating data, or transferring tokens, consuming different amounts of "gas" units. As dapp functionality grows more complex, the number of operations a smart contract performs also grows, meaning each transaction takes up more space of a limited size block. If there's too much demand, users must offer a higher tip amount to try and outbid other users' transactions. A higher tip can make it more likely that your transaction will get into the next block.

Much more could be said about gas fees, but here are a few important things to remember:

  • Gas fees are a necessary cost of using a decentralized blockchain.
  • Gas fees don’t go to the dapp developer - they go to nodes on the Ethereum network.
  • Gas fees can be minimized by trying to perform transactions at off-peak hours. See here for a live gas tracker so you can see fluctuations at different times of the day.
  • Gas fees are only estimates prior to submitting a transaction request to the network. The actual amount of gas needed to perform the transaction will be different. You can adjust the gas limit allowed for your transaction, BUT your transaction may fail if you put a figure that is too low. Therefore, it’s strongly recommended not to modify the gas limit unless you know what you’re doing.

Now that we’ve completed our necessary detour to explain gas fees, let’s proceed with our purchase.

Purchase your ENS name

Click the Request to register button and once again MetaMask will pop up with a prompt to Confirm the transaction. This transaction is necessary to confirm that no one else is trying to register the same ENS name as you are right now.

MetaMask will prompt you to Confirm the transaction
MetaMask will prompt you to Confirm the transaction

Once you click Confirm, you’ll see that the transaction is pending.

Wait one minute for the transaction to execute
Wait one minute for the transaction to execute

After a minute or so, the dapp will update to show that (hopefully) the name is still available and you can proceed to completing registration.

Click Register to complete registrationJus
Click Register to complete registrationJus

Just like last time, you’ll need to Confirm your transaction. This time you’ll see that the app is charging you approximately $5.52 in ETH plus up to $30.34 in ETH gas fees.

Yep, gas is expensive.

Confirm your second transaction
Confirm your second transaction

Once again, the main page will update to show that your transaction is pending. This should take up to 10 minutes to go through.

Wait for your registration transaction to execute
Wait for your registration transaction to execute

Come back a few minutes later and you should see the following screen.

Your purchase of an ENS name is complete
Your purchase of an ENS name is complete

🎉 Congratulations again! You just made your first web3 purchase.

Don’t click the “Set as Primary ENS Name” button just yet. (We’ll be doing that tomorrow.) Instead, click the Disconnect button.

You’ll be booted out of the site and see a screen that looks like this.

Hello stranger
Hello stranger

If you click on the Details button, you’ll see information about your transaction. The registrant, controller, and ETH address will all match your public key. This is proof to the entire world that this domain name is yours.

Your proof of purchase
Your proof of purchase

If you click on your MetaMask extension, you’ll also see the record of your transactions in your wallet activity.

Records of your two transactions on the ENS dapp
Records of your two transactions on the ENS dapp

Recap

Let’s do a quick recap of what just happened.

  • Instead of logging in with username / password, you connected with your wallet
  • Instead of entering a credit card, you signed a transaction with your wallet
  • Instead of interacting with a payments API, a credit card, and a bank, you paid a gas fee to a decentralized network of computers to verify your transaction
  • Instead of getting an order number and receipt via email, you got a transaction record on a public blockchain that anyone can view
h/t @chhlss 
h/t @chhlss 

Hopefully the picture of why web3 is so different is starting to come into focus: it’s both a new money layer and a new identity layer for the Internet.

Further reading:

Subscribe to Carl Cervone
Receive the latest updates directly to your inbox.
Verification
This entry has been permanently stored onchain and signed by its creator.