Skip to content

libwally: add deserialize extended key target#466

Merged
brunoerg merged 1 commit intobitcoinfuzz:v2from
kuliq23:libwally-add-bip32-deserialize-extended-key
Mar 9, 2026
Merged

libwally: add deserialize extended key target#466
brunoerg merged 1 commit intobitcoinfuzz:v2from
kuliq23:libwally-add-bip32-deserialize-extended-key

Conversation

@kuliq23
Copy link
Copy Markdown
Contributor

@kuliq23 kuliq23 commented Mar 6, 2026

Libwallycore seems to accept some invalid Test Vector 5 cases. Similarly to what we found with NBitcoin and BitcoinJ. Resulting in these types of errors:

tprv8Zgy2Q8Bt4oLiTSCgudFk7PMxiCdAxcEgGTGRmGzfhCdVHPnP5ySPE8ehp174szTZCNtFbGg32DbzmnYbaKEuu41mRgiViDAtCUhpJMVE4T
xprv error: NonZeroParentFingerprintForMasterKey
BIP32 deserialize extended key failed
Module: Rustbitcoin
Result: INVALID
Module: LibwallyCore
Result: depth=00;fp=00070000;child=00000000;chaincode=0000000000000000002e00000000000000000000000000000000000000000000;key=00000000000000ffffffffffffff7f0000000000000000000000000000000000
xprv9s21ZrQJ3WcBYLtmSeFpHkqYxCt1j5hHytNJhiXjZz7EdjBibkxCAZrTc44GiGZSuiqaLsHKEnNXtFEuHtaJHiSAeUqKLXGZ6EndmUits6T
xprv error: NonZeroChildNumberForMasterKey
BIP32 deserialize extended key failed
Module: Rustbitcoin
Result: INVALID
Module: LibwallyCore
Result: depth=00;fp=00000000;child=10000000;chaincode=0000000000000000000000000000000000000000000000000000000000000000;key=0000003583940000000000000000000000000000000000000000000000000000
xpub661MyMwAqRbcEYS8w7u3XpxgKfy8Vhzy2d6xc3pYJzqW3oJYDLUS4efD88MkNN19ZY3fyNJ1Su23GPMCzUEzWVeWRw3zhcDr5CEhs5kaq7J
xpub error: Secp256k1(InvalidPublicKey)
BIP32 deserialize extended key failed
Module: Rustbitcoin
Result: INVALID
Module: LibwallyCore
Result: depth=00;fp=00000000;child=00000000;chaincode=00000000f60000000000463933593577767a6455617968676b6b466f6963515a;key=5033790008000000000002000000000000240000000000000080000000000000

Can someone doublecheck if my theory is correct? I can then create an upstream PR in libwally repo fixing this. Thanks

Copy link
Copy Markdown
Member

@erickcestari erickcestari left a comment

Choose a reason for hiding this comment

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

Thanks! I think those bugs are worth reporting to the libwallycore repository.

ACK 0b30169

@brunoerg
Copy link
Copy Markdown
Collaborator

brunoerg commented Mar 8, 2026

Needs rebase

@kuliq23 kuliq23 force-pushed the libwally-add-bip32-deserialize-extended-key branch from 0b30169 to b3310df Compare March 8, 2026 11:14
@kuliq23
Copy link
Copy Markdown
Contributor Author

kuliq23 commented Mar 8, 2026

Needs rebase
Done

Copy link
Copy Markdown
Collaborator

@brunoerg brunoerg left a comment

Choose a reason for hiding this comment

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

ACK b3310df

@brunoerg brunoerg merged commit af9d388 into bitcoinfuzz:v2 Mar 9, 2026
34 checks passed
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.

3 participants