Version bytes

From Trezor Wiki
Jump to: navigation, search

In Bitcoin-like cryptocurrencies, version bytes is a piece of data that is responsible for making different kinds of addresses and account public keys distinguishable in order to prevent potential errors leading to confusion and loss of funds.

See also: Coins definitions for Trezor, Bitcoin address prefixes + general conversion table, XPUB and XPRIV prefixes

Relation of version bytes and address

Technically, an address is base58check-encoded form of transaction commitment prefixed by version bytes:

address = Base58Check ( <versionBytes> <transactionCommitment> )

where transaction commitment is either public key hash for P2PKH, or script hash for P2SH.

NoteUnlike transaction commitments, version bytes and addresses are not included in blockchain. Rather, they are implemented on cryptocurrency software level by wallets and services. Sometime this implementation may change which leads to confusion among users and to transactional problems with services that are slow to adopt the change. This was the case with Litecoin's P2SH where address prefix changed from "3" to "M" to prevent confusion with similar addresses in Bitcoin. In such cases, custom tools are needed to convert an address to different format.