base58 Encodings

The rippled APIs often use a base58 encoding with a checksum (sometimes called "Base58Check") to represent account addresses and other types of values related to cryptographic keys. This encoding is the same as the one used for Bitcoin addresses, except that the XAG Ledger uses the following dictionary: rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz.

The XAG Ledger prefixes different types of values with a specific 8-bit number before encoding them to distinguish between different data types. Combined with the arrangement of characters in the XAG Ledger's base58 dictionary, the result is that the base58 representations for different types of encoded values start with specific letters by type.

The following table lists all the encodings the XAG Ledger uses:

Data Type Starts With Type Prefix Content size¹ Maximum characters
Account address r 0x00 20 bytes 35
Account public key a 0x23 33 bytes 53
Seed value (for secret keys) s 0x21 16 bytes 29
Validation public key or node public key n 0x1C 33 bytes 53

¹ Content size excludes the 1-byte type prefix.

See Also