Encoding and security guides

Base58 and leading zeros: bytes versus Base58Check

Preserve zero bytes in Base58 conversion and distinguish raw encoding from a checksum-bearing format.

Nav Tools ·

Know the selected alphabet

The Bitcoin Base58 alphabet omits visually confusing characters such as zero, uppercase O, uppercase I and lowercase l. Other variants can differ.

Nav Tools uses the Bitcoin-style alphabet. Share the alphabet choice with any other decoder rather than only saying Base58.

Alphabet:
123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz

Preserve zero bytes

Each leading zero byte maps to a leading 1 in this alphabet. Treating the input only as an integer would lose its original byte length.

The fixture below describes bytes, not the text character zero. Use a byte-aware library when reproducing it in application code.

Bytes: 00 00 01
Raw Base58: 112
Text "0" has UTF-8 byte 30, not 00.

Separate text and bytes

The site text codec encodes UTF-8 text. Entering a hex string such as 000001 encodes six text characters rather than three raw bytes.

Use HEX conversion to inspect what the text represents. The raw-byte fixture is a library example, not a promise of a hex input mode.

Raw Base58 does not add a checksum

Base58Check is a separate format that adds protocol-specific version data and a checksum before encoding. Raw Base58 does neither.

A raw decoder accepting a string does not verify a Base58Check address. Use the target protocol library for address validation.

References

← Encoding and security guides