SIGHASH2 for version 1 witness programme [combined summary]



Individual post summaries: Click here to read the original discussion on the bitcoin-dev mailing list

Published on: 2018-09-03T13:53:33+00:00


Summary:

A new proposal called SIGHASH2 has been introduced to simplify the existing SIGHASH and the BIP118 SIGHASH_NOINPUT. The format of SIGHASH2 includes bit flags that denote various values, such as the type of hash and the fees. The proposal aims to save block space by using a more efficient DER format for signatures. It builds upon previous proposals like Taproot and Graftroot.The SIGHASH2 format introduces several new features, including the decoupling of INPUT and SEQUENCE, which allows for optional signing of fees and optimization of signature size. Feedback is being sought on whether certain parameters should be committed to scriptCode and/or scriptPubKey, whether LASTOUTPUT and DUALOUTPUT should be added, and whether a fully flexible way to sign a subset of outputs is desired.The proposed SIGHASH2 format provides equivalent values for other SIGHASH schemes, such as Legacy/BIP143 ALL and SINGLE with matching output. The motivation behind these changes includes the need for compact signatures and increased flexibility.It is important to note that the proposal for SIGHASH2 falls under BIP YYY and is a soft-fork, ensuring backward compatibility. The deployment details are yet to be determined, but the reference implementation can be found on GitHub.In another email conversation, Johnson Lau discusses possible improvements to Bitcoin's serialization process. He questions the use of Double SHA256 and suggests the possibility of replacing it with Single SHA256. The conversation also explores the placement of `sigversion` in the format and its length, with Lau suggesting it should be at the beginning for pre-computation and optimization purposes. The idea of adding a separate opcode for CHECKSIGFROMSTACK is also discussed, along with the effectiveness of putting a 64-byte constant at the beginning of SHA256.Overall, these proposals and discussions highlight ongoing efforts to improve the security, flexibility, and efficiency of Bitcoin transactions. Feedback and contributions from the Bitcoin community are essential for further development and implementation.


Updated on: 2023-08-01T23:21:30.159480+00:00