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.