{sign|verify}message replacement



Summary:

In a discussion on bitcoin-dev, Karl Johan Alm proposed to write a replacement for the message signing tools that are currently broken for all but legacy 1xx addresses. The proposal is to add a new structure called SignatureProof which is a simple scriptSig & witnessProgram container that can be serialized and passed out from/into the signer/verifier. However, Pieter Wuille suggested adding more logic to deal with softforks and compatibility. A solution could be to include a version number in the signature which corresponds to a set of validation flags. This way, when the version number is something a verifier doesn't know, it can be reported as inconclusive. RPC commands such as sign and verify are discussed, with the suggestion to extend the existing signmessage/verifymessage RPC to fall back to the existing signature algorithm for legacy addresses while using the script-based approach for all others. In response to a suggestion by Alm, Pieter stated that the prehashed option isn't needed since it could be used to trick someone into signing off on an actual transaction.


Updated on: 2023-05-20T05:17:26.909252+00:00