> For the complete documentation index, see [llms.txt](https://premium.gitbook.io/main/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://premium.gitbook.io/main/en/basic-settings/merchants-and-auto-payments/merchants/electrum.md).

# Electrum

{% hint style="info" %}
If you need to update the module on the server, please refer to the [instructions](https://premium.gitbook.io/main/en/en/basic-settings/faq/updating-script-files-on-the-server/how-to-update-files-on-the-server#merchant-and-auto-payout-modules).
{% endhint %}

{% hint style="danger" %}
Electrum allows for the cancellation and substitution of transactions, which can lead to the loss of funds for the exchange if the settings mentioned below are not configured in your exchange and a fraudster attempts to exploit this feature of Electrum. If you are using a module to work with Electrum, **make sure** to perform the following configuration.

When using merchants to receive funds, it is necessary to [recalculate the payment amount](https://premium.gitbook.io/main/en/basic-settings/valyuty-i-napravleniya/sozdanie-novogo-napravleniya-obmena#pereschet-po-summe-oplaty) at least for the status "**Paid Request**" in the exchange direction settings.

You must also configure the automatic transition of requests to the status "**Under Review**" if the actual payment amount is less than the original (this option is found in the merchant module settings for receiving funds under the "**Merchants**" section).
{% endhint %}

{% hint style="warning" %}
For receiving funds and for auto payouts, it is **recommended** to use [different Electrum wallets](https://premium.gitbook.io/main/en/basic-settings/modul-electrum/ustanovka-i-nastroika-electrum/sozdanie-dopolnitelnogo-koshelka) — this will create independent channels for receiving and withdrawing BTC.

This measure is necessary to prevent the withdrawal of "dirty" BTC. If you receive and pay everything to one wallet, there is a risk that "dirty" BTC will be withdrawn along with clean funds.
{% endhint %}

## Installation and Configuration of the Module

Install Electrum on the server following the [instructions](https://premium.gitbook.io/main/en/basic-settings/modul-electrum/ustanovka-i-nastroika-electrum).

Make sure to save the port number for connection, server address (optional), username, and password for wallet access in a text file.

<figure><img src="/files/DW7zJXP4iHaOUw5laThW" alt=""><figcaption></figcaption></figure>

## Module Settings

In the admin panel, create a new merchant in the "**Merchants**" -> "**Add Merchant**" section.

Select Electrum from the dropdown list in the "**Module**" field, provide a name for the module, and click "**Save**."

<figure><img src="/files/95XYkfQi2uM6gcCZK5PI" alt=""><figcaption></figcaption></figure>

Fill in the specified authorization fields.

<figure><img src="/files/j2zJoLfMI8UdgVqsEzoT" alt=""><figcaption></figcaption></figure>

* **Number of confirmations for a payment to be considered completed** — leave this field empty to use the default value that Electrum employs.
* **Login** — enter the information from the "**User for Connection**" line.
* **Password** — enter the information from the "**User Password for Connection**" line.
* **Api server** — fill this field only if the Electrum module is installed on a server different from the one where the Premium Exchanger script is installed. Enter the IP address in the format `111.111.111.111` (without specifying the `http/https` protocol).

{% hint style="warning" %}
If the Electrum module is installed on the same server as the Premium Exchanger script, leave this field empty.
{% endhint %}

* **Api port** — enter the information from the "**Port for Connection**" line.

## Continuing the Configuration

Next, proceed to configure the merchant by following the [general setup instructions](https://premium.gitbook.io/main/en/en/basic-settings/merchants-and-auto-payments/merchants/general-merchant-settings).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://premium.gitbook.io/main/en/basic-settings/merchants-and-auto-payments/merchants/electrum.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
