xpub
Also: extended public key, zpub, ypub
wallets · intermediate
An extended public key: a public key plus its BIP-32 chain code, Base58-serialized, that can generate every receive address in an account.
An xpub is the Base58Check-encoded form of a [BIP-32](/glossary/bip32) extended public key: a 33-byte compressed public key, 32-byte chain code, depth, fingerprint, child number, and version bytes — about 111 characters total when serialized.
Why it matters: with just an xpub, anyone can generate every receive address under that node *without* being able to spend. Watch-only wallets, exchanges issuing customer deposit addresses, and accounting software all rely on this property. Hand over the [xprv](/glossary/xprv) and you've given up everything; hand over the xpub and you've given up only forward visibility into future receives.
The version-bytes prefix encodes which kind of addresses the xpub is for. Different wallets and BIPs use different prefixes:
- xpub — original BIP-32, generally interpreted as [BIP-44](/glossary/bip44) P2PKH
- ypub — SLIP-0132 convention for BIP-49 wrapped-SegWit
- zpub — SLIP-0132 convention for [BIP-84](/glossary/bip84) native SegWit
The underlying key material is identical; the prefix is purely a hint to the importing wallet about which address format to render. Mixing them silently is a common source of "I see the wrong addresses" bug reports.