BLOG
Metamask Wallet from the DeFi developer point of view

In today’s cryptocurrency world, the Metamask wallet has become a must-have tool. It and other cryptocurrency software products were released by ConsenSys. By the beginning of 2022, the number of wallet users exceeded 30 million people. This wallet is designed for storing cryptocurrencies, tokens on various blockchains, NFT storage, as well as for interaction with decentralized applications. 

The main product of ConsenSys browser extension Metamask, which can be installed in addition to such browsers: 

  • Google Chrome.
  • Firefox.
  • Brave.
  • Microsoft Edge. 

Metamask apps are also available for use on iOS and Android mobile devices. Originally it was a wallet only for Ethereum cryptocurrency and NFT storage on this blockchain. However, all EVM-compatible blockchains are now supported, as well:

  • Ethereum.
  • Polygon.
  • Fantom Opera. 
  • Avalanche.
  • Optimistic Ethereum.
  • Arbitrum One.
  • Aurora Network.
  • Cronos.
  • Harmony.
  • Celo. 
  • EOS. 
  • BitTorrent Chain Mainnet.
  • Harmony Mainnet.
  • Polis Mainnet.
  • Aquachain. 
  • Expanse Network.
  • Metadium Mainnet.
  • PrimusChain Mainnet.
  • TomoChain.
  • Moonriver. 
  • Theta Mainnet.
  • Callisto Mainnet.
  • Wanchain.
  • Velas EVM Mainnet.
  • Evrice Network.
  • IoTeX Network Mainnet.
  • RSK Mainnet.
  • GoodData Mainnet.
  • Newton. 
  • Lightstreams Mainnet.
  • xDAI Chain.
  • XinFin Network Mainnet.
  • OKExChain Mainnet.
  • GoChain.
  • Meter Mainnet.
  • ThunderCore Mainnet.
  • Fuse Mainnet.
  • Huobi ECO Chain.
  • Energy Web Chain.

To reduce Ethereum’s commission costs, you can choose one of the Layer 2 (L2) blockchains. These include Polygon, Avalanche, and the Optimistic Ethereum network. It is useful to know that stablecoins such as USDT and BUSD can also be stored in Metamask. Keep in mind that you cannot add TRX, Luna, Solana, Aptos blockchain coins to this wallet. You will need separate wallets for these cryptocurrencies. Perhaps, thanks to Snaps technology, this wallet will support many other blockchains not yet compatible with Metamask.

How to use Metamask Wallet 

First you need to install it as a browser extension. Access to user funds is protected by both a password and a passphrase. The order of the words in the passphrase matters. There is a valuable feature such as wallet user authentication using Ethereum mechanisms. This will allow you to connect to and interact with Dapp sites using your wallet. Creating a new ETH, USDT or other cryptocurrency wallet number is no problem. 

The following options are available for your new Metamask wallet: 

  • Network Selection. Clicking on this item displays all available blockchains. 
  • Account selection. Here you can both create new accounts and import existing accounts, as well as switch between them. 
  • Your wallet address. It consists of a unique sequence of mixed letters and numbers. Click on the address to copy it to the clipboard. 
  • Buy, send, exchange. Buttons to perform operations with tokens in your wallet. 
  • Assets and activity. This displays a list of your transactions and all the tokens you’ve added to store in the wallet.  

Metamask has one peculiarity – the wallet “doesn’t see” tokens until you manually add them. So if you don’t see the coins in the wallet, find the “Import Token” tab where you need to specify the name of the token and its other parameters. There are transaction fees, which you can specify small, medium and high. The lower the commission, the more the transaction will go, and if the commission is too low, the cryptocurrency transaction will never complete. To pay commissions, including those associated with NFT, you need to have a small amount in your wallet.   

Metamask built-in exchange 

You can both make cryptocurrency transactions from your wallet by address or account number, and exchange one cryptocurrency for another directly in your wallet. The prices for making the exchange are taken from such decentralized exchanges: 

Uniswap, Totle, AirSwap, 0x, 1inch.exchange.

As when making an exchange on a decentralized exchange, you can specify slippage parameters in the wallet. Usually the amount of slippage when exchanging through the wallet is 2-3%. 

