The Master public key or extended public key (xpub) is the parent public key of a hierarchical deterministic (HD) Bitcoin wallet.
Introduced in 2012 with BIP-32, the extended public key (xpub) is the master public key of a hierarchical deterministic (HD) Bitcoin wallet, allowing the generation of a nearly unlimited number of addresses easily.
All child public keys are derived from the extended public key, and bitcoin addresses are created from these keys. A Master public key (XPUB) is obtained from the Master private key (XPRV) through an operation called elliptic curve multiplication (multiplying the private key by a constant point on the elliptic curve known as the generator point).
By controlling address management, but not private keys, the extended public key allows viewing all transactions and the balance of a wallet. Sharing one’s XPUB with a third party can compromise privacy. Possessing the XPUB allows knowledge of all addresses in a wallet, but it does not allow spending the funds inside.
Example of an extended public key:
xpub6EEtbhR6LZ2NrgJTD69z3B9rFQJQvrEfunmYKyCBiq1MRuQrVWX2h4CD1YzQS1XukeuP5bfzvudWLFJN3dkj8eQucDCWhSYcyu45PMSedj9
The extended public key facilitates the easier generation of a new address. Using a different address every time you want to receive bitcoin is a fundamental practice to protect the privacy of the funds’ recipient.