← Back to Glossary

Ypub (Extended Public Key)

A ypub is an extended public key whose version prefix signals, under the SLIP-132 convention, that its addresses should be derived as wrapped SegWit under BIP 49, the pay-to-script-hash nested type beginning with 3. It carries exactly the same key material as an xpub; only the 4-byte prefix and the intended address format differ.

Why it matters

The prefix exists to prevent a specific, alarming failure. An extended public key says nothing by itself about which address type to derive, so a wallet importing bare key material could scan for the wrong addresses and show a zero balance for funds that are perfectly safe. The ypub prefix embeds the answer, telling any importing software to look for wrapped SegWit addresses, sparing users the experience of apparently vanished coins.

It is a wallet-industry convention rather than consensus protocol, and modern software increasingly replaces the whole prefix scheme with output descriptors, which state the address type explicitly.

How it works

The underlying 78-byte structure is identical to any BIP 32 extended key; swapping the version bytes converts ypub to xpub and back without touching the keys. BIP 49 wallets conventionally derive down the path beginning m/49', and the sibling prefix zpub plays the same role for native SegWit under BIP 84.

Ready to convert your gold to Bitcoin?

Get Your Free Kit →