BIP 352 specifies that silent payment addresses use Bech32m encoding and defines forward-compatible address decoding rules for versions 0 through 30.
The BIP352 reference implementation currently uses the generic SegWit decoder without checking the encoding type, which allows a Bech32 checksum for a silent payment address. It also rejects versions above 16 and passes the complete payload to the spend key parser instead of discarding extension data for future versions.
Update the BIP352-specific decoder to:
- require Bech32m encoding;
- accept versions 0 through 30 and reject version 31;
- require exactly 66 decoded bytes for version 0;
- accept at least 66 decoded bytes for versions 1 through 30 and consume only the first 66 bytes.