Home › Glossary › HD wallet

HD wallet

Also called: hierarchical deterministic wallet, BIP32 wallet, BIP 32 wallet, deterministic wallet, HD wallets.

An HD (hierarchical deterministic) wallet derives a whole tree of keys from one seed, as defined in BIP 32, so a single backup restores every address.

An HD wallet, short for hierarchical deterministic wallet, generates all of its keys from one starting secret. "Deterministic" means the same seed always produces the same keys; "hierarchical" means those keys are arranged in a tree of branches.

How it works

BIP 32, written by Pieter Wuille in 2012, defines the scheme. A seed of 128 to 512 bits (usually from a seed phrase) is hashed with HMAC-SHA512 using the key Bitcoin seed. The left 32 bytes become the master private key and the right 32 bytes the master chain code. Together they form the master extended key, written m.

Each extended key can derive 2^31 normal children and 2^31 hardened children, and each child can have children of its own. A derivation path such as m/84'/0'/0'/0/5 names one key in that tree.

Why it matters

  • One backup. BIP 32 points out that the reference client of the time kept a pool of 100 random keys and needed fresh backups as it used them. An HD wallet's seed covers every future address.
  • Addresses without spending power. An xpub can derive the public keys of its non-hardened children, so a web shop or watch-only app can create receiving addresses without being able to spend.
  • Standard layouts. BIP 43 and BIP 44, followed by BIP 49, BIP 84 and BIP 86, fix which branch holds which address type, so another wallet can find your coins after a restore. Wallets scan addresses in order and stop after 20 unused ones (BIP 44's gap limit).

Almost every modern wallet is an HD wallet. The derivation paths guide shows how the branches are laid out, and BIP 32 vs BIP 39 explains where the seed phrase fits in.

BIPs that define HD wallet

Related terms

  • Seed phrase: A seed phrase is a list of 12 to 24 words, defined by BIP 39, that encodes the random number from which a wallet derives all of its keys.
  • Derivation path: A derivation path like m/84'/0'/0'/0/0 locates one key inside an HD wallet: the sequence of child indexes taken from the master key.
  • xpub (extended public key): An xpub is a BIP 32 extended public key: a public key plus chain code that can derive every address in an account, but can't spend from them.
  • Hardened derivation: Hardened derivation is a BIP 32 way of deriving child keys that requires the parent private key, written with ' or h, as in m/84'/0'/0'.

Learn more

Guides