The processing of signing messages with Bitcoin private keys with P2PKH addresses is a fairly known one but with the introduction of segwit, with its bech32 and P2SH forms, it is unclear how to distinguish these three addresses, a new BIP was proposed by developer Christopher Gilliard intending to set a standard for messages to be signed and verified by different clients.
Feed for tag: message-signature
Message signing and verification is one of the quirks included in Bitcoin clients, although it isn’t used as much, this quirk can help you in different situations like proving the ownership of an address, proving a payment to a real world vendor or like a simple proof of an anonymous identity and avoiding fraud.
Currently this only works with P2PKH addresses (legacy addresses starting with a 1), leaving out a standard way to do it with P2SH or any different type of segwit addresses. Note that there exist some non-standard implementations with limited functionnality.