All operations

Base58

Base64 with the look-alike characters and the punctuation removed.

Why fifty-eight

Take the Base64 alphabet, drop the digit zero, capital O, capital I and lowercase l, then drop the plus and the slash. Fifty-eight characters remain, and that is the whole design.

Satoshi Nakamoto put the reasoning in a comment at the top of base58.h: look-alike characters could be used to build visually identical account numbers, and a double-click selects an all-alphanumeric string as one word. A double-click on a Base64 string stops at the first + or /.

The address above

1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa received the fifty coins from Bitcoin’s genesis block, mined on 3 January 2009. They can never be moved: the genesis coinbase was never added to the set of spendable outputs, so the network rejects any attempt to spend it, private key or not. The pipeline decodes the address and prints the bytes as hex: version byte 00, twenty bytes of public key hash, four bytes of checksum.

The leading 1 is that version byte. A zero byte carries no weight at the front of a number, so an encoder counts the leading zeros and writes a 1 for each. Version byte 5, used for pay-to-script-hash, lands on a 3.

Base58Check

Addresses add a layer above this one. Base58Check appends the first four bytes of a double SHA-256 over the version byte and payload before encoding; here they are c2 9b 7d 93. Change one character and the checksum stops matching, so a wallet can reject a typo without asking anyone.

This operation moves bytes to and from Base58 and does nothing else. It adds no checksum and verifies none, so a mistyped address made of valid characters decodes without complaint and hands back the wrong bytes.

The other Base58s

There is no single standard. Ripple keeps the same fifty-eight characters in a different order, picked so that account addresses start with r. An XRP address therefore decodes here into bytes that mean nothing. Monero uses Bitcoin’s ordering but works in eight-byte blocks of eleven characters, so reading one of its addresses as a single long number comes out wrong. IPFS identifiers of the Qm form follow Bitcoin exactly and decode into a multihash beginning 12 20, then a 32-byte SHA-256.

Cost

Fifty-eight is not a power of two, so no bit-shifting shortcut exists. Each input byte is carried across the whole growing digit array, and the work grows with the square of the length. Fine for a 25-byte address, wrong for a megabyte.

Base64 is the alphabet this was cut down from, and Base32 attacks the same transcription problem by dropping case. The SHA-256 behind those checksum bytes is under hash.