BITCOIN MAINNETLive explorer status
OWNERSHIP

Extended public keys (xpub)

An xpub can generate every receiving address of a wallet account without being able to spend. Learn its uses and why you should keep it private.

A public key that makes more public keys

An extended public key is a public key plus its chain code. With normal derivation, it can produce every child public key, and so every address, below it in the tree.

An xpub generates addresses but can never signSeedAccountprivate keyxprvpublic halfAccount xpubshareablewith careAddressesunlimited
An xpub generates addresses but can never sign

What it's useful for

  • Watch-only wallets that show balances and create receiving addresses, while keys stay on a hardware wallet.
  • Merchants generating a fresh address per invoice on a server that holds no keys.
  • Multisig setups, where co-signers exchange xpubs.

The prefixes

PrefixUsually for
xpubLegacy, or generic
ypubNested SegWit
zpubNative SegWit

Descriptors now replace these prefixes as a clearer way to say which script type applies.

Keep it private

An xpub can't spend, but anyone with it can see every past and future address and balance of that account. Treat it as sensitive.

A real use: accepting payments safely

A shop can put only its xpub on the web server that shows customers payment addresses. If the server is hacked, attackers can see payments but can't take any coins, because the private keys live elsewhere.

Watch-only on MyBitcoinExplorer

Our dashboard watchlists use individual addresses rather than xpubs, so you can monitor exactly what you choose without revealing your whole account. See Watch-only wallets.

Share this guide
Share on X ↗

Key takeaways

  • An xpub derives all public keys and addresses of an account.
  • It can't sign, so it powers watch-only wallets.
  • Leaking an xpub exposes your whole account history.

Common questions

Is it safe to give my xpub to a website?

It can't spend your coins, but it reveals all your addresses and balances to that site.

What's an xprv?

The extended private key. It can spend everything below it: guard it like your seed.

Is an xpub the same as a public key?

It's a public key plus a chain code, so it can derive many child public keys.

Can an xpub be used to steal bitcoin?

Not on its own, but combined with any one child private key it can expose the whole account, so treat it as sensitive.