Extended Private Key (XPRV)

The extended private key is derived from the binary private key (along with an optional passphrase) using mathematical functions that most users donβt need to understand in detail.
Adding a passphrase significantly changes the resulting extended private key. Likewise, modifying the derivation path alters the generated keys and addresses. Itβs generally best to stick with the default derivation path provided by your wallet software, but make sure to write it down for future reference.
Why the Extended Private Key Mattersβ
The extended private key is responsible for generating all Bitcoin addresses in a wallet and granting the ability to spend from them. The key structure works as follows:
- The extended private key produces multiple individual private keys (standard private keys).
- Each individual private key generates a public key.
- Each public key creates a unique Bitcoin address.
Additionally, the extended private key is used to derive the extended public key, which weβll cover next.
Security Considerationsβ
Each individual private key does not reveal the extended private key. While Iβm not a cryptography expert, my understanding is that an individual private key might theoretically reveal the next private key in sequence, though this is uncertain. To stay safe, never share any private key with anyone.
However, it is certain that a public key cannot reveal its corresponding private key, nor can it reveal any other private key in the wallet. This is crucial to understand for security.
Generating and Testing an Extended Private Keyβ
You can generat a test wallet using Ian Colemanβs BIP39 tool, a great resource for experimenting with dummy wallets.
Never use Ian Colemanβs BIP39 tool to generate a real wallet on an internet-connected computer!
Hereβs an example of an extended private key:
xprv9yVYaFXM2uUDeaj3STkiHS8svtqoASkVZ8hdTYuBdgVQGKjr76ks922e4r6826YvdQtQdu71ZA2qK8fYE85jXvTPdBFwgQ2d8rk7hhXV5wu
Understanding Prefixes and Address Typesβ
- Keys starting with
βxβgenerate legacy (P2PKH) addresses, which begin withβ1β. - Keys starting with
βyβgenerate P2SH (Pay to Script Hash) addresses, which begin withβ3β. - Keys starting with
βzβgenerate native SegWit (Bech32) addresses, which begin withβbc1qβ. - Keys starting with uppercase βXβ, βYβ, or βZβ are used for multisignature wallets.
Understanding the extended private key is essential because it underpins all wallet addresses and transactions. Proper handling ensures security and smooth Bitcoin management.