<oembed><type>rich</type><version>1.0</version><author_name>npub1jdl3plz00rvxwc6g2ckemzrgg0amx5wen4kfvs3laxtssxvk9cvsf3gh0m</author_name><author_url>https://nostr.ae/npub1jdl3plz00rvxwc6g2ckemzrgg0amx5wen4kfvs3laxtssxvk9cvsf3gh0m</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2022-11-02&#xA;📝 Original message:My idea, which I hated and didn&#39;t propose, was to mark utxos specifically&#xA;for this exact purpose, but this is extremely ugly from a wallet/consensus&#xA;perspective. nVersion is cleaner(well, except the below issue), at the cost&#xA;of forcibly marking all utxos in a transaction the same way.&#xA;&#xA;&gt; On the validation-side, there is one engineering issue, as I think there&#xA;is no access to the spent nversion fields by the mempool logic.&#xA;&#xA;I don&#39;t think Core tracks this value in the utxo set either, because&#xA;currently there&#39;s no use-case for it today? Am I mistaken?&#xA;&#xA;/**&#xA; * A UTXO entry.&#xA; *&#xA; * Serialized format:&#xA; * - VARINT((coinbase ? 1 : 0) | (height &lt;&lt; 1))&#xA; * - the non-spent CTxOut (via TxOutCompression)&#xA; */&#xA;&#xA;Greg&#xA;&#xA;&#xA;On Wed, Nov 2, 2022 at 6:27 AM Antoine Riard via bitcoin-dev &lt;&#xA;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&#xA;&gt; Hi list,&#xA;&gt;&#xA;&gt; Reading Suhas&#39;s post on mempool policy consistency rules, and the grounded&#xA;&gt; suggestion that as protocol developers we should work on special policy&#xA;&gt; rules to support each reasonable use case on the network rather to arbiter&#xA;&gt; between class of use-cases in the design of an&#xA;&gt; unified set of rules, reminded me there is another solution to solve&#xA;&gt; multi-party funding pinning rather than wide deployment of fullrbf. This&#xA;&gt; was communicated to me a while back, and it was originally dismissed&#xA;&gt; because of the privacy trade-offs (and potential slight fees overhead&#xA;&gt; cost). However, if widely adopted, they might sound acceptable to&#xA;&gt; contracting protocol developers and operators.&#xA;&gt;&#xA;&gt; ## The Problem: Pinning Contracting Protocols Funding Flows with Opt-out&#xA;&gt; Double-Spend&#xA;&gt;&#xA;&gt; As originally laid out [0], multi-party collaborative flows&#xA;&gt; (coinjoin/dual-funding/swaps/splicing/etc), where every participant&#xA;&gt; contributes at least one input, are suffering from a low-cost and&#xA;&gt; high-success DoS vector with asymmetric damages. E.g with lightning&#xA;&gt; interactive transaction construction protocols limits of 252 inputs, 1&#xA;&gt; single input can bleed the timevalue of the remaining 251 inputs, or engage&#xA;&gt; in a MEV attack where the fee-bumping entity is lured to inflate feerate&#xA;&gt; beyond the current blockspace demand. The attack can be hidden and a&#xA;&gt; posteriori assigning blame consistently stays an open question in the lack&#xA;&gt; of a consensus mechanism between participants on the network mempools&#xA;&gt; states.&#xA;&gt;&#xA;&gt; The issue lies in the fact that participants joining inputs together don&#39;t&#xA;&gt; have control, or even view, of the replacement signaling of any potential&#xA;&gt; double-spend of the other participants inputs. Indeed the opt-in fullrbf&#xA;&gt; signaling is enforced based on the nSequence field, and this one is fully&#xA;&gt; malleable by the UTXO spender. There is no current mechanism to require&#xA;&gt; replacement signaling provable to a third-party only on the knowledge of&#xA;&gt; the UTXO spents.&#xA;&gt;&#xA;&gt; # The Solution: Opt-in Full-Replace-by-Fee Spent-nVersion Signaling&#xA;&gt;&#xA;&gt; A new policy is specified in a new way a transaction can signal that it is&#xA;&gt; replaceable.&#xA;&gt;&#xA;&gt; 1. A confirmed transaction is considered to have opted in to allowing&#xA;&gt; replacement of any of its spends (or their descendants), if the last bit of&#xA;&gt; the nVersion field is set.&#xA;&gt;&#xA;&gt; Rational: The future replacement status of any UTXO spend can be&#xA;&gt; determined by inspecting the nVersion, therefore protecting the&#xA;&gt; collaborative participants of a multi-party flows that the target&#xA;&gt; transaction should propagate to the miners, if the fee/feerate offered are&#xA;&gt; the best ones without opt-out based pinning. It can be required the UTXOs&#xA;&gt; to have few confirmations in case of shallow reorgs to increase DoS&#xA;&gt; protection.&#xA;&gt;&#xA;&gt; ## Solution trade-offs&#xA;&gt;&#xA;&gt; On the validation-side, there is one engineering issue, as I think there&#xA;&gt; is no access to the spent nversion fields by the mempool logic. This would&#xA;&gt; presume we add some new cache of all the confirmed UTXOs, so ~50M * 4bytes,&#xA;&gt; 300 MB of additional state for policy-enforcing full-nodes. I don&#39;t know if&#xA;&gt; there is another strong drawback, even the reorg logic the replaceable&#xA;&gt; spends shouldn&#39;t be evicted if the confirmed ancestor is back to the&#xA;&gt; mempool, as mempool validity shouldn&#39;t be reevaluated before a replacement&#xA;&gt; candidate shows up. A fee penalty could be requested for nVersion-signaling&#xA;&gt; transactions to compensate for the additional state stored by full-node&#xA;&gt; operators (even if obviously they&#39;re not the ones earning the fees).&#xA;&gt;&#xA;&gt; For the contracting protocols wallets, as you don&#39;t know in advance which&#xA;&gt; coins are going to be used for a collaborative flow, you&#39;re better off to&#xA;&gt; mark all your coins nVersion fields opting fullrbf. Otherwise, you will&#xA;&gt; have to go through an on-chain fee cost to change the replacement status of&#xA;&gt; the spends of your coins. However, this policy bookmarking comes as a&#xA;&gt; protocol fingerprint leak for an observer of the transaction logs. If all&#xA;&gt; the second-layers used by default, this is constituting a single anonymity&#xA;&gt; set, though it might still be the privacy gains we&#39;re harvesting from&#xA;&gt; Taproot output usage in the optimistic case (e.g in Lightning no commitment&#xA;&gt; + HTLC transactions broadcast).&#xA;&gt;&#xA;&gt; For the zeroconf operators, assuming they have access to the UTXO set,&#xA;&gt; they can inspect the receiving transactions ancestors nVersion fields, and&#xA;&gt; sort those transactions in the wider set of the replaceable ones, as&#xA;&gt; they&#39;re currently doing for BIP125 opt-in ones.&#xA;&gt;&#xA;&gt; Long-term, the annoying privacy issue and the assumption that any wallet&#xA;&gt; will be a Lightning one could lead to the majority of wallets signaling RBF&#xA;&gt; for their spends. Therefore making those wallets incompatible with zeroconf&#xA;&gt; services, slowly economically outlawing them. From my perspective, though&#xA;&gt; it might be a simplification, it sounds an alternative full rbf way&#xA;&gt; forward, where rather than having miners deciding on the policy&#xA;&gt; enforcement, we let the users decide with their coins. However, this new&#xA;&gt; policy enforcement efficiency is still dependent on the existence of relay&#xA;&gt; paths and support at the endpoints that matter, the miner mempools. So in&#xA;&gt; fine we might have to realize incentive alignment with hashrate is what&#xA;&gt; matters in terms of transaction-relay rules ?&#xA;&gt;&#xA;&gt; Credit to Greg Maxwell for this idea.&#xA;&gt;&#xA;&gt; Cheers,&#xA;&gt; Antoine&#xA;&gt;&#xA;&gt; [0]&#xA;&gt; https://lists.linuxfoundation.org/pipermail/lightning-dev/2021-May/003033.html&#xA;&gt; _______________________________________________&#xA;&gt; bitcoin-dev mailing list&#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20221102/70b6a272/attachment.html&gt;</html></oembed>