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.
Once we have installed the extension, it is helpful to pin the extension in Chrome so that it is easily accessible.
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.
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.
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.
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.
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:
Then click the dropdown where it says Ethereum Mainnet. Click show test networks and select the Goerli Test Network.
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.
Then select an amount of Ether to receive:
The Ether should arrive in your wallet shortly:
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.