BP-WG / bp-std

Modern & lightweight implementation of bitcoin standards without rust-bitcoin/miniscript dependencies
Apache License 2.0
16 stars 17 forks source link

Add descriptor sanity checks #33

Open dr-orlovsky opened 1 month ago

dr-orlovsky commented 1 month ago

Right now users can provide library with invalid xpubs doesn't matching the descriptor requirements in many ways. For instance, they can mix testnet and mainnet derivations, contain custom, non-complete or different keychain segments, provide zeros as master fingerprint (which will result in PSBTs failing to be signed with most hardware wallets) etc.

Descriptor trait need to have a check_sanity method detecting such issues and allowing library users to report them to the user upon the wallet creation.