<p><strong>Short answer</strong>: check out <a href="https://btcpayserver.org/" rel="nofollow noreferrer">BTCPay</a>, it does what you ask. You don't have to create your own server to use it, you can just create an account on an existing instance, for example <a href="https://btcpayjungle.com" rel="nofollow noreferrer">this one</a> should be fine to being with.</p>
<p><strong>Long answer</strong>: you're right when you say that one private key generates one address, but Hierarchical Deterministic (HD) wallets are made to solve that.
Basically they allow to generate a virtually unlimited number of private and public key pairs from one piece of data. Deterministic means that if you know this piece of data, the &quot;seed&quot;, you will always generate the same keys in the same order.</p>
<p>But it gets better than that, as you can derive only the public keys, meaning that you can use an unsecured server to generate addresses and receive bitcoin payments without ever exposing your private keys! That's the way BTCPay server work, and that's why you can use another person server to receive payments without trusting him. Worst case he will only know all your addresses, but can never steal your bitcoins.</p>
<p>I'm simplifying a bit, but that's the general idea.</p>
<p>As for your last question, you could have the private keys on another wallet like Electrum, or a Ledger, and then just use that to spend the bitcoins you received on your BTCPay server. I won't go into more details here, you can have a look at the BTCPay documentation or get in touch with their community.</p>
<p>NB: I recommend BTCPay because as far as I can understand your need I think it is the best option, but if you're not confortable with it you could as well use Electrum or a Ledger and send new addresses to your client in email or a secret pastebin for example.</p>
<p>That's great if your customers are okay to pay you in bitcoins. Stay safe, and remember never ever give your seed, or private keys to anyone or any service on the internet.</p>

CC BY-SA 4.0
2020-06-19T10:30:29.230Z
Thank you for your detailed answer.  I have tried BTCPay Server to achieve this already but was having some difficulties with it.  Given what you have described here I am going to persevere with trying to get it to work rather than try to implement my own solution.
Martin
CC BY-SA 4.0
2020-06-18T15:37:20.013Z
2020-06-18T15:37:20.013Z
Sosthène
<p>I believe there are two key decisions to be made, for your case, and essentially the second would depend on the first that is: Would your customer want control over their own funds? If so, a private/public key(s) is in order. If they don't then you can decide if you want to have separate private keys for each client or not.</p>
<p>What it's important in any case is that each payment should be sent to a different public key. You can have as many public keys as you want and only one private key. What I mean is you don't need to create a new pair just to get a new payment address.</p>
<p>Note: BTCPayServer allows you to operate with such different setups.</p>

CC BY-SA 4.0
2020-06-19T10:32:25.407Z
Thank you for your answer.  My customers have no control of the funds once paid so I do not need them to be able to access their keys.  Given this and the other answer, I have decided to attempt to get BTCPay Server working and to integrate with that via the API.
Martin
CC BY-SA 4.0
2020-06-19T18:06:00.630Z
This is slightly incorrect: each public key will have its own related private key, that will be required to spend the funds. Multiple public keys are not derived from the same private key. A modern HD wallet does use a single mnemonic seed phrase to create a master private key, but that key is then just used to derive child keypairs.
chytrik
CC BY-SA 4.0
2020-06-24T17:21:37.710Z
Thanks for the heads-up @chytrik. Now I'm intrigued on how does that work for regular/legacy wallets. Will check that implementation whenever I find some spare time.
rudygodoy
CC BY-SA 4.0
2020-06-24T18:41:58.980Z
Non-HD wallets will just generate random new keypairs as needed. This makes keeping a backup difficult: you have to create a new backup every time a new address is created!
chytrik
CC BY-SA 4.0
2020-06-18T17:52:40.113Z
2020-06-18T17:52:40.113Z
rudygodoy
<p>I have clients that would like to pay for services in BTC.</p>
<p><strong>TL;DR</strong></p>
<p>To generate a new payment address must I generate a new private key (essentially a new wallet)?</p>
<p>Is it better to generate independent private keys for each payment from each client, or to use a determinstic wallet?</p>
<p>Is it possible to automatically move the BTC to a central wallet address without storing the private key for either solution?</p>
<p><strong>How To Generate Multiple Addresses?</strong></p>
<p>Based on <a href="https://en.bitcoin.it/wiki/Address#Address_reuse" rel="nofollow noreferrer">this bitcoin.it</a> article:</p>
<blockquote>
<p>Addresses are not intended to be used more than once, and doing so has
numerous problems associated [with it].</p>
</blockquote>
<p>Therefore, the logic I have follows that <em>each payment received from each client should be to it's own address</em>.</p>
<p>However, I am confused about the generation of multiple addresses, and the best way in which to do it.</p>
<p>Other questions on here, such as <a href="https://bitcoin.stackexchange.com/questions/35983/can-same-private-key-generate-multiple-addresses">this one</a> and <a href="https://bitcoin.stackexchange.com/questions/70784/how-to-generate-multiple-public-addresses-using-one-private-key">this one</a>, indicate that each private key will result in a single address only.  Am I therefore right to conclude that each address for each payment from each client must have it's own private key?</p>
<p>If that is the case (as in my limited understanding it would seem to be), and I am generating the wallet addresses using software, is it better to:</p>
<ol>
<li>Use a deterministic wallet that generates each payment address for each client from a single 'master key', or</li>
<li>Generate an indepedent private key for each payment address for each client?</li>
</ol>
<p><strong>Moving BTC To Central Wallet</strong></p>
<p>I need to move the BTC from the received wallet into my wallet in order to spend it.</p>
<p>In either of the scenarios I mentioned, would the 'master key(s)' be securely stored on the server for programmatic use in order to facilitate moving the received funds into my wallet?</p>
<p>If that is the case, would it be more secure to have independent private keys for each instance of a payment from a client?</p>

