Base58Check writes data using 58 easy-to-read characters plus a 4-byte checksum that catches typos. Learn how legacy addresses and WIF keys are built.
Why 58 characters?
Satoshi took the 62 letters and digits and removed four that look alike: 0 (zero), O (capital o), I (capital i) and l (lowercase L). What's left is 58 characters that are hard to misread.
The steps
- Start with a version byte (00 for P2PKH, 05 for P2SH, 80 for private keys in WIF).
- Add the payload, for example a 20-byte HASH160.
- Compute HASH256 of that and append its first 4 bytes as a checksum.
- Convert the whole thing to base 58. Each leading
00byte becomes a leading1.
Why the checksum matters
Mistype one character and the checksum won't match, so a wallet refuses to send. The chance that a random typo passes is about 1 in 4 billion.
The alphabet
123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyzNotice what's missing: 0, O, I and l.
Version bytes and prefixes
| Version byte | Starts with | Used for |
|---|---|---|
| 0x00 | 1 | P2PKH addresses |
| 0x05 | 3 | P2SH addresses |
| 0x80 | 5, K or L | WIF private keys |
| 0x0488B21E | xpub | Extended public keys |
Key takeaways
- Base58 removes look-alike characters 0, O, I and l.
- A version byte sets the type; a 4-byte checksum catches typos.
- Leading zero bytes become leading 1s, which is why P2PKH addresses start with 1.
Common questions
Why do legacy addresses start with 1?
Their version byte is 00, and each leading zero byte encodes as the character 1.
Is Base58 still used?
For legacy and P2SH addresses, WIF keys and extended keys (xpub, xprv).
Are Base58 addresses case sensitive?
Yes. Changing the case of a letter changes the address and breaks the checksum.
Why didn't Satoshi use Base64?
Base64 includes look-alike characters and symbols like + and / that break when double-clicking or in URLs.