{"type":"rich","version":"1.0","author_name":"npub1jdl3plz00rvxwc6g2ckemzrgg0amx5wen4kfvs3laxtssxvk9cvsf3gh0m","author_url":"https://nostr.ae/npub1jdl3plz00rvxwc6g2ckemzrgg0amx5wen4kfvs3laxtssxvk9cvsf3gh0m","provider_name":"njump","provider_url":"https://nostr.ae","html":"📅 Original date posted:2022-09-23\n📝 Original message:Hello Gloria,\n\nGreat work on synthesizing so much feedback into a proposal like this!\n\nDeath to carve-out rule.\n\nI'd like to elaborate on some caveats and give a few incomplete thoughts.\n\nThere are basically two types of pinning in my estimation today:\n\n1) rule#3 pinning: Make it uneconomical to replace whatever is in mempool\nvia large in size but low feerate junk that won't get mined anytime soon.\nReplacing this with feerate-based policy seems apt, but fraught with DoS\nrisks.\n\n2) package limit pinning: disallowing transaction propagation by package\nlimits being hit: size, ancestor count, descendant count. Today it is\nmitigated by having all outputs be 1 csv timelocked, and having up to 2\nanchor outputs(1 without carve-out rule).\n\nWould kind of be nice if package RBF would detect a \"sibling output spend\"\nconflict, and knock it out of the mempool via the other replacement rules?\nGetting rid of the requirement to 1 block csv lock every output would be\nquite nice from a smart contracting composability point of view.\n\n\u003e \"Does this fix Rule 3 Pinning?\"\n\nAs you likely know from previous discussions the biggest scenario this does\nnot fix in my estimation is ANYONECANPAY situations. If the parent\ntransaction can be \"inflated\" by tacking on additional inputs, this means\nthe total weight of the parent tx lowers the effective feerate of the\npackage. Due to this pinning attack there aren't many(?) deployed schemes\nthat use the signature type.\n\nTo mitigate this we would likely have to opt into a more complex policy\nscheme, committing in the annex to \"total mempool package weight\", which\nwould allow mempool package limits to be picked at signing time.\n\nMaybe ANYONECANPAY isn't a very useful paradigm in general, I cannot speak\nto that, but it came up in eltoo-related designs using BIP118, which adopts\nACP-like signing behavior. This can be mitigated via straight forward\npolicy updates as well for BIP118 deployment, but off topic so will leave\nit there.\n\nThe other scenario it doesn't really fix is where HTLC/commitment-like\ntransactions are being resolved in a batch, but due to relative time\nconstraints, you may want to accelerate some and not others. Now you must\npay higher rates to replace all of the transaction bumps. This is a\n\"self-pin\" and \"get good at utxos noob\" type problem, but it's something\nthat axing rule#3 in favor of a Replace-by-ancestor-feerate system would\nget us.\n\n\u003e \"Can a V2 transaction replace a V3 transaction and vice versa?\"\n\nCircling back to my ACP point, this regime still allows pinning anytime you\nare sharing a transaction with someone else where you don't have control\nover *all* the inputs. So anytime you are doing a coinjoin-like\ntransaction, someone else's inputs can be self-double-spent, requiring you\nto satisfy rule#3 when replacing theirs, if they're bip125-signaling. If\nthey're not bip125 signaling, you'll have to somehow detect this and/or\ndouble-spend your input back to yourself.\n\n\nFinally, a couple suggestions I've already made elsewhere:\n\n1) I do think that we should seriously consider allowing OP_TRUE to become\na standard script type as part of this policy update. If pinning is solved,\nthen there's no reason to require all those extra bytes for \"binding\" an\nanchor to a specific wallet/user. We can save quite a few bytes by having\nthe input be empty of witness data.\n\n2) If we allow for a single dust-value(0 on up) output which is immediately\nspent by the package, anchors become even easier to to design. No value has\nto be \"sapped\" from contract participants to make an anchor output. There's\nmore complications for this, such as making sure the parent transaction is\ndropped if the child spend is dropped, but maybe it's worth the squeeze. I\ndo think that any L2 uptake of these new rules will take significant\ntime... maybe we should be a bit more ambitious?\n\nCheers,\nGreg\n\nOn Fri, Sep 23, 2022 at 11:27 AM Gloria Zhao via bitcoin-dev \u003c\nbitcoin-dev at lists.linuxfoundation.org\u003e wrote:\n\n\u003e Hi everyone,\n\u003e\n\u003e I'm writing to propose a very simple set of mempool/transaction relay\n\u003e policies intended to aid L2/contract protocols. I realized that\n\u003e the previously proposed Package Mempool Accept package RBF [1]\n\u003e had a few remaining problems after digging into the RBF logic more [2].\n\u003e This additional set of policies solves them without requiring a huge RBF\n\u003e overhaul.\n\u003e\n\u003e I've written an implementation (and docs) for Bitcoin Core:\n\u003e https://github.com/bitcoin/bitcoin/pull/25038\n\u003e\n\u003e (You may notice that this proposal incorporates feedback on the PR -\n\u003e thanks Suhas Daftuar, Gregory Sanders, Bastien Teinturier, Anthony Towns,\n\u003e and others.)\n\u003e\n\u003e If you are interested in using package RBF/relay to bump presigned\n\u003e transactions, I think you may be interested in reviewing this proposal.\n\u003e This should solve Rule 3 pinning and perhaps allow us\n\u003e to get rid of CPFP carve-out (yay!). I'm keen to hear if people find\n\u003e the 1-anchor-output, 1000vB child limit too restrictive. Also, if you find\n\u003e a\n\u003e pinning attack or something that makes it unusable for you, I would\n\u003e really really like to know.\n\u003e\n\u003e Note that transactions with nVersion=3 (\"V3 transactions\") are\n\u003e currently non-standard in Bitcoin Core. That means **anything that was\n\u003e standard before this policy change would still be standard\n\u003e afterwards.** If you don't want your transactions to be subject to\n\u003e these rules, just continue whatever you're doing and don't use\n\u003e nVersion=3. AFAICT this shouldn't break anything, but let me know if\n\u003e this would be disruptive for you?\n\u003e\n\u003e **New Policies:**\n\u003e\n\u003e This includes:\n\u003e - a set of additional policy rules applying to V3 transactions\n\u003e - modifications to package RBF rules\n\u003e\n\u003e **V3 transactions:**\n\u003e\n\u003e Existing standardness rules apply to V3 (e.g. min/max tx weight,\n\u003e standard output types, cleanstack, etc.). The following additional\n\u003e rules apply to V3:\n\u003e\n\u003e 1. A V3 transaction can be replaced, even if it does not signal BIP125\n\u003e    replaceability. (It must also meet the other RBF rules around fees,\n\u003e etc. for replacement to happen).\n\u003e\n\u003e 2. Any descendant of an unconfirmed V3 transaction must also be V3.\n\u003e\n\u003e *Rationale*: Combined with Rule 1, this gives us the property of\n\u003e \"inherited\" replaceability signaling when descendants of unconfirmed\n\u003e transactions are created. Additionally, checking whether a transaction\n\u003e signals replaceability this way does not require mempool traversal,\n\u003e and does not change based on what transactions are mined. It also\n\u003e makes subsequent rules about descendant limits much easier to check.\n\u003e\n\u003e *Note*: The descendant of a *confirmed* V3 transaction does not need to be\n\u003e V3.\n\u003e\n\u003e 3. An unconfirmed V3 transaction cannot have more than 1 descendant.\n\u003e\n\u003e *Rationale*: (Upper bound) the larger the descendant limit, the more\n\u003e transactions may need to be replaced. This is a problematic pinning\n\u003e attack, i.e., a malicious counterparty prevents the transaction from\n\u003e being replaced by adding many descendant transactions that aren't\n\u003e fee-bumping.\n\u003e\n\u003e (Lower bound) at least 1 descendant is required to allow CPFP of the\n\u003e presigned transaction. The contract protocol can create presigned\n\u003e transactions paying 0 fees and 1 output for attaching a CPFP at\n\u003e broadcast time (\"anchor output\"). Without package RBF, multiple anchor\n\u003e outputs would be required to allow each counterparty to fee-bump any\n\u003e presigned transaction. With package RBF, since the presigned\n\u003e transactions can replace each other, 1 anchor output is sufficient.\n\u003e\n\u003e 4. A V3 transaction that has an unconfirmed V3 ancestor cannot be\n\u003e    larger than 1000 virtual bytes.\n\u003e\n\u003e *Rationale*: (Upper bound) the larger the descendant size limit, the\n\u003e more vbytes may need to be replaced. With default limits, if the child\n\u003e is e.g. 100,000vB, that might be an additional 100,000sats (at\n\u003e 1sat/vbyte) or more, depending on the feerate.\n\u003e\n\u003e (Lower bound) the smaller this limit, the fewer UTXOs a child may use\n\u003e to fund this fee-bump. For example, only allowing the V3 child to have\n\u003e 2 inputs would require L2 protocols to manage a wallet with high-value\n\u003e UTXOs and make batched fee-bumping impossible. However, as the\n\u003e fee-bumping child only needs to fund fees (as opposed to payments),\n\u003e just a few UTXOs should suffice.\n\u003e\n\u003e With a limit of 1000 virtual bytes, depending on the output types, the\n\u003e child can have 6-15 UTXOs, which should be enough to fund a fee-bump\n\u003e without requiring a carefully-managed UTXO pool. With 1000 virtual\n\u003e bytes as the descendant limit, the cost to replace a V3 transaction\n\u003e has much lower variance.\n\u003e\n\u003e *Rationale*: This makes the rule very easily \"tacked on\" to existing\n\u003e logic for policy and wallets. A transaction may be up to 100KvB on its\n\u003e own (`MAX_STANDARD_TX_WEIGHT`) and 101KvB with descendants\n\u003e (`DEFAULT_DESCENDANT_SIZE_LIMIT_KVB`). If an existing V3 transaction\n\u003e in the mempool is 100KvB, its descendant can only be 1000vB, even if\n\u003e the policy is 10KvB.\n\u003e\n\u003e **Package RBF modifications:**\n\u003e\n\u003e 1. The rule around unconfirmed inputs was\n\u003e originally \"A package may include new unconfirmed inputs, but the\n\u003e ancestor feerate of the child must be at least as high as the ancestor\n\u003e feerates of every transaction being replaced.\"\n\u003e\n\u003e The package may still include new unconfirmed inputs. However,\n\u003e the new rule is modified to be \"The minimum between package feerate\n\u003e and ancestor feerate of the child is not lower than the individual\n\u003e feerates of all directly conflicting transactions and the ancestor\n\u003e feerates of all original transactions.\"\n\u003e\n\u003e *Rationale*: We are attempting to ensure that the replacement\n\u003e transactions are not less incentive-compatible to mine. However, a\n\u003e package/transaction's ancestor feerate is not perfectly representative\n\u003e of its incentive compatibility; it may overestimate (some subset of\n\u003e the ancestors could be included by itself if it has other high-feerate\n\u003e descendants or are themselves higher feerate than this\n\u003e package/transaction). Instead, we use the minimum between the package\n\u003e feerate and ancestor feerate of the child as a more conservative value\n\u003e than what was proposed originally.\n\u003e\n\u003e 2. A new rule is added, requiring that all package transactions with\n\u003e mempool conflicts to be V3. This also means the \"sponsoring\"\n\u003e child transaction must be V3.\n\u003e\n\u003e *Note*: Combined with the V3 rules, this means the package must be\n\u003e a child-with-parents package. Since package validation is only\n\u003e attempted if the transactions do not pay sufficient fees to be\n\u003e accepted on their own, this effectively means that only V3\n\u003e transactions can pay to replace their ancestors' conflicts, and only\n\u003e V3 transactions' replacements may be paid for by a descendant.\n\u003e\n\u003e *Rationale*: The fee-related rules are economically rational for\n\u003e ancestor packages, but not necessarily other types of packages.\n\u003e A child-with-parents package is a type of ancestor package. It\n\u003e may be fine to allow any ancestor package, but it's more difficult\n\u003e to account for all of the possibilities. For example, it gets much\n\u003e harder to see that we're applying the descendant limits correctly if\n\u003e the package has a gnarly, many-generation, non-tree shape. I'm also\n\u003e not sure if this policy is 100% incentive-compatible if the sponsor\n\u003e is not a direct descendant of the sponsee.\n\u003e\n\u003e Please see doc/policy/version3_transactions.md and\n\u003e doc/policy/packages.md in the PR for the full set of rules.\n\u003e\n\u003e **Intended usage for LN:**\n\u003e\n\u003e Commitment transactions should be V3 and have 1 anchor output. They\n\u003e can be signed with 0 fees (or 1sat/vbyte) once package relay is deployed\n\u003e on a significant portion of the network. If the commitment tx must\n\u003e be broadcast, determine the desired feerate at broadcast time and\n\u003e spend the anchor output in a high feerate transaction. I'm going to\n\u003e call the broadcasted commitment tx \"the parent\" and the attached\n\u003e fee-bumping tx \"the child.\"\n\u003e\n\u003e - This child must be V3.\n\u003e - This child must be at most 1000vB. Note this restricts the\n\u003e   number of inputs you can use to fund the fee bump. Depending\n\u003e on the output types, this is around 6-15.\n\u003e - One child may fund fees for multiple commitment tx (\"batched\n\u003e   fee-bumping\").\n\u003e - To do a second fee-bump to add more fees, replace the\n\u003e   *child* with a higher-feerate tx. Do not try to attach a grandchild.\n\u003e\n\u003e Otherwise, never try to spend from an unconfirmed V3 transaction. The\n\u003e descendant limits for V3 transactions are very restrictive.\n\u003e\n\u003e **Expected Questions:**\n\u003e\n\u003e \"Does this fix Rule 3 Pinning?\"\n\u003e Yes. The V3 descendant limit restricts both you and your counterparty.\n\u003e Assuming nodes adopted this policy, you may reasonably assume that you\n\u003e only need to replace the commitment transaction + up to 1000vB.\n\u003e\n\u003e \"Only 1 anchor output? What if I need to bump counterparty's commitment tx\n\u003e 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\u003e\n\u003e \"Is this a privacy issue, i.e. doesn't it allow fingerprinting LN\n\u003e transactions based on nVersion?\"\n\u003e Indeed it may be unrealistic to assume V3 transactions will be in\n\u003e widespread use outside of L2. IIUC, unilateral closes are already\n\u003e obvious LN transactions because of the HTLC inputs. For e.g.\n\u003e cooperative closes and opens, I think it makes sense to continue using\n\u003e V2. So, unless I'm missing something, this shouldn't make it worse.\n\u003e\n\u003e \"So a V3 transaction that doesn't signal BIP125 replaceability is\n\u003e replaceable? Is that a backward compatibility issue?\"\n\u003e Yes it's replaceable. It's not an issue AFAICT because,\n\u003e under previous policy, the V3 transaction wouldn't have been\n\u003e in the mempool in the first place.\n\u003e\n\u003e \"Can a V2 transaction replace a V3 transaction and vice versa?\"\n\u003e Yes, otherwise someone can use V3 transactions to censor V2\n\u003e transactions spending shared inputs. Note if the\n\u003e original V3 transaction has an unconfirmed V3 parent, this would\n\u003e violate the \"inherited V3\" rule and would be rejected.\n\u003e\n\u003e Thanks for reading! Feedback and review would be much appreciated.\n\u003e\n\u003e [1]:\n\u003e https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019464.html\n\u003e [2]:\n\u003e https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-January/019817.html\n\u003e\n\u003e Best,\n\u003e Gloria\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/20220923/43403b3a/attachment-0001.html\u003e"}
