xrpl-dev-portal
xrpl-dev-portal copied to clipboard
Clarify address length in docs
A developer reached out to me about doing validation of XRPL addresses, referencing:
https://xrpl.org/accounts.html#address-encoding
This states that the Account ID content is 20 bytes, and the address is 24 bytes (20 + 4 for checksum). However, addresses are usually found to be 25 bytes.
This makes sense as 25 =
- RIPEMD160 hashes are 160 bits = 20 bytes
- prepend the 1 byte prefix
- append the 4 byte checksum
If that is right, then it seems that the doc is wrong.
Good point. Looking at it, the "type prefix" may be in slightly the wrong spot in the graphic as well. (It is part of the SHA-256 hashes to calculate the checksum, but it's not one of the 20 bytes.)