[softfork proposal] Strict DER signatures



Summary:

In this email correspondence, Pieter is responding to Zooko Wilcox-OHearn regarding updates made to the BIP text and code for handling invalid signatures in Bitcoin transactions. The changes were synced up with the repository code and a comment was added to the BIP text regarding the sigsize=0 case, which was already being handled elsewhere. There are still multiple ways to encode a correctly encoded but invalid signature, including the 0-length string. While it would make sense to treat any other correctly-encoded-but-invalid sig as incorrectly-encoded, Pieter wants to keep the BIP minimal and uncontroversial. Pieter confirms that all the branches of the new IsDERSignature() function have been tested and extra test cases have been added for coverage of IsValidSignatureEncoding. However, there are still TODOs remaining for testing upgrade behavior, which requires significant changes to the codebase. Lastly, Pieter fixes a missing comment in the code.


Updated on: 2023-05-19T19:42:42.805367+00:00