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