Home › Glossary › Base58Check

Base58Check

Also called: Base58, base58 encoding, base58check encoding, legacy address format.

Base58Check is the original text encoding for Bitcoin addresses and keys: Base58 characters plus a 4-byte checksum from double SHA-256.

Base58Check is the encoding Bitcoin has used since the beginning for legacy addresses, WIF private keys and extended keys such as the xpub. It turns binary data into text with a built-in checksum, so most typos are caught.

How it works

The data is laid out as:

[version byte(s)] [payload] [4-byte checksum]

The checksum is the first 4 bytes of SHA-256 applied twice to the version and payload. The whole thing is then written in Base58, an alphabet of 58 characters: digits and letters without 0, O, I and l, which are easy to mix up.

The version byte fixes the first character, so you can tell types apart at a glance:

Version Starts with Meaning
0 1 P2PKH address
5 3 P2SH address (BIP 13)
196 2 Testnet P2SH address
128 (0x80) 5, K or L WIF private key
0x0488B21E xpub Extended public key (BIP 32)

BIP 38 encrypted keys use the same encoding with a prefix that makes them start with 6P.

Why newer addresses moved on

BIP 173 sets out the downsides: Base58 takes more room in QR codes because it can't use alphanumeric mode, mixed case is awkward to read aloud or type on a phone, decoding is slow, and the double SHA-256 checksum has no error-detection guarantees and can't point to where a mistake is. SegWit addresses therefore use Bech32 and Bech32m. Base58Check addresses remain valid, and you can inspect one with the address checker.

BIPs that define Base58Check

Related terms

  • Bech32: Bech32 is the checksummed base32 address format from BIP 173, used for native SegWit version 0 addresses that start with bc1q.
  • WIF (Wallet Import Format): WIF (Wallet Import Format) writes a single private key as Base58Check text starting with 5, K or L, so it can be moved between wallets.
  • P2PKH: P2PKH (Pay to Public Key Hash) is Bitcoin's original single-key output type: coins locked to a public key hash, with addresses starting with 1.
  • P2SH: P2SH (Pay to Script Hash), defined in BIP 16, locks bitcoin to the hash of a script. Its addresses start with 3, and it carried most early multisig.
  • xpub (extended public key): An xpub is a BIP 32 extended public key: a public key plus chain code that can derive every address in an account, but can't spend from them.

Learn more

Guides