<oembed><type>rich</type><version>1.0</version><author_name>npub14ca6vjq25eaema6zxke2g8hjc6ztkf5ej698f5fhyg98zqq85zsqu0m739</author_name><author_url>https://nostr.ae/npub14ca6vjq25eaema6zxke2g8hjc6ztkf5ej698f5fhyg98zqq85zsqu0m739</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2022-09-26&#xA;📝 Original message:Hi Greg, Antoine, Bastien,&#xA;&#xA;Thanks very much for the feedback! I interpret most of the discussion&#xA;around limitations as ideas for future improvements rather than criticisms&#xA;of the proposal (please correct me if I&#39;m wrong). I&#39;ll try to respond to as&#xA;much as possible.&#xA;&#xA;Also I realize that I didn&#39;t contextualize this proposal clearly enough; it&#xA;is very tailored for LN Penalty and definitely doesn&#39;t close all pinning&#xA;attacks possible (sorry for confusing anyone). I also agree that some bits&#xA;can be a little ugly or tack-on; I would definitely prefer a comprehensive&#xA;RBF revamp to fix all our problems and enable other fee-bumping strategies&#xA;such as&#xA;sign-ANYONECANPAY-then-bring-your-own-fees-by-adding-inputs-at-broadcast. I&#xA;was hoping to get some ideas with the &#34;RBF Improvements&#34; post in January,&#xA;but it doesn&#39;t seem like we&#39;re much closer to a workable proposal. I think&#xA;this is a minimally-invasive step that works for Lightning today, a small&#xA;fix similar to CPFP carve out.&#xA;&#xA;&gt; As you likely know from previous discussions the biggest scenario this&#xA;does not fix in my estimation is ANYONECANPAY situations. If the parent&#xA;transaction can be &#34;inflated&#34; by tacking on additional inputs, this means&#xA;the total weight of the parent tx lowers the effective feerate of the&#xA;package.&#xA;&#xA;(For more context to other readers I wrote an explanation for this in&#xA;&#34;SIGHASH_ANYONECANPAY Pinning&#34; section of RBF ML post).  Yes, this&#xA;unfortunately doesn&#39;t fix any of the existing pinning attacks for single&#xA;transaction RBF but also doesn&#39;t make them worse. This boils down to adding&#xA;an incentive compatibility rule that ensures you can&#39;t replace a&#xA;transaction with something that will confirm slower. Package RBF has an&#xA;ancestor feerate-based rule for this (note it is quite conservative and not&#xA;perfect).&#xA;&#xA;So in the scenario above with the &#34;inflated&#34; parent that was signed ACP,&#xA;the replacement would be rejected because the package ancestor feerate is&#xA;lower than the feerate of what is being replaced. But it is imperfect&#xA;(explained below) and thus I wouldn&#39;t recommend it for single transaction&#xA;replacement. So that attack still exists for single transactions, yes.&#xA;&#xA;The strategy of using ACP to bring-your-own-fees has its own challenges but&#xA;hopefully has no current use cases as you say. AFAIK LN Penalty is not&#xA;affected by this since it doesn&#39;t use ACP, though obviously I agree we&#xA;should fix it for the future.&#xA;&#xA;So when I said &#34;this is intended for fee-bumping presigned txns in&#xA;contracting protocols,&#34; I should have said &#34;this is intended for&#xA;fee-bumping presigned txns specifically using CPFP and anchor outputs.&#34;&#xA;Apologies for forgetting to contextualize, I&#39;ve been sitting on this for&#xA;too long.&#xA;&#xA;&gt; The other scenario it doesn&#39;t really fix is where HTLC/commitment-like&#xA;transactions are being resolved in a batch, but due to relative time&#xA;constraints, you may want to accelerate some and not others. Now you must&#xA;pay higher rates to replace all of the transaction bumps. This is a&#xA;&#34;self-pin&#34; and &#34;get good at utxos noob&#34; type problem, but it&#39;s something&#xA;that axing rule#3 in favor of a Replace-by-ancestor-feerate system would&#xA;get us.&#xA;&#xA;I understand you to mean &#34;if you don&#39;t have enough UTXOs and you&#39;re forced&#xA;to batch-bump, you over-pay because you need to bring them all to the&#xA;highest target feerate.&#34; Isn&#39;t this kind of separate, wallet-related&#xA;problem? Contracting or not, surely every wallet needs to have enough UTXOs&#xA;to not batch transactions that shouldn&#39;t be batched... I don&#39;t see how a&#xA;replace-by-ancestor-feerate policy would make any difference for this?&#xA;&#xA;Also in general I&#39;d like to reiterate that ancestor feerate is not a&#xA;panacea to all our RBF incentive compatibility concerns. Like individual&#xA;feerate, unless we run the mining algorithm, it cannot tell us exactly how&#xA;quickly this transaction would be mined.&#xA;&#xA;We&#39;re estimating the incentive compatibility of the original transaction(s)&#xA;and replacement transaction(s), with the goal of not letting a transaction&#xA;replace something that would have been more incentive compatible to mine.&#xA;As such, we don&#39;t want to overestimate how good the replacement is, and we&#xA;don&#39;t want to underestimate how good the original transactions are. This&#xA;rule &#34;The minimum between package feerate and ancestor feerate of the child&#xA;is not lower than the individual feerates of all directly conflicting&#xA;transactions and the ancestor feerates of all original transactions&#34; is a&#xA;conservative estimate.&#xA;&#xA;&gt; Would kind of be nice if package RBF would detect a &#34;sibling output&#xA;spend&#34; conflict, and knock it out of the mempool via the other replacement&#xA;rules? Getting rid of the requirement to 1 block csv lock every output&#xA;would be quite nice from a smart contracting composability point of view.&#xA;&#xA;Interesting, so when a transaction hits a mempool tx&#39;s descendant limit, we&#xA;consider evicting one of its descendants in favor of this transaction,&#xA;based on the RBF rules.&#xA;Cool idea! After chewing on this for a bit, I think this *also* just boils&#xA;down to the fact that RBF should require replacements to be better mining&#xA;candidates. As in, if we added this policy and it can make us evict the&#xA;sibling and accept a transaction with a bunch of low-feerate ancestor junk,&#xA;it would be a new pinning vector.&#xA;&#xA;&gt; 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;&gt; So I&#39;m not sure if those two rules are compatible with miners&#xA;incentives...&#xA;&#xA;The same argument can be made for the 26th descendant of a mempool&#xA;transaction; it&#39;s also not entirely incentive-compatible to reject it, but&#xA;that is not the *only* design goal in mempool policy. Of course, the&#xA;difference here is that the 25-descendant limit rule is a sensible DoS&#xA;protection, while this 1-descendant limit rule is more of a &#34;help the&#xA;Bitcoin ecosystem&#34; policy, just like CPFP carve-out, dust limit, etc. I can&#xA;of course understand why not everyone would be in favor of this, but I do&#xA;think it&#39;s worth it.&#xA;&#xA;&gt; &gt; 4. A V3 transaction that has an unconfirmed V3 ancestor cannot be&#xA;&gt; &gt;    larger than 1000 virtual bytes.&#xA;&#xA;&gt; If I understand correctly the 1000 vb upper bound rational, it would be&#xA;to constraint the pinning counterparty to attach a high fee to a child due&#xA;to 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;Yeah exactly, the &#34;Rule 3 pin&#34; is done by adding a child that&#39;s high-fee&#xA;(so you have to pay that much to evict it). Because they *don&#39;t* want this&#xA;tx to confirm, normally, this child would be really large. If they only&#xA;have 1000vB for the child, they can&#39;t increase the replacement cost without&#xA;also fee-bumping the transaction to make it confirm faster.&#xA;&#xA;&gt; 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; I agree with you, this isn&#39;t worse than today, unilateral closes will&#xA;probably always be identifiable on-chain.&#xA;&#xA;Great to hear that there is no privacy worsening!&#xA;&#xA;Best,&#xA;Gloria&#xA;&#xA;On Mon, Sep 26, 2022 at 5:02 PM Greg Sanders &lt;gsanders87 at gmail.com&gt; wrote:&#xA;&#xA;&gt; Bastien,&#xA;&gt;&#xA;&gt; &gt; This may be already covered by the current package RBF logic, in that&#xA;&gt; scenario we are simply replacing [ParentTx, ChildTx1] with&#xA;&gt; [ParentTx, ChildTx2] that pays more fees, right?&#xA;&gt;&#xA;&gt; For clarification, package RBF is ParentTx*s*(plural), and&#xA;&gt; ChildTx(singular), so it might be a bit more complicated than we&#39;re&#xA;&gt; thinking, and currently the V3 proposal would first de-duplicate the&#xA;&gt; ParentTx based on what is in the mempool, then look at the &#34;rest&#34; of the&#xA;&gt; transactions as a package, then individually. Not the same, not sure how&#xA;&gt; different. I&#39;ll defer to experts.&#xA;&gt;&#xA;&gt; Best,&#xA;&gt; Greg&#xA;&gt;&#xA;&gt; On Mon, Sep 26, 2022 at 11:48 AM Bastien TEINTURIER via bitcoin-dev &lt;&#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&gt;&#xA;&gt;&gt; Thanks Gloria for this great post.&#xA;&gt;&gt;&#xA;&gt;&gt; This is very valuable work for L2 contracts, and will greatly improve&#xA;&gt;&gt; their security model.&#xA;&gt;&gt;&#xA;&gt;&gt; &gt; &#34;Only 1 anchor output? What if I need to bump counterparty&#39;s commitment&#xA;&gt;&gt; tx in mempool?&#34;&#xA;&gt;&gt; &gt; You won&#39;t need to fee-bump a counterparty&#39;s commitment tx using CPFP.&#xA;&gt;&gt; &gt; You would just package RBF it by attaching a high-feerate child to&#xA;&gt;&gt; &gt; your commitment tx.&#xA;&gt;&gt;&#xA;&gt;&gt; Note that we can also very easily make that single anchor spendable by&#xA;&gt;&gt; both participants (or even anyone), so if you see your counterparty&#39;s&#xA;&gt;&gt; commitment in your mempool, you can bump it without publishing your&#xA;&gt;&gt; own commitment, which is quite desirable (your own commitment tx has&#xA;&gt;&gt; CSV delays on your outputs, whereas your counterparty&#39;s commitment tx&#xA;&gt;&gt; doesn&#39;t).&#xA;&gt;&gt;&#xA;&gt;&gt; &gt; &#34;Is this a privacy issue, i.e. doesn&#39;t it allow fingerprinting LN&#xA;&gt;&gt; transactions based on nVersion?&#34;&#xA;&gt;&gt;&#xA;&gt;&gt; I agree with you, this isn&#39;t worse than today, unilateral closes will&#xA;&gt;&gt; probably always be identifiable on-chain.&#xA;&gt;&gt;&#xA;&gt;&gt; &gt; Would kind of be nice if package RBF would detect a &#34;sibling output&#xA;&gt;&gt; spend&#34;&#xA;&gt;&gt; &gt; conflict, and knock it out of the mempool via the other replacement&#xA;&gt;&gt; rules?&#xA;&gt;&gt; &gt; Getting rid of the requirement to 1 block csv lock every output would be&#xA;&gt;&gt; &gt; quite nice from a smart contracting composability point of view.&#xA;&gt;&gt;&#xA;&gt;&gt; +1, that would be very neat!&#xA;&gt;&gt;&#xA;&gt;&gt; This may be already covered by the current package RBF logic, in that&#xA;&gt;&gt; scenario we are simply replacing [ParentTx, ChildTx1] with&#xA;&gt;&gt; [ParentTx, ChildTx2] that pays more fees, right?&#xA;&gt;&gt;&#xA;&gt;&gt; &gt; 1) I do think that we should seriously consider allowing OP_TRUE to&#xA;&gt;&gt; become&#xA;&gt;&gt; &gt; a standard script type as part of this policy update. If pinning is&#xA;&gt;&gt; solved,&#xA;&gt;&gt; &gt; then there&#39;s no reason to require all those extra bytes for &#34;binding&#34; an&#xA;&gt;&gt; &gt; anchor to a specific wallet/user. We can save quite a few bytes by&#xA;&gt;&gt; having&#xA;&gt;&gt; &gt; the input be empty of witness data.&#xA;&gt;&gt; &gt; 2) If we allow for a single dust-value(0 on up) output which is&#xA;&gt;&gt; immediately&#xA;&gt;&gt; &gt; spent by the package, anchors become even easier to to design. No value&#xA;&gt;&gt; has&#xA;&gt;&gt; &gt; to be &#34;sapped&#34; from contract participants to make an anchor output.&#xA;&gt;&gt; There&#39;s&#xA;&gt;&gt; &gt; more complications for this, such as making sure the parent transaction&#xA;&gt;&gt; is&#xA;&gt;&gt; &gt; dropped if the child spend is dropped, but maybe it&#39;s worth the squeeze.&#xA;&gt;&gt;&#xA;&gt;&gt; I also think both of these could be quite useful. This would probably&#xA;&gt;&gt; always&#xA;&gt;&gt; be used in combination with a parent transaction that pays 0 fees, so the&#xA;&gt;&gt; 0-value output would always be spent in the same block.&#xA;&gt;&gt;&#xA;&gt;&gt; But this means we could end up with 0-value outputs in the utxo set, if&#xA;&gt;&gt; for&#xA;&gt;&gt; some reason the parent tx is CPFP-ed via another output than the 0-value&#xA;&gt;&gt; one,&#xA;&gt;&gt; which would be a utxo set bloat issue. But I&#39;d argue that we&#39;re probably&#xA;&gt;&gt; already creating utxo set bloat with the 330 sat anchor outputs&#xA;&gt;&gt; (especially&#xA;&gt;&gt; since we use two of them, but only one is usually spent), so it would&#xA;&gt;&gt; probably be *better* than what we&#39;re doing today.&#xA;&gt;&gt;&#xA;&gt;&gt; Thanks,&#xA;&gt;&gt; Bastien&#xA;&gt;&gt;&#xA;&gt;&gt; Le lun. 26 sept. 2022 à 03:22, Antoine Riard via bitcoin-dev &lt;&#xA;&gt;&gt; bitcoin-dev at lists.linuxfoundation.org&gt; a écrit :&#xA;&gt;&gt;&#xA;&gt;&gt;&gt; Hi Gloria,&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Thanks for the progress on package RBF, few early questions.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; &gt; 2. Any descendant of an unconfirmed V3 transaction must also be V3.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; &gt; 3. An unconfirmed V3 transaction cannot have more than 1 descendant.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; If you&#39;re a miner and you receive a non-V3, second descendant of an&#xA;&gt;&gt;&gt; unconfirmed V3 transaction, if the offered fee is in the top mempool&#xA;&gt;&gt;&gt; backlog, I think you would have an interest to accept such a transaction.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; So I&#39;m not sure if those two rules are compatible with miners&#xA;&gt;&gt;&gt; incentives...&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; &gt; 4. A V3 transaction that has an unconfirmed V3 ancestor cannot be&#xA;&gt;&gt;&gt; &gt;    larger than 1000 virtual bytes.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; If I understand correctly the 1000 vb upper bound rational, it would be&#xA;&gt;&gt;&gt; to constraint the pinning counterparty to attach a high fee to a child due&#xA;&gt;&gt;&gt; to the limited size, if they would like this transaction to be stuck in the&#xA;&gt;&gt;&gt; network mempools. By doing so  this child has high odds to confirm.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; I still wonder if this compatible with miner incentives in period of&#xA;&gt;&gt;&gt; empty mempools, in the sense that if you&#39;ve already a V3 transaction of&#xA;&gt;&gt;&gt; size 100Kvb offering 2 sat/vb, it&#39;s more interesting than a V3 replacement&#xA;&gt;&gt;&gt; candidate of size 1000 vb offering 10 sat/vb. It could be argued the former&#xA;&gt;&gt;&gt; should be conserved.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; (That said, the hard thing with any replacement strategy we might evict&#xA;&gt;&gt;&gt; a parent transaction *now* to which is attached a high-feerate child&#xA;&gt;&gt;&gt; *latter* making for a utxo considered the best ancestor set. Maybe in the&#xA;&gt;&gt;&gt; long-term miners should keep every transaction ever accepted...)&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; &gt; (Lower bound) the smaller this limit, the fewer UTXOs a child may use&#xA;&gt;&gt;&gt; &gt; to fund this fee-bump. For example, only allowing the V3 child to have&#xA;&gt;&gt;&gt; &gt; 2 inputs would require L2 protocols to manage a wallet with high-value&#xA;&gt;&gt;&gt; &gt; UTXOs and make batched fee-bumping impossible. However, as the&#xA;&gt;&gt;&gt; &gt; fee-bumping child only needs to fund fees (as opposed to payments),&#xA;&gt;&gt;&gt; &gt; just a few UTXOs should suffice.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Reminder for L2 devs, batched fee-bumping of time-sensitive&#xA;&gt;&gt;&gt; confirmations of commitment transactions is unsafe, as the counterparty&#xA;&gt;&gt;&gt; could enter in a &#34;cat-and-mouse&#34; game to replace one of the batch element&#xA;&gt;&gt;&gt; at each block to delay confirmation of the remaining elements in the batch,&#xA;&gt;&gt;&gt; I think.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; On the other hand, I wonder if we wouldn&#39;t want a higher bound. LN&#xA;&gt;&gt;&gt; wallets are likely to have one big UTXO in their fee-bumping reserve pool,&#xA;&gt;&gt;&gt; as the cost of acquiring UTXO is non-null and in the optimistic case, you&#xA;&gt;&gt;&gt; don&#39;t need to do unilateral closure. Let&#39;s say you close dozens of channels&#xA;&gt;&gt;&gt; at the same time, a UTXO pool management strategy might be to fan-out the&#xA;&gt;&gt;&gt; first spends UTXOs in N fan-out outputs ready to feed the remaining&#xA;&gt;&gt;&gt; in-flight channels.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; &gt; 1. The rule around unconfirmed inputs was&#xA;&gt;&gt;&gt; &gt; originally &#34;A package may include new unconfirmed inputs, but the&#xA;&gt;&gt;&gt; &gt; ancestor feerate of the child must be at least as high as the ancestor&#xA;&gt;&gt;&gt; &gt; feerates of every transaction being replaced.&#34;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Note, I think we would like this new RBF rule to also apply to single&#xA;&gt;&gt;&gt; transaction package, e.g second-stage HTLC transactions, where a&#xA;&gt;&gt;&gt; counterparty pins a HTLC-preimage by abusing rule 3. In that case, the&#xA;&gt;&gt;&gt; honest LN node should be able to broadcast a &#34;at least as high ancestor&#xA;&gt;&gt;&gt; feerate&#34; HTLC-timeout transaction. With `option_anchor_outputs&#34; there is no&#xA;&gt;&gt;&gt; unconfirmed ancestor to replace, as the commitment transaction, whatever&#xA;&gt;&gt;&gt; the party it is originating from, should already be confirmed.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; &gt; &#34;Is this a privacy issue, i.e. doesn&#39;t it allow fingerprinting LN&#xA;&gt;&gt;&gt; transactions based on nVersion?&#34;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; As of today, I think yes you can already fingerprint LN transactions on&#xA;&gt;&gt;&gt; the  spec-defined amount value of the anchor outputs, 330 sats. There is&#xA;&gt;&gt;&gt; always one of them on post-anchor commitment transactions. And sadly I&#xA;&gt;&gt;&gt; would say we&#39;ll always have tricky fingerprints leaking from unilateral LN&#xA;&gt;&gt;&gt; closures such as HTLC/PTLC timelocks...&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; &gt; &#34;Can a V2 transaction replace a V3 transaction and vice versa?&#34;&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; IIUC, a V3 package could replace a V2 package, with the benefit of the&#xA;&gt;&gt;&gt; new package RBF rules applied. I think this would be a significant&#xA;&gt;&gt;&gt; advantage for LN, as for the current ~85k of opened channels, the old V2&#xA;&gt;&gt;&gt; states shouldn&#39;t be pinning vectors. Currently, commitment transactions&#xA;&gt;&gt;&gt; signal replaceability.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Le ven. 23 sept. 2022 à 11:26, Gloria Zhao via bitcoin-dev &lt;&#xA;&gt;&gt;&gt; bitcoin-dev at lists.linuxfoundation.org&gt; a écrit :&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; Hi everyone,&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; I&#39;m writing to propose a very simple set of mempool/transaction relay&#xA;&gt;&gt;&gt;&gt; policies intended to aid L2/contract protocols. I realized that&#xA;&gt;&gt;&gt;&gt; the previously proposed Package Mempool Accept package RBF [1]&#xA;&gt;&gt;&gt;&gt; had a few remaining problems after digging into the RBF logic more [2].&#xA;&gt;&gt;&gt;&gt; This additional set of policies solves them without requiring a huge&#xA;&gt;&gt;&gt;&gt; RBF overhaul.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; I&#39;ve written an implementation (and docs) for Bitcoin Core:&#xA;&gt;&gt;&gt;&gt; https://github.com/bitcoin/bitcoin/pull/25038&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; (You may notice that this proposal incorporates feedback on the PR -&#xA;&gt;&gt;&gt;&gt; thanks Suhas Daftuar, Gregory Sanders, Bastien Teinturier, Anthony Towns,&#xA;&gt;&gt;&gt;&gt; and others.)&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; If you are interested in using package RBF/relay to bump presigned&#xA;&gt;&gt;&gt;&gt; transactions, I think you may be interested in reviewing this proposal.&#xA;&gt;&gt;&gt;&gt; This should solve Rule 3 pinning and perhaps allow us&#xA;&gt;&gt;&gt;&gt; to get rid of CPFP carve-out (yay!). I&#39;m keen to hear if people find&#xA;&gt;&gt;&gt;&gt; the 1-anchor-output, 1000vB child limit too restrictive. Also, if you&#xA;&gt;&gt;&gt;&gt; find a&#xA;&gt;&gt;&gt;&gt; pinning attack or something that makes it unusable for you, I would&#xA;&gt;&gt;&gt;&gt; really really like to know.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; Note that transactions with nVersion=3 (&#34;V3 transactions&#34;) are&#xA;&gt;&gt;&gt;&gt; currently non-standard in Bitcoin Core. That means **anything that was&#xA;&gt;&gt;&gt;&gt; standard before this policy change would still be standard&#xA;&gt;&gt;&gt;&gt; afterwards.** If you don&#39;t want your transactions to be subject to&#xA;&gt;&gt;&gt;&gt; these rules, just continue whatever you&#39;re doing and don&#39;t use&#xA;&gt;&gt;&gt;&gt; nVersion=3. AFAICT this shouldn&#39;t break anything, but let me know if&#xA;&gt;&gt;&gt;&gt; this would be disruptive for you?&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; **New Policies:**&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; This includes:&#xA;&gt;&gt;&gt;&gt; - a set of additional policy rules applying to V3 transactions&#xA;&gt;&gt;&gt;&gt; - modifications to package RBF rules&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; **V3 transactions:**&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; Existing standardness rules apply to V3 (e.g. min/max tx weight,&#xA;&gt;&gt;&gt;&gt; standard output types, cleanstack, etc.). The following additional&#xA;&gt;&gt;&gt;&gt; rules apply to V3:&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; 1. A V3 transaction can be replaced, even if it does not signal BIP125&#xA;&gt;&gt;&gt;&gt;    replaceability. (It must also meet the other RBF rules around fees,&#xA;&gt;&gt;&gt;&gt; etc. for replacement to happen).&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; 2. Any descendant of an unconfirmed V3 transaction must also be V3.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; *Rationale*: Combined with Rule 1, this gives us the property of&#xA;&gt;&gt;&gt;&gt; &#34;inherited&#34; replaceability signaling when descendants of unconfirmed&#xA;&gt;&gt;&gt;&gt; transactions are created. Additionally, checking whether a transaction&#xA;&gt;&gt;&gt;&gt; signals replaceability this way does not require mempool traversal,&#xA;&gt;&gt;&gt;&gt; and does not change based on what transactions are mined. It also&#xA;&gt;&gt;&gt;&gt; makes subsequent rules about descendant limits much easier to check.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; *Note*: The descendant of a *confirmed* V3 transaction does not need to&#xA;&gt;&gt;&gt;&gt; be V3.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; 3. An unconfirmed V3 transaction cannot have more than 1 descendant.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; *Rationale*: (Upper bound) the larger the descendant limit, the more&#xA;&gt;&gt;&gt;&gt; transactions may need to be replaced. This is a problematic pinning&#xA;&gt;&gt;&gt;&gt; attack, i.e., a malicious counterparty prevents the transaction from&#xA;&gt;&gt;&gt;&gt; being replaced by adding many descendant transactions that aren&#39;t&#xA;&gt;&gt;&gt;&gt; fee-bumping.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; (Lower bound) at least 1 descendant is required to allow CPFP of the&#xA;&gt;&gt;&gt;&gt; presigned transaction. The contract protocol can create presigned&#xA;&gt;&gt;&gt;&gt; transactions paying 0 fees and 1 output for attaching a CPFP at&#xA;&gt;&gt;&gt;&gt; broadcast time (&#34;anchor output&#34;). Without package RBF, multiple anchor&#xA;&gt;&gt;&gt;&gt; outputs would be required to allow each counterparty to fee-bump any&#xA;&gt;&gt;&gt;&gt; presigned transaction. With package RBF, since the presigned&#xA;&gt;&gt;&gt;&gt; transactions can replace each other, 1 anchor output is sufficient.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; 4. A V3 transaction that has an unconfirmed V3 ancestor cannot be&#xA;&gt;&gt;&gt;&gt;    larger than 1000 virtual bytes.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; *Rationale*: (Upper bound) the larger the descendant size limit, the&#xA;&gt;&gt;&gt;&gt; more vbytes may need to be replaced. With default limits, if the child&#xA;&gt;&gt;&gt;&gt; is e.g. 100,000vB, that might be an additional 100,000sats (at&#xA;&gt;&gt;&gt;&gt; 1sat/vbyte) or more, depending on the feerate.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; (Lower bound) the smaller this limit, the fewer UTXOs a child may use&#xA;&gt;&gt;&gt;&gt; to fund this fee-bump. For example, only allowing the V3 child to have&#xA;&gt;&gt;&gt;&gt; 2 inputs would require L2 protocols to manage a wallet with high-value&#xA;&gt;&gt;&gt;&gt; UTXOs and make batched fee-bumping impossible. However, as the&#xA;&gt;&gt;&gt;&gt; fee-bumping child only needs to fund fees (as opposed to payments),&#xA;&gt;&gt;&gt;&gt; just a few UTXOs should suffice.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; With a limit of 1000 virtual bytes, depending on the output types, the&#xA;&gt;&gt;&gt;&gt; child can have 6-15 UTXOs, which should be enough to fund a fee-bump&#xA;&gt;&gt;&gt;&gt; without requiring a carefully-managed UTXO pool. With 1000 virtual&#xA;&gt;&gt;&gt;&gt; bytes as the descendant limit, the cost to replace a V3 transaction&#xA;&gt;&gt;&gt;&gt; has much lower variance.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; *Rationale*: This makes the rule very easily &#34;tacked on&#34; to existing&#xA;&gt;&gt;&gt;&gt; logic for policy and wallets. A transaction may be up to 100KvB on its&#xA;&gt;&gt;&gt;&gt; own (`MAX_STANDARD_TX_WEIGHT`) and 101KvB with descendants&#xA;&gt;&gt;&gt;&gt; (`DEFAULT_DESCENDANT_SIZE_LIMIT_KVB`). If an existing V3 transaction&#xA;&gt;&gt;&gt;&gt; in the mempool is 100KvB, its descendant can only be 1000vB, even if&#xA;&gt;&gt;&gt;&gt; the policy is 10KvB.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; **Package RBF modifications:**&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; 1. The rule around unconfirmed inputs was&#xA;&gt;&gt;&gt;&gt; originally &#34;A package may include new unconfirmed inputs, but the&#xA;&gt;&gt;&gt;&gt; ancestor feerate of the child must be at least as high as the ancestor&#xA;&gt;&gt;&gt;&gt; feerates of every transaction being replaced.&#34;&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; The package may still include new unconfirmed inputs. However,&#xA;&gt;&gt;&gt;&gt; the new rule is modified to be &#34;The minimum between package feerate&#xA;&gt;&gt;&gt;&gt; and ancestor feerate of the child is not lower than the individual&#xA;&gt;&gt;&gt;&gt; feerates of all directly conflicting transactions and the ancestor&#xA;&gt;&gt;&gt;&gt; feerates of all original transactions.&#34;&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; *Rationale*: We are attempting to ensure that the replacement&#xA;&gt;&gt;&gt;&gt; transactions are not less incentive-compatible to mine. However, a&#xA;&gt;&gt;&gt;&gt; package/transaction&#39;s ancestor feerate is not perfectly representative&#xA;&gt;&gt;&gt;&gt; of its incentive compatibility; it may overestimate (some subset of&#xA;&gt;&gt;&gt;&gt; the ancestors could be included by itself if it has other high-feerate&#xA;&gt;&gt;&gt;&gt; descendants or are themselves higher feerate than this&#xA;&gt;&gt;&gt;&gt; package/transaction). Instead, we use the minimum between the package&#xA;&gt;&gt;&gt;&gt; feerate and ancestor feerate of the child as a more conservative value&#xA;&gt;&gt;&gt;&gt; than what was proposed originally.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; 2. A new rule is added, requiring that all package transactions with&#xA;&gt;&gt;&gt;&gt; mempool conflicts to be V3. This also means the &#34;sponsoring&#34;&#xA;&gt;&gt;&gt;&gt; child transaction must be V3.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; *Note*: Combined with the V3 rules, this means the package must be&#xA;&gt;&gt;&gt;&gt; a child-with-parents package. Since package validation is only&#xA;&gt;&gt;&gt;&gt; attempted if the transactions do not pay sufficient fees to be&#xA;&gt;&gt;&gt;&gt; accepted on their own, this effectively means that only V3&#xA;&gt;&gt;&gt;&gt; transactions can pay to replace their ancestors&#39; conflicts, and only&#xA;&gt;&gt;&gt;&gt; V3 transactions&#39; replacements may be paid for by a descendant.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; *Rationale*: The fee-related rules are economically rational for&#xA;&gt;&gt;&gt;&gt; ancestor packages, but not necessarily other types of packages.&#xA;&gt;&gt;&gt;&gt; A child-with-parents package is a type of ancestor package. It&#xA;&gt;&gt;&gt;&gt; may be fine to allow any ancestor package, but it&#39;s more difficult&#xA;&gt;&gt;&gt;&gt; to account for all of the possibilities. For example, it gets much&#xA;&gt;&gt;&gt;&gt; harder to see that we&#39;re applying the descendant limits correctly if&#xA;&gt;&gt;&gt;&gt; the package has a gnarly, many-generation, non-tree shape. I&#39;m also&#xA;&gt;&gt;&gt;&gt; not sure if this policy is 100% incentive-compatible if the sponsor&#xA;&gt;&gt;&gt;&gt; is not a direct descendant of the sponsee.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; Please see doc/policy/version3_transactions.md and&#xA;&gt;&gt;&gt;&gt; doc/policy/packages.md in the PR for the full set of rules.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; **Intended usage for LN:**&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; Commitment transactions should be V3 and have 1 anchor output. They&#xA;&gt;&gt;&gt;&gt; can be signed with 0 fees (or 1sat/vbyte) once package relay is deployed&#xA;&gt;&gt;&gt;&gt; on a significant portion of the network. If the commitment tx must&#xA;&gt;&gt;&gt;&gt; be broadcast, determine the desired feerate at broadcast time and&#xA;&gt;&gt;&gt;&gt; spend the anchor output in a high feerate transaction. I&#39;m going to&#xA;&gt;&gt;&gt;&gt; call the broadcasted commitment tx &#34;the parent&#34; and the attached&#xA;&gt;&gt;&gt;&gt; fee-bumping tx &#34;the child.&#34;&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; - This child must be V3.&#xA;&gt;&gt;&gt;&gt; - This child must be at most 1000vB. Note this restricts the&#xA;&gt;&gt;&gt;&gt;   number of inputs you can use to fund the fee bump. Depending&#xA;&gt;&gt;&gt;&gt; on the output types, this is around 6-15.&#xA;&gt;&gt;&gt;&gt; - One child may fund fees for multiple commitment tx (&#34;batched&#xA;&gt;&gt;&gt;&gt;   fee-bumping&#34;).&#xA;&gt;&gt;&gt;&gt; - To do a second fee-bump to add more fees, replace the&#xA;&gt;&gt;&gt;&gt;   *child* with a higher-feerate tx. Do not try to attach a grandchild.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; Otherwise, never try to spend from an unconfirmed V3 transaction. The&#xA;&gt;&gt;&gt;&gt; descendant limits for V3 transactions are very restrictive.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; **Expected Questions:**&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; &#34;Does this fix Rule 3 Pinning?&#34;&#xA;&gt;&gt;&gt;&gt; Yes. The V3 descendant limit restricts both you and your counterparty.&#xA;&gt;&gt;&gt;&gt; Assuming nodes adopted this policy, you may reasonably assume that you&#xA;&gt;&gt;&gt;&gt; only need to replace the commitment transaction + up to 1000vB.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; &#34;Only 1 anchor output? What if I need to bump counterparty&#39;s commitment&#xA;&gt;&gt;&gt;&gt; tx in mempool?&#34;&#xA;&gt;&gt;&gt;&gt; You won&#39;t need to fee-bump a counterparty&#39;s commitment tx using CPFP.&#xA;&gt;&gt;&gt;&gt; You would just package RBF it by attaching a high-feerate child to&#xA;&gt;&gt;&gt;&gt; your commitment tx.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; &#34;Is this a privacy issue, i.e. doesn&#39;t it allow fingerprinting LN&#xA;&gt;&gt;&gt;&gt; transactions based on nVersion?&#34;&#xA;&gt;&gt;&gt;&gt; Indeed it may be unrealistic to assume V3 transactions will be in&#xA;&gt;&gt;&gt;&gt; widespread use outside of L2. IIUC, unilateral closes are already&#xA;&gt;&gt;&gt;&gt; obvious LN transactions because of the HTLC inputs. For e.g.&#xA;&gt;&gt;&gt;&gt; cooperative closes and opens, I think it makes sense to continue using&#xA;&gt;&gt;&gt;&gt; V2. So, unless I&#39;m missing something, this shouldn&#39;t make it worse.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; &#34;So a V3 transaction that doesn&#39;t signal BIP125 replaceability is&#xA;&gt;&gt;&gt;&gt; replaceable? Is that a backward compatibility issue?&#34;&#xA;&gt;&gt;&gt;&gt; Yes it&#39;s replaceable. It&#39;s not an issue AFAICT because,&#xA;&gt;&gt;&gt;&gt; under previous policy, the V3 transaction wouldn&#39;t have been&#xA;&gt;&gt;&gt;&gt; in the mempool in the first place.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; &#34;Can a V2 transaction replace a V3 transaction and vice versa?&#34;&#xA;&gt;&gt;&gt;&gt; Yes, otherwise someone can use V3 transactions to censor V2&#xA;&gt;&gt;&gt;&gt; transactions spending shared inputs. Note if the&#xA;&gt;&gt;&gt;&gt; original V3 transaction has an unconfirmed V3 parent, this would&#xA;&gt;&gt;&gt;&gt; violate the &#34;inherited V3&#34; rule and would be rejected.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; Thanks for reading! Feedback and review would be much appreciated.&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; [1]:&#xA;&gt;&gt;&gt;&gt; https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019464.html&#xA;&gt;&gt;&gt;&gt; [2]:&#xA;&gt;&gt;&gt;&gt; https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-January/019817.html&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt;&gt; Best,&#xA;&gt;&gt;&gt;&gt; Gloria&#xA;&gt;&gt;&gt;&gt; _______________________________________________&#xA;&gt;&gt;&gt;&gt; bitcoin-dev mailing list&#xA;&gt;&gt;&gt;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt;&gt;&gt;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; _______________________________________________&#xA;&gt;&gt;&gt; bitcoin-dev mailing list&#xA;&gt;&gt;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt;&gt;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&gt;&gt;&#xA;&gt;&gt; _______________________________________________&#xA;&gt;&gt; bitcoin-dev mailing list&#xA;&gt;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&gt;&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220926/f053868f/attachment-0001.html&gt;</html></oembed>