<p>An address is not a wallet, and a HD wallet is only locally relevant to your storage and is not reflected at all in the public ledger.</p>

<p>Bitcoin works on a UTXO model where funds are paid to an output which can be spent by the owner of the private key for a given address. There is no direct links between any addresses and no hierarchical structure in the public ledger.</p>

<p>So if you pay to address <strong>17fPG6yJujgzysrAozHM5FTEytBvWzF2gS</strong>, then the public ledger will only see the payment to that address, and nobody else will have any idea that address <strong>1CGM9zBt885ccKg6j1aqbBESsdPju4aj2m</strong> is even part of the same wallet.</p>

<p>A wallet is simply a collection of key pairs, where each key pair has an address for its public part. BIP32 describes a method of deterministically generating addresses from a root seed, so that you may regenerate the addresses rather than have to store them individually.</p>

<p>To access the funds spent to <strong>17fPG6yJujgzysrAozHM5FTEytBvWzF2gS</strong>, you need to regenerate the key pair for this address by using the same <code>index</code> you used to derive it in the first place.</p>

<p>Locally, a wallet software will be able to aggregate the funds from all of the addresses it generates, so it appears as though there is an aggregated total balance for the wallet, but in the public ledger, these UTXOs are scattered and uncorrelated. Only you will know your actual balance, and nobody can learn it from public information, although some of your addresses may become linked if you have to spend several of them in the same transaction.</p>

CC BY-SA 4.0
2019-11-28T21:02:50.260Z
Thankyou for such a thorough response! how would I go about for example, generating keys using `bitcoin-cli` for an index of **1**?
Curtis
CC BY-SA 4.0
2019-11-28T21:05:01.547Z
You should probably ask a separate question for that. As far as I know, by convention wallets will perform a search beginning at index 0, and will continue searching until they find 20 consecutive addresses which have not been used.
Mark H
CC BY-SA 4.0
2019-11-28T20:59:34.643Z
2019-11-28T20:59:34.643Z
Mark H
<p>So I'm developing a system that generates addresses for users to send bitcoins too in order for them to deposit on the system.</p>

<p>I generate addresses using the following:</p>

<pre><code>var derivedPubKey = config.BIP32_DERIVED;
if (!derivedPubKey)
    throw new Error('Must set env var BIP32_DERIVED_KEY');


var hdNode = bitcoinjs.HDNode.fromBase58(derivedPubKey);

exports.deriveAddress = function(index) {
    return hdNode.derive(index).keyPair.getAddress().toString();
};
</code></pre>

<p>An example address this generated was: <strong>17fPG6yJujgzysrAozHM5FTEytBvWzF2gS</strong></p>

<p>However, I checked my main wallet address <strong>1CGM9zBt885ccKg6j1aqbBESsdPju4aj2m</strong> and I don't see the transaction that I sent to the address above?</p>

<p>How can I access these funds?</p>

<bip32-hd-wallets><node.js>
BIP32 funds not appearing in wallet
Curtis
# BIP32 funds not appearing in wallet

(Asked by: username_0 on 2019-11-28)

So I'm developing a system that generates addresses for users to send bitcoins too in order for them to deposit on the system.

I generate addresses using the following:

```
var derivedPubKey = config.BIP32_DERIVED;
if (!derivedPubKey)
    throw new Error('Must set env var BIP32_DERIVED_KEY');

var hdNode = bitcoinjs.HDNode.fromBase58(derivedPubKey);

exports.deriveAddress = function(index) {
    return hdNode.derive(index).keyPair.getAddress().toString();
};

```

An example address this generated was: **17fPG6yJujgzysrAozHM5FTEytBvWzF2gS**

However, I checked my main wallet address **1CGM9zBt885ccKg6j1aqbBESsdPju4aj2m** and I don't see the transaction that I sent to the address above?

How can I access these funds?

**Tags:** bip32-hd-wallets, node.js


---

## 1 answers

### Answer by username_1 on 2019-11-28. Score: 1

An address is not a wallet, and a HD wallet is only locally relevant to your storage and is not reflected at all in the public ledger.

Bitcoin works on a UTXO model where funds are paid to an output which can be spent by the owner of the private key for a given address. There is no direct links between any addresses and no hierarchical structure in the public ledger.

So if you pay to address **17fPG6yJujgzysrAozHM5FTEytBvWzF2gS**, then the public ledger will only see the payment to that address, and nobody else will have any idea that address **1CGM9zBt885ccKg6j1aqbBESsdPju4aj2m** is even part of the same wallet.

A wallet is simply a collection of key pairs, where each key pair has an address for its public part. BIP32 describes a method of deterministically generating addresses from a root seed, so that you may regenerate the addresses rather than have to store them individually.

To access the funds spent to **17fPG6yJujgzysrAozHM5FTEytBvWzF2gS**, you need to regenerate the key pair for this address by using the same `index` you used to derive it in the first place.

Locally, a wallet software will be able to aggregate the funds from all of the addresses it generates, so it appears as though there is an aggregated total balance for the wallet, but in the public ledger, these UTXOs are scattered and uncorrelated. Only you will know your actual balance, and nobody can learn it from public information, although some of your addresses may become linked if you have to spend several of them in the same transaction.

> **Comments:**
> **username_0**: Thankyou for such a thorough response! how would I go about for example, generating keys using `bitcoin-cli` for an index of **1**?  
> **username_1**: You should probably ask a separate question for that. As far as I know, by convention wallets will perform a search beginning at index 0, and will continue searching until they find 20 consecutive addresses which have not been used.  

---

