Skip to content

btcutil: add BIP32 Test Vector 5 validation and test cases#2525

Open
kuliq23 wants to merge 1 commit into
btcsuite:masterfrom
kuliq23:fix-bip32-tv5
Open

btcutil: add BIP32 Test Vector 5 validation and test cases#2525
kuliq23 wants to merge 1 commit into
btcsuite:masterfrom
kuliq23:fix-bip32-tv5

Conversation

@kuliq23
Copy link
Copy Markdown

@kuliq23 kuliq23 commented May 4, 2026

Change Description

Add stricter BIP32 extended key validation in NewKeyFromString to comply with BIP32 test vector 5, and update tests accordingly.

Just a spec-compliance fix.
Found using bitcoinfuzz tool.
Feel free to refactor or modify the implementation directly if a different approach is preferred.

Steps to Test

  1. cd btcutil
  2. go test ./hdkeychain

Pull Request Checklist

Testing

  • Your PR passes all CI checks. - I believe it is not due to the introduced changes.
  • Tests covering the positive and negative (error paths) are included.
  • Bug fixes contain tests triggering the bug to prevent regressions.

Code Style and Documentation

  • The change is not insubstantial. Typo fixes are not accepted to fight bot spam.
  • The change obeys the Code Documentation and Commenting guidelines, and lines wrap at 80.
  • Commits follow the Ideal Git Commit Structure.
  • Any new logging statements use an appropriate subsystem and logging level. (N/A)

Copy link
Copy Markdown

@allocz allocz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, ACK 209175a

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