6

As far as I understand, there is a standard that describes what address types an extended private key or extended public key is intended to derive and it works as such:

  • xpriv/xpub => Legacy address (1...)
  • ypriv/ypub => nested SegWit address (3...)
  • zpriv/zpub => native SegWit address (bc1q...)

So regarding this, I have 2 questions:

  1. What is the name or BIP number of this standard?
  2. What does an extended public key look like, that is intended to be used for P2TR addresses (bc1p...)?

2 Answers 2

12

There is no ypub/zpub similar thing for Taproot. The recommendation is to use xpriv/xpub along with some extra information indicating that the script to create is Taproot, (e.g. with a tr() descriptor).

This is because it is a layer violation to have the extended keypair indicate the script type to create. The keys should not and do not care about what scripts to create. Additionally, xprv and xpub are not supposed to indicate legacy addresses - they are for BIP 32 extended keys which are script agnostic. To use them to indicate legacy addresses is incorrect.

In general, there is a move towards encouraging and using more complicated scripts where having extended keypairs indicate script type doesn't really make sense.

7

The concept of an xpub originates from BIP32, where it denotes an extended public key, from which multiple child keys can be derived.

At the time of BIP32, there was really only one address type commonly used, pay-to-pubkey-hash (P2PKH). Thus, BIP32 were commonly understood to imply a sequence of derived P2PKH addresses.

After segwit, when other address types came in common use, like P2SH-P2WPKH and P2WPKH, people needed a way to convey "a BIP32 extended public key, but the derived addresses are P2SH-P2WPKH". This became the ypub scheme defined in BIP49 for P2SH-P2WPKH, and later the zpub scheme in BIP84 for P2WPKH. They contain the exact same information as a BIP32 extended public key, but with a different prefix to denote the corresponding address type. Various other variants were defined and adopted by some software, e.g. Zpub for P2WSH, but not standardized through the BIP process as far as I know.

Other software never adopted ypub/zpub/Zpub/..., as the continuing need for new prefixes does not scale well, and the notion of trying to pack all address derivation information into a single key string also just doesn't work for more complex constructions like multisig. For example, in the newer output descriptors (BIP380) standard, xpub is always used, but one would use wpkh(xpub...) to indicate a P2WPKH address type.

As far as I know, there is no *pub-like standard for P2TR yet, and in my opinion there should not be. It is much clearer to convey address type information outside of key strings.

Disclaimer: I'm the author of BIP32, and co-author of BIP380.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.