bitcoincashorg / spec

Technical specifications
112 stars 64 forks source link

Part of the specs is not very clear #51

Closed Ayms closed 6 years ago

Ayms commented 6 years ago

While doing https://github.com/Ayms/cashaddress I found the following section not so clear:

"The checksum is calculated over the following data:

The lower 5 bits of each characters of the prefix. A zero for the separator (5 zero bits). The payload by chunks of 5 bits. The payload is padded with zero bits up to the point where it is a multiple of 5 bits."

I would modify it by:

"The checksum is calculated over the following data:

The lower 5 bits of each characters of the prefix. A zero for the separator (5 zero bits). The payload by chunks of 5 bits. The payload is padded with zero bits (on the right) up to the point where it is a multiple of 5 bits. A 40 bits null checksum with all bits set to 0"

avl42 commented 6 years ago

Something similar has already been done on Bitcoin-UAHF/spec repository - you might need to update your fork to see it. If you have improvements on the current state, please suggest them.

On Thu, Jan 18, 2018 at 3:39 PM, Aymeric Vitte notifications@github.com wrote:

While doing https://github.com/Ayms/cashaddress I found the following section not so clear:

"The checksum is calculated over the following data:

The lower 5 bits of each characters of the prefix. A zero for the separator (5 zero bits). The payload by chunks of 5 bits. The payload is padded with zero bits up to the point where it is a multiple of 5 bits."

I would modify it by:

"The checksum is calculated over the following data:

The lower 5 bits of each characters of the prefix. A zero for the separator (5 zero bits). The payload by chunks of 5 bits. The payload is padded with zero bits (on the right) up to the point where it is a multiple of 5 bits. A 40 bits null checksum with all bits set to 0"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Bitcoin-UAHF/spec/issues/51, or mute the thread https://github.com/notifications/unsubscribe-auth/AFAwst9k5y82dmRanpnQwVM7o36Yywi6ks5tL1eLgaJpZM4RjBSO .

Ayms commented 6 years ago

Right!!! I did not see it, closing it but 'Eight zeros as a "template"' can be unclear too, "40 zero bits" can't be questionned

avl42 commented 6 years ago

on "Eight zeros" versus "40 zero bits" ... The spec describes the construction of a list/vector of small integers to be fed to that PolyMod function.

This list gets concatenated from the prefix-bytes, the separator(0), the 5-bit chunks regrouped from versionbyte+hash inclusive padding, and "8 zero integers". ​If you were to speak of "40 zero bits" at that place, you'd also have to describe splitting the 40 zero bits into 8 zero 5-bit integers ;)

Ayms commented 6 years ago

1, 2 and 3 are now very clear and are talking about groups of 5 bits, 4 is still not for me (frankly speaking I would have spared some time if I saw the changes two days ago), 8 zero 5-bits integers is clear

As you like... minor change, but not potentially confusing any longer...