Ephemeral Anchors: Fixing V3 Package RBF againstpackage limit pinning [combined summary]



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

Published on: 2023-03-13T16:38:25+00:00


Summary:

On February 4th, 2023, Greg Sanders announced that he switched to OP_TRUE on the Bitcoin Improvement Proposal (BIP) and implementation after receiving negative feedback. In response to his announcement, Peter Todd thanked him and reviewed the updated tests for the OP_TRUE case, which were available on GitHub. Todd suggested that many of the test cases did not need to be changed to OP_2 as they were not related to standardness.In an email chain, Greg Sanders expresses his lack of persuasion towards certain ideas and mentions that he has fixed tests for the OP_TRUE case. He provides a link to the Github repo where the tests can be viewed. Another individual responds by saying that after looking through the tests, they believe that not all cases need to be changed to OP_2 as they are not related to standardness. The email thread ends with a signature attachment from Peter Todd, whose website is also linked in the email.The conversation between Greg Sanders and Peter Todd revolves around the use of OP_TRUE as the canonical anyone-can-spend output. While Sanders feels that OP_TRUE is the obvious way to do this, Todd believes that scripts should leave just a single OP_TRUE on the stack at the end of execution, in order to avoid malleability issues. Currently, this is not implemented as a rule. However, Todd suggests that using OP_TRUE as the canonical output would ensure adherence to this standardness rule and prevent the need for special-cased workarounds. Todd has also fixed up tests for the OP_TRUE case on Github.In an email exchange, Greg Sanders suggests using OP_TRUE as the canonical anyone-can-spend output to ensure scripts leave just a single OP_TRUE on the stack at the end of execution, reducing malleability in certain circumstances where scriptSig provides an OP_TRUE. He notes that although this isn't currently implemented as a rule, it could be in a future upgrade. Leaving an OP_2 on the stack wouldn't achieve this and would require a special-cased workaround. By using OP_TRUE, it plays better with other standardness rules and avoids potential issues.In a discussion involving Peter Todd and Greg Sanders regarding the use of OP_2 as a means to avoid changing unit tests in Bitcoin Core, Todd expressed his dislike for the idea, stating that it would result in unnecessarily obscure code. He suggested using OP_TRUE instead, which results in a 1 on the stack and plays better with other standardness rules. Todd also noted that the use of OP_2 may require special cases in certain implementations of other standardness rules. Sanders had previously checked the proposal and found that it fails several standardness tests in unit/functional tests in Bitcoin Core. It is unclear what other standardness rules are being referred to in the discussion.Greg Sanders reported that the use of OP_2 fails several standardness tests in Bitcoin Core. This idea was proposed by Luke Jr in 2017 and later arrived at by Sanders independently. However, the use of OP_2 seems unnecessarily obscure just to avoid changing some unit tests. There is a better way to do this using OP_TRUE which results in a 1 on the stack and plays better with other standardness rules. The use of OP_2 may require special cases in certain implementations of other standardness rules. Peter Todd's signature is attached to the email.The context is a discussion between Greg Sanders and Peter Todd regarding the standardness tests in unit/functional tests in Bitcoin Core. It is mentioned that OP_2 was an idea proposed by Luke Jr in 2017 for similar reasons and Greg arrived at the same conclusion independently. In response to Peter's question about changing test vectors, Greg clarifies that he would have to change tests that test something is non-standard. The context does not provide any further information or links to external sources.On January 27, 2023, Greg Sanders via bitcoin-dev proposed the Ephemeral Anchors idea and wrote up a short draft BIP, which can be found on Github. The pull request on Github has been refreshed on top of the latest V3 proposal, but the BIP itself remains unaffected. In response to the proposal, Peter Todd asked for clarification on why OP_2 is used instead of OP_TRUE, as OP_TRUE is often used in test vectors. Greg Sanders responded on February 2, 2023, stating that he had to change test vectors everywhere for principled reasons.On January 27th, 2023, Greg Sanders wrote a draft BIP of the Ephemeral Anchors idea and shared it with the bitcoin-dev community. The proposal can be found on Github at https://github.com/instagibbs/bips/blob/ephemeral_anchor/bip-ephemeralanchors.mediawiki. A pull request has also been made at https://github.com/bitcoin/bitcoin/pull/26403.


Updated on: 2023-08-02T08:08:51.134293+00:00