-
-
Notifications
You must be signed in to change notification settings - Fork 13
Prevent deriving unserializable keys of depth > 255 #21
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
base: main
Are you sure you want to change the base?
Conversation
Wow, this Both of these tests seem to cause it.
|
I don't feel like debugging some Javascript runtime issues. Running $ bun run --if-present test works as expected and the tests pass. However, $ bun run --if-present test:bun hands on this line and others from the new tests. Feel free to update the branch, you should have the rights. |
The bun error would be fixed after you rebase with |
I've merged |
I will merge it for v2 bc it's backwards incompatible |
I rarely code in Javascript/Node/Typescript, so this is rather hastily effort to put together example of a fix and test cases. Please, review the code carefully, among other for off-by-one errors int the path lengths, thanks!
This attempts to make the derived keys serializable according to BIP32. See also bitcoin/bitcoin#32201
Unfortunately, this is in a sense breaking backwards-compatibility, in case someone was deriving lower than 255 depth keys, however, these would get serialized, assuming BIP32 format, incorrectly (the depth would overflow).