● BIP322 generic signed message format: since 2011, users of many wallets have had the ability to sign an arbitrary message using the public key associated with a P2PKH address in their wallet. However, there’s no standardized way for users to do the same using a P2SH address or any of the different types of segwit addresses (although there are some implemented non-standard methods with limited functionality). Picking up a Bitcoin-Dev mailing list discussion from several months ago, Karl-Johan Alm has proposed a BIP that could work for any address (although it’s not yet described how it would work for P2SH or P2WSH addresses involving an OP_CLTV or OP_CSV timelock).

The basic mechanism is that the authorized spender or spenders for an address generate scriptSigs and witness data (including their signatures) in much the same way they would if they were spending the funds—except instead of signing the spending transaction, they sign their arbitrary message instead (plus some predetermined extra data to ensure they can’t be tricked into signing an actual transaction). The verifier’s software then validates this information the same way it would to determine whether a spending transaction was valid. This allows the message signing facility to be exactly as flexible as Bitcoin scripts themselves.

Currently, discussion appears to be most active on the BIP proposal’s pull request.