xPub Public Bitcoin Address
Set up and administer BTCPay Shop
Deposit xPub key with the BTCPay server
Incoming payments are managed with the help of the BTCPayServer. A Bitcoin wallet is required to receive and send Bitcoin.
To receive Bitcoin with the BTCPay server, you have the following options:
- You use an already existing external wallet in which you import the xpubkey.
- You create a new wallet on the BTCPay server, the BTCPay Wallet.
Wenn Sie Ihre Bitcoin mit der integrierten BTCPay Wallet verwalten möchten, empfehlen wir Ihnen das Tutorial “BTCPay Wallet“. This tutorial explains how to create an xpub key from an existing wallet and store it on the BTCPay server. We describe this using the example of an Electrum Wallet.
In case of an external Bitcoin wallet, the Bitcoin balance is not located in the BTCPayServer at any time, but always on the external wallet of the merchant.
You need a Bitcoin wallet to generate xPub public keys (xpub Key / xpubKey).
The xPub Key is deposited at BTCPayServer and the Private Key remains in the possession of the merchant.
BTCPayServer is thus able to generate a public key for each transaction and credit the payments directly to the merchant’s wallet, without itself coming into possession of the Bitcoin.
The wallet also does not have to be permanently online, but is physically separated from the BTCPay server. The wallet can be a hardware wallet like Coldcard or Ledger or a software wallet like Electrum that runs on your local computer.
In our example, we use the Electrum Wallet, which runs on your own local computer.
We explain how to set up an Electrum Wallet and generate the xPub Key in “Creating xPub Key with Electrum Wallet“.
Export xPub Key at Electrum Wallet
Within Electrum Wallet, go to the Wallet section and then to Information. There you can find the xPub Key
Import xPub Key at BTCPay
In the Shop Administration under General Settings we go to the Derivation Scheme section
In the Shop Administration under General Settings we go to the Derivation Scheme section
In the Derivation Scheme field we enter the xPub key that we exported from Electrum under Wallet and Information.
When inserting, the address type must also be appended.
The address type depends on what your wallet generates or what you specified when creating the Electrum wallet. In Electrum Wallet it is specified as Script Type:
bc1….. | P2WPKH, Bech32 Address | |
3….. | P2SH-P2WPKH | -[p2sh] |
1….. | P2PKH | -[legacy] |
Depending on the script type, the addition, including hyphen and bracket, must be appended to the xpub key.
If a Bech32 address is created with the script type p2wpkh, then an addition is not necessary.
ATTENTION:
For traders, it is recommended that the SegWit (P2SH) format is used instead of the SegWit (Bech32) format.
Therefore we use the address type: p2wpkh-p2sh
Accordingly, we need to append the suffix -[p2sh]to the generated xPub key. Including the minus sign and the square bracket.
To check if the address was specified correctly, we check the Enabled box and click Continue.
We get a listing of 10 Bitcoin addresses in total,
which must be identical to the addresses displayed in the Electrum Wallet under Address:
From this address pool the Bitcoin addresses are taken, which are needed for receiving the Bitcoin payments.
Since only 10 addresses are created in stock by Electrum by default, the Electrum Gap Limit must be increased.
To do this, go to the Console menu item in the Electrum Wallet and enter the command:
wallet.change_gap_limit(100)
and presses Enter
After that the command:
wallet.storage.write()
To check how high the gap limit is, issue the command:
wallet.gap_limit
one.
If you want to read a detailed description about creating the Electrum Wallet and increasing the gap limit, you can find it at:
Create xPub Key with Electrum Wallet
Any Bitcoin payments are automatically credited to your own Bitcoin wallet (here Electrum Wallet).
You can check this by comparing the transactions displayed in BTCPay with the transactions in your wallet.
You also have the sole right to dispose of the Bitcoin on your wallet. You can keep the Bitcoin or forward it to a Bitcoin exchange to exchange for Euros.
Leave a Reply
Your email is safe with us.