xrpl-dev-portal icon indicating copy to clipboard operation
xrpl-dev-portal copied to clipboard

Clarify address length in docs

Open intelliot opened this issue 2 years ago • 1 comments

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.

intelliot avatar May 16 '22 21:05 intelliot

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.)

mDuo13 avatar May 17 '22 00:05 mDuo13