Crypto glossary
Extended public key (xpub)
An extended public key (xpub) can derive every public address of an HD wallet account, enabling watch-only wallets but exposing your full balance and history.
In BIP-32, each node of the key tree has an extended key: a key plus a chain code. The extended public key of an account lets software derive all the account's receiving and change addresses without being able to spend from them. Variants called ypub and zpub signal wrapped SegWit or native SegWit accounts, though modern wallets increasingly use output descriptors instead.
Xpubs make useful setups possible. A merchant can give a payment server its xpub so that it generates a fresh address for every invoice without holding any spending keys. A user can monitor a hardware wallet's balance from a watch-only app on their phone. Multisig wallets exchange the xpubs of all cosigners to build shared addresses.
An xpub is not a secret that allows theft, but it is a serious privacy leak: anyone who has it can see every past and future address, balance and transaction in that account. Some online portfolio trackers ask for it. Worse, combining an xpub with any non-hardened child private key can reveal the account's private key, so the two should never be exposed together.
Example
A shop sets up BTCPay Server with the zpub of its hardware wallet; each customer receives a unique address, and the shop's keys never touch the internet-connected server.
