# MetaMask Configuration

In this guide, you will learn how to use the MetaMask extension to send and receive tokens and interact with the Planq network.

## Connecting with MetaMask

First, you will need to connect your MetaMask wallet to the Planq network:

* Click the "**My Account**" button in the top right corner. Then select **"Networks"** in the settings menu.

<figure><img src="https://913199280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2ESE1RbF6fEs8iz09er3%2Fuploads%2Fz6g5M3ziLYjfMVC4DutJ%2Fimage.png?alt=media&#x26;token=b29b5702-9eb8-4c2a-9d09-63712b6f4bbf" alt=""><figcaption></figcaption></figure>

* Click "**Add Network**":

<figure><img src="https://913199280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2ESE1RbF6fEs8iz09er3%2Fuploads%2Fe6uRJl2xKIPiOJs0CbMp%2Fimage.png?alt=media&#x26;token=531d1b88-68f4-44ae-8683-8b2be82f3c4b" alt=""><figcaption></figcaption></figure>

This button should open a Webpage, if you scroll down you should see an option to add a network manually.

<figure><img src="https://913199280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2ESE1RbF6fEs8iz09er3%2Fuploads%2Fl7H7B1n20Dg2TxBS4kkW%2Fimage.png?alt=media&#x26;token=86767090-b26b-4fee-9722-ae771177f4d9" alt=""><figcaption></figcaption></figure>

{% tabs %}
{% tab title="Mainnet" %}
**Fill in the following details:**

* **Name**: Planq
* **New RPC URL:**`https://evm-rpc.planq.network`;
* **Chain ID: 7070**
* **Symbol:**`PLQ`
* **Block explorer URL:**`https://evm.planq.network/`
  {% endtab %}
  {% endtabs %}

<figure><img src="https://913199280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2ESE1RbF6fEs8iz09er3%2Fuploads%2FSwLmLcRWFKXOETDI5oi1%2Fimage.png?alt=media&#x26;token=d83c839b-acbf-4e64-b1a0-da4d8a6fc5da" alt=""><figcaption></figcaption></figure>

* After saving the network configuration, we should be able to see the token in your address.

## Importing private keys to MetaMask

Alternatively, We can export the private keys by using the `unsafe-export-eth-key` command with `planqd.` For example:

```bash
planqd keys unsafe-export-eth-key mykey --keyring-backend test
```

It will show your private key and you can copy it for the next step. Click the "**My Account"** button at the top right corner again. Then, select "**Import Account**":

![](https://913199280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2ESE1RbF6fEs8iz09er3%2Fuploads%2Fgit-blob-af325ccfc517883158f05dd9e5d3e6635698e155%2F4.png?alt=media)

Paste your private key string from the previous step and click "**Import"**.

<figure><img src="https://913199280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2ESE1RbF6fEs8iz09er3%2Fuploads%2FN5UwmlAd6wgacppcZ726%2Fimage.png?alt=media&#x26;token=f7548df7-7e0f-4a49-a82d-58dc2c6847a1" alt=""><figcaption></figcaption></figure>

Once it has been connected, you should see your token balance and you can then begin performing transactions using your MetaMask wallet!

## Address conventions

Please note that the address format in Planq is in there form of bech32 `plq...` , we can use `planqd debug addr` to convert an address between hex and bech32. For example:

```bash
$ planqd keys list --keyring-backend test
  - name: mykey
    type: local
    address: plq1c47uszfujup3ax0d5p4ges3pxa4ne9zqc20pgf
    pubkey: '{"@type":"/ethermint.crypto.v1alpha1.ethsecp256k1.PubKey","key":"A4KKhRCbnMr3mSqBfeeMPp3svRlPhnKlmxh6MmZ+AoR5"}'
    mnemonic: ""

$ planqd debug addr plq1c47uszfujup3ax0d5p4ges3pxa4ne9zqc20pgf
    Address bytes: [197 125 200 9 60 151 3 30 153 237 160 106 140 194 33 55 107 60 148 64]
    Address (hex): C57DC8093C97031E99EDA06A8CC221376B3C9440
    Address (EIP-55): 0xc57DC8093C97031E99EdA06A8CC221376B3c9440
    Bech32 Acc: plq1c47uszfujup3ax0d5p4ges3pxa4ne9zqc20pgf
    Bech32 Val: plqvaloper1c47uszfujup3ax0d5p4ges3pxa4ne9zqx5zmwc

$ planqd debug addr 2F743F55AC49A446484988505244941DEDA1B60A
    Address bytes: [197 125 200 9 60 151 3 30 153 237 160 106 140 194 33 55 107 60 148 64]
    Address (hex): C57DC8093C97031E99EDA06A8CC221376B3C9440
    Address (EIP-55): 0xc57DC8093C97031E99EdA06A8CC221376B3c9440
    Bech32 Acc: plq1c47uszfujup3ax0d5p4ges3pxa4ne9zqc20pgf
    Bech32 Val: plqvaloper1c47uszfujup3ax0d5p4ges3pxa4ne9zqx5zmwc
```

{% hint style="info" %}
Remarks: You will need to add `0x` at the beginning when using the Ethereum HEX address shown as above. For example: `Address (hex): 2F743F55AC49A446484988505244941DEDA1B60A` implies that `0x2F743F55AC49A446484988505244941DEDA1B60A` will be the address in Ethereum.
{% endhint %}

## Resetting your account on MetaMask

If you come across any issue with your MetaMask account or if you have used your imported account to perform transactions in the legacy testnet, you can reset it by using the `Reset Account` function.

Simply go to `Setting/Advance` and click `Reset Account`:

![](https://913199280-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2ESE1RbF6fEs8iz09er3%2Fuploads%2Fgit-blob-4c96dd88f1f8a4d064387a97a5196444674ce0d6%2FMetamask-reset.png?alt=media)
