Skip to content

Fix checksum calculation following BIP-128 standard#10524

Open
oren-z0 wants to merge 1 commit intospesmilo:masterfrom
oren-z0:timelock-recovery-fix-checksum-bip-128
Open

Fix checksum calculation following BIP-128 standard#10524
oren-z0 wants to merge 1 commit intospesmilo:masterfrom
oren-z0:timelock-recovery-fix-checksum-bip-128

Conversation

@oren-z0
Copy link
Contributor

@oren-z0 oren-z0 commented Mar 13, 2026

Non-Ascii characters should not be converted for
checksum calculation.
This will give consistent hash to BIP-128 and its
Javascript code example.

Timelock-Recovery Plans that contained only ascii
characters are not affected.

Non-Ascii characters should not be converted for
checksum calculation.
This will give consistent hash to BIP-128 and its
Javascript code example.

Timelock-Recovery Plans that contained only ascii
characters are not affected.
@oren-z0 oren-z0 force-pushed the timelock-recovery-fix-checksum-bip-128 branch from b65d72e to edf4055 Compare March 13, 2026 21:03
@SomberNight
Copy link
Member

Which field could contain non-ascii characters? I guess "wallet_name"?

This will give consistent hash to BIP-128 and its Javascript code example.

Are you saying the current python code does not produce the same hash as the example at the end of the BIP?
Why is that? Where is the non-ASCII character in that example?

A unit test would be nice.

@oren-z0
Copy link
Contributor Author

oren-z0 commented Mar 13, 2026

Yes, "wallet_name" could contain non-ascii character.
The BIP also allows an optional field for a description and optional labels for the destinations, which are not implemented in Electrum, but could be implemented in the future (and contain non-ascii characters).

Yes, if using ensure_ascii=True does give a different result than Javascript's JSON.stringify().
With ensure_ascii=False the results are the same (tested using Python 3.13 and Node.JS 24.1).

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

Successfully merging this pull request may close these issues.

2 participants