Encodings

Base58

Base58 with the Bitcoin alphabet. No 0 and O and I and l and leading zero bytes become leading ones
IDbase5808 / 20base58 · 58 characters
Encoding / Base58

Base58

No 0, O, I or l. Nothing to confuse.

Overhead
+37% on random bytes
Padding
none
Standard
Bitcoin Core base58.cpp
Used by
Solana, IPFS CIDv0
family 4 / 20

Sample

Out
2yGEbwRFyhPZZckKA
Back
"hello world!"

Access

Importimport { base58 } from "@agntn/encodings/base58"
CLIencodings encode base58 'hello world!'
Tryplayground with the sample above
Kinbase58check, base58-flickr, base58-ripple

Satoshi dropped 0, O, I and l from base62 and got 58 characters nobody can misread. The catch? Base58 doesn't work in blocks. The whole input is one big number, divided by 58 over and over.

ts
encode("base58", "hello world");                     // "StV1DL6CwTryKyV"
base58.encode(hex.decode("0000287fb4cd"));           // "11233QC4"

Leading zero bytes don't survive arithmetic, so each one becomes a leading 1. That's why every Bitcoin P2PKH address starts with 1. Version byte zero.

It's quadratic, by the way. Fine for addresses and keys, silly for a megabyte. Solana keys and IPFS CIDv0 hashes are plain base58. Bitcoin adds a checksum, see Base58Check.