web3 tutorial [04/10] - metamask: setting up an ethereum wallet

by parttimelarry

What is MetaMask

Metamask is the the most popular Ethereum wallet with tens of millions of active users. It allows users to interact with Decentralized Finance (DeFi) dapps like Uniswap and Aave as well as NFT marketplaces like OpenSea or LooksRare.

It is also preferred by dapp developers since it allows you to easily create test accounts and connect to Ethereum testnets. We will be using this functionality extensively to test our web3 dapp during development.

MetaMask is a self custody wallet. This means that you own your keys and it is your responsiblity to protect them.

Set Up Metamask

Download and Install the Extension

Metamask is distributed as a browser extension. To get started, go to the MetaMask homepage and download and install the extension. We will be using the Chrome extension in this tutorial.

Download Metamask

Once we have installed the extension, it is helpful to pin the extension in Chrome so that it is easily accessible.

Pin Metamask Extension

Create a New Wallet

Once the extension is installed, click Get Started. MetaMask will walk you through the process of importing an existing wallet or creating a new wallet. We will create a new Wallet for this tutorial.

Create New

Recovery Phrase

MetaMask will prompt you to create a password and will generate a Secret Recovery Phrase. This 12 word phrase allows you to recover your private key. This means that anyone who has your seed phrase can access your wallet and all of your assets. Write this down and never give it to anyone.

Write Down Seedphrase

Connect to a Dapp

Once your wallet is set up, you can give it a quick test by connecting to a popular dapp like Uniswap.

Connect Wallet

When you click Connect Wallet, MetaMask should prompt you to choose an account. We will write the code for a Connect Wallet button when we build the user interface for our app.

Choose Account

Ethereum Testnets

MetaMask allows you to connect your wallet to Ethereum testnets like Rinkeby, Ropsten, Kovan, and Goerli. This is important because we want to test our application on a testnet before deploying to Ethereum mainnet. To enable test networks, go to Settings -> Advanced in MetaMask and flip the switch under Show test networks:

Copy Address

Then click the dropdown where it says Ethereum Mainnet. Click show test networks and select the Goerli Test Network.

Copy Address Copy Address

Test Ether

We don’t want to exchange our hard earned fiat money for Ether just to test our application. We can obtain Testnet Ether from a faucet. Since we are using the the Goerli Testnet, we can use the Goerli Faucet to request some funds. Using a Twitter account, tweet your Ethereum address and paste the link into the textbox.

Tweet Ethereum Address

Then select an amount of Ether to receive:

Copy Address

The Ether should arrive in your wallet shortly:

Copy Address

Next steps

Now that we have our wallet set up, we are ready for the next section! In part 5, we will deploy our smart contract to the Goerli Testnet using Alchemy.