What is the length of the extended public key?


What is the length of the Extended Public Key?

The extended public key (xpub) is a format generated from a bitcoin wallet’s master public key (MPK). It is used to derive child public keys that can be implemented in software or hardware wallets. The xpub key contains additional data that allows you to derive multiple public keys that can be used for the same wallet without revealing any private key information.

The length of an extended public key (xpub) can vary depending on the encryption format used. In general, the maximum length of an xpub key can be up to 112 characters when encrypted using Base58 Check. However, the actual length of the key depends on how many bits are stored in it.

The size of an extended public key can be determined by the type of key derivation function used. Different protocols and programming languages may have different ways of calculating how long an xpub key should be.

In the case of Bitcoin, the xpub key is typically used for Hierarchical Deterministic (HD) wallets, which allow a virtually unlimited number of child keys to be generated from a single master key. These child keys can be used as public keys for different transactions and do not require the master key to be disclosed.

For example, suppose we use wallet software to generate an augmented public key with 256 bits of data. Given that each character in Base58 check encoding represents approximately 5.86 bits, it would take approximately 44 characters to represent the key (rounding up).

When using the BIP32 (Bitcoin Improvement Proposal 32) protocol, the xpub key length is determined as follows:

  • 78 bytes (includes prefix, depth, parent fingerprint, child index, chain code and public key)
  • 4 bytes.
  • Depth: 1 byte.
  • 32 bytes.
  • 4 bytes.
  • 33 bytes.

Therefore, the total length of an xpub key in the BIP32 protocol is 78 bytes, or 156 hexadecimal characters.

In summary, the length of an extended public key can vary depending on the encoding format used, the purpose for which it is used, and other factors such as programming language or protocol specifications. However, it is typically around 44-156 characters when using Base58 Check encoding or the BIP32 protocol.


What is the extended public key in bitcoin?

An extended public key is derived from a regular public key using a Hierarchical Deterministic (HD) wallet structure, as described in the book Mastering Bitcoin by Andreas Antonopoulos. It is used as part of the mechanism for generating new Bitcoin addresses.

How long does the extended public key last?

The length of the extended public key depends on the encryption format used. The book “Mastering Bitcoin” states that the most commonly used cryptographic format, known as “extended public key format version bytes”, produces an Extended Public Key that is 78 bytes long.

Why is the public key important in bitcoin?

The extended public key is important because it can be used to generate new Bitcoin addresses in a deterministic manner. This means that if you know the public key, you can generate a unique sequence of bitcoin addresses without needing the private keys associated with those addresses. This can be useful in many scenarios, such as backing up a wallet or allowing a third party to receive payments on your behalf.

Leave a Reply

Your email address will not be published. Required fields are marked *