dapp development

An Introduction to MetaMask

5640 VIEWS

·

If you have any interest in Ethereum dApp development or want to see how Ethereum transactions work without running a full Ethereum node, then MetaMask is a great tool for you. Ethereum is available (as pictured above) as an extension on Google Chrome, Firefox, Opera, or Brave. Whichever browser you choose, you should have a good experience with MetaMask.

With MetaMask, you can leverage multiple Ethereum testnets and the Ethereum mainnet to work with dApps on the browser. This extension tool allows a developer to confirm the functionality of a dApp and allows users to conduct transactions through the browser. This extension works as a bridge between the browser and the Ethereum blockchain, but it also has functionality similar to an Ethereum wallet.

Why MetaMask is great for dApp development

MetaMask allows you to execute Ethereum operations, including identity management, signing transactions, and managing multiple accounts over multiple networks (including the mainnet, Ropsten, Kovan, and Rinkeby). You can also run your dApp through a localhost (8545), and you can create a custom RPC (remote procedure call) endpoint.

This browser-based Ethereum “hub” completes transactions and can help a developer track the progress of their dApp. Whether you are creating a simple UI that uses Web3 to interact with a small smart contract, or a full-featured, mainnet-ready dApp, MetaMask can handle transactions as if you had your own node. In learning dApp development, being able to work with an app on the browser while in development with this tool allows a quick view of transaction information, including contract deployments and any contract methods.

The vault

What makes MetaMask useful for dApp developers and anyone using Ethereum through dApps on the browser is the Vault. It allows you to store account information across different networks and it is secured by a mnemonic phrase (from an HD Wallet) and password to secure your account numbers and balances. To access the vault, you would have to get your phrase from your wallet. You can also use a test wallet and generate the corresponding phrase through Ganache CLI, which is a great RPC client for testing through the development of a dApp.

Your accounts

 

You can see your accounts easily on MetaMask — listed by account number — along with the ether balance. You can also hover your mouse over the account number above the Ethereum logo to copy the account number to the clipboard (which is especially useful to place into arguments in a Web3 method).

You can also import additional accounts, create a new account, and even connect a hardware wallet. The flexibility to manage accounts over networks gives a developer and enthusiast an opportunity to interact with dApps through testing or live production use. For those enthusiasts and customers looking to immediately buy some ether while in a dApp, this can be done using Coinbase or ShapeShift, and there is the option to directly deposit Ether. (Always be sure to check which network you are in before you purchase and conduct transactions through MetaMask.)

Approving/signing transactions

Approving transactions is easy on MetaMask. Thanks to the UI, the transaction process is really easy to see (the total ether that you will spend both in ETH and the conversion to US Dollars). The approval process is also key in checking how much gas you spend on a given function from a smart contract before executing it (useful during development). For the consumer, this is also a check to ensure that they are good to sign off on a transaction of ether.

Things to keep in mind

There are clear advantages to using MetaMask, especially if you are learning about Ethereum and dApp development. MetaMask is growing in popularity, and has been used in demos for dApp development. However, it is still a browser extension, which means that even though your private key is locally stored, other information on your usage may be collected.

I still think it is a great tool, and it has a quickly growing community in the Ethereum space. As far as wallet usage, this is trickier. I have not used MetaMask with actual ether yet, but if I do, I will do so with a small amount that I am not afraid of losing. Using MetaMask with ether generated by testnets is a safer way to put your dApp through transactions while in development. It’s always good advice to keep the majority of your ether in a secure hard wallet.

Don’t let these issues scare you. The community is vibrant and helpful, and MetaMask could be a great tool for you as you continue to learn the Ethereum blockchain.


Phillip Lorenzo is a recent graduate of Learners Guild, an apprenticeship program in Oakland, CA. Before beginning his journey to code, Phil was in nonprofit arts management and was also pursuing a filmmaking career. He started coding last January, and hasn’t looked back since.


Discussion

Click on a tab to select how you'd like to leave your comment

Leave a Comment

Your email address will not be published. Required fields are marked *

Menu
Skip to toolbar