# HD wallets (BIP 32)

A hierarchical deterministic (HD) wallet derives an endless tree of keys from one seed, so a single backup restores everything. Learn how it works.

Canonical page: https://mybitcoinexplorer.com/learn/hd-wallets-bip32
Topic: Keys and addresses
Published: 2026-10-29
Updated: 2026-10-30


## One seed, a whole tree
Early wallets made each key separately, so every new address needed a new backup. **Hierarchical deterministic (HD)** wallets fix that: they derive all keys from one [seed](https://mybitcoinexplorer.com/learn/seed-phrases-bip39) in a tree.

> Diagram: One seed creates a tree of keys — Seed;Master key;Account 0,Account 1;Receive,Change,Receive,Change;Addr 0,Addr 1,Addr 0,Addr 1,Addr 0,Addr 1,Addr 0,Addr 1

## Deterministic
"Deterministic" means the same seed always produces exactly the same tree, so restoring the seed in any compatible wallet recreates every key and address.

## How a child key is made
Each key has a **chain code** alongside it. To get child number i, the wallet hashes (with HMAC-SHA512) the parent key, the chain code and i. Half the result tweaks the parent key; the other half becomes the child's chain code.

## Hardened vs normal
- **Normal** children can be derived from the parent **public** key. That's what lets an [xpub](https://mybitcoinexplorer.com/learn/extended-public-keys-xpub) generate addresses without any private keys.
- **Hardened** children (written with ′ or h) need the parent private key. They are used near the top of the tree to limit damage if one child private key leaks.


## The gap limit
When restoring, a wallet checks addresses in order and stops after it finds a run of unused ones, usually 20. If you generated many addresses without receiving to them, some funds may not appear until you raise the gap limit in settings.

## Why HD wallets are a privacy win
Because new addresses cost nothing, HD wallets can give every payment its own address while one backup still covers them all.


## Key takeaways

- HD wallets derive every key from one seed.
- The same seed always rebuilds the same tree of keys.
- Normal derivation lets public keys create child addresses; hardened derivation adds safety.

## Common questions

### How many addresses can an HD wallet make?

Billions per branch. In practice, wallets scan for used addresses using a 'gap limit'.

### Is an HD wallet the same as a hardware wallet?

No. HD describes how keys are derived; hardware describes where they're stored. Most hardware wallets are HD wallets.

### Do I need a new backup after creating new addresses?

No. Every address in an HD wallet comes from the same seed.

### Is BIP 32 the same as BIP 39?

No. BIP 39 turns words into a seed; BIP 32 turns that seed into a tree of keys.

## Related lessons

- [Derivation paths](https://mybitcoinexplorer.com/learn/derivation-paths)
- [Extended public keys (xpub)](https://mybitcoinexplorer.com/learn/extended-public-keys-xpub)
- [Seed phrases (BIP 39)](https://mybitcoinexplorer.com/learn/seed-phrases-bip39)
- [Private keys](https://mybitcoinexplorer.com/learn/private-keys)
