An xPub key, or extended public key, is a master public key that generates all subsequent addresses for a blockchain, such as Bitcoin. It allows you to view the wallet’s transaction history and balance without exposing private keys. Since xPub keys cannot initiate transactions, they help ensure your security.
The evolution of Bitcoin standards has created several types of extended public keys:
- xPub: Generates addresses prefixed with 1.
- yPub: Generates addresses prefixed with 3 (SegWit).
- zPub: Generates Bech32 addresses prefixed with bc1 (SegWit).
These variations offer better security and efficiency for managing transactions.
How xPub keys work with UTXOs
In Unspent Transaction Output (UTXO)-based systems like Bitcoin, when a transaction occurs, the entire balance is transferred and any unspent amount is moved to a new, unused address.
Example: Using xPub keys with UTXOs
- Carol has 10 BTC in Wallet A.
- She sends 7 BTC to Tim.
- The remaining 3 BTC are moved to a new Wallet C.
This enhances privacy and security by moving funds to new addresses, which can be monitored using the xPub key without exposing private keys.
Reasons to use xPub keys instead of regular public keys
Managing individual addresses for each transaction can be cumbersome, requiring you to track hundreds of addresses. xPub keys offer read-only access to all transactions, addresses, and balances linked to the wallet. However, spending requires access to your private keys.
Understand xPub key’s limits
xPub keys don't apply to all blockchains. For example, Cardano uses an extended UTXO model with a stake key system instead of the xPub framework.
Other blockchains may adapt the UTXO model for features like privacy or smart contracts, requiring different address management methods that prioritize specific functionalities over simple tracking with xPub keys.