<oembed><type>rich</type><version>1.0</version><author_name>npub1dw88wd5gqsqn6ufxhf9h03uk8087l7gfzdtez5csjlt6pupu4pwsj8plrw</author_name><author_url>https://nostr.ae/npub1dw88wd5gqsqn6ufxhf9h03uk8087l7gfzdtez5csjlt6pupu4pwsj8plrw</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2019-03-08&#xA;📝 Original message:On Thu, Mar 7, 2019 at 2:50 PM Matt Corallo &lt;lf-lists at mattcorallo.com&gt;&#xA;wrote:&#xA;&#xA;&gt; Replies inline.&#xA;&gt;&#xA;&gt; Matt&#xA;&gt;&#xA;&gt; On 3/7/19 3:03 PM, Russell O&#39;Connor wrote:&#xA;&gt; &gt;&#xA;&gt; &gt;     * OP_CODESEPARATOR in non-BIP 143 scripts fails the script&#xA;&gt; validation.&#xA;&gt; &gt;     This includes OP_CODESEPARATORs in unexecuted branches of if&#xA;&gt; &gt;     statements,&#xA;&gt; &gt;     similar to other disabled opcodes, but unlike OP_RETURN.&#xA;&gt; &gt;&#xA;&gt; &gt;&#xA;&gt; &gt; OP_CODESEPARATOR is the only mechanism available that allows users to&#xA;&gt; &gt; sign which particular branch they are authorizing for within scripts&#xA;&gt; &gt; that have multiple possible conditions that reuse the same public key.&#xA;&gt;&#xA;&gt; This is true, and yet it does not appear to actually be practically&#xA;&gt; usable. Thus far, despite a ton of effort, I have not yet seen a&#xA;&gt; practical use-case for OP_CODESEPARATOR (except for one example of it&#xA;&gt; being used to make SegWit scripts ever-so-slightly more effecient in&#xA;&gt; TumbleBit, hence why this BIP does not propose disabling it for SegWit).&#xA;&gt;&#xA;&#xA;It&#39;s very easy to construct a practical script using OP_CODESEPARATOR.&#xA;&#xA;IF &lt;2&gt; &lt;ALICEPUBKEY&gt; &lt;BOBPUBKEY&gt; &lt;2&gt; CHECKMULTISIGVERIFY ELSE CODESEPARATOR&#xA;&lt;ALICEPUBKEY&gt; CHECKSIGVERFY ENDIF&#xA;&#xA;Now when someone hands Alice, the CFO of XYZ corp., some transaction, she&#xA;has the option of either signing it unilaterally herself, or creating a&#xA;partial signature such that the transaction additionally needs Bob, the&#xA;CEOs signature as well, and Alice&#39;s choice is committed to the blockchain&#xA;for auditing purposes later.&#xA;&#xA;Now, there are many things you might object about this scheme, but my point&#xA;is that (A) regardless of what you think about this scheme, it, or similar&#xA;schemes, may have been devised by users, and (B) users may have already&#xA;committed funds to such schemes, and due to P2SH you cannot know that this&#xA;is not the case.&#xA;&#xA;&#xA;&gt; &gt; Because of P2SH you cannot know that no one is currently using this&#xA;&gt; &gt; feature.  Activating a soft-fork as describe above means these sorts of&#xA;&gt; &gt; funds would be permanently lost.  It is not acceptable to risk people&#39;s&#xA;&gt; &gt; money like this.&#xA;&gt;&#xA;&gt; (1) It has been well documented again and again that there is desire to&#xA;&gt; remove OP_CODESEPARATOR, (2) it is well-documented OP_CODESEPARATOR in&#xA;&gt; non-segwit scripts represents a rather significant vulnerability in&#xA;&gt; Bitcoin today, and (3) lots of effort has gone into attempting to find&#xA;&gt; practical use-cases for OP_CODESEPARATOR&#39;s specific construction, with&#xA;&gt; no successes as of yet. I strongly, strongly disagree that the&#xA;&gt; highly-unlikely remote possibility that someone created something before&#xA;&gt; which could be rendered unspendable is sufficient reason to not fix a&#xA;&gt; vulnerability in Bitcoin today.&#xA;&gt;&#xA;&#xA;Please don&#39;t strawman my position.  I am not suggesting we don&#39;t fix a&#xA;vulnerability in Bitcoin.  I am suggesting we find another way.  One that&#xA;limits the of risk destroying other people&#39;s money.&#xA;&#xA;Here is a more concrete proposal:  No matter how bad OP_CODESEPARATOR is,&#xA;it cannot be worse than instead including another input that spends another&#xA;identically sized UTXO.  So how about we soft-fork in a rule that says that&#xA;an input&#39;s weight is increased by an amount equal to the number of&#xA;OP_CODESEPARATORs executed times the sum of weight of the UTXO being spent&#xA;and 40 bytes, the weight of a stripped input. The risk of destroying other&#xA;people&#39;s money is limited and AFAIU it would completely address the&#xA;vulnerabilities caused by OP_CODESEPARATOR.&#xA;&#xA;Even soft forking a rule like, &#34;it is illegal to execute an&#xA;OP_CODESEPARATOR after any CHECKSIG/CHECKMULTISIG operation&#34;, would be&#xA;vastly better than the current proposal, even though I would still object&#xA;to it.&#xA;&#xA;&#xA;&gt; &gt; I suggest an alternative whereby the execution of OP_CODESEPARATOR&#xA;&gt; &gt; increases the transactions weight suitably as to temper the&#xA;&gt; &gt; vulnerability caused by it.  Alternatively there could be some sort of&#xA;&gt; &gt; limit (maybe 1) on the maximum number of OP_CODESEPARATORs allowed to be&#xA;&gt; &gt; executed per script, but that would require an argument as to why&#xA;&gt; &gt; exceeding that limit isn&#39;t reasonable.&#xA;&gt;&#xA;&gt; You could equally argue, however, that any such limit could render some&#xA;&gt; moderately-large transaction unspendable, so I&#39;m somewhat skeptical of&#xA;&gt; this argument. Note that OP_CODESEPARATOR is non-standard, so getting&#xA;&gt; them mined is rather difficult in any case.&#xA;&gt;&#xA;&#xA;I already know of people who&#39;s funds are tied up due to in other changes to&#xA;Bitcoin Core&#39;s default relay policy.  Non-standardness is not an excuse to&#xA;take other people&#39;s tied up funds and destroy them permanently.&#xA;&#xA;There is some sort of crisis in the Bitcoin protocol stemming from the&#xA;possible excessive usage of OP_CODESEPARTOR otherwise we wouldn&#39;t even be&#xA;considering this soft fork.  Fine.  But presumably it is impossible for a&#xA;transaction to both be produced in good faith for legitimate use and at the&#xA;same time are expensive enough to be used as an attack vector, and&#xA;hopefully there is a wide gap between these two cases.  So let&#39;s draw a&#xA;line between the two cases to rule out attacks while allowing legitimate&#xA;uses by simply suitably pricing the OP_CODESEPARATOR opcode by weight.  At&#xA;worst case this moderately-large transaction is very expensive, reflecting&#xA;its true cost, or is was so expensive that it couldn&#39;t possibly have been&#xA;legitimate to begin with since the resources to validate it exceed the&#xA;amount that are reasonable to validate an entire block of regular&#xA;transactions.&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20190308/b6349b97/attachment-0001.html&gt;</html></oembed>