<oembed><type>rich</type><version>1.0</version><author_name>npub1vjzmc45k8dgujppapp2ue20h3l9apnsntgv4c0ukncvv549q64gsz4x8dd</author_name><author_url>https://nostr.ae/npub1vjzmc45k8dgujppapp2ue20h3l9apnsntgv4c0ukncvv549q64gsz4x8dd</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2022-09-25&#xA;📝 Original message:Hi Gloria,&#xA;&#xA;Thanks for the progress on package RBF, few early questions.&#xA;&#xA;&gt; 2. Any descendant of an unconfirmed V3 transaction must also be V3.&#xA;&#xA;&gt; 3. An unconfirmed V3 transaction cannot have more than 1 descendant.&#xA;&#xA;If you&#39;re a miner and you receive a non-V3, second descendant of an&#xA;unconfirmed V3 transaction, if the offered fee is in the top mempool&#xA;backlog, I think you would have an interest to accept such a transaction.&#xA;&#xA;So I&#39;m not sure if those two rules are compatible with miners incentives...&#xA;&#xA;&gt; 4. A V3 transaction that has an unconfirmed V3 ancestor cannot be&#xA;&gt;    larger than 1000 virtual bytes.&#xA;&#xA;If I understand correctly the 1000 vb upper bound rational, it would be to&#xA;constraint the pinning counterparty to attach a high fee to a child due to&#xA;the limited size, if they would like this transaction to be stuck in the&#xA;network mempools. By doing so  this child has high odds to confirm.&#xA;&#xA;I still wonder if this compatible with miner incentives in period of empty&#xA;mempools, in the sense that if you&#39;ve already a V3 transaction of size&#xA;100Kvb offering 2 sat/vb, it&#39;s more interesting than a V3 replacement&#xA;candidate of size 1000 vb offering 10 sat/vb. It could be argued the former&#xA;should be conserved.&#xA;&#xA;(That said, the hard thing with any replacement strategy we might evict a&#xA;parent transaction *now* to which is attached a high-feerate child *latter*&#xA;making for a utxo considered the best ancestor set. Maybe in the long-term&#xA;miners should keep every transaction ever accepted...)&#xA;&#xA;&gt; (Lower bound) the smaller this limit, the fewer UTXOs a child may use&#xA;&gt; to fund this fee-bump. For example, only allowing the V3 child to have&#xA;&gt; 2 inputs would require L2 protocols to manage a wallet with high-value&#xA;&gt; UTXOs and make batched fee-bumping impossible. However, as the&#xA;&gt; fee-bumping child only needs to fund fees (as opposed to payments),&#xA;&gt; just a few UTXOs should suffice.&#xA;&#xA;Reminder for L2 devs, batched fee-bumping of time-sensitive confirmations&#xA;of commitment transactions is unsafe, as the counterparty could enter in a&#xA;&#34;cat-and-mouse&#34; game to replace one of the batch element at each block to&#xA;delay confirmation of the remaining elements in the batch, I think.&#xA;&#xA;On the other hand, I wonder if we wouldn&#39;t want a higher bound. LN wallets&#xA;are likely to have one big UTXO in their fee-bumping reserve pool, as the&#xA;cost of acquiring UTXO is non-null and in the optimistic case, you don&#39;t&#xA;need to do unilateral closure. Let&#39;s say you close dozens of channels at&#xA;the same time, a UTXO pool management strategy might be to fan-out the&#xA;first spends UTXOs in N fan-out outputs ready to feed the remaining&#xA;in-flight channels.&#xA;&#xA;&gt; 1. The rule around unconfirmed inputs was&#xA;&gt; originally &#34;A package may include new unconfirmed inputs, but the&#xA;&gt; ancestor feerate of the child must be at least as high as the ancestor&#xA;&gt; feerates of every transaction being replaced.&#34;&#xA;&#xA;Note, I think we would like this new RBF rule to also apply to single&#xA;transaction package, e.g second-stage HTLC transactions, where a&#xA;counterparty pins a HTLC-preimage by abusing rule 3. In that case, the&#xA;honest LN node should be able to broadcast a &#34;at least as high ancestor&#xA;feerate&#34; HTLC-timeout transaction. With `option_anchor_outputs&#34; there is no&#xA;unconfirmed ancestor to replace, as the commitment transaction, whatever&#xA;the party it is originating from, should already be confirmed.&#xA;&#xA;&gt; &#34;Is this a privacy issue, i.e. doesn&#39;t it allow fingerprinting LN&#xA;transactions based on nVersion?&#34;&#xA;&#xA;As of today, I think yes you can already fingerprint LN transactions on&#xA;the  spec-defined amount value of the anchor outputs, 330 sats. There is&#xA;always one of them on post-anchor commitment transactions. And sadly I&#xA;would say we&#39;ll always have tricky fingerprints leaking from unilateral LN&#xA;closures such as HTLC/PTLC timelocks...&#xA;&#xA;&gt; &#34;Can a V2 transaction replace a V3 transaction and vice versa?&#34;&#xA;&#xA;IIUC, a V3 package could replace a V2 package, with the benefit of the new&#xA;package RBF rules applied. I think this would be a significant advantage&#xA;for LN, as for the current ~85k of opened channels, the old V2 states&#xA;shouldn&#39;t be pinning vectors. Currently, commitment transactions signal&#xA;replaceability.&#xA;&#xA;Le ven. 23 sept. 2022 à 11:26, Gloria Zhao via bitcoin-dev &lt;&#xA;bitcoin-dev at lists.linuxfoundation.org&gt; a écrit :&#xA;&#xA;&gt; Hi everyone,&#xA;&gt;&#xA;&gt; I&#39;m writing to propose a very simple set of mempool/transaction relay&#xA;&gt; policies intended to aid L2/contract protocols. I realized that&#xA;&gt; the previously proposed Package Mempool Accept package RBF [1]&#xA;&gt; had a few remaining problems after digging into the RBF logic more [2].&#xA;&gt; This additional set of policies solves them without requiring a huge RBF&#xA;&gt; overhaul.&#xA;&gt;&#xA;&gt; I&#39;ve written an implementation (and docs) for Bitcoin Core:&#xA;&gt; https://github.com/bitcoin/bitcoin/pull/25038&#xA;&gt;&#xA;&gt; (You may notice that this proposal incorporates feedback on the PR -&#xA;&gt; thanks Suhas Daftuar, Gregory Sanders, Bastien Teinturier, Anthony Towns,&#xA;&gt; and others.)&#xA;&gt;&#xA;&gt; If you are interested in using package RBF/relay to bump presigned&#xA;&gt; transactions, I think you may be interested in reviewing this proposal.&#xA;&gt; This should solve Rule 3 pinning and perhaps allow us&#xA;&gt; to get rid of CPFP carve-out (yay!). I&#39;m keen to hear if people find&#xA;&gt; the 1-anchor-output, 1000vB child limit too restrictive. Also, if you find&#xA;&gt; a&#xA;&gt; pinning attack or something that makes it unusable for you, I would&#xA;&gt; really really like to know.&#xA;&gt;&#xA;&gt; Note that transactions with nVersion=3 (&#34;V3 transactions&#34;) are&#xA;&gt; currently non-standard in Bitcoin Core. That means **anything that was&#xA;&gt; standard before this policy change would still be standard&#xA;&gt; afterwards.** If you don&#39;t want your transactions to be subject to&#xA;&gt; these rules, just continue whatever you&#39;re doing and don&#39;t use&#xA;&gt; nVersion=3. AFAICT this shouldn&#39;t break anything, but let me know if&#xA;&gt; this would be disruptive for you?&#xA;&gt;&#xA;&gt; **New Policies:**&#xA;&gt;&#xA;&gt; This includes:&#xA;&gt; - a set of additional policy rules applying to V3 transactions&#xA;&gt; - modifications to package RBF rules&#xA;&gt;&#xA;&gt; **V3 transactions:**&#xA;&gt;&#xA;&gt; Existing standardness rules apply to V3 (e.g. min/max tx weight,&#xA;&gt; standard output types, cleanstack, etc.). The following additional&#xA;&gt; rules apply to V3:&#xA;&gt;&#xA;&gt; 1. A V3 transaction can be replaced, even if it does not signal BIP125&#xA;&gt;    replaceability. (It must also meet the other RBF rules around fees,&#xA;&gt; etc. for replacement to happen).&#xA;&gt;&#xA;&gt; 2. Any descendant of an unconfirmed V3 transaction must also be V3.&#xA;&gt;&#xA;&gt; *Rationale*: Combined with Rule 1, this gives us the property of&#xA;&gt; &#34;inherited&#34; replaceability signaling when descendants of unconfirmed&#xA;&gt; transactions are created. Additionally, checking whether a transaction&#xA;&gt; signals replaceability this way does not require mempool traversal,&#xA;&gt; and does not change based on what transactions are mined. It also&#xA;&gt; makes subsequent rules about descendant limits much easier to check.&#xA;&gt;&#xA;&gt; *Note*: The descendant of a *confirmed* V3 transaction does not need to be&#xA;&gt; V3.&#xA;&gt;&#xA;&gt; 3. An unconfirmed V3 transaction cannot have more than 1 descendant.&#xA;&gt;&#xA;&gt; *Rationale*: (Upper bound) the larger the descendant limit, the more&#xA;&gt; transactions may need to be replaced. This is a problematic pinning&#xA;&gt; attack, i.e., a malicious counterparty prevents the transaction from&#xA;&gt; being replaced by adding many descendant transactions that aren&#39;t&#xA;&gt; fee-bumping.&#xA;&gt;&#xA;&gt; (Lower bound) at least 1 descendant is required to allow CPFP of the&#xA;&gt; presigned transaction. The contract protocol can create presigned&#xA;&gt; transactions paying 0 fees and 1 output for attaching a CPFP at&#xA;&gt; broadcast time (&#34;anchor output&#34;). Without package RBF, multiple anchor&#xA;&gt; outputs would be required to allow each counterparty to fee-bump any&#xA;&gt; presigned transaction. With package RBF, since the presigned&#xA;&gt; transactions can replace each other, 1 anchor output is sufficient.&#xA;&gt;&#xA;&gt; 4. A V3 transaction that has an unconfirmed V3 ancestor cannot be&#xA;&gt;    larger than 1000 virtual bytes.&#xA;&gt;&#xA;&gt; *Rationale*: (Upper bound) the larger the descendant size limit, the&#xA;&gt; more vbytes may need to be replaced. With default limits, if the child&#xA;&gt; is e.g. 100,000vB, that might be an additional 100,000sats (at&#xA;&gt; 1sat/vbyte) or more, depending on the feerate.&#xA;&gt;&#xA;&gt; (Lower bound) the smaller this limit, the fewer UTXOs a child may use&#xA;&gt; to fund this fee-bump. For example, only allowing the V3 child to have&#xA;&gt; 2 inputs would require L2 protocols to manage a wallet with high-value&#xA;&gt; UTXOs and make batched fee-bumping impossible. However, as the&#xA;&gt; fee-bumping child only needs to fund fees (as opposed to payments),&#xA;&gt; just a few UTXOs should suffice.&#xA;&gt;&#xA;&gt; With a limit of 1000 virtual bytes, depending on the output types, the&#xA;&gt; child can have 6-15 UTXOs, which should be enough to fund a fee-bump&#xA;&gt; without requiring a carefully-managed UTXO pool. With 1000 virtual&#xA;&gt; bytes as the descendant limit, the cost to replace a V3 transaction&#xA;&gt; has much lower variance.&#xA;&gt;&#xA;&gt; *Rationale*: This makes the rule very easily &#34;tacked on&#34; to existing&#xA;&gt; logic for policy and wallets. A transaction may be up to 100KvB on its&#xA;&gt; own (`MAX_STANDARD_TX_WEIGHT`) and 101KvB with descendants&#xA;&gt; (`DEFAULT_DESCENDANT_SIZE_LIMIT_KVB`). If an existing V3 transaction&#xA;&gt; in the mempool is 100KvB, its descendant can only be 1000vB, even if&#xA;&gt; the policy is 10KvB.&#xA;&gt;&#xA;&gt; **Package RBF modifications:**&#xA;&gt;&#xA;&gt; 1. The rule around unconfirmed inputs was&#xA;&gt; originally &#34;A package may include new unconfirmed inputs, but the&#xA;&gt; ancestor feerate of the child must be at least as high as the ancestor&#xA;&gt; feerates of every transaction being replaced.&#34;&#xA;&gt;&#xA;&gt; The package may still include new unconfirmed inputs. However,&#xA;&gt; the new rule is modified to be &#34;The minimum between package feerate&#xA;&gt; and ancestor feerate of the child is not lower than the individual&#xA;&gt; feerates of all directly conflicting transactions and the ancestor&#xA;&gt; feerates of all original transactions.&#34;&#xA;&gt;&#xA;&gt; *Rationale*: We are attempting to ensure that the replacement&#xA;&gt; transactions are not less incentive-compatible to mine. However, a&#xA;&gt; package/transaction&#39;s ancestor feerate is not perfectly representative&#xA;&gt; of its incentive compatibility; it may overestimate (some subset of&#xA;&gt; the ancestors could be included by itself if it has other high-feerate&#xA;&gt; descendants or are themselves higher feerate than this&#xA;&gt; package/transaction). Instead, we use the minimum between the package&#xA;&gt; feerate and ancestor feerate of the child as a more conservative value&#xA;&gt; than what was proposed originally.&#xA;&gt;&#xA;&gt; 2. A new rule is added, requiring that all package transactions with&#xA;&gt; mempool conflicts to be V3. This also means the &#34;sponsoring&#34;&#xA;&gt; child transaction must be V3.&#xA;&gt;&#xA;&gt; *Note*: Combined with the V3 rules, this means the package must be&#xA;&gt; a child-with-parents package. Since package validation is only&#xA;&gt; attempted if the transactions do not pay sufficient fees to be&#xA;&gt; accepted on their own, this effectively means that only V3&#xA;&gt; transactions can pay to replace their ancestors&#39; conflicts, and only&#xA;&gt; V3 transactions&#39; replacements may be paid for by a descendant.&#xA;&gt;&#xA;&gt; *Rationale*: The fee-related rules are economically rational for&#xA;&gt; ancestor packages, but not necessarily other types of packages.&#xA;&gt; A child-with-parents package is a type of ancestor package. It&#xA;&gt; may be fine to allow any ancestor package, but it&#39;s more difficult&#xA;&gt; to account for all of the possibilities. For example, it gets much&#xA;&gt; harder to see that we&#39;re applying the descendant limits correctly if&#xA;&gt; the package has a gnarly, many-generation, non-tree shape. I&#39;m also&#xA;&gt; not sure if this policy is 100% incentive-compatible if the sponsor&#xA;&gt; is not a direct descendant of the sponsee.&#xA;&gt;&#xA;&gt; Please see doc/policy/version3_transactions.md and&#xA;&gt; doc/policy/packages.md in the PR for the full set of rules.&#xA;&gt;&#xA;&gt; **Intended usage for LN:**&#xA;&gt;&#xA;&gt; Commitment transactions should be V3 and have 1 anchor output. They&#xA;&gt; can be signed with 0 fees (or 1sat/vbyte) once package relay is deployed&#xA;&gt; on a significant portion of the network. If the commitment tx must&#xA;&gt; be broadcast, determine the desired feerate at broadcast time and&#xA;&gt; spend the anchor output in a high feerate transaction. I&#39;m going to&#xA;&gt; call the broadcasted commitment tx &#34;the parent&#34; and the attached&#xA;&gt; fee-bumping tx &#34;the child.&#34;&#xA;&gt;&#xA;&gt; - This child must be V3.&#xA;&gt; - This child must be at most 1000vB. Note this restricts the&#xA;&gt;   number of inputs you can use to fund the fee bump. Depending&#xA;&gt; on the output types, this is around 6-15.&#xA;&gt; - One child may fund fees for multiple commitment tx (&#34;batched&#xA;&gt;   fee-bumping&#34;).&#xA;&gt; - To do a second fee-bump to add more fees, replace the&#xA;&gt;   *child* with a higher-feerate tx. Do not try to attach a grandchild.&#xA;&gt;&#xA;&gt; Otherwise, never try to spend from an unconfirmed V3 transaction. The&#xA;&gt; descendant limits for V3 transactions are very restrictive.&#xA;&gt;&#xA;&gt; **Expected Questions:**&#xA;&gt;&#xA;&gt; &#34;Does this fix Rule 3 Pinning?&#34;&#xA;&gt; Yes. The V3 descendant limit restricts both you and your counterparty.&#xA;&gt; Assuming nodes adopted this policy, you may reasonably assume that you&#xA;&gt; only need to replace the commitment transaction + up to 1000vB.&#xA;&gt;&#xA;&gt; &#34;Only 1 anchor output? What if I need to bump counterparty&#39;s commitment tx&#xA;&gt; in mempool?&#34;&#xA;&gt; You won&#39;t need to fee-bump a counterparty&#39;s commitment tx using CPFP.&#xA;&gt; You would just package RBF it by attaching a high-feerate child to&#xA;&gt; your commitment tx.&#xA;&gt;&#xA;&gt; &#34;Is this a privacy issue, i.e. doesn&#39;t it allow fingerprinting LN&#xA;&gt; transactions based on nVersion?&#34;&#xA;&gt; Indeed it may be unrealistic to assume V3 transactions will be in&#xA;&gt; widespread use outside of L2. IIUC, unilateral closes are already&#xA;&gt; obvious LN transactions because of the HTLC inputs. For e.g.&#xA;&gt; cooperative closes and opens, I think it makes sense to continue using&#xA;&gt; V2. So, unless I&#39;m missing something, this shouldn&#39;t make it worse.&#xA;&gt;&#xA;&gt; &#34;So a V3 transaction that doesn&#39;t signal BIP125 replaceability is&#xA;&gt; replaceable? Is that a backward compatibility issue?&#34;&#xA;&gt; Yes it&#39;s replaceable. It&#39;s not an issue AFAICT because,&#xA;&gt; under previous policy, the V3 transaction wouldn&#39;t have been&#xA;&gt; in the mempool in the first place.&#xA;&gt;&#xA;&gt; &#34;Can a V2 transaction replace a V3 transaction and vice versa?&#34;&#xA;&gt; Yes, otherwise someone can use V3 transactions to censor V2&#xA;&gt; transactions spending shared inputs. Note if the&#xA;&gt; original V3 transaction has an unconfirmed V3 parent, this would&#xA;&gt; violate the &#34;inherited V3&#34; rule and would be rejected.&#xA;&gt;&#xA;&gt; Thanks for reading! Feedback and review would be much appreciated.&#xA;&gt;&#xA;&gt; [1]:&#xA;&gt; https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019464.html&#xA;&gt; [2]:&#xA;&gt; https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-January/019817.html&#xA;&gt;&#xA;&gt; Best,&#xA;&gt; Gloria&#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/20220925/a8ab458a/attachment-0001.html&gt;</html></oembed>