<p>If you're only missing part of the derivation path, then the key can still be generated from the master private key. The issue is just that Bitcoin Core doesn't search all derivation paths (that'd be impossible), just those that are explicitly given to it.</p>
<p>So you can take the master private key, construct a descriptor with that key that generates the address that you want, and import that descriptor to your wallet. It should then recognize your funds on a rescan and be able to spend them.</p>

CC BY-SA 4.0
2024-03-11T16:16:42.767Z
Thank you Ava!
I am trying with Bitcoin Core console `importmulti '[{"desc": "pkh([my_xprv/44'"'"'/0'"'"'/0'"'"'/0/12]my_xpub)","timestamp": "now","range": [0,1000],"watchonly": true}]' '{"rescan": true}'`

But I have "Only legacy wallets are supported by this command"

Is my descriptor correct or am I missing something ?
stifou
CC BY-SA 4.0
2024-03-11T16:31:25.610Z
tried to update Bitcoin Core from 25.1 to 26.0.0 - without luck
stifou
CC BY-SA 4.0
2024-03-11T17:54:31.287Z
@stifou `importmulti` is not available for descriptor wallets, you should use `importdescriptors`. However, your descriptor is probably constructed incorrectly. You can use `listdescriptors true` to get the descriptor with the master private key, and then change the derivation path in that to be what you need, and import that.
Ava Chow
CC BY-SA 4.0
2024-03-11T15:00:39.437Z
2024-03-11T15:00:39.437Z
Ava Chow
<p>I managed to recover the funds thanks to Ava Chow's help!</p>
<p>Blog blog with screenshots <a href="https://sbounmy.com/lost-funds-in-generated-child-address-bip32-hd-wallet-not-recognized-by-bitcoin-core-wallet/" rel="nofollow noreferrer">here</a></p>
<p>I couldn't properly find the right derivation path so I used <a href="https://iancoleman.io/bip39/" rel="nofollow noreferrer">https://iancoleman.io/bip39/</a></p>
<ol>
<li>I put my <code>master private key</code> in <code>BIP Root Key</code></li>
<li>check if the <code>BIP32 Extended Public Key</code> matches the <code>master public key</code> I've setup in my app (used <a href="https://github.com/sbounmy/cryptocoin_payable/blob/master/README.md?plain=1#L100" rel="nofollow noreferrer">cryptocoin_payable</a>)</li>
<li>found the index <code>284</code> which was my node path and the public address matches the one which has the funds <code>1F3PZ1Qjtpmdcg3QGhK5szsPzY9nPLJeNq</code> !</li>
</ol>
<p>With this I constructed the descriptor :</p>
<p><code>pkh(my_private_key)</code></p>
<p>Then find the checksum</p>
<pre><code>getdescriptorinfo &quot;pkh(my_private_key)&quot;
{
  &quot;descriptor&quot;: &quot;pkh(my_private_key)#something&quot;,
  &quot;checksum&quot;: &quot;my_checksum&quot;,
  &quot;isrange&quot;: false,
  &quot;issolvable&quot;: true,
  &quot;hasprivatekeys&quot;: true
}
</code></pre>
<p>Then import the descriptor :</p>
<pre><code>importdescriptors '[{ &quot;desc&quot;: &quot;pkh(my_private_key)#my_checkum&quot;, &quot;timestamp&quot;:1455191478, &quot;internal&quot;: true }]'
</code></pre>
<p>Wait for scanning a while...</p>
<p>And voila !</p>
<p>At some point I was expecting this to work (following Ava's help) <code>importdescriptors '[{ &quot;desc&quot;: &quot;pkh(master_private_key/44'&quot;'&quot;'/0'&quot;'&quot;'/0'&quot;'&quot;'/0/284)#nnzeerhk&quot;, &quot;timestamp&quot;:1455191478, &quot;internal&quot;: true }]'</code>
￼<code>[{ &quot;success&quot;: true }]</code> but didn't... maybe derivation path should be <code>m/0'&quot;'&quot;'/0'&quot;'&quot;'/284</code> instead.</p>

CC BY-SA 4.0
2024-03-14T13:00:44.870Z
Awesome, thank you for letting us know and writing up your own solution!
Murch
CC BY-SA 4.0
2024-03-14T06:42:41.137Z
2024-03-14T06:42:41.137Z
stifou
<p>I have an app that generates 1 public address = 1 transaction using HD Wallet.</p>
<p>However I forgot to put the node path <code>/0</code> while generating the child address and my Bitcoin Core wallet does not recognize the fund that have been sent.</p>
<p>Is there any way I can recover the funds through <code>scriptPubKey</code> or something ?</p>
<p>or are the funds lost forever ?</p>
<p>Address that received the fund : <a href="https://bitcoinexplorer.org/address/1F3PZ1Qjtpmdcg3QGhK5szsPzY9nPLJeNq" rel="nofollow noreferrer">https://bitcoinexplorer.org/address/1F3PZ1Qjtpmdcg3QGhK5szsPzY9nPLJeNq</a></p>
<p>￼</p>
<pre><code>Address generated without node path
    getaddressinfo 1F3PZ1Qjtpmdcg3QGhK5szsPzY9nPLJeNq
    ￼
    {
      &quot;address&quot;: &quot;1F3PZ1Qjtpmdcg3QGhK5szsPzY9nPLJeNq&quot;,
      &quot;scriptPubKey&quot;: &quot;76a9149a056b1113775ba165d929461f305d493349a55b88ac&quot;,
      &quot;ismine&quot;: false,
      &quot;solvable&quot;: false,
      &quot;iswatchonly&quot;: false,
      &quot;isscript&quot;: false,
      &quot;iswitness&quot;: false,
      &quot;ischange&quot;: false,
      &quot;labels&quot;: [
      ]
    }


Address generated with node path

    ￼
    getaddressinfo 1Fq1BbugkWzQyJBoFEJrbcTmsxe44Mhhfz    
    ￼
    {
      &quot;address&quot;: &quot;1Fq1BbugkWzQyJBoFEJrbcTmsxe44Mhhfz&quot;,
      &quot;scriptPubKey&quot;: &quot;76a914a2a5e135a645025d0b87f710ec7d7122fd9c8a3488ac&quot;,
      &quot;ismine&quot;: true,
      &quot;solvable&quot;: true,
      &quot;desc&quot;: &quot;pkh([3db26443/44'/0'/0'/0/12]------)#psf0gapz&quot;,
      &quot;parent_desc&quot;: &quot;pkh([3db26443/44'/0'/0']xpub-----/0/*)#7uthurwc&quot;,
      &quot;iswatchonly&quot;: false,
      &quot;isscript&quot;: false,
      &quot;iswitness&quot;: false,
      &quot;pubkey&quot;: &quot;------&quot;,
      &quot;iscompressed&quot;: true,
      &quot;ischange&quot;: true,
      &quot;timestamp&quot;: 1703084241,
      &quot;hdkeypath&quot;: &quot;m/44'/0'/0'/0/12&quot;,
      &quot;hdseedid&quot;: &quot;0000000000000000000000000000000000000000&quot;,
      &quot;hdmasterfingerprint&quot;: &quot;3db26443&quot;,
      &quot;labels&quot;: [
      ]
    }
</code></pre>

<bip32-hd-wallets><wallet-recovery>
Lost funds? Generated child address (HD Wallet BIP32) without Node path
stifou
# Lost funds? Generated child address (HD Wallet BIP32) without Node path

(Asked by: username_0 on 2024-03-11)

I have an app that generates 1 public address = 1 transaction using HD Wallet.

However I forgot to put the node path `/0` while generating the child address and my Bitcoin Core wallet does not recognize the fund that have been sent.

Is there any way I can recover the funds through `scriptPubKey` or something ?

or are the funds lost forever ?

Address that received the fund : <https://bitcoinexplorer.org/address/1F3PZ1Qjtpmdcg3QGhK5szsPzY9nPLJeNq>

￼

```
Address generated without node path
    getaddressinfo 1F3PZ1Qjtpmdcg3QGhK5szsPzY9nPLJeNq
    ￼
    {
      "address": "1F3PZ1Qjtpmdcg3QGhK5szsPzY9nPLJeNq",
      "scriptPubKey": "76a9149a056b1113775ba165d929461f305d493349a55b88ac",
      "ismine": false,
      "solvable": false,
      "iswatchonly": false,
      "isscript": false,
      "iswitness": false,
      "ischange": false,
      "labels": [
      ]
    }

Address generated with node path

    ￼
    getaddressinfo 1Fq1BbugkWzQyJBoFEJrbcTmsxe44Mhhfz    
    ￼
    {
      "address": "1Fq1BbugkWzQyJBoFEJrbcTmsxe44Mhhfz",
      "scriptPubKey": "76a914a2a5e135a645025d0b87f710ec7d7122fd9c8a3488ac",
      "ismine": true,
      "solvable": true,
      "desc": "pkh([3db26443/44'/0'/0'/0/12]------)#psf0gapz",
      "parent_desc": "pkh([3db26443/44'/0'/0']xpub-----/0/*)#7uthurwc",
      "iswatchonly": false,
      "isscript": false,
      "iswitness": false,
      "pubkey": "------",
      "iscompressed": true,
      "ischange": true,
      "timestamp": 1703084241,
      "hdkeypath": "m/44'/0'/0'/0/12",
      "hdseedid": "0000000000000000000000000000000000000000",
      "hdmasterfingerprint": "3db26443",
      "labels": [
      ]
    }

```

**Tags:** bip32-hd-wallets, wallet-recovery


---

## 2 answers

### Answer by username_1 on 2024-03-11. Score: 2

If you're only missing part of the derivation path, then the key can still be generated from the master private key. The issue is just that Bitcoin Core doesn't search all derivation paths (that'd be impossible), just those that are explicitly given to it.

So you can take the master private key, construct a descriptor with that key that generates the address that you want, and import that descriptor to your wallet. It should then recognize your funds on a rescan and be able to spend them.

> **Comments:**
> **username_0**: Thank you Ava! I am trying with Bitcoin Core console `importmulti '[{"desc": "pkh([my_xprv/44'"'"'/0'"'"'/0'"'"'/0/12]my_xpub)","timestamp": "now","range": [0,1000],"watchonly": true}]' '{"rescan": true}'`  But I have "Only legacy wallets are supported by this command"  Is my descriptor correct or am I missing something ?  
> **username_0**: tried to update Bitcoin Core from 25.1 to 26.0.0 - without luck  
> **username_1**: @username_0 `importmulti` is not available for descriptor wallets, you should use `importdescriptors`. However, your descriptor is probably constructed incorrectly. You can use `listdescriptors true` to get the descriptor with the master private key, and then change the derivation path in that to be what you need, and import that.  

---

### Answer by username_0 on 2024-03-14. Score: 1

I managed to recover the funds thanks to username_1's help!

Blog blog with screenshots [here](https://sbounmy.com/lost-funds-in-generated-child-address-bip32-hd-wallet-not-recognized-by-bitcoin-core-wallet/)

I couldn't properly find the right derivation path so I used <https://iancoleman.io/bip39/>

1. I put my `master private key` in `BIP Root Key`
2. check if the `BIP32 Extended Public Key` matches the `master public key` I've setup in my app (used [cryptocoin\_payable](https://github.com/sbounmy/cryptocoin_payable/blob/master/README.md?plain=1#L100))
3. found the index `284` which was my node path and the public address matches the one which has the funds `1F3PZ1Qjtpmdcg3QGhK5szsPzY9nPLJeNq` !

With this I constructed the descriptor :

`pkh(my_private_key)`

Then find the checksum

```
getdescriptorinfo "pkh(my_private_key)"
{
  "descriptor": "pkh(my_private_key)#something",
  "checksum": "my_checksum",
  "isrange": false,
  "issolvable": true,
  "hasprivatekeys": true
}

```

Then import the descriptor :

```
importdescriptors '[{ "desc": "pkh(my_private_key)#my_checkum", "timestamp":1455191478, "internal": true }]'

```

Wait for scanning a while...

And voila !

At some point I was expecting this to work (following Ava's help) `importdescriptors '[{ "desc": "pkh(master_private_key/44'"'"'/0'"'"'/0'"'"'/0/284)#nnzeerhk", "timestamp":1455191478, "internal": true }]'`
￼`[{ "success": true }]` but didn't... maybe derivation path should be `m/0'"'"'/0'"'"'/284` instead.

> **Comments:**
> **username_2**: Awesome, thank you for letting us know and writing up your own solution!  

---

