<p>I'm not a wallet developer but this is how I imagine the process of discovering funds in a seeded HD wallet works:</p>
<p>Start generating addresses for Account #0 and check if they appear in the blockchain history. After you see a long run of addresses with no history (say a few hundred), you can assume that's all the addresses that were used on this account. Do the above for Account #1, Account #2... until you start seeing accounts with no used addresses at all (again choose some cutoff point), then assume that's all the accounts.</p>
<p>If your seeded wallet supports multiple address types (Legacy, P2SH SegWit, Native SegWit), do the above for all of them.</p>

CC BY-SA 4.0
2021-06-11T14:41:49.263Z
2021-06-11T14:41:49.263Z
Vojtěch Strnad
<p>HD wallets create derivation paths for generated keys. But if you need to regenerate these keys with your seed or master key, where do you get the derivation paths? I don't see how they can be stored in the seed somehow. Does a wallet bruteforce derivation paths to find UTXOs with balances?</p>

<bip32-hd-wallets><seed><hardened-derivation>
How are derivation paths stored and regenerated for HD wallets?
Matt Tainsh
# How are derivation paths stored and regenerated for HD wallets?

(Asked by: username_0 on 2021-06-11)

HD wallets create derivation paths for generated keys. But if you need to regenerate these keys with your seed or master key, where do you get the derivation paths? I don't see how they can be stored in the seed somehow. Does a wallet bruteforce derivation paths to find UTXOs with balances?

**Tags:** bip32-hd-wallets, seed, hardened-derivation


---

## 1 answers

### Answer by username_1 on 2021-06-11. Score: 1 | Accepted answer

I'm not a wallet developer but this is how I imagine the process of discovering funds in a seeded HD wallet works:

Start generating addresses for Account #0 and check if they appear in the blockchain history. After you see a long run of addresses with no history (say a few hundred), you can assume that's all the addresses that were used on this account. Do the above for Account #1, Account #2... until you start seeing accounts with no used addresses at all (again choose some cutoff point), then assume that's all the accounts.

If your seeded wallet supports multiple address types (Legacy, P2SH SegWit, Native SegWit), do the above for all of them.


---

