What is an xpub (extended public key)?
An extended public key for one branch of a wallet. It reveals addresses and payments in that branch, but cannot by itself spend them.
Not to be confused with: a private key — it can see, it cannot spendPrivate keyThe secret number that lets you spend your bitcoin. Whoever knows it controls the coins, so it must never be shared..
Defined in BIP-32, an xpub lets a wallet or watch-only app derive the non-hardened public keysPublic keyThe partner of a private key. It lets anyone check a signature without revealing the private key under current computing assumptions. below it without holding the private keysPrivate keyThe secret number that lets you spend your bitcoin. Whoever knows it controls the coins, so it must never be shared..
A wallet can use several xpubs and other key material, so one xpub does not necessarily cover every account. Treat it as private: it can reveal the history, balance and public keys for its own derivation subtree.
References
- Bitcoin Improvement Proposals, “BIP-32: Hierarchical Deterministic Wallets”.