<p>Addresses derived by an HD wallet are intentionally not publicly linkable to one-another (that would be obviously terrible for privacy). Your wallet software will know the addresses are related (ie, it derived them all from the same seed), but a casual observer will not. </p>

<p>Accordingly, when you pay some bitcoin to a child address, there is no associated activity involving the parent addresses. </p>

<blockquote>
  <p>How to generate sub addresses belonging to one private key in blockchain.com API</p>
</blockquote>

<p>You cannot. Each address derived by an HD wallet will have a corresponding, unique private key related to it. The master private key for the wallet will not be able to sign and spend any funds stored at child addresses - you need the child private keys to do that. </p>

CC BY-SA 4.0
2020-02-04T15:57:39.097Z
Thank you @chytrik for the reply.
I hope you know our needs based on the information I've provided in my question. Now, I am sure that we have a problem in our understanding about HD wallets.

May you tell me please what is the usage of HD wallets if the generated addresses can not be associated with the main account?
And what is the best solution regarding to our requirements in the project?
Mohammad Saberi
CC BY-SA 4.0
2020-02-04T23:15:05.487Z
HD wallets are useful in many ways, for example the ability to load an xpub key onto an insecure server in order to generate receiving addresses. Generally, if you're operating a business, each new user can be associated with a new address, helping differentiate payments. To spend those funds you just use the private key for each address, which is generated in parallel on a secure machine. I'd recommend reading through: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki and https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch05.asciidoc, at least
chytrik
CC BY-SA 4.0
2020-02-05T08:25:07.523Z
in this way, we can generate normal pub/priv keys too and we should store them somewhere like xpub/xpriv ones. Finally, we have to keep all key pairs and use them separately for transactions. Am I right?
Mohammad Saberi
CC BY-SA 4.0
2020-02-04T13:06:57.860Z
2020-02-04T13:06:57.860Z
chytrik
<p>We're creating a platform to buy/sell Bitcoin. 
We need to generate a new child address for each customer allowing them to receive Bitcoin. But all incoming Bitcoins should be stored in our main wallet actually.<br>
These are what we have done up to now:</p>

<ol>
<li>Creating a new wallet using Blockchain.com API using <code>/api/v2/create</code> and receiving an address as <a href="https://www.blockchain.com/btc/address/1551SHYQu8CPuRxJagViGkppNZrv2gkfFi" rel="nofollow noreferrer">1551SHYQu8CPuRxJagViGkppNZrv2gkfFi</a></li>
<li>Converting the wallet to HD using <code>/merchant/:guid/enableHD</code></li>
<li>Receiving the first sub-wallet (xPriv &amp; xPub) if I am not wrong with a new public address <a href="https://www.blockchain.com/btc/address/1CLpEvgs9o2mgKN5aS1mPeXGcqXs7fT75F" rel="nofollow noreferrer">1CLpEvgs9o2mgKN5aS1mPeXGcqXs7fT75F</a></li>
<li>Send BTC to the address generated in step 3.</li>
</ol>

<p>We expected that the transaction happened on on the <a href="https://www.blockchain.com/btc/address/1CLpEvgs9o2mgKN5aS1mPeXGcqXs7fT75F" rel="nofollow noreferrer">last address</a> as a derived child from the <a href="https://www.blockchain.com/btc/address/1551SHYQu8CPuRxJagViGkppNZrv2gkfFi" rel="nofollow noreferrer">first address</a> should be stored and visible in the main wallet, but by using explorers, we found out that there is not any event on the main address, whereas the transaction on the second one is confirmed.<br>
We may did something wrong, or we might have a misunderstanding about the correct behavior in this purpose.<br>
Your assistant is much appreciated.</p>

<address><bip32-hd-wallets><address-generation><bitcoin-wallet-app><xpub>
How to generate sub addresses belonging to one private key
Mohammad Saberi
# How to generate sub addresses belonging to one private key

(Asked by: username_0 on 2020-02-04)

We're creating a platform to buy/sell Bitcoin.
We need to generate a new child address for each customer allowing them to receive Bitcoin. But all incoming Bitcoins should be stored in our main wallet actually.  
These are what we have done up to now:

1. Creating a new wallet using Blockchain.com API using `/api/v2/create` and receiving an address as [1551SHYQu8CPuRxJagViGkppNZrv2gkfFi](https://www.blockchain.com/btc/address/1551SHYQu8CPuRxJagViGkppNZrv2gkfFi)
2. Converting the wallet to HD using `/merchant/:guid/enableHD`
3. Receiving the first sub-wallet (xPriv & xPub) if I am not wrong with a new public address [1CLpEvgs9o2mgKN5aS1mPeXGcqXs7fT75F](https://www.blockchain.com/btc/address/1CLpEvgs9o2mgKN5aS1mPeXGcqXs7fT75F)
4. Send BTC to the address generated in step 3.

We expected that the transaction happened on on the [last address](https://www.blockchain.com/btc/address/1CLpEvgs9o2mgKN5aS1mPeXGcqXs7fT75F) as a derived child from the [first address](https://www.blockchain.com/btc/address/1551SHYQu8CPuRxJagViGkppNZrv2gkfFi) should be stored and visible in the main wallet, but by using explorers, we found out that there is not any event on the main address, whereas the transaction on the second one is confirmed.  
We may did something wrong, or we might have a misunderstanding about the correct behavior in this purpose.  
Your assistant is much appreciated.

**Tags:** address, bip32-hd-wallets, address-generation, bitcoin-wallet-app, xpub


---

## 1 answers

### Answer by username_1 on 2020-02-04. Score: 1 | Accepted answer

Addresses derived by an HD wallet are intentionally not publicly linkable to one-another (that would be obviously terrible for privacy). Your wallet software will know the addresses are related (ie, it derived them all from the same seed), but a casual observer will not.

Accordingly, when you pay some bitcoin to a child address, there is no associated activity involving the parent addresses.

> How to generate sub addresses belonging to one private key in blockchain.com API

You cannot. Each address derived by an HD wallet will have a corresponding, unique private key related to it. The master private key for the wallet will not be able to sign and spend any funds stored at child addresses - you need the child private keys to do that.

> **Comments:**
> **username_0**: Thank you @username_1 for the reply. I hope you know our needs based on the information I've provided in my question. Now, I am sure that we have a problem in our understanding about HD wallets.  May you tell me please what is the usage of HD wallets if the generated addresses can not be associated with the main account? And what is the best solution regarding to our requirements in the project?  
> **username_1**: HD wallets are useful in many ways, for example the ability to load an xpub key onto an insecure server in order to generate receiving addresses. Generally, if you're operating a business, each new user can be associated with a new address, helping differentiate payments. To spend those funds you just use the private key for each address, which is generated in parallel on a secure machine. I'd recommend reading through: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki and https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch05.asciidoc, at least  
> **username_0**: in this way, we can generate normal pub/priv keys too and we should store them somewhere like xpub/xpriv ones. Finally, we have to keep all key pairs and use them separately for transactions. Am I right?  

---

