A hierarchical deterministic wallet, or HD wallet, creates an entire tree of private keys and public addresses from a single starting value called a seed. The seed is normally written down as a recovery phrase, so one backup protects every key the wallet will ever produce. The method is set out in Bitcoin Improvement Proposal 32, described under BIP-32, and is used by most hardware wallets, exchange custody systems and software wallets.
For businesses, the value lies in handling large numbers of addresses: an exchange or payment processor can give each customer a fresh deposit address, keep records for accounting and reconcile receipts, without holding a separate backup per address. Three ideas decide how this works in practice: the derivation path that names each key, hardened derivation that protects the keys above it, and the gap limit that decides how many addresses a wallet looks for when it is restored. This page explains the concepts for payments and custody, without protocol detail.
Derivation Path
A derivation path is the written route from the master key to a particular child key in the wallet tree. It is shown as a series of numbers separated by slashes, such as m/44h/0h/0h/0/0, where m stands for the master key and each number is a step down one level. The letter h, or an apostrophe, marks a hardened step.
The layout most wallets follow is set by BIP-44. After m come five levels: a purpose number (44), a coin type (0 for Bitcoin, a different number for each other asset), an account number, a change flag that separates receiving addresses from change addresses, and an address index. Accounts let a business divide funds by department or client. Because the path decides which keys appear, a wallet restored on another device must use the same path scheme, or the funds will seem to have gone, even though they are safe at the addresses the other scheme created.
Hardened Derivation
Hardened derivation is a way of generating a child key so that the child cannot be used to work out its parent. In normal derivation, a child public key can be computed from the parent public key and a value called the chain code, which allows a server to produce receiving addresses without access to private keys. The weakness is that if an attacker learns one child private key as well as the parent's public key and chain code, the attacker can calculate the parent private key and hence every sibling key.
Hardened derivation avoids this by mixing the parent private key into the calculation, so a child public key cannot be derived from the parent public key alone. Wallets therefore use hardened steps at the upper levels, such as purpose, coin type and account, and normal steps for the lowest levels. The trade-off is that a hardened account cannot generate addresses from a shared extended public key, so a watch-only system needs the account-level key exported. Careful key handling still follows the rules for any private key.
Gap Limit
The gap limit is the number of consecutive unused addresses that a wallet will check before it stops looking for more. When an HD wallet is restored from a seed, it has no memory of which addresses were used, so it generates addresses in order and asks the blockchain whether each has received funds. BIP-44 sets the default gap limit at 20, so after 20 empty addresses in a row the wallet assumes there are no more.
The setting matters to any business that hands out many addresses. If a payment processor issues hundreds of deposit addresses and only a few customers pay, there may be a gap of more than 20 unused addresses, and a restored wallet could stop before reaching later payments and show a lower balance than it should. The funds are not lost; raising the gap limit in the wallet software, or scanning further, brings them into view. Operators therefore record the highest address index used, and test recovery before relying on it, in line with sound wallet recovery practice.
Ref 1070001410