An xpub, ypub or zpub is the public half of a Bitcoin wallet. Share it with a watch-only app and you can follow your balance forever, without ever exposing a private key. Here's what each prefix means, why watching is safe, and the privacy trade-offs to know.
What an extended public key is
Modern Bitcoin wallets are hierarchical deterministic (HD). From a single seed phrase, the wallet derives an effectively unlimited tree of keys and addresses. Every branch of that tree has two halves: a private key, which can sign and spend, and a matching public key, which can only receive and be observed.
An extended public key, the thing that starts with xpub, ypub or zpub, is the public half of one account branch. Hand it to a piece of software and that software can mathematically derive every receive and change address in the account, watch them on the blockchain, and add up your balance. What it cannot do is produce a single signature, because the private side of the tree never travels with the public key.
xpub vs ypub vs zpub
Here's the part that confuses people: xpub, ypub and zpub are not three different technologies. They encode the same kind of key. The leading letter is a version prefix (defined by SLIP-0132) that tells the wallet which address format to derive, so the addresses it shows match the ones your hardware actually generates.
- xpub, legacy P2PKH (BIP44). The original format. Derivation path
m/44'/0'/0', producing addresses that start with 1. Widely compatible, but the most expensive to spend from because the inputs are larger. - ypub, nested SegWit, P2SH-P2WPKH (BIP49). SegWit wrapped inside a legacy-style script. Path
m/49'/0'/0', with addresses that start with 3. A middle ground that older services accept while still cutting fees. - zpub, native SegWit, P2WPKH (BIP84). The modern default. Path
m/84'/0'/0', with bech32 addresses that start with bc1q. The cheapest to transact with and the most widely recommended today.
The practical rule: export whichever prefix matches the address type you use. If your wallet hands you bc1 addresses, give a watch-only app the zpub. Feed it the wrong prefix and the derived addresses simply won't line up with your real ones, so the balance reads as zero.
What a watch-only wallet is, and why it's safe
A watch-only wallet imports a public key (an xpub/ypub/zpub) or even a single address, and nothing else. It is, in the most literal sense, read-only. You get the full picture, balance, incoming and outgoing transactions, confirmation status, with none of the spending power.
This is the safe way to keep an eye on cold storage. Your hardware wallet or signing device keeps the private keys offline; your phone only ever sees the public side. Even if your phone is lost or compromised, an attacker learns your balance and history but cannot move a single satoshi. A well-built app reinforces this: Bitcoin Insight rejects private keys outright, if you ever paste a seed or a WIF private key by accident, it refuses the input rather than storing it.
HD derivation and the gap limit
When you add an extended public key, the app walks the HD tree (BIP32) to generate your addresses: one chain for receive addresses, another for change. Because the tree is deterministic, the same xpub always yields the same sequence of addresses, on any compliant wallet.
To know when to stop scanning, wallets use a gap limit, conventionally 20 consecutive unused addresses. The app derives addresses in order and checks each for activity; once it hits 20 in a row that have never been used, it assumes the rest are empty and stops. This keeps lookups fast, but it has an edge case: if you somehow skipped ahead and left a gap larger than the limit, funds beyond that gap may not be detected until the limit is raised. For everyday wallets this almost never happens.
Privacy considerations
Watch-only is safe for your funds, but be deliberate about privacy. An extended public key reveals the entire account: anyone holding it can derive and monitor all of your addresses, link them together as one wallet, and see your total balance and history. So treat an xpub as sensitive even though it can't spend.
There's also the data source. To show a balance, a watch-only app has to ask some server whether each derived address has coins. In Bitcoin Insight the key never leaves your device, derivation happens on-device and the key is stored in the iOS Keychain, but the resulting addresses are looked up via the public mempool.space API. That means the data provider can see the addresses being queried. For most people this is a fine trade-off; if you need maximum privacy, running your own node and pointing tools at it is the gold standard.
Track an xpub balance on iPhone with Bitcoin Insight
Bitcoin Insight is a native iOS app (iOS 17+) built for exactly this. Adding a watch-only wallet takes a few seconds:
- Paste an xpub, ypub or zpub, or a single address, and the app derives your addresses on-device using the matching BIP path.
- Private keys are rejected. The import is watch-only by design; seeds and private keys are refused, never stored.
- Face ID, Touch ID or Optic ID lock. Gate the wallet behind biometrics so balances stay private even if your phone is unlocked.
- Hide balances with a tap for glancing in public, and store the key safely in the iOS Keychain.
- See it in context alongside the live mempool, fee estimates, the block height and the built-in block explorer.
It's free, open source under the MIT license, with no accounts, no ads and no tracking, the only paid extra is a one-time unlock for the Home and Lock Screen widgets.
FAQ
Is a watch-only wallet safe?
Yes. A watch-only wallet holds only your extended public key (xpub, ypub or zpub), never a private key or seed phrase. It can show balances and transaction history, but it cannot move funds, because spending requires the private keys that never leave your hardware or signing wallet. Bitcoin Insight goes a step further and rejects private keys outright if you ever paste one by mistake.
What is the difference between xpub, ypub and zpub?
They are the same kind of extended public key with different version prefixes that signal which address type a wallet uses. xpub maps to legacy P2PKH addresses that start with 1, ypub maps to nested SegWit P2SH addresses that start with 3, and zpub maps to native SegWit bech32 addresses that start with bc1. Use the prefix your wallet exported so the addresses derived for watching match the ones you actually use.
Can I track an xpub balance on iPhone with Face ID?
Yes. Bitcoin Insight is a native iOS app that lets you add an xpub, ypub or zpub as a watch-only wallet. Addresses are derived on-device, the key is stored in the iOS Keychain, and you can lock the wallet behind Face ID, Touch ID or Optic ID and hide balances with a tap. It is free, with no account required.