Currently the handling of invalid bech32(m) addresses over RPC has many issues:
- No error for invalid addresses is reported, leading to internal bugs via
CHECK_NONFATAL
, see #27723 - The error messages use “data size” (the meaning of which is unclear to the user, because the witness program data and bech32 section data are related but different) when they mean “program size”
Fix all issues. Also, use the BIP 173 and BIP 350 test vectors.