Search…
⌃K

Metamask

What MetaMask is, what it is used for, and how to add XDC Network in MetaMask

🧭 Table of contents

📰 Overview

hardhat
Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software. Get Solidity stack traces & console.log.

What you will learn

This article will teach you what MetaMask is, what MetaMask is used for, and how to connect MetaMask to the XDC Network.

What you will do

  • Learn about MetaMask
  • Connect MetaMask to XDC network
  • Send tokens over XDC apothem testnet using MetaMask

📰 About MetaMask

MetaMask is a non-custodial cryptocurrency wallet used to interact with the Ethereum and EVM-compatible blockchains.
MetaMask allows users to access and manage their blockchain account funds via convenient user interface.

Why people use non-custodial wallets

To understand why people use non-custodial wallets, we first need to understand what custodial means. Custodial wallet a wallet whose private keys are held and managed by third party service (for example, an exchange). With custodial wallet you delegate control over your crypto holdings to another entity.
Non-custodial wallet is the opposite of that. With non-custodial wallet, only the person who has private key controls wallet's funds.
There are pros and cons that come with using non-custodial wallet:
  • pros
    • You can use your funds however you want
    • No one can block your funds
  • cons
    • Once you forget or lose your seed phrase or private key, your funds are lots forever
    • For every thing you do, like transfering or swapping tokens, you need to pay transaction fees. While it may not be the problem when using networks with low fees, like Polygon or XDC, fees on networks like Ethereum sometimes are very expensive

👛 MetaMask Overview

metamask_overview
  • Address: your address on a blockchain, you can use it receive funds
  • Balance: current balance of native tokens on this account
  • Network: current blockchain network you are using. You can change it by clicking on it and selecting another one in dropdown
  • Tokens: your tokens balance. This includes native tokens and ERC20 (or XRC20 if you are on XDC network) tokens.

👛 Adding XDC mainnet and apothem testnet in MetaMask

To add new network on MetaMask, press on network dropdown near your account icon.
open_networks_arrow
This will open list existing network and also an option to add new network. Now press Add Network.
add_network_arrow
New page will open asking you to fill network info.
To add xinfin mainnet, use following configuration:
Network Name
XinFin
New RPC URL
https://rpc.xinfin.network
Chain ID
50
Currency Symbol
XDC
Block Explorer URL
https://explorer.xinfin.network/
xinfin_add
To connect apothem testnet, repeat steps with following network settings:
Network Name
Apothem
New RPC URL
https://rpc.apothem.network
Chain ID
51
Currency Symbol
TXDC
Block Explorer URL
https://explorer.apothem.network/
apothem_add

👛 Transfer funds on XDC using MetaMask

First, lets get sound funds from apothem faucet. Copy your address in MetaMask, then replace 0x with xdc. So, if your address is 0xA4e66f4Cc17752f331eaC6A20C00756156719519, it should be xdcA4e66f4Cc17752f331eaC6A20C00756156719519 on XDC network.
With this address in hand, we can head to the Apothem Faucet and claim some TXDC for development purposes:
Step 02
Now click on send button to send your XDC token.
send_start_arrow
This will open send modal. Paste some address in search input in 0x format. In this exampel we just use our own account address.
send_arrow
On next page you will be asked to fill gas price, gas limit and token amount fields. If gas price is not set automatically, just set it to 1 gwei and gas limit should be 21000, then choose any amount of tokens you want, but less than your total balance. After all fields are filled, press next.
send_next_arrow
Re-check all info you filled previously and press confirm.
send_confirm_arrow
After you transaction was sent, it will take some time to add to a block and then MetaMask will notify you that your transaction was added successfully (or failed).
txinfo
You can click on it to get more info:
tx_info2
If you press View on block explorer, you will be redirected to Apothem Explorer website entry with your transaction.
For more information about MetaMask, Please Visit MetaMask Website. For more information about XinFin Network, Please Visit XDC Network Documentation on GitBook.