Switching Metamask to Binance Smart Chain will not present any problems for you. Metamask can be turned into a Binance Smart Chain-based digital asset wallet by simply switching to that network. By default, the user is connected to the main Ethereum blockchain first. Similarly, by simply specifying the network parameters, you can switch to any other supported blockchain. It takes a few clicks to do so. 

Thanks to the recent “MetaMask Snap” update, this wallet will soon be able to store bitcoins and other cryptocurrencies that were not previously supported. This is an additional program that runs in an isolated environment and gives you the ability to connect additional APIs, networks, and protocols. Eventually, it will allow interacting with networks that don’t support EVM. And a feature such as a portfolio will show the approximate total value of tokens the user has across all networks. Storing NFT in this wallet can’t be called particularly convenient yet. So, for now, you can’t send from the wallet the NFT you own to someone else’s address. This can be done through OpenSea or a similar marketplace for NFT.  

How to use Metamask testnets

Metamask test networks are indispensable for DeFi developers. Working in test nets does not involve the risk of losing money, so you can safely test all of DeFi’s features.  

Most often developers use such Metamask test networks:

  • Ropsten Ethereum.
  • Rinkeby Ethereum.
  • Goerli Ethereum. 
  • Kovan Ethereum.
  • Binance Smart Chain: testnet. 

However, other blockchain networks supported by this wallet exist in testnet versions. To switch to a test network, just specify its parameters in the connection settings.

Protecting private information in Metamask

There are many security threats in the cryptocurrency world. The main ones are related to the loss of a password or passphrase for accessing funds. Therefore, Metamask users need to remember that the password and passphrase for accessing funds should be stored securely, and to store large sums, use hardware wallets. This wallet has easy integration with Ledger, CoolWallet, KeepKey, and Trezor hardware wallets. And it automatically blocks connections to malicious sites. Overall, Metamask is fairly well protected against hacks, although users have lost money by entering information on a phishing (fake) Metamask site.

Why is Metamask so popular among users? 

The demand for Metamask Wallet is because it is a very simple application that does not require you to download and install anything. It works quickly, combining wallets for dozens of cryptocurrency networks and thousands of different tokens – all password and passphrase protected. At the same time, one cryptocurrency for another can be immediately exchanged directly from the wallet, taking advantage of decentralized exchange technologies. For many users, this browser extension has become a way to discover the world of cryptocurrencies, many of them began to use the digital assets on a regular basis. Among its users are many young people from various countries. According to ConsenSys, users from countries such as the U.S., Nigeria, the Philippines, Germany and Brazil were the most active.  

The security of this wallet is high enough for everyday use. The top blockchains want to be represented in the Metamask wallet. This wallet has already become a real Metamask universe not only for users, but also for software developers. However, in order to program applications using Metamask features yourself, the knowledge at the level of an ordinary user will not be enough. Let’s take a look at the Metamask developer tools and the advanced features available to advanced users. 

Metamask developer tools

There are quite a few tools for creating DeFi applications that use the capabilities of Metamask. A good option is to use the Moralis framework in combination with a code editor (Visual Studio Code or a similar tool). You may need to download and install Node.js. Many applications can be created based on existing and proven code templates.  The skill of downloading and cloning repositories from GitHub comes in handy.  

You don’t need to sync with a full node, which can be time-consuming, to start development.

Try a novelty like the Metamask SDK. It’s a great way to write a Dapp that communicates with a browser extension or a Metamask mobile app. The SDK is planned to allow data exchange with game applications as well. Writing Dapps in JavaScript, React, React Native and other web frameworks is supported.    

Metamask API

The Metamask API includes the Ethereum JavaScript Provider API and the RPC API. Using the API commands will allow the developer to isolate wallet addresses and prevent mass hacking of the system. The Ethereum JavaScript Provider API enables users to sign transactions and otherwise interact with blockchains. To use higher-level abstractions, it is worth using a variety of software libraries. Using the Metamask API commands and the Metamask SDK features, you can learn to create your own decentralized applications running through Metamask. And using the capabilities of the Moralis framework, Node.js commands, and writing program code in your preferred programming language, you can create a Dapp of any complexity.