Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convertbits needs to refuse to pad on decode #7

Open
Steve132 opened this issue May 22, 2018 · 0 comments
Open

Convertbits needs to refuse to pad on decode #7

Steve132 opened this issue May 22, 2018 · 0 comments

Comments

@Steve132
Copy link

The line

payload=converted[1:-6]

is wrong, because the checksum is defined to be exactly 40 bits long. 40 bits is 5 bytes, so the correct line is

payload=conveted[1:-5]

However, this line also breaks the code because of the fact that there is another bug. If you look at https://github.com/simon-v/minipos/blob/master/cashaddr.py , you can see that convertbits is supposed to avoid padding on the decode stage. This is why your payload is longer than necessary by one bit.

I have an implementation that is something like a mixture of your implementation and their implementation that fixes these bugs and correctly implements >160 bit lengths at https://github.com/Steve132/wallet_standard/blob/master/python/coffer/coins/_cashaddr.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant