HD wallet

Also known as: Hierarchical deterministic wallet

On this page 8

An HD wallet, short for hierarchical deterministic wallet, is a crypto wallet that derives an unlimited tree of key pairs from a single seed, so one backup restores every private key and address the wallet has ever used. In wallets & custody, the HD design is the reason a twelve or twenty-four word recovery phrase can protect years of activity across many accounts and blockchains.

The model was standardized for Bitcoin in BIP32, extended by BIP39 for mnemonic seed phrases and BIP44 for a common path layout, and it is now used by nearly every modern software and hardware wallet in Crypto & blockchain, including multichain wallets that hold Bitcoin, Ethereum and Solana assets side by side.

How an HD wallet derives keys from one seed

An HD wallet works by feeding a random seed of 128 to 512 bits into HMAC-SHA512, which produces a master private key and a chain code. The chain code is extra entropy that, together with a parent key and an index number, deterministically produces each child key. Repeating the step creates grandchildren, great-grandchildren and so on, forming a tree.

Because the process is fully deterministic, the same seed always regenerates the same tree in the same order. The wallet therefore never needs to back up individual keys: it only needs the seed, usually encoded as a BIP39 mnemonic, plus knowledge of which derivation paths were used. Older non-deterministic wallets, by contrast, generated independent random keys and required a fresh backup whenever new keys were created.

The table below summarizes the building blocks that appear in every BIP32 implementation.

ComponentSize or formRole in the tree
Seed128-512 bits, often from a BIP39 phraseSingle root secret for the whole tree
Master key256-bit private keyRoot node from which all branches start
Chain code256 bitsExtra entropy that prevents guessing child keys
Child index32-bit integerSelects one branch under a parent node
Extended keyxprv or xpub stringKey plus chain code, able to derive descendants
Core components of BIP32 key derivation

Hardened and non-hardened derivation

BIP32 defines two child types, and the difference is the most important security detail of the HD wallet design. Non-hardened children (indexes 0 to 2^31 – 1) can be derived from the parent extended public key, which lets a server or watch-only wallet generate fresh receiving addresses without holding any private key.

Hardened children (indexes 2^31 and above, written with an apostrophe such as 44′) require the parent private key. Hardening blocks a known attack: if an attacker obtains an xpub plus any single non-hardened child private key, simple arithmetic reveals the parent private key and therefore every sibling key. For that reason, the upper levels of standard paths are always hardened.

PropertyNon-hardenedHardened
Index range0 to 2,147,483,6472,147,483,648 and above
Derivable from xpubYesNo, needs the private key
Typical useAddress and change levelsPurpose, coin type and account levels
Risk if a child key leaksParent key can be recovered with the xpubLeak stays isolated to that child
Comparison of the two derivation modes

Derivation paths and standards

A derivation path is the address of a key inside the tree, written as m / purpose’ / coin_type’ / account’ / change / address_index. BIP44 fixed this five-level layout so that different wallet software can restore the same funds from the same seed. Later proposals changed only the purpose number to signal the address format.

Path mismatches are the most common reason a correctly restored seed appears to show an empty balance. The seed is fine, but the new wallet is scanning a different branch.

StandardExample pathAddress type
BIP44m/44’/0’/0’/0/0Legacy Bitcoin P2PKH, also used by most EVM wallets as m/44’/60’/0’/0/n
BIP49m/49’/0’/0’/0/0Nested SegWit P2SH-P2WPKH
BIP84m/84’/0’/0’/0/0Native SegWit P2WPKH, bc1q addresses
BIP86m/86’/0’/0’/0/0Taproot P2TR, bc1p addresses
SLIP-0010m/44’/501’/0’/0′Ed25519 chains such as Solana, hardened only
Widely used derivation path standards

The coin type number comes from the SLIP-0044 registry (0 for Bitcoin, 60 for Ethereum, 501 for Solana). The change level separates external receiving addresses (0) from internal change addresses (1), which matters for UTXO chains that return leftover value to the sender.

The HD structure describes how keys are generated, not where they are stored or who controls them. A hardware wallet, a mobile hot wallet and a browser extension such as MetaMask can all be HD wallets. The comparison below places the concept next to neighboring designs in the same Topic.

DesignKey generationBackup modelMain difference
HD walletTree derived from one seedOne seed phraseUnlimited addresses, single backup
Non-deterministic walletIndependent random keysEvery key backed upBackups go stale as keys are added
Multisig walletSeveral HD trees, one per signerEach seed plus the wallet descriptorSpending needs m-of-n signatures
MPC walletKey shares, no full key existsShare backups held by partiesNo single seed to steal or lose
Smart contract walletContract logic plus signer keysRecovery rules in codeSupports social recovery and policies
HD wallets and neighboring wallet concepts

Privacy and operational benefits

HD wallets make it practical to use a fresh address for every payment, which reduces address reuse and makes on-chain linking harder. Separate accounts at the third level let one seed keep business, personal and savings funds in distinct branches without mixing their histories.

Extended public keys enable watch-only setups: an accounting system or merchant server can generate invoices and track balances while the private keys stay offline on a hardware device. That separation is a cornerstone of practical self-custody for businesses.

Risks, limitations and common mistakes

The single seed is both the strength and the single point of failure: anyone who learns the seed controls every derived key, and losing it means losing every branch. Experienced practitioners treat the xpub as sensitive data as well, because it exposes the entire transaction history of an account.

  • Sharing an xpub with an untrusted service reveals all past and future addresses of that account.
  • Assuming one path when restoring can hide funds held under BIP49, BIP84 or a vendor-specific path.
  • Ignoring the gap limit, usually 20 unused addresses, can make a restored wallet stop scanning before it finds later deposits.
  • Forgetting an optional BIP39 passphrase produces a valid but entirely different tree with no error message.
  • Exporting a child private key while an xpub is public breaks non-hardened isolation.

The short version

An HD wallet works like a master recipe that can bake endless keys. Instead of storing hundreds of separate keys, the wallet keeps one secret starting point, the seed, and follows fixed steps to recreate any key whenever it needs one.

The practical result is simple: write down the recovery phrase once, keep it safe, and every address can be rebuilt on a new device. The flip side is equally simple: whoever holds that phrase holds everything.

Where it makes a difference

A small online store accepts Bitcoin and wants a unique address for every order without keeping private keys on its web server. The owner initializes a hardware wallet, records the 24-word phrase on a steel plate, and exports the account xpub for path m/84’/0’/0′. The checkout software derives a new bc1q address from that xpub for each invoice and marks orders as paid when deposits arrive.

After two years and roughly 3,000 orders, the hardware device fails. The owner buys a replacement, enters the same phrase and selects the native SegWit account. Because the receiving index has grown far beyond 20, the owner raises the gap limit to 3,500 in the wallet software. Every historical address and the full balance reappear, and no funds are lost despite the hardware failure.