<address><private-key><address-generation><deterministic-wallets>
Correct Approach for Payments on Multiple Addresses
Martin
# Correct Approach for Payments on Multiple Addresses

(Asked by: username_0 on 2020-06-18)

I have clients that would like to pay for services in BTC.

**TL;DR**

To generate a new payment address must I generate a new private key (essentially a new wallet)?

Is it better to generate independent private keys for each payment from each client, or to use a determinstic wallet?

Is it possible to automatically move the BTC to a central wallet address without storing the private key for either solution?

**How To Generate Multiple Addresses?**

Based on [this bitcoin.it](https://en.bitcoin.it/wiki/Address#Address_reuse) article:

> Addresses are not intended to be used more than once, and doing so has
> numerous problems associated [with it].

Therefore, the logic I have follows that *each payment received from each client should be to it's own address*.

However, I am confused about the generation of multiple addresses, and the best way in which to do it.

Other questions on here, such as [this one](https://bitcoin.stackexchange.com/questions/35983/can-same-private-key-generate-multiple-addresses) and [this one](https://bitcoin.stackexchange.com/questions/70784/how-to-generate-multiple-public-addresses-using-one-private-key), indicate that each private key will result in a single address only. Am I therefore right to conclude that each address for each payment from each client must have it's own private key?

If that is the case (as in my limited understanding it would seem to be), and I am generating the wallet addresses using software, is it better to:

1. Use a deterministic wallet that generates each payment address for each client from a single 'master key', or
2. Generate an indepedent private key for each payment address for each client?

**Moving BTC To Central Wallet**

I need to move the BTC from the received wallet into my wallet in order to spend it.

In either of the scenarios I mentioned, would the 'master key(s)' be securely stored on the server for programmatic use in order to facilitate moving the received funds into my wallet?

If that is the case, would it be more secure to have independent private keys for each instance of a payment from a client?

**Tags:** address, private-key, address-generation, deterministic-wallets


---

## 2 answers

### Answer by username_1 on 2020-06-18. Score: 2 | Accepted answer

**Short answer**: check out [BTCPay](https://btcpayserver.org/), it does what you ask. You don't have to create your own server to use it, you can just create an account on an existing instance, for example [this one](https://btcpayjungle.com) should be fine to being with.

**Long answer**: you're right when you say that one private key generates one address, but Hierarchical Deterministic (HD) wallets are made to solve that.
Basically they allow to generate a virtually unlimited number of private and public key pairs from one piece of data. Deterministic means that if you know this piece of data, the "seed", you will always generate the same keys in the same order.

But it gets better than that, as you can derive only the public keys, meaning that you can use an unsecured server to generate addresses and receive bitcoin payments without ever exposing your private keys! That's the way BTCPay server work, and that's why you can use another person server to receive payments without trusting him. Worst case he will only know all your addresses, but can never steal your bitcoins.

I'm simplifying a bit, but that's the general idea.

As for your last question, you could have the private keys on another wallet like Electrum, or a Ledger, and then just use that to spend the bitcoins you received on your BTCPay server. I won't go into more details here, you can have a look at the BTCPay documentation or get in touch with their community.

NB: I recommend BTCPay because as far as I can understand your need I think it is the best option, but if you're not confortable with it you could as well use Electrum or a Ledger and send new addresses to your client in email or a secret pastebin for example.

That's great if your customers are okay to pay you in bitcoins. Stay safe, and remember never ever give your seed, or private keys to anyone or any service on the internet.

> **Comments:**
> **username_0**: Thank you for your detailed answer.  I have tried BTCPay Server to achieve this already but was having some difficulties with it.  Given what you have described here I am going to persevere with trying to get it to work rather than try to implement my own solution.  

---

### Answer by username_2 on 2020-06-18. Score: 1

I believe there are two key decisions to be made, for your case, and essentially the second would depend on the first that is: Would your customer want control over their own funds? If so, a private/public key(s) is in order. If they don't then you can decide if you want to have separate private keys for each client or not.

What it's important in any case is that each payment should be sent to a different public key. You can have as many public keys as you want and only one private key. What I mean is you don't need to create a new pair just to get a new payment address.

Note: BTCPayServer allows you to operate with such different setups.

> **Comments:**
> **username_0**: Thank you for your answer.  My customers have no control of the funds once paid so I do not need them to be able to access their keys.  Given this and the other answer, I have decided to attempt to get BTCPay Server working and to integrate with that via the API.  
> **username_3**: This is slightly incorrect: each public key will have its own related private key, that will be required to spend the funds. Multiple public keys are not derived from the same private key. A modern HD wallet does use a single mnemonic seed phrase to create a master private key, but that key is then just used to derive child keypairs.  
> **username_2**: Thanks for the heads-up @username_3. Now I'm intrigued on how does that work for regular/legacy wallets. Will check that implementation whenever I find some spare time.  
> **username_3**: Non-HD wallets will just generate random new keypairs as needed. This makes keeping a backup difficult: you have to create a new backup every time a new address is created!  

---

