Hardened Derivation

Deriving a child key so that the parent's public key cannot be used to derive it, protecting against a leaked xpub.

Basically

Hardened derivation uses secret information from the parent key to make child keys. Someone with only the parent public key cannot make those children or turn one leaked child key into the rest.

Key Takeaways

  • Hardened derivation feeds the parent private key into HMAC-SHA512, while normal derivation uses the parent public key. An extended public key (xpub) alone cannot derive child keys at hardened levels.
  • Hardened derivation blocks a serious attack. With normal derivation, an attacker who obtains a child private key and the parent xpub can calculate the parent private key and compromise the entire HD wallet branch.
  • Standard BIP-44 paths harden the first three levels: purpose, coin type and account. The last two levels, change and address index, remain non-hardened so watch-only wallets can generate addresses.

What Is Hardened Derivation?

Hardened derivation is a key derivation method defined in BIP-32. It breaks the mathematical link between the parent public key and child keys. A hierarchical deterministic (HD) wallet generates keys in a tree from one seed phrase, and each level can use normal (non-hardened) or hardened derivation.

Normal derivation lets anyone with the parent extended public key derive every child public key below it. You can use this to generate receiving addresses without exposing private keys. Hardened derivation gives up that convenience so an exposed child private key cannot compromise the parent.

Hardened derivation uses an apostrophe (') or the letter h after the index number. For example, m/44'/0'/0' uses hardened derivation at all three levels.

How It Works

Normal and hardened derivation both use HMAC-SHA512 to produce child keys. The parent chain code is the HMAC key in both cases. The difference is the data fed into the function.

Normal (Non-Hardened) Derivation

Normal child keys use indices 0 through 2^31 - 1. Their HMAC input data combines the serialised parent public key with the child index.

The public key input lets anyone with the parent extended public key calculate the same HMAC output and derive child public keys. The xpub contains both the public key and chain code, so watch-only wallets and payment processors can generate fresh addresses without access to private keys.

Hardened Derivation

Hardened child keys use indices 2^31 through 2^32 - 1. Their HMAC input data uses the parent private key instead of the parent public key.

The parent private key requirement means only someone with that private key can derive children at this level. An xpub holder cannot compute hardened child keys at all: not the public keys, not the private keys, nothing.

Key Derivation Math

The 64-byte HMAC output splits into two 32-byte halves in both cases. The left half (IL) helps compute the child key, and the right half (IR) becomes the child chain code.

The additive relationship makes normal derivation vulnerable. An attacker who knows IL, which is computable from the xpub, and the child private key can subtract to recover the parent private key.

Hardened derivation stops the attacker from computing IL without the parent private key. That breaks the attack chain.

The Security Vulnerability

The BIP-32 specification explicitly warns that a parent extended public key plus any non-hardened child private key descending from it is equivalent to the parent extended private key. The attacker can therefore obtain every private key in that subtree.

Xpubs are designed to be shared, which creates this risk. A merchant might export an account-level xpub to a payment processor to generate fresh receiving addresses, while a user might load an xpub into a watch-only wallet on a less secure device. If one child private key from that non-hardened branch leaks through a compromised server, a leaked backup or a software bug, the attacker can reconstruct the parent private key and drain every address in the branch.

Hardened derivation prevents this cascade entirely. Even if a hardened child's private key leaks alongside the parent xpub, the attacker cannot reverse the derivation because they lack the parent private key needed to compute IL.

Notation and Index Ranges

BIP-32 divides the 32-bit child index space into two halves. One half is for normal derivation and the other is for hardened derivation.

The apostrophe notation is shorthand: 0' means index 0 + 2^31, which is 0x80000000 or 2,147,483,648. The BIP-32 specification itself uses an H subscript, but BIP-44 and common wallet implementations made the apostrophe convention standard.

Which Levels Should Be Hardened

The BIP-44 standard defines a five-level derivation path with three hardened levels followed by two non-hardened levels. The first three levels are hardened and the last two are not.

The design places the hardened boundary at the account level. An account-level xpub exported from a signing device can generate all receiving and change addresses below it while keeping accounts security-isolated. Other BIP standards follow the same pattern: BIP-84 (native SegWit) uses m/84'/0'/0', and BIP-86 (Taproot) uses m/86'/0'/0'.

Account Isolation in Wallets

Hardened derivation at the account level makes each account in an HD wallet cryptographically independent. You can export the xpub for account 0 to a payment processor and the xpub for account 1 to an accounting system without either party deriving keys for the other account. Even if one account's child private key leaks, the other accounts remain safe because the hardened boundary prevents upward key recovery.

Hardware Wallet Security

Cold storage devices such as hardware wallets enforce hardened derivation paths to prevent key compromise cascades. The hardened levels above an exported account-level xpub stop it from reconstructing the master key or keys for other accounts, even if a child private key later leaks on a connected computer. In early 2026, Ledger strengthened this with strict hardened derivation prefix rules: each application on the device is confined to its own isolated subtree, and at least one component of each path prefix must be hardened.

Multi-Currency Wallet Separation

The hardened coin type level, such as 0' for Bitcoin and 60' for Ethereum, creates cryptographically separate key trees for each cryptocurrency. A vulnerability in one chain's key handling therefore cannot compromise keys on another chain, even though all keys derive from the same seed phrase.

Why It Matters

Hardened derivation is a foundational security mechanism for any wallet that manages Bitcoin keys. Wallet developers building on Bitcoin infrastructure, including self-custodial solutions and Layer 2 protocols like Spark, need to distinguish hardened from normal derivation. Choosing the wrong derivation type at the wrong level can expose an entire key hierarchy to compromise from a single leaked child key.

Developers integrating Bitcoin wallet functionality can rely on frameworks and SDKs to handle much of this complexity. You still need to understand the underlying derivation model to make correct key management decisions. For a deeper comparison of wallet development approaches, see the Bitcoin wallet SDK comparison.

No Public Key Derivation at Hardened Levels

The primary trade-off of hardened derivation is losing public-key-only derivation. A watch-only wallet holding an xpub cannot generate child public keys beyond a hardened boundary. Payment processors, gap limit scanners and any other system that generates addresses from an xpub must therefore operate below the hardened levels in the derivation path.

Non-Hardened Levels Remain Vulnerable

Hardened derivation protects only the levels where it is applied. BIP-44 paths use normal derivation below the account level, so an attacker with the account-level xpub and any child private key below it can still compute all other private keys at that non-hardened level. The security model assumes you treat the account xpub carefully and do not share it publicly, as it reveals all addresses and balances for that account.

Backup and Recovery Implications

Hardened derivation creates independent subtrees, so recovering a wallet from a seed phrase requires knowing which derivation paths were used. Most wallets follow standard paths such as BIP-44, BIP-49, BIP-84 and BIP-86, but non-standard hardened paths can make funds difficult to recover if the path is not documented. Always record which derivation paths your wallet uses alongside your seed phrase backup.

Performance Considerations

Hardened derivation requires the private key for every derivation step. Systems that store the private key on a secure element or HSM need a round trip to the secure hardware for each hardened derivation step. For high-throughput address generation, the non-hardened levels below the account boundary avoid this bottleneck by allowing derivation from the xpub alone.

The glossary entry is for informational purposes only. It is not financial or investment advice, so always do your own research before using any protocol or technology.

0

← All 1876 glossary terms