<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-09&#xA;📝 Original message:Hi Matt,&#xA;&#xA;On Fri, Mar 8, 2019 at 1:35 PM Matt Corallo &lt;lf-lists at mattcorallo.com&gt;&#xA;wrote:&#xA;&#xA;&gt; Replies inline.&#xA;&gt;&#xA;&gt; On 3/8/19 3:57 PM, Russell O&#39;Connor wrote:&#xA;&gt; &gt; On Thu, Mar 7, 2019 at 2:50 PM Matt Corallo &lt;lf-lists at mattcorallo.com&#xA;&gt; &gt; &lt;mailto:lf-lists at mattcorallo.com&gt;&gt; wrote:&#xA;&gt; &gt; It&#39;s very easy to construct a practical script using OP_CODESEPARATOR.&#xA;&gt; &gt;&#xA;&gt; &gt; IF &lt;2&gt; &lt;ALICEPUBKEY&gt; &lt;BOBPUBKEY&gt; &lt;2&gt; CHECKMULTISIGVERIFY ELSE&#xA;&gt; &gt; CODESEPARATOR &lt;ALICEPUBKEY&gt; CHECKSIGVERFY ENDIF&#xA;&gt; &gt;&#xA;&gt; &gt; Now when someone hands Alice, the CFO of XYZ corp., some transaction,&#xA;&gt; &gt; she has the option of either signing it unilaterally herself, or&#xA;&gt; &gt; creating a partial signature such that the transaction additionally&#xA;&gt; &gt; needs Bob, the CEOs signature as well, and Alice&#39;s choice is committed&#xA;&gt; &gt; to the blockchain for auditing purposes later.&#xA;&gt; &gt;&#xA;&gt; &gt; Now, there are many things you might object about this scheme, but my&#xA;&gt; &gt; point is that (A) regardless of what you think about this scheme, it, or&#xA;&gt; &gt; similar schemes, may have been devised by users, and (B) users may have&#xA;&gt; &gt; already committed funds to such schemes, and due to P2SH you cannot know&#xA;&gt; &gt; that this is not the case.&#xA;&gt;&#xA;&gt; The common way to set that up is to have a separate key, but, ok, fair&#xA;&gt; enough. That said, the argument that &#34;it may be hidden by P2SH!&#34; isn&#39;t&#xA;&gt; sufficient here. It has to *both* be hidden by P2SH and have never been&#xA;&gt; spent from (either on mainnet or testnet) or be lock-timed a year in the&#xA;&gt; future. I&#39;m seriously skeptical that someone is using a highly esoteric&#xA;&gt; scheme and has just been pouring money into it without ever having&#xA;&gt; tested it or having withdrawn any money from it whatsoever. This is just&#xA;&gt; a weird argument.&#xA;&gt;&#xA;&#xA;No one is required to test their Scripts on a public testnet; they can use&#xA;regtest. Because these transactions are non-standard on mainnet, it could&#xA;take years to arrange for these funds to be recovered by having their&#xA;transactions mined directly, or take years to become valuable enough to be&#xA;worth bothering having them directly mined.  As I have noted elsewhere, you&#xA;cannot first make transactions non-standard and then use the fact that you&#xA;don&#39;t see them being used on mainnet to justify a soft-fork.&#xA;&#xA;My argument isn&#39;t weird; it is principled.  You are skeptical that any uses&#xA;of OP_CODESEPARATOR have P2SH commitments.  I am also skeptical, and so is&#xA;everyone reading this mailing list.  But none of us know this with&#xA;certainty, and it is /wrong/ for any of us to gamble with other people&#39;s&#xA;money that our assumptions are true.&#xA;&#xA;Instead, it is this soft-fork proposal that is unprecedented. Let me&#xA;reiterate what I posted in another thread:&#xA;&#xA;Bitcoin has *never* made a soft-fork, since the time of Satoishi, that&#xA;invalidated transactions that send secured inputs to secured outputs&#xA;(excluding uses of OP_NOP1-OP_NOP10).&#xA;&#xA;The fact that Bitcoin has stuck to this principle gives me and everyone&#xA;else confidence in the protocol; that anyone can secure their funds by&#xA;whatever scheme they dream up, and deploy it without needing permission or&#xA;anyone else to vet their Scripts. So long as they are not impairing the&#xA;Bitcoin protocol itself, the most that Bitcoin Core will do is stop&#xA;relaying their transactions by default.&#xA;&#xA;Undermining this principle means undermining what provides Bitcoin&#39;s value&#xA;in the first place.&#xA;&#xA;The problem in this particular case is that there exist valid secure&#xA;transactions that make use OP_CODESEPARATOR such that these transactions&#xA;themselves impair the Bitcoin protocol (through excessive validation costs)&#xA;in a way that, AFAIU, is fundamental to the nature of such transactions (in&#xA;particular, it isn&#39;t just due to an implementation detail of Bitcoin&#xA;Core).  Thus to fix this vulnerability we must necessarily violate the&#xA;principle of not invalidating, secure transactions.  However, this fact&#xA;isn&#39;t license to freely invalidate any transactions we want.  We ought to&#xA;strive to minimize the scope of violation of this principle.  Alice and Bob&#xA;from XYZ. corp should be able to keep their benign transaction illustrated&#xA;above, and we only eliminate those transactions that actually impair the&#xA;Bitcoin protocol.&#xA;&#xA;This is the perfect opportunity to show the world that Bitcoin Core simply&#xA;doesn&#39;t take chances when it comes to other people money.&#xA;&#xA;&gt; Please don&#39;t strawman my position.  I am not suggesting we don&#39;t fix a&#xA;&gt; &gt; vulnerability in Bitcoin.  I am suggesting we find another way.  One&#xA;&gt; &gt; that limits the of risk destroying other people&#39;s money.&#xA;&gt; &gt;&#xA;&gt; &gt; Here is a more concrete proposal:  No matter how bad OP_CODESEPARATOR&#xA;&gt; &gt; is, it cannot be worse than instead including another input that spends&#xA;&gt; &gt; another identically sized UTXO.  So how about we soft-fork in a rule&#xA;&gt; &gt; that says that an input&#39;s weight is increased by an amount equal to the&#xA;&gt; &gt; number of OP_CODESEPARATORs executed times the sum of weight of the UTXO&#xA;&gt; &gt; being spent and 40 bytes, the weight of a stripped input. The risk of&#xA;&gt; &gt; destroying other people&#39;s money is limited and AFAIU it would completely&#xA;&gt; &gt; address the vulnerabilities caused by OP_CODESEPARATOR.&#xA;&gt;&#xA;&gt; You&#39;re already arguing that someone has such an esoteric use of script,&#xA;&gt; suggesting they aren&#39;t *also* creating pre-signed, long-locktimed&#xA;&gt; transactions with many inputs isn&#39;t much of a further stretch&#xA;&gt; (especially since this may result in the fee being non-standardly low if&#xA;&gt; you artificially increase its weight).&#xA;&gt;&#xA;&#xA;There is no consensus rule about minimum fees, and CPFP could add the more&#xA;fees. But yes, I am saying that Alice and Bob could be building on their&#xA;transaction illustrated above, but not creating a many input tx that&#xA;wouldn&#39;t fit into a block with my proposed added weight, because if their&#xA;transaction won&#39;t fit into a block with the added weight then it was a&#xA;malicious transaction to begin with.&#xA;&#xA;Do you not recognize the material difference between a soft-fork that&#xA;doubles the cost of a transaction like Alice and Bob&#39;s versus making their&#xA;transaction entirely illegal?&#xA;&#xA;&#xA;&gt; Note that &#34;just limit number of OP_CODESEPARATOR calls&#34; results in a ton&#xA;&gt; of complexity and reduces the simple analysis that fees (almost) have&#xA;&gt; today vs just removing it allows us to also remove a ton of code.&#xA;&#xA;&#xA;Further note that if you don&#39;t remove it getting the efficiency wins&#xA;&gt; right is even harder because instead of being able to cache sighashes&#xA;&gt; you now have to (at a minimum) wipe the cache between each&#xA;&gt; OP_CODESEPARATOR call, which results in a ton of additional&#xA;&gt; implementation complexity.&#xA;&gt;&#xA;&#xA;How can this be &#34;additional&#34; complexity when this is how the protocol works&#xA;today?  All you have to do is not change the semantics of&#xA;OP_CODESEPARATOR.  It is literally no work.&#xA;Regarding the efficiency wins, let me repeat myself: The performance costs&#xA;of wiping the cached sighashs is not worse than what the performance costs&#xA;would be if the transaction had an additional input spending an equally&#xA;sized UTXO.&#xA;&#xA;&#xA;&gt; &gt;      &gt; I suggest an alternative whereby the execution of OP_CODESEPARATOR&#xA;&gt; &gt;      &gt; increases the transactions weight suitably as to temper the&#xA;&gt; &gt;      &gt; vulnerability caused by it.  Alternatively there could be some&#xA;&gt; &gt;     sort of&#xA;&gt; &gt;      &gt; limit (maybe 1) on the maximum number of OP_CODESEPARATORs&#xA;&gt; &gt;     allowed to be&#xA;&gt; &gt;      &gt; executed per script, but that would require an argument as to why&#xA;&gt; &gt;      &gt; exceeding that limit isn&#39;t reasonable.&#xA;&gt; &gt;&#xA;&gt; &gt;     You could equally argue, however, that any such limit could render&#xA;&gt; some&#xA;&gt; &gt;     moderately-large transaction unspendable, so I&#39;m somewhat skeptical&#xA;&gt; of&#xA;&gt; &gt;     this argument. Note that OP_CODESEPARATOR is non-standard, so getting&#xA;&gt; &gt;     them mined is rather difficult in any case.&#xA;&gt; &gt;&#xA;&gt; &gt;&#xA;&gt; &gt; I already know of people who&#39;s funds are tied up due to in other changes&#xA;&gt; &gt; to Bitcoin Core&#39;s default relay policy.  Non-standardness is not an&#xA;&gt; &gt; excuse to take other people&#39;s tied up funds and destroy them permanently.&#xA;&gt;&#xA;&gt; Huh?! The whole point of non-standardness in this context is to (a) make&#xA;&gt; soft-forking something out safer by derisking miners not upgrading right&#xA;&gt; away and (b) signal something that may be a candidate for soft-forking&#xA;&gt; out so that we get feedback. Who is getting things disabled who isn&#39;t&#xA;&gt; bothering to *tell* people that their use-case is being hurt?!&#xA;&gt;&#xA;&#xA;People have told me that they are hurt by some other non-standardness&#xA;changes and I understand that they have been sitting on those funds for&#xA;years.  Maybe they don&#39;t realize their is some place to complain or maybe&#xA;they think there must be a good reason why they are not allowed to do what&#xA;they were previously allowed to do.  Perhaps others don&#39;t want to risk&#xA;blowing their pseudonymity.  Perhaps they think that attempting to undo&#xA;some of these non-standardness changes is futile.  I can bring up the&#xA;specific cases I&#39;ve encountered in a new thread if you think it is&#xA;worthwhile.&#xA;&#xA;Regarding OP_CODESEAPRATOR specifically, disabling the rely of such&#xA;transactions partially mitigates the vulnerability.  Once the vulnerability&#xA;is properly patched, for example by suitably increasing the weight of the&#xA;operation or opcode, we could drop the prohibition on relaying such&#xA;transactions.  Non-standardness is not necessarily a path to a new&#xA;consensus rule. We have several non-standardness rules in place that are&#xA;never intended to become new consensus rules.  Sometimes non-standardness&#xA;is a temporary mitigation.&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20190309/9a5108cc/attachment.html&gt;</html></oembed>