What's the difference between xpub and bpub?

1

I've seen extended public keys such as the one below

xpub661MyMwAqRbcFLCsW67CH9AgprkK2MbeLbmdMiBRWb1Wamm6GjGhTFQChvPmwQGQh78MMd8Eu7CLJ7FEuwhsomD66XC74VnfgHdEx1NFSKL

But now I've seen a bpub

bpubgqxJY83YqBS1rgM392MqkPnaa7P8yBEkZ7pZksTUHjRxQRn8RzuL8ST1NYhAqgbM7f3SDzTTJifL1WuCYvVxHinLuhF4kFdnBNN34N4Y2et

What's the difference?

arshbot

Posted 2018-08-16T17:53:01.673

Reputation: 753

I don't recall this being defined in any (common) spec. Where are you seeing this?Raghav Sood 2018-08-16T17:58:21.683

bpub is probably the prefix for extended public keys for an altcoin.Andrew Chow 2018-08-16T18:15:32.093

@RaghavSood I found it while trying to answer a question about pywallet - and thus extended keys.

https://github.com/Ballanxe/pegaso/blob/5e0cbf8439c175becd80beb92e9e1fb075b65a47/src/.env

arshbot 2018-08-16T19:20:51.787

1@AndrewChow can you elaborate? What are prefixes? When do they apply? Why are they the same for some altcoins but not others?arshbot 2018-08-16T19:21:29.007

Answers

3

bpub appears to be the extended private key prefix for the Blockcypher testnet.

Bitcoin addresses and private keys usually have a prefix to help differentiate the network/type of key.

The original xpub notation comes from BIP32, meaning extended public key. This expanded into ypub with BIP49, and finally zpub with BIP49+ (used in BIP84).

Various coins can define their own prefix by simply altering the bytes. Litecoin, for instance, often uses Ltub.

It works the same way as changing the address prefix, except you change four bytes, instead of one.

Raghav Sood

Posted 2018-08-16T17:53:01.673

Reputation: 10 897