{"type":"rich","version":"1.0","author_name":"npub14ca6vjq25eaema6zxke2g8hjc6ztkf5ej698f5fhyg98zqq85zsqu0m739","author_url":"https://nostr.ae/npub14ca6vjq25eaema6zxke2g8hjc6ztkf5ej698f5fhyg98zqq85zsqu0m739","provider_name":"njump","provider_url":"https://nostr.ae","html":"📅 Original date posted:2022-09-23\n📝 Original message:Hi everyone,\n\nI'm writing to propose a very simple set of mempool/transaction relay\npolicies intended to aid L2/contract protocols. I realized that\nthe previously proposed Package Mempool Accept package RBF [1]\nhad a few remaining problems after digging into the RBF logic more [2].\nThis additional set of policies solves them without requiring a huge RBF\noverhaul.\n\nI've written an implementation (and docs) for Bitcoin Core:\nhttps://github.com/bitcoin/bitcoin/pull/25038\n\n(You may notice that this proposal incorporates feedback on the PR - thanks\nSuhas Daftuar, Gregory Sanders, Bastien Teinturier, Anthony Towns, and\nothers.)\n\nIf you are interested in using package RBF/relay to bump presigned\ntransactions, I think you may be interested in reviewing this proposal.\nThis should solve Rule 3 pinning and perhaps allow us\nto get rid of CPFP carve-out (yay!). I'm keen to hear if people find\nthe 1-anchor-output, 1000vB child limit too restrictive. Also, if you find a\npinning attack or something that makes it unusable for you, I would\nreally really like to know.\n\nNote that transactions with nVersion=3 (\"V3 transactions\") are\ncurrently non-standard in Bitcoin Core. That means **anything that was\nstandard before this policy change would still be standard\nafterwards.** If you don't want your transactions to be subject to\nthese rules, just continue whatever you're doing and don't use\nnVersion=3. AFAICT this shouldn't break anything, but let me know if\nthis would be disruptive for you?\n\n**New Policies:**\n\nThis includes:\n- a set of additional policy rules applying to V3 transactions\n- modifications to package RBF rules\n\n**V3 transactions:**\n\nExisting standardness rules apply to V3 (e.g. min/max tx weight,\nstandard output types, cleanstack, etc.). The following additional\nrules apply to V3:\n\n1. A V3 transaction can be replaced, even if it does not signal BIP125\n   replaceability. (It must also meet the other RBF rules around fees,\netc. for replacement to happen).\n\n2. Any descendant of an unconfirmed V3 transaction must also be V3.\n\n*Rationale*: Combined with Rule 1, this gives us the property of\n\"inherited\" replaceability signaling when descendants of unconfirmed\ntransactions are created. Additionally, checking whether a transaction\nsignals replaceability this way does not require mempool traversal,\nand does not change based on what transactions are mined. It also\nmakes subsequent rules about descendant limits much easier to check.\n\n*Note*: The descendant of a *confirmed* V3 transaction does not need to be\nV3.\n\n3. An unconfirmed V3 transaction cannot have more than 1 descendant.\n\n*Rationale*: (Upper bound) the larger the descendant limit, the more\ntransactions may need to be replaced. This is a problematic pinning\nattack, i.e., a malicious counterparty prevents the transaction from\nbeing replaced by adding many descendant transactions that aren't\nfee-bumping.\n\n(Lower bound) at least 1 descendant is required to allow CPFP of the\npresigned transaction. The contract protocol can create presigned\ntransactions paying 0 fees and 1 output for attaching a CPFP at\nbroadcast time (\"anchor output\"). Without package RBF, multiple anchor\noutputs would be required to allow each counterparty to fee-bump any\npresigned transaction. With package RBF, since the presigned\ntransactions can replace each other, 1 anchor output is sufficient.\n\n4. A V3 transaction that has an unconfirmed V3 ancestor cannot be\n   larger than 1000 virtual bytes.\n\n*Rationale*: (Upper bound) the larger the descendant size limit, the\nmore vbytes may need to be replaced. With default limits, if the child\nis e.g. 100,000vB, that might be an additional 100,000sats (at\n1sat/vbyte) or more, depending on the feerate.\n\n(Lower bound) the smaller this limit, the fewer UTXOs a child may use\nto fund this fee-bump. For example, only allowing the V3 child to have\n2 inputs would require L2 protocols to manage a wallet with high-value\nUTXOs and make batched fee-bumping impossible. However, as the\nfee-bumping child only needs to fund fees (as opposed to payments),\njust a few UTXOs should suffice.\n\nWith a limit of 1000 virtual bytes, depending on the output types, the\nchild can have 6-15 UTXOs, which should be enough to fund a fee-bump\nwithout requiring a carefully-managed UTXO pool. With 1000 virtual\nbytes as the descendant limit, the cost to replace a V3 transaction\nhas much lower variance.\n\n*Rationale*: This makes the rule very easily \"tacked on\" to existing\nlogic for policy and wallets. A transaction may be up to 100KvB on its\nown (`MAX_STANDARD_TX_WEIGHT`) and 101KvB with descendants\n(`DEFAULT_DESCENDANT_SIZE_LIMIT_KVB`). If an existing V3 transaction\nin the mempool is 100KvB, its descendant can only be 1000vB, even if\nthe policy is 10KvB.\n\n**Package RBF modifications:**\n\n1. The rule around unconfirmed inputs was\noriginally \"A package may include new unconfirmed inputs, but the\nancestor feerate of the child must be at least as high as the ancestor\nfeerates of every transaction being replaced.\"\n\nThe package may still include new unconfirmed inputs. However,\nthe new rule is modified to be \"The minimum between package feerate\nand ancestor feerate of the child is not lower than the individual\nfeerates of all directly conflicting transactions and the ancestor\nfeerates of all original transactions.\"\n\n*Rationale*: We are attempting to ensure that the replacement\ntransactions are not less incentive-compatible to mine. However, a\npackage/transaction's ancestor feerate is not perfectly representative\nof its incentive compatibility; it may overestimate (some subset of\nthe ancestors could be included by itself if it has other high-feerate\ndescendants or are themselves higher feerate than this\npackage/transaction). Instead, we use the minimum between the package\nfeerate and ancestor feerate of the child as a more conservative value\nthan what was proposed originally.\n\n2. A new rule is added, requiring that all package transactions with\nmempool conflicts to be V3. This also means the \"sponsoring\"\nchild transaction must be V3.\n\n*Note*: Combined with the V3 rules, this means the package must be\na child-with-parents package. Since package validation is only\nattempted if the transactions do not pay sufficient fees to be\naccepted on their own, this effectively means that only V3\ntransactions can pay to replace their ancestors' conflicts, and only\nV3 transactions' replacements may be paid for by a descendant.\n\n*Rationale*: The fee-related rules are economically rational for\nancestor packages, but not necessarily other types of packages.\nA child-with-parents package is a type of ancestor package. It\nmay be fine to allow any ancestor package, but it's more difficult\nto account for all of the possibilities. For example, it gets much\nharder to see that we're applying the descendant limits correctly if\nthe package has a gnarly, many-generation, non-tree shape. I'm also\nnot sure if this policy is 100% incentive-compatible if the sponsor\nis not a direct descendant of the sponsee.\n\nPlease see doc/policy/version3_transactions.md and\ndoc/policy/packages.md in the PR for the full set of rules.\n\n**Intended usage for LN:**\n\nCommitment transactions should be V3 and have 1 anchor output. They\ncan be signed with 0 fees (or 1sat/vbyte) once package relay is deployed\non a significant portion of the network. If the commitment tx must\nbe broadcast, determine the desired feerate at broadcast time and\nspend the anchor output in a high feerate transaction. I'm going to\ncall the broadcasted commitment tx \"the parent\" and the attached\nfee-bumping tx \"the child.\"\n\n- This child must be V3.\n- This child must be at most 1000vB. Note this restricts the\n  number of inputs you can use to fund the fee bump. Depending\non the output types, this is around 6-15.\n- One child may fund fees for multiple commitment tx (\"batched\n  fee-bumping\").\n- To do a second fee-bump to add more fees, replace the\n  *child* with a higher-feerate tx. Do not try to attach a grandchild.\n\nOtherwise, never try to spend from an unconfirmed V3 transaction. The\ndescendant limits for V3 transactions are very restrictive.\n\n**Expected Questions:**\n\n\"Does this fix Rule 3 Pinning?\"\nYes. The V3 descendant limit restricts both you and your counterparty.\nAssuming nodes adopted this policy, you may reasonably assume that you\nonly need to replace the commitment transaction + up to 1000vB.\n\n\"Only 1 anchor output? What if I need to bump counterparty's commitment tx\nin mempool?\"\nYou won't need to fee-bump a counterparty's commitment tx using CPFP.\nYou would just package RBF it by attaching a high-feerate child to\nyour commitment tx.\n\n\"Is this a privacy issue, i.e. doesn't it allow fingerprinting LN\ntransactions based on nVersion?\"\nIndeed it may be unrealistic to assume V3 transactions will be in\nwidespread use outside of L2. IIUC, unilateral closes are already\nobvious LN transactions because of the HTLC inputs. For e.g.\ncooperative closes and opens, I think it makes sense to continue using\nV2. So, unless I'm missing something, this shouldn't make it worse.\n\n\"So a V3 transaction that doesn't signal BIP125 replaceability is\nreplaceable? Is that a backward compatibility issue?\"\nYes it's replaceable. It's not an issue AFAICT because,\nunder previous policy, the V3 transaction wouldn't have been\nin the mempool in the first place.\n\n\"Can a V2 transaction replace a V3 transaction and vice versa?\"\nYes, otherwise someone can use V3 transactions to censor V2\ntransactions spending shared inputs. Note if the\noriginal V3 transaction has an unconfirmed V3 parent, this would\nviolate the \"inherited V3\" rule and would be rejected.\n\nThanks for reading! Feedback and review would be much appreciated.\n\n[1]:\nhttps://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019464.html\n[2]:\nhttps://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-January/019817.html\n\nBest,\nGloria\n-------------- next part --------------\nAn HTML attachment was scrubbed...\nURL: \u003chttp://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220923/9b52c0c4/attachment.html\u003e"}
