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.
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.