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.
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”.
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.
You will then be prompted with a button to “Connect” and a pop-up showing different wallets you can connect with.
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.
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.)
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.
What you’ll see is that the cost of registering looks cheap - but there’s a 0.020 ETH max gas fee.
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:
Now that we’ve completed our necessary detour to explain gas fees, let’s proceed with our purchase.
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.
Once you click Confirm, you’ll see that the transaction is pending.
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.
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.
Once again, the main page will update to show that your transaction is pending. This should take up to 10 minutes to go through.
Come back a few minutes later and you should see the following screen.
🎉 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.
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.
If you click on your MetaMask extension, you’ll also see the record of your transactions in your wallet activity.
Let’s do a quick recap of what just happened.
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.