← GlossarySecurity
What Is an Extended Public Key (xpub)? Privacy and Safety Risks
An extended public key, or xpub, is a BIP-32 public key plus a chain code that lets software derive every non-hardened child public key beneath it, and therefore every receive address, without access to any private key.
Key takeaways
- An xpub can generate all the addresses in its branch but cannot spend.
- It enables watch-only wallets and per-payment addresses for merchants.
- Anyone who has it can see every address and balance in that branch.
- Combined with a leaked child private key, it can expose the parent private key in some cases.
What it is
In an HD wallet, a key has two halves that matter here: the key itself and a chain code. BIP-32 lets the public version of a parent, together with its chain code, derive child public keys directly. That bundle is the extended public key, often called an xpub. With it, software can generate the sequence of receive addresses under that branch without ever seeing a private key.
What it is good for
A merchant's web server can hold an xpub and give each customer a fresh address, while the spending keys stay offline. A watch-only wallet can show your balance and history without the ability to move funds. The Bitcoin developer guide describes using such public data on a networked machine while an offline signer holds the private keys.
The privacy cost
An xpub reveals every address derived from it, past and future. Anyone who gets yours can link all your payments in that branch together and watch your balance. It cannot spend, but it removes the privacy that separate addresses were meant to give. Treat an xpub as sensitive and share it only with software you trust.
The extra risk
BIP-32 warns about a specific hazard: if an attacker holds an xpub and also learns one non-hardened child private key, they can compute the parent private key and then every sibling key. This is why wallets use hardened derivation for the upper levels and why you should not casually expose child private keys from an HD wallet.
Example
A shop loads an xpub into its server. For each order the server derives the next address and shows it at checkout. Payments arrive at addresses the shop can monitor, while the keys that can spend them sit in an offline wallet.
Put it into practice
Share receive addresses, not keys
To get paid, share a receive address from Scrypt Wallet, which exposes one destination. Never share a private key or recovery key with anyone.
Create a free wallet Get Scrypt for AndroidSources and verification
Last reviewed 2026-10-02 by the Scrypt Wallet team. The factual claims on this page, and where each comes from:
- BIP-32 allows a parent public key and chain code to derive child public keys without private keys. [1]
- BIP-32 warns that a leaked non-hardened child private key together with the parent public key can reveal the parent private key. [1]
- The developer guide describes an offline signer holding private keys while a networked wallet uses public data. [2]
Sources
- BIP-32: Hierarchical deterministic wallets · bitcoin/bips on GitHub · primary source
- Bitcoin developer guide: Wallets · Bitcoin.org · primary source
Primary sources are protocol papers, specifications, source code or a project's own documentation; secondary sources are wikis and explainers. We checked each claim against the source text on the review date. Found an error? Tell us and we will correct it.
Frequently asked questions
Can someone steal my coins with my xpub?
Not directly. But they can see all your addresses and balances, and combined with a leaked child key they could derive more.
Is an xpub the same as a public address?
No. An address is one destination. An xpub can generate all the addresses in a branch.
Should I share my xpub?
Only with software you trust for read-only use, because it exposes your full history in that branch.
Written by the Scrypt Wallet team · Updated 2026-10-02. General education, not financial, tax or legal advice.