Skip to content

fix: reject underscores in BIP32 path indexes - #860

Open
SashaMIT wants to merge 1 commit into
bitcoin-core:masterfrom
SashaMIT:codered-bip32-reject-underscore
Open

SashaMIT wants to merge 1 commit into
bitcoin-core:masterfrom
SashaMIT:codered-bip32-reject-underscore

Conversation

@SashaMIT

Copy link
Copy Markdown

Summary

parse_path used Python int() on each path component. int("1_0") is 10, so m/1_0 derived index 10 instead of failing. The caller already has the path string. An underscore is not a BIP32 character, and it was changing the index. Components now have to be digits, with the existing h or ' harden suffix.

Test plan

  • parse_path("m/1_0") returned [10] before the change
  • test_parse_path_rejects_underscore and test_deriv_path pass after the change

Made with Cursor

Python int() accepts 1_0 as 10, so parse_path("m/1_0") derived index 10. Path components now have to be digits, with the existing harden suffix.
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.

1 participant