# Electrum wallet

This document explains how to connect a desktop [Electrum Wallet](https://electrum.org/) to Bitcart.

Electrum wallet is recommended, as Bitcart is tightly integrated with it, providing the best user experience and speed.

1. Register an account in your Bitcart instance
2. ​[Download](https://electrum.org/#download) and install Electrum Wallet

## Electrum Wallet Setup <a href="#electrum-wallet-setup" id="electrum-wallet-setup"></a>

After the installation, open Electrum Wallet by clicking on the icon on your desktop.

### Quick Setup <a href="#quick-setup" id="quick-setup"></a>

1. Create a new Electrum Wallet
2. In Electrum, Wallet > Information - copy the **Master Public Key**.
3. In Bitcart, Wallets > Create wallet > Paste the Extended Public Key in xpub field

## Step by Step <a href="#step-by-step" id="step-by-step"></a>

The following setup guides you through setting up an entirely new Bech32 (SegWit) Wallet in Electrum. If you already have a wallet skip to the Extended Public Key copying.

Firstly, give your wallet a name, for example, `Bitcart Wallet` and click `Next`.

![Enter your new wallet's name](https://4146767839-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lz8A22xAOkwN-WbWyqG%2F-M-PqwhTlpLiayqrpEQx%2F-M-Pt-Kj-mLVWxaPUfz5%2Felectrum_createwallet.png?alt=media\&token=80b53e59-34d9-456d-a05e-a53acfe0207d)

Choose `Standard wallet` and proceed by clicking the `Next`button.

![Select wallet type](https://4146767839-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lz8A22xAOkwN-WbWyqG%2F-M-PqwhTlpLiayqrpEQx%2F-M-Q06ORl_L7vRnaF-sP%2Felectrum_createwallet_step2.png?alt=media\&token=ee2fdd1f-e69a-4be0-a1bb-f3ec7ee48d8c)

Since we're creating a brand-new wallet,choose `Create a new seed` and `Next`

![Create a new seed](https://4146767839-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lz8A22xAOkwN-WbWyqG%2F-M-PqwhTlpLiayqrpEQx%2F-M-Q0c3wwnrE033RD9F9%2Felectrum_createwallet_step3.png?alt=media\&token=71d45b6d-2227-4908-8281-c1c77411d4b5)

From the multiple choice menu, select `SegWit` and `Next`

![Select Segwit](https://4146767839-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lz8A22xAOkwN-WbWyqG%2F-M-PqwhTlpLiayqrpEQx%2F-M-Q0mHL8__-M3XdUxva%2Felectrum_createwallet_step4.png?alt=media\&token=e060eb64-7527-4f05-845d-08025907ef90)

**IMPORTANT NOTE:** If you're a merchant, instead of SegWit (Bech32), it's recommended to use SegWit wrapped (P2SH) format. [This guide](https://www.youtube.com/watch?v=-1DBJWwA2Cw) explains how to create P2SH wallet in Electrum that's more suited for merchants, due to compatibility with legacy wallets customers use.

**IMPORTANT NOTE 2:** Write down your recovery words in the order you see them on the screen. Write them down a piece of paper and store it somewhere secure. Take your time and triple check each word. Do not store your seed in a digital format (photograph, text document). Whoever has the access to your seed can access your funds. Confirm that the seed has been properly backed up by re-entering it in the same order. Once the seed is validated, proceed to the next step.

![Backup your seed!](https://4146767839-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lz8A22xAOkwN-WbWyqG%2F-M-PqwhTlpLiayqrpEQx%2F-M-Q19iO9s227v7PSR8A%2Felectrum_createwallet_step5.png?alt=media\&token=318ac329-68ca-4f3d-86b1-ceeae53ee94e)

It's highly recommended that you encrypt your wallet. Select a password that you can easily remember and mark make sure `Encrypt Wallet File` is marked. Proceed by clicking `Next`.

![Encrypt your wallet!](https://4146767839-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lz8A22xAOkwN-WbWyqG%2F-M-PqwhTlpLiayqrpEQx%2F-M-Q1oOpml9xqyGcM1-D%2Felectrum_createwallet_step6.png?alt=media\&token=75d1e92d-d973-488e-b2d4-8a8568faf4d0)

When the wallet loads (it may take few moments), in the top menu, click on the `Wallet` and then`Information` .

![See wallet information](https://4146767839-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lz8A22xAOkwN-WbWyqG%2F-M-PqwhTlpLiayqrpEQx%2F-M-Q2P8ale9cTcn0MTIs%2Felectrum_createwallet_step7.png?alt=media\&token=cdd3901e-5f2a-46d1-8920-90fed364daf4)

Select and **copy** the `Master Public Key`. This is the **public** key from which Bitcart will derive addresses.

![Copy the Master Public Key](https://4146767839-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lz8A22xAOkwN-WbWyqG%2F-M-PqwhTlpLiayqrpEQx%2F-M-Q6ex4aogEbpxSTazX%2Felectrum_createwallet_step8.png?alt=media\&token=c380e6e7-e28b-4710-9466-ec2318455f69)

Return to your Bitcart. Click on the `Details` button in the `Wallets` card and click on the `New Wallet` button. Enter your wallet name and Paste the Master Public Key from electrum to xpub field. Click `Save`.

![Add new wallet](https://4146767839-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lz8A22xAOkwN-WbWyqG%2F-MPeVXEO-Ub-zZn8PSJI%2F-MPeX9IsWHKlBtiP8aer%2Fconnect_electrum.png?alt=media\&token=992054f6-2885-4c7c-a6db-10555ea4d7f1)

### Configuring the Gap Limit in Electrum <a href="#configuring-the-gap-limit-in-electrum" id="configuring-the-gap-limit-in-electrum"></a>

In the top menu, click on the `View` and then`Show Console` .

![Show console](https://4146767839-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lz8A22xAOkwN-WbWyqG%2F-M-PqwhTlpLiayqrpEQx%2F-M-Q86AjQ1EdU93VvoRw%2Felectrum_gaplimit.png?alt=media\&token=a0de62a0-587c-4b07-82e4-c9c0b6f59d2c)

Enter following commands in Electrum console and press `enter` on your keyboard.

```
 wallet.change_gap_limit(100) 
```

If you are running a version older than Electrum 4, also enter the following command and press `enter`

```
wallet.storage.write()
```

![Enter the commands here](https://4146767839-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lz8A22xAOkwN-WbWyqG%2F-M-PqwhTlpLiayqrpEQx%2F-M-Q8tP7LPOwmh_5S6iO%2Felectrum_gaplimit_step2.png?alt=media\&token=e671c4fa-a577-4f4c-8856-2f93955d1b73)

Restart your Electrum and verify that the newly set gap limit is correct by entering in the console:

```
wallet.gap_limit
```

There's no good answer to how much you should set the gap limit to. Most merchants set 100-200. If you're a big merchants with high transaction volume, you can try with even higher gap limit.

For more details about the Gap Limit, check the FAQ.

Electrum and Bitcart are now connected. Any payments received to your Bitcart will be visible in Electrum, where you can further spend them.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bitcart.ai/your-first-invoice/electrumwallet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
