Protocols

Extended keys: xpub, ypub, and zpub

Last reviewed 1 December 2026.

Safety: Never type or paste a real recovery phrase, extended private key (xprv, yprv, zprv), or wallet backup into a website, chat, or any tool you do not fully control and trust. Examples on this page come from published official test vectors.

An extended key is a BIP32 node: a public or private key plus a chain code, so children can be derived from it. When that node is written down, it becomes a Base58 string that usually starts with xpub or xprv. Later Bitcoin address types added other prefixes, notably ypub and zpub. Those prefixes are version bytes, not a different kind of cryptography, and they are easy to misread.

This page is a comparison of the common prefixes and how they relate to BIP44, BIP49, BIP84, and BIP86.

What "extended" means

A plain public key identifies one address (or a handful of script forms of that same key). An extended public key identifies a branch: the key, the chain code, the depth, the parent fingerprint, and the child index. From an account-level extended public key, a watch-only wallet can derive the non-hardened receiving and change addresses for that account without holding private keys.

An extended private key can derive the same public branch and all of the descendant private keys. Treat an xprv, yprv, or zprv with the same care as a seed.

BIP32 serializes this data as 78 bytes plus a 4-byte checksum, then Base58-encodes it to a 111-character string. The first four bytes are a version field. On Bitcoin mainnet, BIP32 chose versions that encode as xpub (public) and xprv (private). Testnet uses tpub and tprv.

Why later prefixes exist

BIP32's xpub does not record how those keys should be turned into addresses, and it does not record the derivation path. After SegWit, the same public key could be a legacy P2PKH address, a nested SegWit address, or a native SegWit address. BIP43 recommended keeping the original xpub/xprv versions even for multi-coin trees, and using the purpose field to identify the scheme.

Wallet authors still found that users confused an xpub used for BIP44 with an xpub used for BIP49. BIP49 and BIP84 therefore defined alternate version bytes that encode as ypub/yprv and zpub/zprv. SLIP-0132 is the registry for those bytes, and it explains the same problem: without a new prefix, a consumer of an xpub would have to know the path in advance or scan more than one address space.

Prefix comparison

For Bitcoin mainnet, the usual mapping is:

ConventionPurpose pathTypical addressPublic prefixPrivate prefix
BIP44 legacy P2PKHm/44'/0'starts with 1xpubxprv
BIP49 P2WPKH-in-P2SHm/49'/0'starts with 3ypubyprv
BIP84 P2WPKHm/84'/0'bc1qzpubzprv
BIP86 P2TRm/86'/0'bc1pxpubxprv

Testnet counterparts are tpub/tprv for BIP44-style keys, upub/uprv for BIP49, and vpub/vprv for BIP84.

SLIP-0132 also registers uppercase prefixes for some multisig scripts: Ypub/Yprv for P2WSH nested in P2SH, and Zpub/Zprv for native P2WSH, with testnet Upub and Vpub. Those are not the same as BIP49 or BIP84 single-key accounts.

BIP86 is the exception that surprises people

BIP86 does not define a new prefix. Its official test vectors serialize Taproot account keys as xpub and xprv. SLIP-0132 does not list a Taproot-specific public prefix either.

So an xpub might be a BIP44 legacy account, a BIP86 Taproot account, or simply a BIP32 node with no script convention attached. The prefix alone cannot tell you which. The path can. A descriptor, which states the script and the path together, can too.

Official test vectors

SLIP-0132 and BIP86 both use the public BIP39 test mnemonic abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about with no passphrase. Under those published vectors, the first receiving addresses are:

Public test vector, never use for funds.

BIP44 m/44'/0'/0'/0/0  1LqBGSKuX5yYUonjxT5qGfpUsXKYYWeabA
BIP49 m/49'/0'/0'/0/0  37VucYSaXLCAsxYyAPfbSi9eh4iEcbShgf
BIP84 m/84'/0'/0'/0/0  bc1qcr8te4kr609gcawutmrza0j4xv80jy8z306fyu
BIP86 m/86'/0'/0'/0/0  bc1p5cyxnuxmeuwuvkwfem96lqzszd02n6xdcjrs20cac6yqjjwudpxqkedrcr

These are public test data, not a wallet for storing funds. They are useful because they show four different addresses from the same mnemonic, distinguished only by purpose and script type.

What an account xpub can and cannot do

An extended public key at the account level (for example m/84'/0'/0') can derive the non-hardened children 0/i and 1/i. That is enough to generate receiving and change addresses and to watch the account.

It cannot derive hardened children, so it cannot walk up to the coin-type or purpose node, and it cannot derive sibling accounts. It also does not hide your transaction history on that account: anyone with the xpub can compute the same addresses.

There is a further BIP32 warning. If a parent extended public key and any non-hardened child private key are both leaked, the parent private key can be recovered. That is why BIP44 hardens purpose, coin type, and account, and only then uses public derivation for addresses.

Re-serializing a key with a different prefix does not change the underlying key or chain code. It can change how a wallet interprets the script type. Do not casually convert an xpub to a zpub and assume the addresses will match what you already used.

A descriptor is the more complete backup for this information: it states the script and the path, instead of hoping a prefix is enough.

FAQ

Is the prefix a checksum of the path? No. It is a version byte chosen by convention. The same key can be encoded with more than one prefix.

Can I share an xpub safely? It cannot spend funds, but it reveals all non-hardened addresses under that node, and it is dangerous if combined with a leaked child private key. Share it only with a watch-only system you trust.

Why does my Taproot account show an xpub, not a zpub? Because BIP86 uses the original BIP32 versions. zpub is the BIP84 (native SegWit) prefix.

What about Litecoin or other coins' prefixes? SLIP-0132 lists some of them (for example Litecoin Ltub/Mtub). This page focuses on Bitcoin.

See also

Related lesson

Sources