delvingbitcoin

Combined summary - OP_PAIRCOMMIT as a candidate for addition to LNhance

Combined summary - OP_PAIRCOMMIT as a candidate for addition to LNhance

The discussion begins with addressing a potential update to the Bitcoin Improvement Proposal (BIP) concerning CheckTemplateVerify (CTV).

It is suggested that having CTV return an error for 0-byte hashes could simplify the verification process by eliminating the need for a DUP VERIFY step. This suggestion stems from the observation that there's seldom a legitimate reason to include a 0-size argument for CTV. Additionally, it is mentioned that the PC code on a specific branch was broken, but this issue has since been resolved, as indicated by a link to a pull request on GitHub (GitHub).

The conversation shifts to the topic of optimizing SHA256 iterations, particularly within the context of LN-Symmetry, by focusing on reducing the number of hashing cycles needed in specific scenarios. For instance, when considering a situation involving a 7-byte balance commitment plus a 32-byte CTV hash without any HTLCs in flight, resulting in a total preimage size of 55 bytes, it is proposed that this can fit into a single block with the SHA256 length commitment. Concerns are raised about length redistribution attacks due to the concatenation of two preimages, given CTV's design for only 32-byte templates. A couple of hashing techniques are proposed to mitigate these concerns and enhance security, including one that involves using a custom hash function designed to significantly alter the output for minor changes in input, aimed at mitigating stack element resizing attacks.

The email highlights issues surrounding the integration of new opcodes and their impact on project timelines and complexity. There is a debate over prioritizing simplicity in development versus integrating advanced functionalities like those offered by OP_CAT. The discussion leans towards activating OP_CTV before embarking on more complex opcode integrations. This reflects a broader dialogue on development priorities, suggesting a step-by-step approach might be beneficial in the long run.

Moreover, the utilization of Vector Commitments in LN-Symmetry is discussed as a method to enhance security and simplify contract scripting. Employing OP_PAIRCOMMIT to commit to a vector of stack elements is presented as an effective strategy against witness malleability, highlighting the importance of secure scripting practices in blockchain contracts. The detailed exploration into preliminary specifications for managing state templates emphasizes the need for accurate and secure scripting practices, showcasing a structured approach to handling contract states and securing interactions on the blockchain.

Lastly, an optimization technique for SHA256 iterations in LN-Symmetry is outlined, focusing on pre-computing the Tag as a mid-state to reduce validation processes. This technique aims to address concerns related to length redistribution attacks and proposes a solution involving the alteration of expected bit changes in the preimage for enhanced security. A link to a GitHub pull request is provided, offering insights into proposed technical adjustments to improve efficiency and security in the context of LN-Symmetry with CTV.

Discussion History

0
moonsettler Original Post
October 25, 2024 14:34 UTC
1
October 25, 2024 14:38 UTC
2
October 25, 2024 17:57 UTC
3
October 25, 2024 19:06 UTC
4
October 25, 2024 19:11 UTC
5
October 25, 2024 19:22 UTC
6
October 25, 2024 21:50 UTC
7
October 28, 2024 11:16 UTC
8
October 28, 2024 12:05 UTC