<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <updated></updated>
  <generator>https://nostr.ae</generator>

  <title>Nostr notes by </title>
  <author>
    <name></name>
  </author>
  <link rel="self" type="application/atom+xml" href="https://nostr.ae/npub14ca6vjq25eaema6zxke2g8hjc6ztkf5ej698f5fhyg98zqq85zsqu0m739.rss" />
  <link href="https://nostr.ae/npub14ca6vjq25eaema6zxke2g8hjc6ztkf5ej698f5fhyg98zqq85zsqu0m739" />
  <id>https://nostr.ae/npub14ca6vjq25eaema6zxke2g8hjc6ztkf5ej698f5fhyg98zqq85zsqu0m739</id>
  <icon></icon>
  <logo></logo>




  <entry>
    <id>https://nostr.ae/nevent1qqsf0cng00e3qqnqc6q7yqdzggv5n2zjaykq48u6n46arrc9m5q52aczyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2qvqc8yw</id>
    
      <title type="html">📅 Original date posted:2022-11-01 📝 Original message:Hi ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsf0cng00e3qqnqc6q7yqdzggv5n2zjaykq48u6n46arrc9m5q52aczyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2qvqc8yw" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs9n5uef2wvv58kc7p3xj8p837slp9ydc56ke77szr3s7kdlvkm45g88kazt&#39;&gt;nevent1q…kazt&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-11-01&lt;br/&gt;📝 Original message:Hi everyone,&lt;br/&gt;&lt;br/&gt;I&amp;#39;ve made some significant changes to my package relay proposal based on&lt;br/&gt;observations while implementing, feedback on this thread, and offline&lt;br/&gt;discussions [1].&lt;br/&gt;&lt;br/&gt;The new proposal is called Ancestor Package Relay, BIP331, and PR&amp;#39;d at&lt;br/&gt;&lt;a href=&#34;https://github.com/bitcoin/bips/pull/1382&#34;&gt;https://github.com/bitcoin/bips/pull/1382&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;The major changes to the proposal are:&lt;br/&gt;1. Scope reduction to receiver-initiated only&lt;br/&gt;2. Scope reduction to ancestor packages only&lt;br/&gt;3. Removal of block hash from package information&lt;br/&gt;&lt;br/&gt;1.  Scope reduction to receiver-initiated only&lt;br/&gt;Receiver-intiated package relay enables a node to ask for more information&lt;br/&gt;when they suspect they are missing something (i.e. in this case to resolve&lt;br/&gt;a missing parent tx). Sender-initiated package relay should, theoretically,&lt;br/&gt;save a round trip by notifying the receiver ahead of time that &amp;#34;hey, this&lt;br/&gt;is going to be a package, so make sure you download and submit these&lt;br/&gt;transactions together.&amp;#34; As with any proactive communication, there is a&lt;br/&gt;chance that the node already knows this information, so this network&lt;br/&gt;bandwidth was wasted. The logic used to decide _when_ to announce a package&lt;br/&gt;proactively determines whether it is a net increase or decrease for overall&lt;br/&gt;bandwidth usage. However, it&amp;#39;s difficult to design anything to save&lt;br/&gt;bandwidth without any idea of what its bandwidth usage actually looks like&lt;br/&gt;in practice. We&amp;#39;ll want to design the sender-initiated protocol carefully,&lt;br/&gt;and inform the design decisions using data collected from the mainnet p2p&lt;br/&gt;network. However, there is no historical transaction data to use because&lt;br/&gt;the goal is to enable currently-rejected transactions to propagate. In&lt;br/&gt;order to get this right, I propose we hold off on sender-initiated for now,&lt;br/&gt;deploy receiver-initiated package relay, observe its usage and figure out&lt;br/&gt;where we can save a round trip, and then produce a well-researched&lt;br/&gt;sender-initiated package relay proposal.&lt;br/&gt;&lt;br/&gt;2. Scope reduction to ancestor packages only&lt;br/&gt;The proposal now only includes ancestor packages (previously called&lt;br/&gt;tx-with-unconfirmed-ancestors or &amp;#34;v2&amp;#34; packages). The&lt;br/&gt;child-with-unconfirmed-parents (previously called &amp;#34;v1&amp;#34;) package has been&lt;br/&gt;removed since it is a subset of ancestor packages and sender-initiated&lt;br/&gt;relay has been removed. It may be relevant again in the future with&lt;br/&gt;sender-initiated packages. If you were reviewing the previous proposal,&lt;br/&gt;&amp;#34;pkginfo2&amp;#34; message has been renamed to &amp;#34;ancpkginfo&amp;#34; and &amp;#34;MSG_PKGINFO2&amp;#34; inv&lt;br/&gt;type to &amp;#34;MSG_ANCPKGINFO&amp;#34;.&lt;br/&gt;&lt;br/&gt;3. Removal of block hash from package information&lt;br/&gt;Most of the rationale is already on this thread. The block hash was an&lt;br/&gt;attempt to enforce topology when chainstates differ, but isn&amp;#39;t worth it. It&lt;br/&gt;does not make much sense to drop or delay transaction data requests due to&lt;br/&gt;mismatched chainstates, and the chainstate may change again between package&lt;br/&gt;information and transaction data rounds. Instead, differences in chainstate&lt;br/&gt;should be handled internally at the mempool validation level. The node&lt;br/&gt;should de-duplicate recently-confirmed transactions and make a best effort&lt;br/&gt;to validate the transactions it has already downloaded.&lt;br/&gt;&lt;br/&gt;Thanks,&lt;br/&gt;Gloria&lt;br/&gt;&lt;br/&gt;[1]&lt;br/&gt;&lt;a href=&#34;https://diyhpl.us/wiki/transcripts/bitcoin-core-dev-tech/2022-10-11-package-relay/&#34;&gt;https://diyhpl.us/wiki/transcripts/bitcoin-core-dev-tech/2022-10-11-package-relay/&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;On Fri, Jun 17, 2022 at 9:08 PM Antoine Riard &amp;lt;antoine.riard at gmail.com&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hi Gloria,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thanks for working on that,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; Always overestimating fees may sidestep this issue temporarily (while&lt;br/&gt;&amp;gt; mempool&lt;br/&gt;&amp;gt; &amp;gt; traffic is low and predictable), but this solution is not foolproof&lt;br/&gt;&amp;gt; &amp;gt; and wastes users&amp;#39; money. The feerate market can change due to sudden&lt;br/&gt;&amp;gt; &amp;gt; spikes in traffic (e.g. huge 12sat/vB dump a few days ago [9]) or&lt;br/&gt;&amp;gt; &amp;gt; sustained, high volume of Bitcoin payments (e.g.  April 2021 and&lt;br/&gt;&amp;gt; &amp;gt; December 2017).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Even if the LN implementations started to overestimate fees based on the&lt;br/&gt;&amp;gt; historical worst-case of block inclusion feerates, there is still room for&lt;br/&gt;&amp;gt; exploitation due to bip125 rule#3. Indeed, as long as the adversary is able&lt;br/&gt;&amp;gt; to stick in the mempool a higher fee package while the feerate is not&lt;br/&gt;&amp;gt; compelling enough to get it mined, your &amp;#34;honest&amp;#34; LN package should be&lt;br/&gt;&amp;gt; bounced off.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Considering Core&amp;#39;s `MAX_STANDARD_TX_WEIGHT` of 400000 WU, I think it&amp;#39;s&lt;br/&gt;&amp;gt; practical for an attacker to succeed with this pinning tactic in periods of&lt;br/&gt;&amp;gt; traffic spikes. Of course, LN implementation could overestimate fees with a&lt;br/&gt;&amp;gt; target like `MAX_STANDARD_WEIGHT` * `worst_case_block_inclusion_feerate` to&lt;br/&gt;&amp;gt; mitigate. However, assuming a value of 20sat for the latter, it would&lt;br/&gt;&amp;gt; require from any LN user a minimal channel value of 2000000 satoshis to be&lt;br/&gt;&amp;gt; theoretically secure against this type of pinning.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; So package relay is required to mitigate efficiently and realistically&lt;br/&gt;&amp;gt; against pinning attacks, while conserving the same level of &amp;#34;economic&amp;#34;&lt;br/&gt;&amp;gt; openness for Lightning. Beyond, it should be also noted that package relay&lt;br/&gt;&amp;gt; is only building block of the full set of mitigations, and there should be&lt;br/&gt;&amp;gt; a yet to-find-consensus-as-of-today other policy change such as&lt;br/&gt;&amp;gt; user-elected package limits or replace-by-feerate.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Anyway, I think it would be beneficial to document the design trade-offs&lt;br/&gt;&amp;gt; of pinning mitigations in the `Rationale` subsection, at the attention of&lt;br/&gt;&amp;gt; future L2s devs and users ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; {|&lt;br/&gt;&amp;gt; &amp;gt; |  Field Name  ||  Type  ||  Size  ||  Purpose&lt;br/&gt;&amp;gt; &amp;gt; |-&lt;br/&gt;&amp;gt; &amp;gt; |version || uint32_t || 4 || Denotes a package version supported by the&lt;br/&gt;&amp;gt; &amp;gt; node.&lt;br/&gt;&amp;gt; &amp;gt; |-&lt;br/&gt;&amp;gt; &amp;gt; |max_count || uint32_t || 4 ||Specifies the maximum number of&lt;br/&gt;&amp;gt; transactions&lt;br/&gt;&amp;gt; &amp;gt; per package this node is&lt;br/&gt;&amp;gt; &amp;gt; willing to accept.&lt;br/&gt;&amp;gt; &amp;gt; |-&lt;br/&gt;&amp;gt; &amp;gt; |max_weight || uint32_t || 4 ||Specifies the maximum total weight per&lt;br/&gt;&amp;gt; &amp;gt; package this node is willing&lt;br/&gt;&amp;gt; &amp;gt; to accept.&lt;br/&gt;&amp;gt; &amp;gt; |-&lt;br/&gt;&amp;gt; &amp;gt; |}&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; It&amp;#39;s unclear to me what&amp;#39;s the purpose of `max_count` and `max_weight` in&lt;br/&gt;&amp;gt; the overall package relay flow, if they are intended to be exposed as&lt;br/&gt;&amp;gt; configurable settings to node operators. If those fields are present to&lt;br/&gt;&amp;gt; allow DoS protection increase of low-performance host, I believe it would&lt;br/&gt;&amp;gt; be better to restrain the number of consumed UTXOs or executed sigops per&lt;br/&gt;&amp;gt; package, as DoS vectors are more likely to be CPU-based, rather than&lt;br/&gt;&amp;gt; memory-based as package size already bounded at acceptance by&lt;br/&gt;&amp;gt; `MAX_PACKAGE_COUNT`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thinking more we might introduce a `MAX_SIGOPS_PER_PACKAGR` limit, as&lt;br/&gt;&amp;gt; otherwise if we naively grant one package announcement as equal to one&lt;br/&gt;&amp;gt; transaction announcement in our tx-request logic, we might increase our DoS&lt;br/&gt;&amp;gt; surface, node ressources staying equivalent ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; {|&lt;br/&gt;&amp;gt; &amp;gt; |  Field Name  ||  Type  ||  Size  ||   Purpose&lt;br/&gt;&amp;gt; &amp;gt; |-&lt;br/&gt;&amp;gt; &amp;gt; |txns_length||CompactSize||1 or 3 bytes|| The number of transactions&lt;br/&gt;&amp;gt; &amp;gt; requested.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I&amp;#39;m not sure if we&amp;#39;ll ever allow 3-bytes of package size, that would be&lt;br/&gt;&amp;gt; ~32k of transactions.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; |-&lt;br/&gt;&amp;gt; &amp;gt; |txns||List of wtxids||txns_length * 32|| The wtxids of each transaction&lt;br/&gt;&amp;gt; in&lt;br/&gt;&amp;gt; &amp;gt; the package.&lt;br/&gt;&amp;gt; &amp;gt; |}&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think there is a bandwidth consumption trade-off to be aware of in the&lt;br/&gt;&amp;gt; function of the package-relay usage. Let&amp;#39;s consider a single issuer&lt;br/&gt;&amp;gt; broadcasting the package to spend a shared-utxo, after the first shot the&lt;br/&gt;&amp;gt; parent component should be spread across the network mempools. At each&lt;br/&gt;&amp;gt; fee-bump, only the bumped CPFP will propagate on the network, the parent&lt;br/&gt;&amp;gt; wtxid is reannounced in `pckginfo1` though there is no need to fetch it&lt;br/&gt;&amp;gt; redundantly and waste bandwidth.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; However, I think the bandwidth saving does not hold in case of competing&lt;br/&gt;&amp;gt; transaction issuers to spend a shared-utxo. In that case, the parent might&lt;br/&gt;&amp;gt; differ at each broadcast and the list of wtxid is dissemblable at every&lt;br/&gt;&amp;gt; claim of the shared-utxo. We could save the 32 bytes * number of packages&lt;br/&gt;&amp;gt; elements by announcing a package_id, computed from the list of wtxids.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I don&amp;#39;t know about the occurrence of competing broadcasts among LN&lt;br/&gt;&amp;gt; non-cooperative closes, where bandwidth could be potentially saved. I would&lt;br/&gt;&amp;gt; say it&amp;#39;s likely low because IIRC there is nothing in the LN protocol where&lt;br/&gt;&amp;gt; the counterparties signal to each other they&amp;#39;re going on-chain to introduce&lt;br/&gt;&amp;gt; a competing broadcast synchronizing event. That said, it might increase in&lt;br/&gt;&amp;gt; the future in a post-eltoo, multi-party contracting protocol world.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; So it might be interesting to document this design trade-off, if we seek&lt;br/&gt;&amp;gt; bandwidth optimizations in function of a changing landscape in the type of&lt;br/&gt;&amp;gt; transaction issuers in the future.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; 3. The sender provides package information using &amp;#34;pckginfo1&amp;#34;,&lt;br/&gt;&amp;gt; &amp;gt;    including the blockhash of the sender&amp;#39;s best block, the wtxids of&lt;br/&gt;&amp;gt; &amp;gt; the transactions in the package, their total fees and total weight.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; It&amp;#39;s unclear to me how the `pckinfo1` receiver should proceed if the&lt;br/&gt;&amp;gt; sender&amp;#39;s best block is not in sync with the local chain tip.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If the package isn&amp;#39;t processed further, that&amp;#39;s annoying for all the&lt;br/&gt;&amp;gt; low-performance  LN mobile clients, their chain tips might be always behind&lt;br/&gt;&amp;gt; by few blocks from the p2p network nodes. It sounds like their packages&lt;br/&gt;&amp;gt; won&amp;#39;t propagate at all.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If the package is processed further whatever the sender-receiver sync on&lt;br/&gt;&amp;gt; chain tip, what&amp;#39;s the purpose of including the blockhash ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; A child-with-unconfirmed-parents package for a transaction should be&lt;br/&gt;&amp;gt; &amp;gt; announced when it meets the peer&amp;#39;s fee filter but one or more of its&lt;br/&gt;&amp;gt; &amp;gt; parents don&amp;#39;t; a &amp;#34;inv(MSG_PCKG1)&amp;#34; instead of &amp;#34;inv(WTX)&amp;#34; should be sent&lt;br/&gt;&amp;gt; &amp;gt; for the child. Each of the parents which meet the peer&amp;#39;s fee filter&lt;br/&gt;&amp;gt; &amp;gt; should still be announced normally.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I believe we might have concerns of package-feerate downgrades attacks.&lt;br/&gt;&amp;gt; E.g, in the LN context, where your channel counterparty is aiming to jam&lt;br/&gt;&amp;gt; the propagation of the best-feerate version of the package.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Let&amp;#39;s say you have :&lt;br/&gt;&amp;gt; - Alice&amp;#39;s commitment_tx, at 1s/vB&lt;br/&gt;&amp;gt; - package A &#43; child B, at 3s/vB&lt;br/&gt;&amp;gt; - package A &#43; child C, at 10s/vB&lt;br/&gt;&amp;gt; - block inclusion feerate at 10s/vB&lt;br/&gt;&amp;gt; - Alice and Mallory are LN channel counterparties&lt;br/&gt;&amp;gt; - commitment_tx is using LN&amp;#39;s anchor outputs&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Alice&amp;#39;s LN node broadcasts A&#43;C to her mempool.&lt;br/&gt;&amp;gt; Bob&amp;#39;s feefilter is at 3s/vB.&lt;br/&gt;&amp;gt; Mallory broadcasts her child B in Alice&amp;#39;s mempool.&lt;br/&gt;&amp;gt; LN commitment does not meet Bob&amp;#39;s feefilter.&lt;br/&gt;&amp;gt; Package A&#43;child B at 3s/vB meets Bob&amp;#39;s feefilter and is announced to Bob.&lt;br/&gt;&amp;gt; Mallory broadcasts her own commitment_tx at 4s/vB in Bob&amp;#39;s mempool.&lt;br/&gt;&amp;gt; When Alice&amp;#39;s child C is relayed to Bob, it&amp;#39;s bounced off Bob&amp;#39;s mempool.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Do you think this situation is plausible ? Of course, it might be heavily&lt;br/&gt;&amp;gt; dependent on package-relay yet-not-implemented internal p2p logic.&lt;br/&gt;&amp;gt; I think it could be fixable if LN removes the counterparty&amp;#39;s&lt;br/&gt;&amp;gt; `anchor_output` on the local node&amp;#39;s version of the commitment transaction,&lt;br/&gt;&amp;gt; once package relay is deployed.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Another question, at the next fee-bump iteration, Alice rebroadcasts&lt;br/&gt;&amp;gt; A&#43;child D, at 12 s/vB. Her node has already marked Alice&amp;#39;s commitment_tx as&lt;br/&gt;&amp;gt; known in Bob&amp;#39;s `m_tx_inventory_known_filter`. So when a new higher fee&lt;br/&gt;&amp;gt; child is  discovered, should a `child-with-unconfirmed-parents` be&lt;br/&gt;&amp;gt; announced between Alice and Bob ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Anyway, I think it would be interesting to pseudo-specify the&lt;br/&gt;&amp;gt; package-assemblage algorithm (or if there is code already available) to see&lt;br/&gt;&amp;gt; if it&amp;#39;s robust against adversarial or unlucky situations ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; In fact, a package&lt;br/&gt;&amp;gt; &amp;gt; of transactions may be announced using both Erlay and package relay.&lt;br/&gt;&amp;gt; &amp;gt; After reconciliation, if the initiator would have announced a&lt;br/&gt;&amp;gt; &amp;gt; transaction by wtxid but also has package information for it, they may&lt;br/&gt;&amp;gt; &amp;gt; send &amp;#34;inv(MSG_PCKG)&amp;#34; instead of &amp;#34;inv(WTX)&amp;#34;.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yes, I think this holds. Note, we might have to add to the reconciliation&lt;br/&gt;&amp;gt; set low-fee parents succeeding the feefilter check due to a child. When the&lt;br/&gt;&amp;gt; reconcildiff, we might have to bifucarte again on feefilter to decide to&lt;br/&gt;&amp;gt; announce missing wtixds either as `inv(MSG_PCKG)` or `inv(WTX)`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; (IIRC, I&amp;#39;ve already made few feedbacks offline though good to get them in&lt;br/&gt;&amp;gt; the public space and think more)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Antoine&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Le mar. 17 mai 2022 à 12:09, Gloria Zhao via bitcoin-dev &amp;lt;&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&amp;gt; a écrit :&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Hi everybody,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I’m writing to propose a set of p2p protocol changes to enable package&lt;br/&gt;&amp;gt;&amp;gt; relay, soliciting feedback on the design and approach. Here is a link&lt;br/&gt;&amp;gt;&amp;gt; to the most up-to-date proposal:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bips/pull/1324&#34;&gt;https://github.com/bitcoin/bips/pull/1324&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; If you have concept or approach feedback, *please respond on the&lt;br/&gt;&amp;gt;&amp;gt; mailing list* to allow everybody to view and participate in the&lt;br/&gt;&amp;gt;&amp;gt; discussion. If you find a typo or inaccurate wording, please feel free&lt;br/&gt;&amp;gt;&amp;gt; to leave suggestions on the PR.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I’m also working on an implementation for Bitcoin Core.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The rest of this post will include the same contents as the proposal,&lt;br/&gt;&amp;gt;&amp;gt; with a bit of reordering and additional context. If you are not 100%&lt;br/&gt;&amp;gt;&amp;gt; up-to-date on package relay and find the proposal hard to follow, I&lt;br/&gt;&amp;gt;&amp;gt; hope you find this format more informative and persuasive.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ==Background and Motivation==&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Users may create and broadcast transactions that depend upon, i.e.&lt;br/&gt;&amp;gt;&amp;gt; spend outputs of, unconfirmed transactions. A “package” is the&lt;br/&gt;&amp;gt;&amp;gt; widely-used term for a group of transactions representable by a&lt;br/&gt;&amp;gt;&amp;gt; connected Directed Acyclic Graph (where a directed edge exists between&lt;br/&gt;&amp;gt;&amp;gt; a transaction that spends the output of another transaction).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Incentive-compatible mempool and miner policies help create a fair,&lt;br/&gt;&amp;gt;&amp;gt; fee-based market for block space. While miners maximize transaction&lt;br/&gt;&amp;gt;&amp;gt; fees in order to earn higher block rewards, non-mining users&lt;br/&gt;&amp;gt;&amp;gt; participating in transaction relay reap many benefits from employing&lt;br/&gt;&amp;gt;&amp;gt; policies that result in a mempool with the same contents, including&lt;br/&gt;&amp;gt;&amp;gt; faster compact block relay and more accurate fee estimation.&lt;br/&gt;&amp;gt;&amp;gt; Additionally, users may take advantage of mempool and miner policy to&lt;br/&gt;&amp;gt;&amp;gt; bump the priority of their transactions by attaching high-fee&lt;br/&gt;&amp;gt;&amp;gt; descendants (Child Pays for Parent or CPFP).  Only considering&lt;br/&gt;&amp;gt;&amp;gt; transactions one at a time for submission to the mempool creates a&lt;br/&gt;&amp;gt;&amp;gt; limitation in the node&amp;#39;s ability to determine which transactions have&lt;br/&gt;&amp;gt;&amp;gt; the highest feerates, since it cannot take into account descendants&lt;br/&gt;&amp;gt;&amp;gt; until all the transactions are in the mempool. Similarly, it cannot&lt;br/&gt;&amp;gt;&amp;gt; use a transaction&amp;#39;s descendants when considering which of two&lt;br/&gt;&amp;gt;&amp;gt; conflicting transactions to keep (Replace by Fee or RBF).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; When a user&amp;#39;s transaction does not meet a mempool&amp;#39;s minimum feerate&lt;br/&gt;&amp;gt;&amp;gt; and they cannot create a replacement transaction directly, their&lt;br/&gt;&amp;gt;&amp;gt; transaction will simply be rejected by this mempool. They also cannot&lt;br/&gt;&amp;gt;&amp;gt; attach a descendant to pay for replacing a conflicting transaction.&lt;br/&gt;&amp;gt;&amp;gt; This limitation harms users&amp;#39; ability to fee-bump their transactions.&lt;br/&gt;&amp;gt;&amp;gt; Further, it presents a security issue in contracting protocols which&lt;br/&gt;&amp;gt;&amp;gt; rely on **presigned**, time-sensitive transactions to prevent cheating&lt;br/&gt;&amp;gt;&amp;gt; (HTLC-Timeout in LN Penalty [1] [2] [3], Unvault Cancel in Revault&lt;br/&gt;&amp;gt;&amp;gt; [4], Refund Transaction in Discreet Log Contracts [5], Updates in&lt;br/&gt;&amp;gt;&amp;gt; eltoo [6]). In other words, a key security assumption of many&lt;br/&gt;&amp;gt;&amp;gt; contracting protocols is that all parties can propagate and confirm&lt;br/&gt;&amp;gt;&amp;gt; transactions in a timely manner.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In the past few years, increasing attention [0][1][2][3][6] has been&lt;br/&gt;&amp;gt;&amp;gt; brought to **pinning attacks**, a type of censorship in which the&lt;br/&gt;&amp;gt;&amp;gt; attacker uses mempool policy restrictions to prevent a transaction&lt;br/&gt;&amp;gt;&amp;gt; from being relayed or getting mined.  TLDR: revocation transactions&lt;br/&gt;&amp;gt;&amp;gt; must meet a certain confirmation target to be effective, but their&lt;br/&gt;&amp;gt;&amp;gt; feerates are negotiated well ahead of broadcast time. If the&lt;br/&gt;&amp;gt;&amp;gt; forecasted feerate was too low and no fee-bumping options are&lt;br/&gt;&amp;gt;&amp;gt; available, attackers can steal money from their counterparties. I walk&lt;br/&gt;&amp;gt;&amp;gt; through a concrete example for stealing Lightning HTLC outputs at&lt;br/&gt;&amp;gt;&amp;gt; ~23:58 in this talk [7][8].  Note that most attacks are only possible&lt;br/&gt;&amp;gt;&amp;gt; when the market for blockspace at broadcast time  demands much higher&lt;br/&gt;&amp;gt;&amp;gt; feerates than originally anticipated at signing time. Always&lt;br/&gt;&amp;gt;&amp;gt; overestimating fees may sidestep this issue temporarily (while mempool&lt;br/&gt;&amp;gt;&amp;gt; traffic is low and predictable), but this solution is not foolproof&lt;br/&gt;&amp;gt;&amp;gt; and wastes users&amp;#39; money. The feerate market can change due to sudden&lt;br/&gt;&amp;gt;&amp;gt; spikes in traffic (e.g. huge 12sat/vB dump a few days ago [9]) or&lt;br/&gt;&amp;gt;&amp;gt; sustained, high volume of Bitcoin payments (e.g.  April 2021 and&lt;br/&gt;&amp;gt;&amp;gt; December 2017).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The best solution is to enable nodes to consider packages of&lt;br/&gt;&amp;gt;&amp;gt; transactions as a unit, e.g. one or more low-fee parent transactions&lt;br/&gt;&amp;gt;&amp;gt; with a high-fee child, instead of separately. A package-aware mempool&lt;br/&gt;&amp;gt;&amp;gt; policy can help determine if it would actually be economically&lt;br/&gt;&amp;gt;&amp;gt; rational to accept a transaction to the mempool if it doesn&amp;#39;t meet fee&lt;br/&gt;&amp;gt;&amp;gt; requirements individually. Network-wide adoption of these policies&lt;br/&gt;&amp;gt;&amp;gt; would create a more purely-feerate-based market for block space and&lt;br/&gt;&amp;gt;&amp;gt; allow contracting protocols to adjust fees (and therefore mining&lt;br/&gt;&amp;gt;&amp;gt; priority) at broadcast time.  Some support for packages has existed in&lt;br/&gt;&amp;gt;&amp;gt; Bitcoin Core for years. Since v0.13, Bitcoin Core has used ancestor&lt;br/&gt;&amp;gt;&amp;gt; packages instead of individual transactions to evaluate the incentive&lt;br/&gt;&amp;gt;&amp;gt; compatibility of transactions in the mempool [10] and select them for&lt;br/&gt;&amp;gt;&amp;gt; inclusion in blocks [11].&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Package Relay, the concept of {announcing, requesting, downloading}&lt;br/&gt;&amp;gt;&amp;gt; packages between nodes on the p2p network, has also been discussed for&lt;br/&gt;&amp;gt;&amp;gt; many years. The earliest public mention I can find is from 2015 [12].&lt;br/&gt;&amp;gt;&amp;gt; The two most common use cases for package relay are fee-bumping&lt;br/&gt;&amp;gt;&amp;gt; otherwise-too-low-fee transactions and reducing the amount of orphans.&lt;br/&gt;&amp;gt;&amp;gt; It seems uncontroversial to say that everybody desires package relay&lt;br/&gt;&amp;gt;&amp;gt; conceptually, with varying degrees of urgency. Lots of work has been&lt;br/&gt;&amp;gt;&amp;gt; done by others over the past few years, from which I&amp;#39;ve taken&lt;br/&gt;&amp;gt;&amp;gt; inspiration from [13][14][15][16].&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; My approach has been to split the project into two components: (1) Package&lt;br/&gt;&amp;gt;&amp;gt; Mempool Accept, which includes validation logic and mempool policy.&lt;br/&gt;&amp;gt;&amp;gt; (3) Package Relay, which includes the p2p protocol changes.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Progress so far:&lt;br/&gt;&amp;gt;&amp;gt; After discussions with various developers of contracting protocols&lt;br/&gt;&amp;gt;&amp;gt; (with heavier emphasis towards LN), it was determined that a&lt;br/&gt;&amp;gt;&amp;gt; package containing a child with all of its unconfirmed parents&lt;br/&gt;&amp;gt;&amp;gt; (child-with-unconfirmed-parents or 1-child-multi-parent package) would&lt;br/&gt;&amp;gt;&amp;gt; be sufficient for their use case, i.e. fee-bumping presigned&lt;br/&gt;&amp;gt;&amp;gt; transactions. A child-with-unconfirmed-parents package has several&lt;br/&gt;&amp;gt;&amp;gt; properties that make many things easier to reason about.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; A few months ago, I proposed a set of policies for safe package&lt;br/&gt;&amp;gt;&amp;gt; validation and fee assessment for packages of this restricted&lt;br/&gt;&amp;gt;&amp;gt; topology [17]. A series of PRs implementing this proposal have&lt;br/&gt;&amp;gt;&amp;gt; been merged into Bitcoin Core [18].&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Theoretically, developing a safe and incentive-compatible package&lt;br/&gt;&amp;gt;&amp;gt; mempool acceptance policy is sufficient to solve this issue. Nodes&lt;br/&gt;&amp;gt;&amp;gt; could opportunistically accept packages (e.g. by trying combinations&lt;br/&gt;&amp;gt;&amp;gt; of transactions rejected from their mempools), but this practice would&lt;br/&gt;&amp;gt;&amp;gt; likely be inefficient at best and open new Denial of Service attacks&lt;br/&gt;&amp;gt;&amp;gt; at worst. Additional p2p messages may enable nodes to request and&lt;br/&gt;&amp;gt;&amp;gt; share package validation-related information with one another in a&lt;br/&gt;&amp;gt;&amp;gt; more communication-efficient way.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Given that only package RBF remains for package mempool accept, and we&lt;br/&gt;&amp;gt;&amp;gt; can make progress on p2p and mempool in parallel, I think it’s&lt;br/&gt;&amp;gt;&amp;gt; appropriate to put forward a package relay proposal.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ==Proposal==&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This proposal contains 2 components: a “generic” package relay&lt;br/&gt;&amp;gt;&amp;gt; protocol and an extension of it, child-with-unconfirmed-parents&lt;br/&gt;&amp;gt;&amp;gt; packages, as version 1 package relay. Another version of packages,&lt;br/&gt;&amp;gt;&amp;gt; “tx-with-unconfirmed-ancestors” can be created to extend package relay&lt;br/&gt;&amp;gt;&amp;gt; for eliminating orphans.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ===Generic Package Relay===&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Two main ideas are introduced:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Download and validate packages of transactions together.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Provide information to help peers decide whether to request and/or how&lt;br/&gt;&amp;gt;&amp;gt; to validate transactions which are part of a package.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ====Intended Protocol Flow====&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Due to the asynchronous nature of a distributed transaction relay&lt;br/&gt;&amp;gt;&amp;gt; network, nodes may not receive all of the information needed to&lt;br/&gt;&amp;gt;&amp;gt; validate a transaction at once. For example, after a node completes&lt;br/&gt;&amp;gt;&amp;gt; Initial Block Download (IBD) and first starts participating in&lt;br/&gt;&amp;gt;&amp;gt; transaction relay with an empty mempool, it is common to receive&lt;br/&gt;&amp;gt;&amp;gt; orphans. In such scenarios where a node is aware that it is missing&lt;br/&gt;&amp;gt;&amp;gt; information, a &amp;#39;&amp;#39;receiver-initiated&amp;#39;&amp;#39; dialogue is appropriate:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1. Receiver requests package information.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 2. The sender provides package information, including the wtxids of&lt;br/&gt;&amp;gt;&amp;gt;    the transactions in the package and anything else that might be&lt;br/&gt;&amp;gt;&amp;gt; relevant (e.g. total fees and size).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 3. The reciever uses the package information to decide how to request&lt;br/&gt;&amp;gt;&amp;gt;    and validate the transactions.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Sometimes, no matter what order transactions are received by a node,&lt;br/&gt;&amp;gt;&amp;gt; validating them individually is insufficient. When the sender is aware&lt;br/&gt;&amp;gt;&amp;gt; of additional information that the receiver needs to accept a package,&lt;br/&gt;&amp;gt;&amp;gt; a proactive &amp;#39;&amp;#39;sender-initiated&amp;#39;&amp;#39; dialogue should be enabled:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1. Sender announces they have package information pertaining to a&lt;br/&gt;&amp;gt;&amp;gt;    transaction that might otherwise be undesired on its own.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 2. The receiver requests package information.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 3. The sender provides package information, including the wtxids of&lt;br/&gt;&amp;gt;&amp;gt;    the transactions in the package and anything else that might be&lt;br/&gt;&amp;gt;&amp;gt; relevant (e.g. total fees and size).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 4. The reciever uses the package information to decide how to request&lt;br/&gt;&amp;gt;&amp;gt;    and validate the transactions.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Package relay is negotiated between two peers during the version&lt;br/&gt;&amp;gt;&amp;gt; handshake. Package relay requires both peers to support wtxid-based&lt;br/&gt;&amp;gt;&amp;gt; relay because package transactions are referenced by their wtxid.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ====New Messages====&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Three new protocol messages are added for use in any version of&lt;br/&gt;&amp;gt;&amp;gt; package relay. Additionally, each version of package relay must define&lt;br/&gt;&amp;gt;&amp;gt; its own inv type and &amp;#34;pckginfo&amp;#34; message version, referred to in this&lt;br/&gt;&amp;gt;&amp;gt; document as &amp;#34;MSG_PCKG&amp;#34; and &amp;#34;pckginfo&amp;#34; respectively. See&lt;br/&gt;&amp;gt;&amp;gt; BIP-v1-packages for a concrete example.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; =====sendpackages=====&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; {|&lt;br/&gt;&amp;gt;&amp;gt; |  Field Name  ||  Type  ||  Size  ||  Purpose&lt;br/&gt;&amp;gt;&amp;gt; |-&lt;br/&gt;&amp;gt;&amp;gt; |version || uint32_t || 4 || Denotes a package version supported by the&lt;br/&gt;&amp;gt;&amp;gt; node.&lt;br/&gt;&amp;gt;&amp;gt; |-&lt;br/&gt;&amp;gt;&amp;gt; |max_count || uint32_t || 4 ||Specifies the maximum number of&lt;br/&gt;&amp;gt;&amp;gt; transactions per package this node is&lt;br/&gt;&amp;gt;&amp;gt; willing to accept.&lt;br/&gt;&amp;gt;&amp;gt; |-&lt;br/&gt;&amp;gt;&amp;gt; |max_weight || uint32_t || 4 ||Specifies the maximum total weight per&lt;br/&gt;&amp;gt;&amp;gt; package this node is willing&lt;br/&gt;&amp;gt;&amp;gt; to accept.&lt;br/&gt;&amp;gt;&amp;gt; |-&lt;br/&gt;&amp;gt;&amp;gt; |}&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1. The &amp;#34;sendpackages&amp;#34; message has the structure defined above, with&lt;br/&gt;&amp;gt;&amp;gt;    pchCommand == &amp;#34;sendpackages&amp;#34;.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 2. During version handshake, nodes should send a &amp;#34;sendpackages&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt;    message indicate they support package relay and may request&lt;br/&gt;&amp;gt;&amp;gt; packages.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 3. The message should contain a version supported by the node. Nodes&lt;br/&gt;&amp;gt;&amp;gt;    should send a &amp;#34;sendpackages&amp;#34; message for each version they support.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 4. The &amp;#34;sendpackages&amp;#34; message MUST be sent before sending a &amp;#34;verack&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt;    message. If a &amp;#34;sendpackages&amp;#34; message is received afer &amp;#34;verack&amp;#34;, the&lt;br/&gt;&amp;gt;&amp;gt; sender should be disconnected.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 5. If &amp;#39;fRelay==false&amp;#39; in a peer&amp;#39;s version message, the node must not&lt;br/&gt;&amp;gt;&amp;gt;    send &amp;#34;sendpackages&amp;#34; to them. If a &amp;#34;sendpackages&amp;#34; message is&lt;br/&gt;&amp;gt;&amp;gt; received by a peer after sending `fRelay==false` in their version&lt;br/&gt;&amp;gt;&amp;gt; message, the sender should be disconnected.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 6.. Upon receipt of a &amp;#34;sendpackages&amp;#34; message with a version that is&lt;br/&gt;&amp;gt;&amp;gt; not supported, a node must treat the peer as if it never received the&lt;br/&gt;&amp;gt;&amp;gt; message.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 7. If both peers send &amp;#34;wtxidrelay&amp;#34; and &amp;#34;sendpackages&amp;#34; with the same&lt;br/&gt;&amp;gt;&amp;gt;    version, the peers should announce, request, and send package&lt;br/&gt;&amp;gt;&amp;gt; information to each other.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; =====getpckgtxns=====&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; {|&lt;br/&gt;&amp;gt;&amp;gt; |  Field Name  ||  Type  ||  Size  ||   Purpose&lt;br/&gt;&amp;gt;&amp;gt; |-&lt;br/&gt;&amp;gt;&amp;gt; |txns_length||CompactSize||1 or 3 bytes|| The number of transactions&lt;br/&gt;&amp;gt;&amp;gt; requested.&lt;br/&gt;&amp;gt;&amp;gt; |-&lt;br/&gt;&amp;gt;&amp;gt; |txns||List of wtxids||txns_length * 32|| The wtxids of each transaction&lt;br/&gt;&amp;gt;&amp;gt; in the package.&lt;br/&gt;&amp;gt;&amp;gt; |}&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1. The &amp;#34;getpckgtxns&amp;#34; message has the structure defined above, with&lt;br/&gt;&amp;gt;&amp;gt;    pchCommand == &amp;#34;getpckgtxns&amp;#34;.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 2. A &amp;#34;getpckgtxns&amp;#34; message should be used to request all or some of&lt;br/&gt;&amp;gt;&amp;gt;    the transactions previously announced in a &amp;#34;pckginfo&amp;#34; message,&lt;br/&gt;&amp;gt;&amp;gt; specified by witness transactiosome id.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 3. Upon receipt of a &amp;#34;getpckgtxns&amp;#34; message, a node must respond with&lt;br/&gt;&amp;gt;&amp;gt;    either a &amp;#34;pckgtxns&amp;#34; containing the requested transactions or a&lt;br/&gt;&amp;gt;&amp;gt; &amp;#34;notfound&amp;#34; message indicating one or more of the transactions is&lt;br/&gt;&amp;gt;&amp;gt; unavailable. This allows the receiver to avoid downloading and storing&lt;br/&gt;&amp;gt;&amp;gt; transactions that cannot be validated immediately.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 4. A &amp;#34;getpckgtxns&amp;#34; message should only be sent if both peers agreed to&lt;br/&gt;&amp;gt;&amp;gt;    send packages in the version handshake. If a &amp;#34;getpckgtxns&amp;#34; message&lt;br/&gt;&amp;gt;&amp;gt; is received from a peer with which package relay was not negotiated,&lt;br/&gt;&amp;gt;&amp;gt; the sender should be disconnected.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; =====pckgtxns=====&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; {|&lt;br/&gt;&amp;gt;&amp;gt; |  Field Name  ||  Type  ||  Size  ||   Purpose&lt;br/&gt;&amp;gt;&amp;gt; |-&lt;br/&gt;&amp;gt;&amp;gt; |txns_length||CompactSize||1 or 3 bytes|| The number of transactions&lt;br/&gt;&amp;gt;&amp;gt; provided.&lt;br/&gt;&amp;gt;&amp;gt; |-&lt;br/&gt;&amp;gt;&amp;gt; |txns||List of transactions||variable|| The transactions in the package.&lt;br/&gt;&amp;gt;&amp;gt; |}&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1. The &amp;#34;pckgtxns&amp;#34; message has the structure defined above, with&lt;br/&gt;&amp;gt;&amp;gt;    pchCommand == &amp;#34;pckgtxns&amp;#34;.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 2. A &amp;#34;pckgtxns&amp;#34; message should contain the transaction data requested&lt;br/&gt;&amp;gt;&amp;gt;    using &amp;#34;getpckgtxns&amp;#34;.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 3. A &amp;#34;pckgtxns&amp;#34; message should only be sent to a peer that requested&lt;br/&gt;&amp;gt;&amp;gt;    the package using &amp;#34;getpckgtxns&amp;#34;. If a node receives an unsolicited&lt;br/&gt;&amp;gt;&amp;gt; package, the sender should be disconnected.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 4. A &amp;#34;pckgtxns&amp;#34; message should only be sent if both peers agreed to&lt;br/&gt;&amp;gt;&amp;gt;    send packages in the version handshake. If a &amp;#34;pckgtxns&amp;#34; message is&lt;br/&gt;&amp;gt;&amp;gt; received from a peer with which package relay was not negotiated, the&lt;br/&gt;&amp;gt;&amp;gt; sender should be disconnected.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ===Version 1 Packages: child-with-unconfirmed-parents===&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This extends package relay for packages consisting of one transaction&lt;br/&gt;&amp;gt;&amp;gt; and all of its unconfirmed parents,by defining version 1 packages, a&lt;br/&gt;&amp;gt;&amp;gt; pckginfo1 message, and a MSG_PCKG1 inv type. It enables the use case&lt;br/&gt;&amp;gt;&amp;gt; in which a child pays for its otherwise-too-low-fee parents and their&lt;br/&gt;&amp;gt;&amp;gt; mempool conflict(s).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ====Intended Protocol Flow====&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; When relaying a package of low-fee parent(s) and high-fee child, the&lt;br/&gt;&amp;gt;&amp;gt; sender and receiver do the following:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1. Sender announces they have a child-with-unconfirmed-parents package&lt;br/&gt;&amp;gt;&amp;gt;    for a child that pays for otherwise-too-low-fee parent(s) using&lt;br/&gt;&amp;gt;&amp;gt; &amp;#34;inv(MSG_PCKG1)&amp;#34;.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 2. The receiver requests package information using&lt;br/&gt;&amp;gt;&amp;gt;    &amp;#34;getdata(MSG_PCKG1)&amp;#34;.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 3. The sender provides package information using &amp;#34;pckginfo1&amp;#34;,&lt;br/&gt;&amp;gt;&amp;gt;    including the blockhash of the sender&amp;#39;s best block, the wtxids of&lt;br/&gt;&amp;gt;&amp;gt; the transactions in the package, their total fees and total weight.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 4. The reciever uses the package information to decide how to request&lt;br/&gt;&amp;gt;&amp;gt;    the transactions. For example, if the receiver already has some of&lt;br/&gt;&amp;gt;&amp;gt; the transactions in their mempool, they only request the missing ones.&lt;br/&gt;&amp;gt;&amp;gt; They could also decide not to request the package at all based on the&lt;br/&gt;&amp;gt;&amp;gt; fee information provided.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 5. Upon receiving a &amp;#34;pckgtxns&amp;#34;, the receiver submits the transactions&lt;br/&gt;&amp;gt;&amp;gt;    together as a package.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ====New Messages====&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; A new inv type, &amp;#34;MSG_PCKG1&amp;#34;, and new protocol message, &amp;#34;PCKGINFO1&amp;#34;,&lt;br/&gt;&amp;gt;&amp;gt; are added.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; =====pckginfo1=====&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; {|&lt;br/&gt;&amp;gt;&amp;gt; |  Field Name  ||  Type  ||  Size  ||   Purpose&lt;br/&gt;&amp;gt;&amp;gt; |-&lt;br/&gt;&amp;gt;&amp;gt; |blockhash || uint256 || 32 || The chain tip at which this package is&lt;br/&gt;&amp;gt;&amp;gt; defined.&lt;br/&gt;&amp;gt;&amp;gt; |-&lt;br/&gt;&amp;gt;&amp;gt; |pckg_fee||CAmount||4|| The sum total fees paid by all transactions in&lt;br/&gt;&amp;gt;&amp;gt; the package.&lt;br/&gt;&amp;gt;&amp;gt; |-&lt;br/&gt;&amp;gt;&amp;gt; |pckg_weight||int64_t||8|| The sum total weight of all transactions in&lt;br/&gt;&amp;gt;&amp;gt; the package.&lt;br/&gt;&amp;gt;&amp;gt; |-&lt;br/&gt;&amp;gt;&amp;gt; |txns_length||CompactSize||1 or 3 bytes|| The number of transactions&lt;br/&gt;&amp;gt;&amp;gt; provided.&lt;br/&gt;&amp;gt;&amp;gt; |-&lt;br/&gt;&amp;gt;&amp;gt; |txns||List of wtxids||txns_length * 32|| The wtxids of each transaction&lt;br/&gt;&amp;gt;&amp;gt; in the package.&lt;br/&gt;&amp;gt;&amp;gt; |}&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1. The &amp;#34;pckginfo1&amp;#34; message has the structure defined above, with&lt;br/&gt;&amp;gt;&amp;gt;    pchCommand == &amp;#34;pckginfo1&amp;#34;.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 2. A &amp;#34;pckginfo1&amp;#34; message contains information about a version 1&lt;br/&gt;&amp;gt;&amp;gt;    package (defined below), referenced by the wtxid of the transaction&lt;br/&gt;&amp;gt;&amp;gt; it pertains to and the current blockhash.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 3. Upon receipt of a &amp;#34;pckginfo1&amp;#34; message, the node should decide if it&lt;br/&gt;&amp;gt;&amp;gt;    wants to validate the package, request transaction data if&lt;br/&gt;&amp;gt;&amp;gt; necessary, etc.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 4. Upon receipt of a malformed &amp;#34;pckginfo1&amp;#34; message or package that&lt;br/&gt;&amp;gt;&amp;gt;    does not abide by the max_count, max_weight, or other rules&lt;br/&gt;&amp;gt;&amp;gt; specified by the version agreed upon in the initial negotiation, the&lt;br/&gt;&amp;gt;&amp;gt; sender should be disconnected.  If a node receives a &amp;#34;pckginfo1&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt; message for which the &amp;#34;pckg_fee&amp;#34; or &amp;#34;pckg_weight&amp;#34; do not reflect the&lt;br/&gt;&amp;gt;&amp;gt; true total fees and weight, respectively, or the transactions in the&lt;br/&gt;&amp;gt;&amp;gt; package, the message is malformed.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 5. A node MUST NOT send a &amp;#34;pckginfo1&amp;#34; message that has not been&lt;br/&gt;&amp;gt;&amp;gt;    requested by the recipient. Upon receipt of an unsolicited&lt;br/&gt;&amp;gt;&amp;gt; &amp;#34;pckginfo1&amp;#34;, a node should disconnect the sender.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 6. A &amp;#34;pckginfo1&amp;#34; message should only be sent if both peers agreed to&lt;br/&gt;&amp;gt;&amp;gt;    send version 1 packages in the version handshake. If a &amp;#34;pckginfo1&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt; message is received from a peer with which package relay was not&lt;br/&gt;&amp;gt;&amp;gt; negotiated, the sender should be disconnected.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; =====MSG_PCKG1=====&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1. A new inv type (MSG_PCKG1 == 0x6) is added, for use in inv messages&lt;br/&gt;&amp;gt;&amp;gt;    and getdata requests pertaining to version 1 packages.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 2. As an inv type, it indicates that both transaction data and version&lt;br/&gt;&amp;gt;&amp;gt;    1 package information are available for the transaction. The&lt;br/&gt;&amp;gt;&amp;gt; transaction is referenced by its wtxid. As a getdata request type, it&lt;br/&gt;&amp;gt;&amp;gt; indicates that the sender wants package information for the&lt;br/&gt;&amp;gt;&amp;gt; transaction.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 3. Upon receipt of a &amp;#34;getdata&amp;#34; request for &amp;#34;MSG_PCKG1&amp;#34;, the node&lt;br/&gt;&amp;gt;&amp;gt;    should respond with the version 1 package corresponding to the&lt;br/&gt;&amp;gt;&amp;gt; requested transaction and its current chain tip, or with NOTFOUND.&lt;br/&gt;&amp;gt;&amp;gt; The node should not assume that the sender is requesting the&lt;br/&gt;&amp;gt;&amp;gt; transaction data as well.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ====Child With Parent Packages Rules====&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; A child-with-unconfirmed-parents package sent between nodes must abide&lt;br/&gt;&amp;gt;&amp;gt; by the rules below, otherwise the package is malformed and the sender&lt;br/&gt;&amp;gt;&amp;gt; should be disconnected.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; A version 1 or &amp;#39;&amp;#39;child-with-unconfirmed-parents&amp;#39;&amp;#39; package can be&lt;br/&gt;&amp;gt;&amp;gt; defined for any transaction that spends unconfirmed inputs. The child&lt;br/&gt;&amp;gt;&amp;gt; can be thought of as the &amp;#34;representative&amp;#34; of the package. This package&lt;br/&gt;&amp;gt;&amp;gt; can be uniquely identified by the transaction&amp;#39;s wtxid and the current&lt;br/&gt;&amp;gt;&amp;gt; chain tip block hash.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; A &amp;#39;&amp;#39;child-with-unconfirmed-parents&amp;#39;&amp;#39; package MUST be:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1. &amp;#39;&amp;#39;Sorted topologically.&amp;#39;&amp;#39; For every transaction t in the package,&lt;br/&gt;&amp;gt;&amp;gt;    if any of t&amp;#39;s parents are present in the package, the parent must&lt;br/&gt;&amp;gt;&amp;gt; appear somewhere in the list before t. In other words, the&lt;br/&gt;&amp;gt;&amp;gt; transactions must be sorted in ascending order of the number of&lt;br/&gt;&amp;gt;&amp;gt; ancestors present in the package.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 2. &amp;#39;&amp;#39;Only 1 child with unconfirmed parents.&amp;#39;&amp;#39; The package must consist&lt;br/&gt;&amp;gt;&amp;gt;    of one transaction and its unconfirmed parents. There must not be&lt;br/&gt;&amp;gt;&amp;gt; any other transactions in the package. Other dependency relationships&lt;br/&gt;&amp;gt;&amp;gt; may exist within the package (e.g. one parent may spend the output of&lt;br/&gt;&amp;gt;&amp;gt; another parent) provided that topological order is respected.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 3. &amp;#39;&amp;#39;All unconfirmed parents.&amp;#39;&amp;#39; All of the child&amp;#39;s unconfirmed parents&lt;br/&gt;&amp;gt;&amp;gt;    must be present.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 4. &amp;#39;&amp;#39;No conflicts.&amp;#39;&amp;#39; None of the transactions in the package may&lt;br/&gt;&amp;gt;&amp;gt;    conflict with each other (i.e.  spend the same prevout).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 5. &amp;#39;&amp;#39;Total fees and weight.&amp;#39;&amp;#39; The &amp;#39;total_fee&amp;#39; and &amp;#39;total_weight&amp;#39;&lt;br/&gt;&amp;gt;&amp;gt;    fields must accurately represent the sum total of all transactions&amp;#39;&lt;br/&gt;&amp;gt;&amp;gt; fees and weights as defined in BIP141, respectively.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Not all of the child&amp;#39;s parents must be present; the child transaction&lt;br/&gt;&amp;gt;&amp;gt; may also spend confirmed inputs. However, if the child has confirmed&lt;br/&gt;&amp;gt;&amp;gt; parents, they must not be in the package.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; While a child-with-unconfirmed-parents package is perhaps most&lt;br/&gt;&amp;gt;&amp;gt; relevant when the child has a higher feerate than its parents, this&lt;br/&gt;&amp;gt;&amp;gt; property is not required to construct a valid package.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ====Clarifications====&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;#39;&amp;#39;Q: Under what circumstances should a sender announce a&lt;br/&gt;&amp;gt;&amp;gt; child-with-unconfirmed-parents package?&amp;#39;&amp;#39;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; A child-with-unconfirmed-parents package for a transaction should be&lt;br/&gt;&amp;gt;&amp;gt; announced when it meets the peer&amp;#39;s fee filter but one or more of its&lt;br/&gt;&amp;gt;&amp;gt; parents don&amp;#39;t; a &amp;#34;inv(MSG_PCKG1)&amp;#34; instead of &amp;#34;inv(WTX)&amp;#34; should be sent&lt;br/&gt;&amp;gt;&amp;gt; for the child. Each of the parents which meet the peer&amp;#39;s fee filter&lt;br/&gt;&amp;gt;&amp;gt; should still be announced normally.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;#39;&amp;#39;Q: What if a new block arrives in between messages?&amp;#39;&amp;#39;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; A child-with-unconfirmed-parents package is defined for a transaction&lt;br/&gt;&amp;gt;&amp;gt; based on the current chain state. As such, a new block extending the&lt;br/&gt;&amp;gt;&amp;gt; tip may decrease the number of transactions in the package (i.e. if&lt;br/&gt;&amp;gt;&amp;gt; any of the transaction&amp;#39;s parents were included in the block). In a&lt;br/&gt;&amp;gt;&amp;gt; reorg, the number of transactions in the package may decrease or&lt;br/&gt;&amp;gt;&amp;gt; increase (i.e. if any of the transaction&amp;#39;s parents were included in a&lt;br/&gt;&amp;gt;&amp;gt; block in the previous chain but not the new one).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; If the new block arrives before the &amp;#34;getdata&amp;#34; or &amp;#34;pckginfo1&amp;#34;, nothing&lt;br/&gt;&amp;gt;&amp;gt; needs to change.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; If the new block arrives before &amp;#34;getpckgtxns&amp;#34; or before &amp;#34;pckgtxns&amp;#34;,&lt;br/&gt;&amp;gt;&amp;gt; the receiver may need to re-request package information if the block&lt;br/&gt;&amp;gt;&amp;gt; contained a transaction in the package. If the block doesn&amp;#39;t contain&lt;br/&gt;&amp;gt;&amp;gt; any transactions in the package, whether it extends the previous tip&lt;br/&gt;&amp;gt;&amp;gt; or causes a reorg, nothing needs to change.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;#39;&amp;#39;Q: Can &amp;#34;getpckgtxns&amp;#34; and &amp;#34;pckgtxns&amp;#34; messages contain only one&lt;br/&gt;&amp;gt;&amp;gt; transaction?&amp;#39;&amp;#39;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Yes.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ===Further Protocol Extensions===&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; When introducing a new type of package, assign it a version number &amp;#34;n&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt; and use an additional &amp;#34;sendpackages&amp;#34; message during version handshake&lt;br/&gt;&amp;gt;&amp;gt; to negotiate support for it. An additional package information message&lt;br/&gt;&amp;gt;&amp;gt; &amp;#34;pckginfon&amp;#34; and inv type &amp;#34;MSG_PCKGn&amp;#34; should be defined for the type of&lt;br/&gt;&amp;gt;&amp;gt; package.  However, &amp;#34;getpckgtxns&amp;#34; and &amp;#34;pckgtxns&amp;#34; do not need to be&lt;br/&gt;&amp;gt;&amp;gt; changed.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Example proposal for tx-with-unconfirmed-ancestors package relay: [19]&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ===Compatibility===&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Older clients remain fully compatible and interoperable after this&lt;br/&gt;&amp;gt;&amp;gt; change. Clients implementing this protocol will only attempt to send&lt;br/&gt;&amp;gt;&amp;gt; and request packages if agreed upon during the version handshake.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ===Package Erlay===&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Clients using BIP330 reconciliation-based transaction relay (Erlay)&lt;br/&gt;&amp;gt;&amp;gt; are able to use package relay without interference. In fact, a package&lt;br/&gt;&amp;gt;&amp;gt; of transactions may be announced using both Erlay and package relay.&lt;br/&gt;&amp;gt;&amp;gt; After reconciliation, if the initiator would have announced a&lt;br/&gt;&amp;gt;&amp;gt; transaction by wtxid but also has package information for it, they may&lt;br/&gt;&amp;gt;&amp;gt; send &amp;#34;inv(MSG_PCKG)&amp;#34; instead of &amp;#34;inv(WTX)&amp;#34;.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ===Rationale===&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ====P2P Message Design====&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; These p2p messages are added for communication efficiency and, as&lt;br/&gt;&amp;gt;&amp;gt; such, one should measure alternative solutions based on the resources&lt;br/&gt;&amp;gt;&amp;gt; used to communicate (not necessarily trustworthy) information: We&lt;br/&gt;&amp;gt;&amp;gt; would like to minimize network bandwidth, avoid downloading a&lt;br/&gt;&amp;gt;&amp;gt; transaction more than once, avoid downloading transactions that are&lt;br/&gt;&amp;gt;&amp;gt; eventually rejected, and minimize storage allocated for&lt;br/&gt;&amp;gt;&amp;gt; not-yet-validated transactions.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Consider these (plausible) scenarios in transaction relay:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Alice (the &amp;#34;sender&amp;#34;) is relaying transactions to Bob (the &amp;#34;receiver&amp;#34;).&lt;br/&gt;&amp;gt;&amp;gt; Alice&amp;#39;s mempool has a minimum feerate of 1sat/vB and Bob&amp;#39;s has a&lt;br/&gt;&amp;gt;&amp;gt; minimum feerate of 3sat/vB. For simplicity, all transactions are&lt;br/&gt;&amp;gt;&amp;gt; 1600Wu in virtual size and 500 bytes in serialized size. Apart from&lt;br/&gt;&amp;gt;&amp;gt; the spending relationships specified, all other inputs are from&lt;br/&gt;&amp;gt;&amp;gt; confirmed UTXOs.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1. Package {A, B} where A pays 0 satoshis and B pays 8000 satoshis in&lt;br/&gt;&amp;gt;&amp;gt;    fees.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 2. Package {C, D} where C pays 0 satoshis and D pays 1200 satoshis in&lt;br/&gt;&amp;gt;&amp;gt;    fees.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 3. Package {E, F, G, H, J} that pays 4000, 8000, 0, 2000, and 4000&lt;br/&gt;&amp;gt;&amp;gt;    satoshis in fees, respectively.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ====Alternative Designs Considered====&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;#39;&amp;#39;Package Information Only:&amp;#39;&amp;#39; Just having &amp;#34;pckginfo&amp;#34; gives enough&lt;br/&gt;&amp;gt;&amp;gt; information for the receiver to accept the package. Omit the&lt;br/&gt;&amp;gt;&amp;gt; &amp;#34;getpckgtxns&amp;#34; and &amp;#34;pckgtxns&amp;#34; messages. While this option is a good&lt;br/&gt;&amp;gt;&amp;gt; fallback if batched transaction download fails for some reason, it&lt;br/&gt;&amp;gt;&amp;gt; shouldn&amp;#39;t be used as the default because it &amp;#39;always&amp;#39; requires storage&lt;br/&gt;&amp;gt;&amp;gt; of unvalidated transactions.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;#39;&amp;#39;No Package Information Round:&amp;#39;&amp;#39; Instead of having a package&lt;br/&gt;&amp;gt;&amp;gt; information round, just use the child&amp;#39;s wtxid to refer to the package&lt;br/&gt;&amp;gt;&amp;gt; and always send the entire package together. This would cause nodes to&lt;br/&gt;&amp;gt;&amp;gt; redownload duplicate transactions.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I have also created a slidedeck exploring various alternative designs&lt;br/&gt;&amp;gt;&amp;gt; and some examples in which they fall flat [20]. Please feel free to&lt;br/&gt;&amp;gt;&amp;gt; suggest other alternatives.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ====Versioning System====&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This protocol should be extensible to support multiple types of&lt;br/&gt;&amp;gt;&amp;gt; packages based on future desired use cases. Two &amp;#34;flavors&amp;#34; of&lt;br/&gt;&amp;gt;&amp;gt; versioning were considered:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1. When package mempool acceptance is upgraded to support more types&lt;br/&gt;&amp;gt;&amp;gt;    of packages, increment the version number (similar to Erlay).&lt;br/&gt;&amp;gt;&amp;gt; During version handshake, peers negotiate which version of package&lt;br/&gt;&amp;gt;&amp;gt; relay they will use by each sending one &amp;#34;sendpackages&amp;#34; message.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 2. When introducing another type of package, assign a version number&lt;br/&gt;&amp;gt;&amp;gt;    to it and announce it as an additional supported version (similar&lt;br/&gt;&amp;gt;&amp;gt; to Compact Block Relay). During version handshake, peers send one&lt;br/&gt;&amp;gt;&amp;gt; &amp;#34;sendpackages&amp;#34; message for each version supported.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The second option was favored because it allows different parameters&lt;br/&gt;&amp;gt;&amp;gt; for different versions.  For example, it should be possible to support&lt;br/&gt;&amp;gt;&amp;gt; both &amp;#34;arbitrary topology but maximum 3-transaction&amp;#34; package as well as&lt;br/&gt;&amp;gt;&amp;gt; &amp;#34;child-with-unconfirmed-parents with default mempool ancestor limits&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt; packages simultaneously.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ==Acknowledgements==&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I hope to have made it abundantly clear that this proposal isn’t&lt;br/&gt;&amp;gt;&amp;gt; inventing the concept of package relay, and in fact builds upon years&lt;br/&gt;&amp;gt;&amp;gt; of work by many others, including Suhas Daftuar and Antoine Riard.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Thank you to John Newbery and Martin Zumsande for input on the design.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Thank you to Matt Corallo, Christian Decker, David Harding, Antoine&lt;br/&gt;&amp;gt;&amp;gt; Poinsot, Antoine Riard, Gregory Sanders, Chris Stewart, Bastien&lt;br/&gt;&amp;gt;&amp;gt; Teinturier, and others for input on the desired interface for&lt;br/&gt;&amp;gt;&amp;gt; contracting protocols.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Looking forward to hearing your thoughts!&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Best,&lt;br/&gt;&amp;gt;&amp;gt; Gloria&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [0]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-January/019817.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-January/019817.html&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [1]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-April/002639.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-April/002639.html&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [2]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-June/002758.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-June/002758.html&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [3]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/t-bast/lightning-docs/blob/master/pinning-attacks.md&#34;&gt;https://github.com/t-bast/lightning-docs/blob/master/pinning-attacks.md&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [4]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/revault/practical-revault/blob/master/transactions.md#cancel_tx&#34;&gt;https://github.com/revault/practical-revault/blob/master/transactions.md#cancel_tx&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [5]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/discreetlogcontracts/dlcspecs/blob/master/Transactions.md#refund-transaction&#34;&gt;https://github.com/discreetlogcontracts/dlcspecs/blob/master/Transactions.md#refund-transaction&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [6]: &lt;a href=&#34;https://gist.github.com/instagibbs/60264606e181451e977e439a49f69fe1&#34;&gt;https://gist.github.com/instagibbs/60264606e181451e977e439a49f69fe1&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [7]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://btctranscripts.com/adopting-bitcoin/2021/2021-11-16-gloria-zhao-transaction-relay-policy/#lightning-attacks&#34;&gt;https://btctranscripts.com/adopting-bitcoin/2021/2021-11-16-gloria-zhao-transaction-relay-policy/#lightning-attacks&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [8]: &lt;a href=&#34;https://youtu.be/fbWSQvJjKFs?t=1438&#34;&gt;https://youtu.be/fbWSQvJjKFs?t=1438&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [9]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://www.reddit.com/r/Bitcoin/comments/unew4e/looks_like_70_mvb_of_transactions_just_got_dumped/&#34;&gt;https://www.reddit.com/r/Bitcoin/comments/unew4e/looks_like_70_mvb_of_transactions_just_got_dumped/&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [10]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/7594&#34;&gt;https://github.com/bitcoin/bitcoin/pull/7594&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [11]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/7600&#34;&gt;https://github.com/bitcoin/bitcoin/pull/7600&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [12]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/6455#issuecomment-122716820&#34;&gt;https://github.com/bitcoin/bitcoin/pull/6455#issuecomment-122716820&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [13]: &lt;a href=&#34;https://gist.github.com/sdaftuar/8756699bfcad4d3806ba9f3396d4e66a&#34;&gt;https://gist.github.com/sdaftuar/8756699bfcad4d3806ba9f3396d4e66a&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [14]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/issues/14895&#34;&gt;https://github.com/bitcoin/bitcoin/issues/14895&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [15]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/16401&#34;&gt;https://github.com/bitcoin/bitcoin/pull/16401&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [16]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/19621&#34;&gt;https://github.com/bitcoin/bitcoin/pull/19621&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [17]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019464.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019464.html&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [18]: &lt;a href=&#34;https://github.com/users/glozow/projects/5/views/4?layout=board&#34;&gt;https://github.com/users/glozow/projects/5/views/4?layout=board&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [19]: &lt;a href=&#34;https://gist.github.com/glozow/9b321cd3ef6505135c763112033ff2a7&#34;&gt;https://gist.github.com/glozow/9b321cd3ef6505135c763112033ff2a7&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [20]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://docs.google.com/presentation/d/1B__KlZO1VzxJGx-0DYChlWawaEmGJ9EGApEzrHqZpQc/edit?usp=sharing&#34;&gt;https://docs.google.com/presentation/d/1B__KlZO1VzxJGx-0DYChlWawaEmGJ9EGApEzrHqZpQc/edit?usp=sharing&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20221101/d77fa967/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20221101/d77fa967/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-08T01:16:10&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsrmccyhsucnzx7elt25ae6yqzvxqu7ramnpszltx0gs6v8lwxxwygzyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2qcwvmkk</id>
    
      <title type="html">📅 Original date posted:2022-10-27 📝 Original message:Hi AJ, ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsrmccyhsucnzx7elt25ae6yqzvxqu7ramnpszltx0gs6v8lwxxwygzyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2qcwvmkk" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsp4jpceztq86r6g4ewx99xnuu4fqwuu9sn0yzu256757avtxv49asyhgskd&#39;&gt;nevent1q…gskd&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-10-27&lt;br/&gt;📝 Original message:Hi AJ,&lt;br/&gt;&lt;br/&gt;Not going to comment on what Bitcoin Core&amp;#39;s philosophy on mempol policy is&lt;br/&gt;or should be. I want to note that I think this:&lt;br/&gt;&lt;br/&gt;&amp;gt; It&amp;#39;s also possible that this is something of a one time thing: full rbf&lt;br/&gt;&amp;gt; has been controversial for ages, but widely liked by devs, and other&lt;br/&gt;&amp;gt; attempts (eg making it available in knots) haven&amp;#39;t actually achieved&lt;br/&gt;&amp;gt; much of a result in practice. So maybe this is just a special case&lt;br/&gt;&lt;br/&gt;is true.&lt;br/&gt;&lt;br/&gt;&amp;gt; The second thing is that whatever your relay policy is, you still&lt;br/&gt;&amp;gt; need a path all the way to miners through nodes that will accept your&lt;br/&gt;&amp;gt; transaction at every step. If you&amp;#39;re making your mempool more restrictive&lt;br/&gt;&amp;gt; (eg -permitbaremultisig=0, -datacarrier=0), that&amp;#39;s easy for you (though&lt;br/&gt;&amp;gt; you&amp;#39;re making life more difficult for people who do create those sorts&lt;br/&gt;&amp;gt; of txs); but if you want a more permissive policy (package relay,&lt;br/&gt;&amp;gt; version-3-rbf, full-rbf), you might need to do some work.&lt;br/&gt;&lt;br/&gt;&amp;gt; The cutoff for that is probably something like &amp;#34;do 30% of listening&lt;br/&gt;&amp;gt; nodes have a compatible policy&amp;#34;? If they do, then you&amp;#39;ll have about a&lt;br/&gt;&amp;gt; 95% chance of having at least one of your outbound peers accept your tx,&lt;br/&gt;&amp;gt; just by random chance.&lt;br/&gt;&lt;br/&gt;Yes, in most cases, whether Bitcoin Core is restricting or loosening&lt;br/&gt;policy, the user in question is fine as long as they have a path from their&lt;br/&gt;node to a miner that will accept it. This is the case for something like&lt;br/&gt;-datacarriersize if the use case is putting stuff into OP_RETURN outputs,&lt;br/&gt;or if they&amp;#39;re LN and using CPFP carveout, v3, package relay, etc. But&lt;br/&gt;replacement is not only a question of &amp;#34;will my transaction propagate&amp;#34; but&lt;br/&gt;also, &amp;#34;will someone else&amp;#39;s transaction propagate, invalidating mine&amp;#34; or, in&lt;br/&gt;other words, &amp;#34;can I prevent someone else&amp;#39;s transaction from propagating.&amp;#34; A&lt;br/&gt;zeroconf user relies on there *not* being a path from someone else&amp;#39;s full&lt;br/&gt;RBF node to a full RBF miner. This is why I think RBF is so controversial&lt;br/&gt;in general, why -mempoolfullrbf on someone else&amp;#39;s node is considered more&lt;br/&gt;significant than another policy option, and why full RBF shouldn&amp;#39;t be&lt;br/&gt;compared with something like datacarriersize. I don&amp;#39;t think past patterns&lt;br/&gt;can be easily applied here, and I don&amp;#39;t think this necessarily shows a&lt;br/&gt;different &amp;#34;direction&amp;#34; in thinking about mempool policy in general.&lt;br/&gt;&lt;br/&gt;Best,&lt;br/&gt;Gloria&lt;br/&gt;&lt;br/&gt;On Thu, Oct 27, 2022 at 12:52 AM Anthony Towns via bitcoin-dev &amp;lt;&lt;br/&gt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hi *,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; TLDR: Yes, this post is too long, and there&amp;#39;s no TLDR. If it&amp;#39;s any&lt;br/&gt;&amp;gt; consolation, it took longer to write than it does to read?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On Tue, Jun 15, 2021 at 12:55:14PM -0400, Antoine Riard via bitcoin-dev&lt;br/&gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt; &amp;gt; Subject: Re: [bitcoin-dev] Proposal: Full-RBF in Bitcoin Core 24.0&lt;br/&gt;&amp;gt; &amp;gt; I&amp;#39;m writing to propose deprecation of opt-in RBF in favor of full-RBF&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; If there is ecosystem agreement on switching to full-RBF, but 0.24 sounds&lt;br/&gt;&amp;gt; &amp;gt; too early, let&amp;#39;s defer it to 0.25 or 0.26. I don&amp;#39;t think Core has a&lt;br/&gt;&amp;gt; &amp;gt; consistent deprecation process w.r.t to policy rules heavily relied-on by&lt;br/&gt;&amp;gt; &amp;gt; Bitcoin users, if we do so let sets a precedent satisfying as many folks&lt;br/&gt;&amp;gt; as&lt;br/&gt;&amp;gt; &amp;gt; we can.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; One precedent that seems to be being set here, which to me seems fairly&lt;br/&gt;&amp;gt; novel for bitcoin core, is that we&amp;#39;re about to start supporting and&lt;br/&gt;&amp;gt; encouraging nodes to have meaningfully different mempool policies. From&lt;br/&gt;&amp;gt; what I&amp;#39;ve seen, the baseline expectation has always been that while&lt;br/&gt;&amp;gt; certainly mempools can and will differ, policies will be largely the same:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   Firstly, there is no &amp;#34;the mempool&amp;#34;. There is no global mempool. Rather&lt;br/&gt;&amp;gt;   each node maintains its own mempool and accepts and rejects transaction&lt;br/&gt;&amp;gt;   to that mempool using their own internal policies. Most nodes have&lt;br/&gt;&amp;gt;   the same policies, but due to different start times, relay delays,&lt;br/&gt;&amp;gt;   and other factors, not every node has the same mempool, although they&lt;br/&gt;&amp;gt;   may be very similar.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   -&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://bitcoin.stackexchange.com/questions/98585/how-to-find-if-two-transactions-in-mempool-are-conflicting&#34;&gt;https://bitcoin.stackexchange.com/questions/98585/how-to-find-if-two-transactions-in-mempool-are-conflicting&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Up until now, the differences between node policies supported by different&lt;br/&gt;&amp;gt; nodes running core have been quite small, with essentially the following&lt;br/&gt;&amp;gt; options available:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;  -minrelaytxfee, -maxmempool - changes the lowest fee rate you&amp;#39;ll accept&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;  -mempoolexpiry - how long to keep txs in the mempool&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;  -datacarrier - reject txs creating OP_RETURN outputs&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;  -datacarriersize - maximum size of OP_RETURN data&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;  -permitbaremultisig - prevent relay of bare multisig&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;  -bytespersigop - changes how SIGOP accounting works for relay and&lt;br/&gt;&amp;gt;  mining prioritisation&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; as well as these, marked as &amp;#34;debug only&amp;#34; options (only shown with&lt;br/&gt;&amp;gt; -help-debug):&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;  -incrementalrelayfee - make it easier/harder to spam txs by only&lt;br/&gt;&amp;gt;  slightly bumping the fee; marked as a &amp;#34;debug only&amp;#34; option&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;  -dustrelayfee - make it easier/harder to create uneconomic utxos;&lt;br/&gt;&amp;gt;  marked as a &amp;#34;debug only&amp;#34; option&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;  -limit{descendant,ancestor}{count,size} - changes how large the&lt;br/&gt;&amp;gt;  transaction chains can be; marked as a &amp;#34;debug only&amp;#34; option&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; and in theory, but not available on mainnet:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;  -acceptnonstdtxn - relay/mine non standard transactions&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; There&amp;#39;s also the &amp;#34;prioritisetransaction&amp;#34; rpc, which can cause you to keep&lt;br/&gt;&amp;gt; a low feerate transaction in your mempool longer than you might otherwise.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think that -minrelaytxfee, -maxmempool and -mempoolexpiry are the only&lt;br/&gt;&amp;gt; ones of those options commonly set, and those only rarely result in any&lt;br/&gt;&amp;gt; differences in the txs at the top of the mempool.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; There are also quite a few parameters that aren&amp;#39;t even runtime&lt;br/&gt;&amp;gt; configurable:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;  - MAX_STANDARD_TX_WEIGHT&lt;br/&gt;&amp;gt;  - MIN_STANDARD_TX_NONWITNESS_SIZE (see also #26265)&lt;br/&gt;&amp;gt;  - MAX_P2SH_SIGOPS (see also #26348)&lt;br/&gt;&amp;gt;  - MAX_STANDARD_TX_SIGOPS_COST&lt;br/&gt;&amp;gt;  - MAX_STANDARD_P2WSH_STACK_ITEMS&lt;br/&gt;&amp;gt;  - MAX_STANDARD_P2WSH_STACK_ITEM_SIZE&lt;br/&gt;&amp;gt;  - MAX_STANDARD_TAPSCRIPT_STACK_ITEM_SIZE&lt;br/&gt;&amp;gt;  - MAX_STANDARD_P2WSH_SCRIPT_SIZE&lt;br/&gt;&amp;gt;  - MAX_STANDARD_SCRIPTSIG_SIZE&lt;br/&gt;&amp;gt;  - EXTRA_DESCENDANT_TX_SIZE_LIMIT&lt;br/&gt;&amp;gt;  - MAX_REPLACEMENT_CANDIDATES&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; And other plausible options aren&amp;#39;t configurable even at compile time&lt;br/&gt;&amp;gt; -- eg, core doesn&amp;#39;t implement BIP 125&amp;#39;s inherited signalling rule so&lt;br/&gt;&amp;gt; there&amp;#39;s no way to enable it; core doesn&amp;#39;t allow opting out of BIP 125&lt;br/&gt;&amp;gt; rule 3 ratchet on absolute fee; core doesn&amp;#39;t allow CPFP carveout with&lt;br/&gt;&amp;gt; more than 1 ancestor; core doesn&amp;#39;t allow opting out of LOW_S checks&lt;br/&gt;&amp;gt; (even via -acceptnonstdtxn); etc.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; We also naturally have different mempool policies between different&lt;br/&gt;&amp;gt; releases: eg, expansions of policy, such as allowing OP_RETURN or&lt;br/&gt;&amp;gt; expanding it from 40 to 80 bytes or new soft forks where old nodes won&amp;#39;t&lt;br/&gt;&amp;gt; relay transactions that use the new; and also occassional restrictions&lt;br/&gt;&amp;gt; in policy, such as the LOW_S requirement.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; While supporting and encouraging different mempool polices might be new&lt;br/&gt;&amp;gt; for core, it&amp;#39;s not new for knots: knots changes some of these defaults&lt;br/&gt;&amp;gt; (-permitbaremultisig defaults to false, -datacarriersize is reduced to&lt;br/&gt;&amp;gt; 42), allows the use of -acceptnonstdtxn on mainnet, and introduces new&lt;br/&gt;&amp;gt; options including -spkreuse and -mempoolreplacement (giving the latter&lt;br/&gt;&amp;gt; full rbf behaviour by default). Knots also includes a `-corepolicy`&lt;br/&gt;&amp;gt; option to make it easy to get a configuration matching core&amp;#39;s defaults.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think gmaxwell&amp;#39;s take from Feb 2015 (in the context of how restrictive&lt;br/&gt;&amp;gt; policy on OP_RETURN data should be) was a reasonable description for&lt;br/&gt;&amp;gt; core&amp;#39;s approach up until now:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   There is also a matter of driving competent design rather than lazy&lt;br/&gt;&amp;gt;   first thing that works. E.g. In stealth addresses the early proposals&lt;br/&gt;&amp;gt;   use highly inefficient single ECDH point per output instead of simply&lt;br/&gt;&amp;gt;   pooling them. Network behavior is one of the few bits of friction&lt;br/&gt;&amp;gt;   driving good technical design rather than &amp;#34;move fast, break things, and&lt;br/&gt;&amp;gt;   force everyone else onto my way of doing thing rather than discussing&lt;br/&gt;&amp;gt;   the design in public&amp;#34;. No one wants to be an outright gatekeeper,&lt;br/&gt;&amp;gt;   but the network is a shared resource and it&amp;#39;s perfectly reasonable&lt;br/&gt;&amp;gt;   node behavior to be stingy about the perpetual storage impact of the&lt;br/&gt;&amp;gt;   transactions they&amp;#39;re willing to process, especially when it comes to&lt;br/&gt;&amp;gt;   neutral technical criteria like the amount of network irrelevant data&lt;br/&gt;&amp;gt;   stuffed in transactions.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   There is also a very clear pattern we&amp;#39;ve seen in the past where&lt;br/&gt;&amp;gt;   people take anything the system lets them do as strong evidence that&lt;br/&gt;&amp;gt;   they have a irrevocable right to use the system in that way, and that&lt;br/&gt;&amp;gt;   their only responsibility-- and if their usage harms the system it&amp;#39;s&lt;br/&gt;&amp;gt;   the responsibility of the system to not permit it. [...&lt;br/&gt;&amp;gt;   ...] For mitigating these risks it&amp;#39;s optimal if transactions&lt;br/&gt;&amp;gt;   seem as uniform and indistinguishable as reasonably possible.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   - &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/5286#issuecomment-72564175&#34;&gt;https://github.com/bitcoin/bitcoin/pull/5286#issuecomment-72564175&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Perhaps see also sdaftuar in Nov 2015,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   To me the most important question is, is priority something that miners&lt;br/&gt;&amp;gt;   want to use?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   If a non-negligible amount of hashpower intends to use it in their&lt;br/&gt;&amp;gt;   transaction selection, then I think it makes sense for nodes to use it&lt;br/&gt;&amp;gt;   too, because it&amp;#39;s generally helpful to have your mempool predict the&lt;br/&gt;&amp;gt;   UTXO as much as possible, and for nodes to be able to have reasonable&lt;br/&gt;&amp;gt;   fee and priority estimates (which won&amp;#39;t happen unless they track the&lt;br/&gt;&amp;gt;   priority transactions somehow -- I&amp;#39;m presuming that miners run with&lt;br/&gt;&amp;gt;   much bigger mempools than regular nodes).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   If the answer is no, then that&amp;#39;s fine and I don&amp;#39;t see a reason to push&lt;br/&gt;&amp;gt;   in this direction. I sort of assumed there was enough hashpower mining&lt;br/&gt;&amp;gt;   with priority, since last time I checked estimatepriority was still&lt;br/&gt;&amp;gt;   giving meaningful results for low-ish blockheights, but I haven&amp;#39;t done&lt;br/&gt;&amp;gt;   any kind of real analysis.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   - &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/6992#issuecomment-155969455&#34;&gt;https://github.com/bitcoin/bitcoin/pull/6992#issuecomment-155969455&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; or in June 2019,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   What this PR is proposing is to get rid of a command-line option that is&lt;br/&gt;&amp;gt;   (a) a footgun for users and (b) does not reflect what I believe to be&lt;br/&gt;&amp;gt;   the understanding most users have, which is that [X txs] are expected&lt;br/&gt;&amp;gt;   to propagate well on the network.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   ..&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   I don&amp;#39;t think this rises to the level that Luke is concerned about,&lt;br/&gt;&amp;gt;   namely a prelude to forcing a common relay policy on all nodes. In&lt;br/&gt;&amp;gt;   particular I do agree it makes sense that we offer some ways of&lt;br/&gt;&amp;gt;   customizing policy parameters (eg the mempool size, min relay fee,&lt;br/&gt;&amp;gt;   etc). Instead, I think the justification for this change is that we&lt;br/&gt;&amp;gt;   should not support behaviors we think are harmful to the ecosystem&lt;br/&gt;&amp;gt;   overall and have no legitimate use-case, and we should eliminate ways&lt;br/&gt;&amp;gt;   that users might inadvertently shoot themselves in the foot.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   - &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/16171#issuecomment-500393271&#34;&gt;https://github.com/bitcoin/bitcoin/pull/16171#issuecomment-500393271&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; (or see discussion in &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/7219&#34;&gt;https://github.com/bitcoin/bitcoin/pull/7219&lt;/a&gt;)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I don&amp;#39;t mean to imply the above are saying &amp;#34;there&amp;#39;s one way to do&lt;br/&gt;&amp;gt; things and it&amp;#39;s this way&amp;#34;, or that the old way of doing things should&lt;br/&gt;&amp;gt; necessarily be the way we keep doing things. Just that previously core&lt;br/&gt;&amp;gt; has tended towards designing a single policy that works as well as it&lt;br/&gt;&amp;gt; can for everyone and the ecosystem as a whole. (I&amp;#39;m also not saying that&lt;br/&gt;&amp;gt; fullrbf can&amp;#39;t work well for everyone or the ecosystem as a whole)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; By contrast, I think the most common response to pushback against the&lt;br/&gt;&amp;gt; full rbf option has been along the lines of &amp;#34;it&amp;#39;s just an option, we&lt;br/&gt;&amp;gt; don&amp;#39;t want to force people&amp;#34;, eg:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   Blaming the default false -mempoolfullrbf option for a full RBF network&lt;br/&gt;&amp;gt;   would be holding Bitcoin Core developers responsible for the decisions&lt;br/&gt;&amp;gt;   of individual node operators and miners. I don&amp;#39;t think having the&lt;br/&gt;&amp;gt;   option (again, default false) can directly cause a full RBF network,&lt;br/&gt;&amp;gt;   and likewise, I don&amp;#39;t think removing this option removes the &amp;#34;risk&amp;#34;&lt;br/&gt;&amp;gt;   of a full RBF network.&lt;br/&gt;&amp;gt;    - glozow&lt;br/&gt;&amp;gt;      &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/26287#issuecomment-1274949400&#34;&gt;https://github.com/bitcoin/bitcoin/pull/26287#issuecomment-1274949400&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   NACK. This is a default false option.&lt;br/&gt;&amp;gt;    - achow101&lt;br/&gt;&amp;gt;      &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/26287#issuecomment-1274953204&#34;&gt;https://github.com/bitcoin/bitcoin/pull/26287#issuecomment-1274953204&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   Erecting artificial barriers to prevent or make it difficult for users&lt;br/&gt;&amp;gt;   to do what they want to do, is not appropriate behaviour.&lt;br/&gt;&amp;gt;    - luke-jr&lt;br/&gt;&amp;gt;      &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/26287#issuecomment-1290721905&#34;&gt;https://github.com/bitcoin/bitcoin/pull/26287#issuecomment-1290721905&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   I&amp;#39;m in general against removing options.&lt;br/&gt;&amp;gt;    - instagibbs&lt;br/&gt;&amp;gt;      &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/26287#issuecomment-1292030700&#34;&gt;https://github.com/bitcoin/bitcoin/pull/26287#issuecomment-1292030700&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think this differs from what core has done in the past, in that&lt;br/&gt;&amp;gt; previously we&amp;#39;ve tried to ensure a new policy is good for everyone (or as&lt;br/&gt;&amp;gt; nearly as it can be), and then enabled it as soon as it&amp;#39;s implemented.&lt;br/&gt;&amp;gt; Any options that have been added have either been to control resource&lt;br/&gt;&amp;gt; usage in ways that don&amp;#39;t significantly effect tx propagation, to&lt;br/&gt;&amp;gt; allow people to revert to the old behaviour when the new behaviour is&lt;br/&gt;&amp;gt; controversial (eg the -mempoolreplacement=0 option from 0.12 to 0.18),&lt;br/&gt;&amp;gt; and to make it easier to test/debug the implementation.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Giving people a new relay behaviour they can opt-in to when we aren&amp;#39;t&lt;br/&gt;&amp;gt; confident enough to turn on by default doesn&amp;#39;t match the approach I&amp;#39;ve&lt;br/&gt;&amp;gt; seen core take in the past.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If this is going to be an ongoing shift in how core sees relay/mempool&lt;br/&gt;&amp;gt; policy, I think that&amp;#39;s significant and worth paying attention to.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I don&amp;#39;t think it&amp;#39;s necessary to have that shift to roll out full rbf.&lt;br/&gt;&amp;gt; The other approach would be either:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;  * set -mempoolfullrbf=true as the default for 24.0, and just have the&lt;br/&gt;&amp;gt;    command line param there in case people want to do a&lt;br/&gt;&amp;gt;    &amp;#34;UserRejectedMempoolPolicy&amp;#34; campaign to get everyone to opt-out&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;  * revert it for now because we don&amp;#39;t think mainnet is ready for fullrbf&lt;br/&gt;&amp;gt;    yet, and introduce it as default true for 25.0 or 26.0 or 27.0 or&lt;br/&gt;&amp;gt;    to activate at some scheduled date in that timeframe (potentially&lt;br/&gt;&amp;gt;    backporting it to previous releases to help with adoption too,&lt;br/&gt;&amp;gt;    whatever). same effect as the previous option, just with a bit more&lt;br/&gt;&amp;gt;    advanced notice and time to prepare&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I don&amp;#39;t think anyone&amp;#39;s proposed the first (which I interpret as &amp;#34;most of&lt;br/&gt;&amp;gt; us don&amp;#39;t think mainnet is ready for fullrbf today&amp;#34;), but the comments&lt;br/&gt;&amp;gt; above are all pushback by people arguing against (the first step of)&lt;br/&gt;&amp;gt; the second approach, and they seem to be winning the day.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; It&amp;#39;s also possible that this is something of a one time thing: full rbf&lt;br/&gt;&amp;gt; has been controversial for ages, but widely liked by devs, and other&lt;br/&gt;&amp;gt; attempts (eg making it available in knots) haven&amp;#39;t actually achieved&lt;br/&gt;&amp;gt; much of a result in practice. So maybe this is just a special case and&lt;br/&gt;&amp;gt; not a precedent, and when people propose other default false options,&lt;br/&gt;&amp;gt; there will be substantially more resistance to them being merged,&lt;br/&gt;&amp;gt; despite all the talk about users having options that&amp;#39;s going on right now.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Assuming it is the change of direction it appears to be -- and all of&lt;br/&gt;&amp;gt; the above is really just justification for that assumption -- then like&lt;br/&gt;&amp;gt; I said, I think it&amp;#39;s worth seriously considering what it means for people&lt;br/&gt;&amp;gt; to choose their own relay/mempool policies and for you to expect to have&lt;br/&gt;&amp;gt; different mempool policies to many or most of your potential peers.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; One thing maybe worth noting is that is that you can still only choose&lt;br/&gt;&amp;gt; your policy from options that people write code for -- if it wasn&amp;#39;t&lt;br/&gt;&amp;gt; something you could get by running knots or compiling a rejected PR&lt;br/&gt;&amp;gt; yourself, it won&amp;#39;t magically become more possible now.  Presumably it&lt;br/&gt;&amp;gt; would mean that once a PR is written, it might get better review (rather&lt;br/&gt;&amp;gt; than being dismissed as not suitable for everyone), and there would be&lt;br/&gt;&amp;gt; less maintenance burden than if it had to be manually rebased every&lt;br/&gt;&amp;gt; release, though (or at least the maintenance burden would be shared&lt;br/&gt;&amp;gt; across everyone working on the codebase).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The second thing is that whatever your relay policy is, you still&lt;br/&gt;&amp;gt; need a path all the way to miners through nodes that will accept your&lt;br/&gt;&amp;gt; transaction at every step. If you&amp;#39;re making your mempool more restrictive&lt;br/&gt;&amp;gt; (eg -permitbaremultisig=0, -datacarrier=0), that&amp;#39;s easy for you (though&lt;br/&gt;&amp;gt; you&amp;#39;re making life more difficult for people who do create those sorts&lt;br/&gt;&amp;gt; of txs); but if you want a more permissive policy (package relay,&lt;br/&gt;&amp;gt; version-3-rbf, full-rbf), you might need to do some work.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The cutoff for that is probably something like &amp;#34;do 30% of listening&lt;br/&gt;&amp;gt; nodes have a compatible policy&amp;#34;? If they do, then you&amp;#39;ll have about a&lt;br/&gt;&amp;gt; 95% chance of having at least one of your outbound peers accept your tx,&lt;br/&gt;&amp;gt; just by random chance. If erlay allows increasing your outbound count to&lt;br/&gt;&amp;gt; 12 connections instead of 8; that might reduce down to needing just 20%&lt;br/&gt;&amp;gt; of listening nodes (~93%).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; But for cases where less than 30% (20%) of network supports your preferred&lt;br/&gt;&amp;gt; policy, you probably need to do something cleverer.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; One approach is to set a service bit and preferentially peer with other&lt;br/&gt;&amp;gt; nodes that advertise that service bit; knots does the first half of this&lt;br/&gt;&amp;gt; for fullrbf, and both halves have been proposed for core in #25600.&lt;br/&gt;&amp;gt; Preferential peering was previously done for the segwit deployment,&lt;br/&gt;&amp;gt; though in that case it was necessary not just for tx propogation but&lt;br/&gt;&amp;gt; also for ensuring block propogation, making it effectively a consensus&lt;br/&gt;&amp;gt; critical issue.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Another approach is having a separate relay network -- eg, lightning nodes&lt;br/&gt;&amp;gt; already have a gossip network, and might want to help their own ecosystem&lt;br/&gt;&amp;gt; by ensuring unilateral channel closes and justice transactions are quickly&lt;br/&gt;&amp;gt; relayed. Using their own gossip network to relay the transaction around,&lt;br/&gt;&amp;gt; and each lightning node adding it to their local bitcoind&amp;#39;s mempool and&lt;br/&gt;&amp;gt; allowing it to propogate (or not) from there as normal, would also be a&lt;br/&gt;&amp;gt; way of allowing transactions to propogate well. It does mean that miners&lt;br/&gt;&amp;gt; would either need to also participate in lightning gossip directly, or&lt;br/&gt;&amp;gt; that miners would need to connect to *many* peers to be confident of&lt;br/&gt;&amp;gt; seeing those transactions (eg, if only 2% of the network would see a&lt;br/&gt;&amp;gt; tx, you&amp;#39;d need to make 228 connections to have a 99% chance of seeing&lt;br/&gt;&amp;gt; the tx). You can&amp;#39;t currently do something like this, because all the&lt;br/&gt;&amp;gt; relay policies are also applied when adding txs to the mempool via RPC,&lt;br/&gt;&amp;gt; and there&amp;#39;s no convenient way to remove txs from the mempool.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; A case where something like that might occur is in preventing L2&lt;br/&gt;&amp;gt; transactions from pinning attacks -- so you might have a high-fee,&lt;br/&gt;&amp;gt; low-feerate transaction that&amp;#39;s been widely propogated, sitting in the&lt;br/&gt;&amp;gt; bottom of people&amp;#39;s mempools, and you want to replace it with a smaller,&lt;br/&gt;&amp;gt; higher-feerate transaction, but don&amp;#39;t want to pay a higher absolute fee,&lt;br/&gt;&amp;gt; and are thus blocked by BIP 125 rule 3. Perhaps 98% of the network is&lt;br/&gt;&amp;gt; unwilling to deviate from BIP 125 rule 3 for you; because that would&lt;br/&gt;&amp;gt; make it easy for random griefers to spam their mempool with large txs&lt;br/&gt;&amp;gt; then delete them while only paying a small fee; but your L2 peers may be&lt;br/&gt;&amp;gt; able to decode your replacement transaction and be sure that you aren&amp;#39;t&lt;br/&gt;&amp;gt; going to spam them, and thus will happily relay it.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; From a technical point-of-view, that&amp;#39;s largely fine; the downside is it&lt;br/&gt;&amp;gt; increases the centralisation pressure on mining: whether that&amp;#39;s by having&lt;br/&gt;&amp;gt; to connect to substantially more nodes, or having to parse through more&lt;br/&gt;&amp;gt; spam, you can&amp;#39;t just run your mining operation off a standard install&lt;br/&gt;&amp;gt; of bitcoin core anymore, but need to actively opt-in to find all the&lt;br/&gt;&amp;gt; weird unusual ways people are sending transactions around in order to&lt;br/&gt;&amp;gt; actually collect as much in fees as your competitors are.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; That&amp;#39;s probably moderately bad for privacy as well -- if lightning or&lt;br/&gt;&amp;gt; coinjoins need special relay rules that most nodes haven&amp;#39;t opted into,&lt;br/&gt;&amp;gt; it&amp;#39;s potentially easy to use that to find the bitcoin nodes on the&lt;br/&gt;&amp;gt; network that are participating in those protocols, and from there to&lt;br/&gt;&amp;gt; either identify the operator, or run a DoS attack to make it hard for you&lt;br/&gt;&amp;gt; to keep doing what you want. Obviously if you&amp;#39;re setting a service bit to&lt;br/&gt;&amp;gt; get better routing, you&amp;#39;ve given up that privacy already. Likewise if the&lt;br/&gt;&amp;gt; government or random vandals are opposed to bitcoin mining, and miners&lt;br/&gt;&amp;gt; have to have special configuration on their nodes that distinguish them&lt;br/&gt;&amp;gt; from regular users, then perhaps that makes it easier to find or shut&lt;br/&gt;&amp;gt; down their operations.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; There are a few efficiencies to be gained from similar mempool policies as&lt;br/&gt;&amp;gt; well: more reliable compact block reconstruction (if you&amp;#39;re not missing&lt;br/&gt;&amp;gt; any transactions, you avoid a round-trip) and presumably more efficient&lt;br/&gt;&amp;gt; set reconstruction with erlay. You&amp;#39;ll also waste less bandwidth sending&lt;br/&gt;&amp;gt; transactions that the other node is only going to reject. Both those&lt;br/&gt;&amp;gt; depend on how many transactions are going to rely on unusual mempool&lt;br/&gt;&amp;gt; policies in the first place though.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ariard wrote:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   I know I&amp;#39;ve advocated in the past to turn RBF support by default in&lt;br/&gt;&amp;gt;   the past. Though after gathering a lot of feedbacks, this approach&lt;br/&gt;&amp;gt;   of offering the policy flexiblity to the interested users only and&lt;br/&gt;&amp;gt;   favoring a full-rbf gradual deployment sounds better to me.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   - &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/25353#issuecomment-1157137026&#34;&gt;https://github.com/bitcoin/bitcoin/pull/25353#issuecomment-1157137026&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I guess all the above leads me to think that gradual deployments of&lt;br/&gt;&amp;gt; mempool policies are likely the worse approach: even when they&amp;#39;re not&lt;br/&gt;&amp;gt; hurting anyone, it makes them hard to use during the gradual phase,&lt;br/&gt;&amp;gt; and getting around that comes with worrying compromises on privacy and&lt;br/&gt;&amp;gt; centralisation; and when they are problematic for some, the indeterminate&lt;br/&gt;&amp;gt; nature of a gradual deployment means it&amp;#39;s hard to plan for when that&lt;br/&gt;&amp;gt; risk is going to eventuate.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Theoretically, one way to recover the good parts of core deciding on&lt;br/&gt;&amp;gt; what&amp;#39;s good for the network might be for people outside of core to&lt;br/&gt;&amp;gt; recommend a mempool configuration; then core can just have an option&lt;br/&gt;&amp;gt; to make that easy, similar to &amp;#34;-std=c&#43;&#43;17&amp;#34; for a C&#43;&#43; compiler, and much&lt;br/&gt;&amp;gt; the same as knots&amp;#39; &amp;#34;-corepolicy&amp;#34; option.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Presuming anyone actually wants to take on that job, and listen to the&lt;br/&gt;&amp;gt; concerns of zeroconf businesses, lightning and coinjoin devs, miners, etc;&lt;br/&gt;&amp;gt; and can come up with something that keeps most of them happy, and that&lt;br/&gt;&amp;gt; 70% or 90% of the network ends up just following those recommendations&lt;br/&gt;&amp;gt; because it&amp;#39;s easy, it works, and it&amp;#39;s recommended by all the apps they&lt;br/&gt;&amp;gt; want to use, then that could work great:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;  * miners don&amp;#39;t need to do anything special, so there&amp;#39;s no new&lt;br/&gt;&amp;gt;    mining centralisation pressure&lt;br/&gt;&amp;gt;  * miners and users don&amp;#39;t reveal what they&amp;#39;re doing with bitcoin by the way&lt;br/&gt;&amp;gt;    they configure their nodes, so there&amp;#39;s no privacy problems&lt;br/&gt;&amp;gt;  * devs can be fairly confident in how they have to design their apps&lt;br/&gt;&amp;gt;    in order to get their transactions to most hashpower&lt;br/&gt;&amp;gt;  * devs don&amp;#39;t have to add new p2p layers to make it happen&lt;br/&gt;&amp;gt;  * at least there&amp;#39;s someone to talk to when you&amp;#39;re trying to figure out&lt;br/&gt;&amp;gt;    how to make some new project possible when it&amp;#39;s inhibited by current&lt;br/&gt;&amp;gt;    relay policies and you don&amp;#39;t have to try to convince everyone to&lt;br/&gt;&amp;gt;    upgrade on your own&lt;br/&gt;&amp;gt;  * core devs just provide options, and don&amp;#39;t have to worry about being&lt;br/&gt;&amp;gt;    seen as gatekeepers&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The &amp;#34;downside&amp;#34; in that scenario is that users/dev aren&amp;#39;t making much&lt;br/&gt;&amp;gt; actual use of all the choices core is offering by making different&lt;br/&gt;&amp;gt; options available; but the upside is that that choice is at least readily&lt;br/&gt;&amp;gt; available should whoever is coming up with these policy become out of&lt;br/&gt;&amp;gt; step with what people actually want.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; One thing that might make an approach like that difficult is that core&lt;br/&gt;&amp;gt; has historically been happy to remove options that don&amp;#39;t seem useful&lt;br/&gt;&amp;gt; anymore: eg the ability to turn of BIP 125 support (#16171), and priority&lt;br/&gt;&amp;gt; transactions (#9602). Perhaps that&amp;#39;s fine if you&amp;#39;re trying to actively&lt;br/&gt;&amp;gt; craft a single mempool/relay policy that&amp;#39;s good enough for almost everyone&lt;br/&gt;&amp;gt; (after all, it makes the code simpler and more efficient, and reduces&lt;br/&gt;&amp;gt; the number of footguns); all you&amp;#39;re doing is leaving a minority of people&lt;br/&gt;&amp;gt; who want weird things to run a fork, and that&amp;#39;s going to happen anyway.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; But if people are following policy developed outside of core, core&lt;br/&gt;&amp;gt; might well disagree with them and decide &amp;#34;no that&amp;#39;s a stupid policy,&lt;br/&gt;&amp;gt; no one should do that&amp;#34; and remove some feature that others thing should&lt;br/&gt;&amp;gt; continue to be normal. Beyond the examples above, there&amp;#39;s already talk of&lt;br/&gt;&amp;gt; removing the ability to disable fullrbf support in #26305, for instance.&lt;br/&gt;&amp;gt; If that happens, then the people maintaining the policy will instead&lt;br/&gt;&amp;gt; end up maintaining an entire fork of bitcoin core, and all we&amp;#39;ve done&lt;br/&gt;&amp;gt; is transition to people running software from a different repo, and a&lt;br/&gt;&amp;gt; different set of maintainers.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If we&amp;#39;re really going to a world where core&amp;#39;s eager to add new options,&lt;br/&gt;&amp;gt; and reluctant to remove them, at least if anyone at all finds them&lt;br/&gt;&amp;gt; interesting, that&amp;#39;s presumably a non-issue, though.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; aj&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20221027/1d0aaf6c/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20221027/1d0aaf6c/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-08T01:15:55&#43;02:00</updated>
  </entry>

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

  <entry>
    <id>https://nostr.ae/nevent1qqszxe2ue50a4su8rkqpk2t033xlq2z0sj754ms7tr67s45f7rm723szyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2q4dmy7e</id>
    
      <title type="html">📅 Original date posted:2022-09-23 📝 Original message:Hi ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqszxe2ue50a4su8rkqpk2t033xlq2z0sj754ms7tr67s45f7rm723szyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2q4dmy7e" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs24z5dr8mkzdeefn9n26zx8ye6lnxlr2tnank63hd9unysv868pushrswfp&#39;&gt;nevent1q…swfp&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-09-23&lt;br/&gt;📝 Original message:Hi everyone,&lt;br/&gt;&lt;br/&gt;I&amp;#39;m writing to propose a very simple set of mempool/transaction relay&lt;br/&gt;policies intended to aid L2/contract protocols. I realized that&lt;br/&gt;the previously proposed Package Mempool Accept package RBF [1]&lt;br/&gt;had a few remaining problems after digging into the RBF logic more [2].&lt;br/&gt;This additional set of policies solves them without requiring a huge RBF&lt;br/&gt;overhaul.&lt;br/&gt;&lt;br/&gt;I&amp;#39;ve written an implementation (and docs) for Bitcoin Core:&lt;br/&gt;&lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/25038&#34;&gt;https://github.com/bitcoin/bitcoin/pull/25038&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;(You may notice that this proposal incorporates feedback on the PR - thanks&lt;br/&gt;Suhas Daftuar, Gregory Sanders, Bastien Teinturier, Anthony Towns, and&lt;br/&gt;others.)&lt;br/&gt;&lt;br/&gt;If you are interested in using package RBF/relay to bump presigned&lt;br/&gt;transactions, I think you may be interested in reviewing this proposal.&lt;br/&gt;This should solve Rule 3 pinning and perhaps allow us&lt;br/&gt;to get rid of CPFP carve-out (yay!). I&amp;#39;m keen to hear if people find&lt;br/&gt;the 1-anchor-output, 1000vB child limit too restrictive. Also, if you find a&lt;br/&gt;pinning attack or something that makes it unusable for you, I would&lt;br/&gt;really really like to know.&lt;br/&gt;&lt;br/&gt;Note that transactions with nVersion=3 (&amp;#34;V3 transactions&amp;#34;) are&lt;br/&gt;currently non-standard in Bitcoin Core. That means **anything that was&lt;br/&gt;standard before this policy change would still be standard&lt;br/&gt;afterwards.** If you don&amp;#39;t want your transactions to be subject to&lt;br/&gt;these rules, just continue whatever you&amp;#39;re doing and don&amp;#39;t use&lt;br/&gt;nVersion=3. AFAICT this shouldn&amp;#39;t break anything, but let me know if&lt;br/&gt;this would be disruptive for you?&lt;br/&gt;&lt;br/&gt;**New Policies:**&lt;br/&gt;&lt;br/&gt;This includes:&lt;br/&gt;- a set of additional policy rules applying to V3 transactions&lt;br/&gt;- modifications to package RBF rules&lt;br/&gt;&lt;br/&gt;**V3 transactions:**&lt;br/&gt;&lt;br/&gt;Existing standardness rules apply to V3 (e.g. min/max tx weight,&lt;br/&gt;standard output types, cleanstack, etc.). The following additional&lt;br/&gt;rules apply to V3:&lt;br/&gt;&lt;br/&gt;1. A V3 transaction can be replaced, even if it does not signal BIP125&lt;br/&gt;   replaceability. (It must also meet the other RBF rules around fees,&lt;br/&gt;etc. for replacement to happen).&lt;br/&gt;&lt;br/&gt;2. Any descendant of an unconfirmed V3 transaction must also be V3.&lt;br/&gt;&lt;br/&gt;*Rationale*: Combined with Rule 1, this gives us the property of&lt;br/&gt;&amp;#34;inherited&amp;#34; replaceability signaling when descendants of unconfirmed&lt;br/&gt;transactions are created. Additionally, checking whether a transaction&lt;br/&gt;signals replaceability this way does not require mempool traversal,&lt;br/&gt;and does not change based on what transactions are mined. It also&lt;br/&gt;makes subsequent rules about descendant limits much easier to check.&lt;br/&gt;&lt;br/&gt;*Note*: The descendant of a *confirmed* V3 transaction does not need to be&lt;br/&gt;V3.&lt;br/&gt;&lt;br/&gt;3. An unconfirmed V3 transaction cannot have more than 1 descendant.&lt;br/&gt;&lt;br/&gt;*Rationale*: (Upper bound) the larger the descendant limit, the more&lt;br/&gt;transactions may need to be replaced. This is a problematic pinning&lt;br/&gt;attack, i.e., a malicious counterparty prevents the transaction from&lt;br/&gt;being replaced by adding many descendant transactions that aren&amp;#39;t&lt;br/&gt;fee-bumping.&lt;br/&gt;&lt;br/&gt;(Lower bound) at least 1 descendant is required to allow CPFP of the&lt;br/&gt;presigned transaction. The contract protocol can create presigned&lt;br/&gt;transactions paying 0 fees and 1 output for attaching a CPFP at&lt;br/&gt;broadcast time (&amp;#34;anchor output&amp;#34;). Without package RBF, multiple anchor&lt;br/&gt;outputs would be required to allow each counterparty to fee-bump any&lt;br/&gt;presigned transaction. With package RBF, since the presigned&lt;br/&gt;transactions can replace each other, 1 anchor output is sufficient.&lt;br/&gt;&lt;br/&gt;4. A V3 transaction that has an unconfirmed V3 ancestor cannot be&lt;br/&gt;   larger than 1000 virtual bytes.&lt;br/&gt;&lt;br/&gt;*Rationale*: (Upper bound) the larger the descendant size limit, the&lt;br/&gt;more vbytes may need to be replaced. With default limits, if the child&lt;br/&gt;is e.g. 100,000vB, that might be an additional 100,000sats (at&lt;br/&gt;1sat/vbyte) or more, depending on the feerate.&lt;br/&gt;&lt;br/&gt;(Lower bound) the smaller this limit, the fewer UTXOs a child may use&lt;br/&gt;to fund this fee-bump. For example, only allowing the V3 child to have&lt;br/&gt;2 inputs would require L2 protocols to manage a wallet with high-value&lt;br/&gt;UTXOs and make batched fee-bumping impossible. However, as the&lt;br/&gt;fee-bumping child only needs to fund fees (as opposed to payments),&lt;br/&gt;just a few UTXOs should suffice.&lt;br/&gt;&lt;br/&gt;With a limit of 1000 virtual bytes, depending on the output types, the&lt;br/&gt;child can have 6-15 UTXOs, which should be enough to fund a fee-bump&lt;br/&gt;without requiring a carefully-managed UTXO pool. With 1000 virtual&lt;br/&gt;bytes as the descendant limit, the cost to replace a V3 transaction&lt;br/&gt;has much lower variance.&lt;br/&gt;&lt;br/&gt;*Rationale*: This makes the rule very easily &amp;#34;tacked on&amp;#34; to existing&lt;br/&gt;logic for policy and wallets. A transaction may be up to 100KvB on its&lt;br/&gt;own (`MAX_STANDARD_TX_WEIGHT`) and 101KvB with descendants&lt;br/&gt;(`DEFAULT_DESCENDANT_SIZE_LIMIT_KVB`). If an existing V3 transaction&lt;br/&gt;in the mempool is 100KvB, its descendant can only be 1000vB, even if&lt;br/&gt;the policy is 10KvB.&lt;br/&gt;&lt;br/&gt;**Package RBF modifications:**&lt;br/&gt;&lt;br/&gt;1. The rule around unconfirmed inputs was&lt;br/&gt;originally &amp;#34;A package may include new unconfirmed inputs, but the&lt;br/&gt;ancestor feerate of the child must be at least as high as the ancestor&lt;br/&gt;feerates of every transaction being replaced.&amp;#34;&lt;br/&gt;&lt;br/&gt;The package may still include new unconfirmed inputs. However,&lt;br/&gt;the new rule is modified to be &amp;#34;The minimum between package feerate&lt;br/&gt;and ancestor feerate of the child is not lower than the individual&lt;br/&gt;feerates of all directly conflicting transactions and the ancestor&lt;br/&gt;feerates of all original transactions.&amp;#34;&lt;br/&gt;&lt;br/&gt;*Rationale*: We are attempting to ensure that the replacement&lt;br/&gt;transactions are not less incentive-compatible to mine. However, a&lt;br/&gt;package/transaction&amp;#39;s ancestor feerate is not perfectly representative&lt;br/&gt;of its incentive compatibility; it may overestimate (some subset of&lt;br/&gt;the ancestors could be included by itself if it has other high-feerate&lt;br/&gt;descendants or are themselves higher feerate than this&lt;br/&gt;package/transaction). Instead, we use the minimum between the package&lt;br/&gt;feerate and ancestor feerate of the child as a more conservative value&lt;br/&gt;than what was proposed originally.&lt;br/&gt;&lt;br/&gt;2. A new rule is added, requiring that all package transactions with&lt;br/&gt;mempool conflicts to be V3. This also means the &amp;#34;sponsoring&amp;#34;&lt;br/&gt;child transaction must be V3.&lt;br/&gt;&lt;br/&gt;*Note*: Combined with the V3 rules, this means the package must be&lt;br/&gt;a child-with-parents package. Since package validation is only&lt;br/&gt;attempted if the transactions do not pay sufficient fees to be&lt;br/&gt;accepted on their own, this effectively means that only V3&lt;br/&gt;transactions can pay to replace their ancestors&amp;#39; conflicts, and only&lt;br/&gt;V3 transactions&amp;#39; replacements may be paid for by a descendant.&lt;br/&gt;&lt;br/&gt;*Rationale*: The fee-related rules are economically rational for&lt;br/&gt;ancestor packages, but not necessarily other types of packages.&lt;br/&gt;A child-with-parents package is a type of ancestor package. It&lt;br/&gt;may be fine to allow any ancestor package, but it&amp;#39;s more difficult&lt;br/&gt;to account for all of the possibilities. For example, it gets much&lt;br/&gt;harder to see that we&amp;#39;re applying the descendant limits correctly if&lt;br/&gt;the package has a gnarly, many-generation, non-tree shape. I&amp;#39;m also&lt;br/&gt;not sure if this policy is 100% incentive-compatible if the sponsor&lt;br/&gt;is not a direct descendant of the sponsee.&lt;br/&gt;&lt;br/&gt;Please see doc/policy/version3_transactions.md and&lt;br/&gt;doc/policy/packages.md in the PR for the full set of rules.&lt;br/&gt;&lt;br/&gt;**Intended usage for LN:**&lt;br/&gt;&lt;br/&gt;Commitment transactions should be V3 and have 1 anchor output. They&lt;br/&gt;can be signed with 0 fees (or 1sat/vbyte) once package relay is deployed&lt;br/&gt;on a significant portion of the network. If the commitment tx must&lt;br/&gt;be broadcast, determine the desired feerate at broadcast time and&lt;br/&gt;spend the anchor output in a high feerate transaction. I&amp;#39;m going to&lt;br/&gt;call the broadcasted commitment tx &amp;#34;the parent&amp;#34; and the attached&lt;br/&gt;fee-bumping tx &amp;#34;the child.&amp;#34;&lt;br/&gt;&lt;br/&gt;- This child must be V3.&lt;br/&gt;- This child must be at most 1000vB. Note this restricts the&lt;br/&gt;  number of inputs you can use to fund the fee bump. Depending&lt;br/&gt;on the output types, this is around 6-15.&lt;br/&gt;- One child may fund fees for multiple commitment tx (&amp;#34;batched&lt;br/&gt;  fee-bumping&amp;#34;).&lt;br/&gt;- To do a second fee-bump to add more fees, replace the&lt;br/&gt;  *child* with a higher-feerate tx. Do not try to attach a grandchild.&lt;br/&gt;&lt;br/&gt;Otherwise, never try to spend from an unconfirmed V3 transaction. The&lt;br/&gt;descendant limits for V3 transactions are very restrictive.&lt;br/&gt;&lt;br/&gt;**Expected Questions:**&lt;br/&gt;&lt;br/&gt;&amp;#34;Does this fix Rule 3 Pinning?&amp;#34;&lt;br/&gt;Yes. The V3 descendant limit restricts both you and your counterparty.&lt;br/&gt;Assuming nodes adopted this policy, you may reasonably assume that you&lt;br/&gt;only need to replace the commitment transaction &#43; up to 1000vB.&lt;br/&gt;&lt;br/&gt;&amp;#34;Only 1 anchor output? What if I need to bump counterparty&amp;#39;s commitment tx&lt;br/&gt;in mempool?&amp;#34;&lt;br/&gt;You won&amp;#39;t need to fee-bump a counterparty&amp;#39;s commitment tx using CPFP.&lt;br/&gt;You would just package RBF it by attaching a high-feerate child to&lt;br/&gt;your commitment tx.&lt;br/&gt;&lt;br/&gt;&amp;#34;Is this a privacy issue, i.e. doesn&amp;#39;t it allow fingerprinting LN&lt;br/&gt;transactions based on nVersion?&amp;#34;&lt;br/&gt;Indeed it may be unrealistic to assume V3 transactions will be in&lt;br/&gt;widespread use outside of L2. IIUC, unilateral closes are already&lt;br/&gt;obvious LN transactions because of the HTLC inputs. For e.g.&lt;br/&gt;cooperative closes and opens, I think it makes sense to continue using&lt;br/&gt;V2. So, unless I&amp;#39;m missing something, this shouldn&amp;#39;t make it worse.&lt;br/&gt;&lt;br/&gt;&amp;#34;So a V3 transaction that doesn&amp;#39;t signal BIP125 replaceability is&lt;br/&gt;replaceable? Is that a backward compatibility issue?&amp;#34;&lt;br/&gt;Yes it&amp;#39;s replaceable. It&amp;#39;s not an issue AFAICT because,&lt;br/&gt;under previous policy, the V3 transaction wouldn&amp;#39;t have been&lt;br/&gt;in the mempool in the first place.&lt;br/&gt;&lt;br/&gt;&amp;#34;Can a V2 transaction replace a V3 transaction and vice versa?&amp;#34;&lt;br/&gt;Yes, otherwise someone can use V3 transactions to censor V2&lt;br/&gt;transactions spending shared inputs. Note if the&lt;br/&gt;original V3 transaction has an unconfirmed V3 parent, this would&lt;br/&gt;violate the &amp;#34;inherited V3&amp;#34; rule and would be rejected.&lt;br/&gt;&lt;br/&gt;Thanks for reading! Feedback and review would be much appreciated.&lt;br/&gt;&lt;br/&gt;[1]:&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019464.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019464.html&lt;/a&gt;&lt;br/&gt;[2]:&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-January/019817.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-January/019817.html&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Best,&lt;br/&gt;Gloria&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220923/9b52c0c4/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220923/9b52c0c4/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-08T01:13:42&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqs9z74k8a2w2pwng79vwh7zxulew7ufujkyuv0g93vst0cu6chp2pczyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2qshq8j3</id>
    
      <title type="html">📅 Original date posted:2022-05-23 📝 Original message:Hi aj, ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqs9z74k8a2w2pwng79vwh7zxulew7ufujkyuv0g93vst0cu6chp2pczyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2qshq8j3" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsqcq7tktkf4z03qeeddrf5m9d84p7sh2c2420nzmnvlv5sghfnmkqyhjjcz&#39;&gt;nevent1q…jjcz&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-05-23&lt;br/&gt;📝 Original message:Hi aj,&lt;br/&gt;&lt;br/&gt;&amp;gt; if you&amp;#39;re writing a protocol that&amp;#39;s&lt;br/&gt;&amp;gt; dependent on people seeing that a package as a whole pays a competitive&lt;br/&gt;&amp;gt; feerate, don&amp;#39;t you want to know in advance what conditions the network&lt;br/&gt;&amp;gt; is going to impose on your transactions in order to consider them as a&lt;br/&gt;&amp;gt; package?&lt;br/&gt;&lt;br/&gt;I do think unifying the size/count constraints would result in a more&lt;br/&gt;stable/easier to reason about interface for L2 devs. Then the requirement&lt;br/&gt;for propagation is just a path of nodes that support v1 package relay, and&lt;br/&gt;it’s implied their mempool policy supports it as well. Also seems like it&lt;br/&gt;could be a fingerprinting problem for nodes to give very specific&lt;br/&gt;count/size limits.&lt;br/&gt;&lt;br/&gt;&amp;gt; (… maybe core&amp;#39;s defaults should be reconsidered rather than standardised&lt;br/&gt;as-is)&lt;br/&gt;&lt;br/&gt;&amp;gt; Worst case, you could presumably do a new package relay version with&lt;br/&gt;&amp;gt; different constraints, if needed.&lt;br/&gt;&lt;br/&gt;Maybe this was my actual concern. I think the defaults are safe but it’s&lt;br/&gt;not like they’ve been proven to be optimal. This creates an obstacle to&lt;br/&gt;changing them, especially if we want to make them smaller. But I think it’s&lt;br/&gt;unlikely we’ll do that, and adding another version for new constraints&lt;br/&gt;doesn’t seem too bad.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;(Agreed with everything here, thanks for the feedback and clarifications!)&lt;br/&gt;TLDR, making these changes:&lt;br/&gt;- Count and size are implied by the version. Version 1 is specifically&lt;br/&gt;child-with-unconfirmed-parents, where the whole package is at most 25&lt;br/&gt;transactions and 101KvB.&lt;br/&gt;- Announce sendpackages based on our own state. It’s ok to send&lt;br/&gt;“sendpackages” if they sent fRelay=false.&lt;br/&gt;- At verack, require fRelay=true and wtxidrelay if they sent sendpackages,&lt;br/&gt;otherwise disconnect.&lt;br/&gt;- If we get “getpckgtxns” or “pckgtxns” without having negotiated&lt;br/&gt;“sendpackages” ahead of time, ignore, don’t disconnect. Emphasize that the&lt;br/&gt;intention is to validate all of the transactions received through&lt;br/&gt;“pckgtxns” together.&lt;br/&gt;&lt;br/&gt;&amp;gt; If you&amp;#39;re asking for the package for &amp;#34;D&amp;#34;, would a response telling you:&lt;br/&gt;&amp;gt;   txid_D (500 sat, 100vB)&lt;br/&gt;&amp;gt;   txid_A (0 sat, 100vB)&lt;br/&gt;&amp;gt;   txid_B (2000 sat, 100 vB)&lt;br/&gt;&amp;gt; be better, in that case? Then the receiver can maybe do the logic&lt;br/&gt;&amp;gt; themselves to figure out that they already have A in their mempool&lt;br/&gt;&amp;gt; so it&amp;#39;s fine, or not?&lt;br/&gt;&lt;br/&gt;Right, I also considered giving the fees and sizes of each transaction in&lt;br/&gt;the package in “pckginfo1”. But I don’t think that information provides&lt;br/&gt;additional meaning unless you know the exact topology, i.e. also know if&lt;br/&gt;the parents have dependency relationships between them. For instance, in&lt;br/&gt;the {A, B, D} package there, even if you have the information listed, your&lt;br/&gt;decision should be different depending on whether B spends from A. The only&lt;br/&gt;thing you know for sure about a child with direct parents is: if the&lt;br/&gt;aggregate feerate is too low, you won’t want the child since it depends on&lt;br/&gt;everyone else. If there’s a good-feerate transaction in there that doesn’t&lt;br/&gt;have a dependency, you’re fine as long as someone sends it to you&lt;br/&gt;individually.&lt;br/&gt;&lt;br/&gt;Best,&lt;br/&gt;Gloria&lt;br/&gt;&lt;br/&gt;On Mon, May 23, 2022 at 2:34 PM Anthony Towns via bitcoin-dev &amp;lt;&lt;br/&gt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; On Wed, May 18, 2022 at 02:40:58PM -0400, Gloria Zhao via bitcoin-dev&lt;br/&gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; Does it make sense for these to be configurable, rather than implied&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; by the version?&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; … would it be better to either just not do sendpackages&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; at all if you&amp;#39;re limiting ancestors in the mempool incompatibly&lt;br/&gt;&amp;gt; &amp;gt; Effectively: if you’re setting your ancestor/descendant limits lower than&lt;br/&gt;&amp;gt; &amp;gt; the default, you can’t do package relay. I wonder if this might be&lt;br/&gt;&amp;gt; &amp;gt; controversial, since it adds pressure to adhere to Bitcoin Core’s current&lt;br/&gt;&amp;gt; &amp;gt; mempool policy? I would be happy to do it this way, though - makes things&lt;br/&gt;&amp;gt; &amp;gt; easier to implement.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; How about looking at it the other way: if you&amp;#39;re writing a protocol that&amp;#39;s&lt;br/&gt;&amp;gt; dependent on people seeing that a package as a whole pays a competitive&lt;br/&gt;&amp;gt; feerate, don&amp;#39;t you want to know in advance what conditions the network&lt;br/&gt;&amp;gt; is going to impose on your transactions in order to consider them as a&lt;br/&gt;&amp;gt; package? In that case, aren&amp;#39;t the &amp;#34;depth&amp;#34; and &amp;#34;size&amp;#34; constraints things&lt;br/&gt;&amp;gt; we should specify in a standard?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; (The above&amp;#39;s not a rhetorical question; I&amp;#39;m not sure what the answer is.&lt;br/&gt;&amp;gt; And even if it&amp;#39;s &amp;#34;yes&amp;#34;, maybe core&amp;#39;s defaults should be reconsidered&lt;br/&gt;&amp;gt; rather than standardised as-is)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Worst case, you could presumably do a new package relay version with&lt;br/&gt;&amp;gt; different constraints, if needed.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; &amp;gt; 5. If &amp;#39;fRelay==false&amp;#39; in a peer&amp;#39;s version message, the node must not&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; &amp;gt;    send &amp;#34;sendpackages&amp;#34; to them. If a &amp;#34;sendpackages&amp;#34; message is&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; &amp;gt; received by a peer after sending `fRelay==false` in their version&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; &amp;gt; message, the sender should be disconnected.&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; Seems better to just say &amp;#34;if you set fRelay=false in your version&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; message, you must not send sendpackages&amp;#34;? You already won&amp;#39;t do packages&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; with the peer if they don&amp;#39;t also announce sendpackages.&lt;br/&gt;&amp;gt; &amp;gt; I guess, theoretically, if you allow bloom filters with this peer, it’s&lt;br/&gt;&amp;gt; &amp;gt; plausible they’re saying “fRelay=false, I’ll send you a bloom filter&lt;br/&gt;&amp;gt; later,&lt;br/&gt;&amp;gt; &amp;gt; and I’ll also want to talk about packages.”&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I was just meaning &amp;#34;it&amp;#39;s okay to send VERSION fRelay=true then immediately&lt;br/&gt;&amp;gt; send WTXIDRELAY then immediately send SENDPACKAGES&amp;#34; without having to&lt;br/&gt;&amp;gt; first verify what the other guy&amp;#39;s fRelay was set to. On the other hand,&lt;br/&gt;&amp;gt; you do already have to verify the other guy&amp;#39;s version is high enough,&lt;br/&gt;&amp;gt; but it would be kind-of nice to move towards just announcing the features&lt;br/&gt;&amp;gt; you support, and not having to make it a multistep negotiation...&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; Maybe: &amp;#34;You must not send sendpackages unless you also send&lt;br/&gt;&amp;gt; wtxidrelay&amp;#34; ?&lt;br/&gt;&amp;gt; &amp;gt; Do you mean if we get a verack, and the peer sent “sendpackages” but not&lt;br/&gt;&amp;gt; &amp;gt; “wtxidrelay,” we should disconnect them?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yes.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; I have it as: we send a PCKG INV when this transaction’s feerate is above&lt;br/&gt;&amp;gt; &amp;gt; the fee filter, but one or more of its parents don’t. I don’t think using&lt;br/&gt;&amp;gt; &amp;gt; ancestor feerate is better.&lt;br/&gt;&amp;gt; &amp;gt; See this counterexample:&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;  &lt;img src=&#34;https://raw.githubusercontent.com/glozow/bitcoin-notes/master/mempool_garden/abc_1parent_2kids.png&#34;&gt; &lt;br/&gt;&amp;gt; &amp;gt; A (0fee) has 2 kids, B (3sat/vB) and C (20sat/vB), everything’s the same&lt;br/&gt;&amp;gt; &amp;gt; vsize. Let’s say the fee filter is 3sat/vB.&lt;br/&gt;&amp;gt; &amp;gt; If we do it based on ancestor feerate, we won’t send B. But B is actually&lt;br/&gt;&amp;gt; &amp;gt; fine; C is paying for A.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; But that only works if the receiver also has C, in which case they also&lt;br/&gt;&amp;gt; have A, and you don&amp;#39;t need package relay to do anything with B? If they&lt;br/&gt;&amp;gt; didn&amp;#39;t have C already, then relaying {A,B} would be a waste of time,&lt;br/&gt;&amp;gt; because {A,B} would be rejected as only paying 1.5sat/vB or whatever..&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If you switch it to being:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   A (0 sats, 200vB)&lt;br/&gt;&amp;gt;   B (2000 sats, 200vB, spends A:0)&lt;br/&gt;&amp;gt;   C (200 sats, 200vB)&lt;br/&gt;&amp;gt;   D (1000 sats, 200vB, sepnds A:1, C:0)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; then you get:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   A alone = 0s/vB&lt;br/&gt;&amp;gt;   B&#43;A = 5s/vB&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   C alone = 1s/vB&lt;br/&gt;&amp;gt;   D&#43;C&#43;A = 2s/vB&lt;br/&gt;&amp;gt;   D&#43;C = 3s/vB      (B&#43;A already at 5s/vB)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; which I think recovers your point, while also having all the details&lt;br/&gt;&amp;gt; only be dealing with direct parents.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; Are &amp;#34;getpckgtxns&amp;#34; / &amp;#34;pcktxns&amp;#34; really limited to packages, or are they&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; just a general way to request a batch of transactions?&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; Maybe call those messages &amp;#34;getbatchtxns&amp;#34; and &amp;#34;batchtxns&amp;#34; and allow&lt;br/&gt;&amp;gt; them to&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; be used more generally, potentially in ways unrelated to packages/cpfp?&lt;br/&gt;&amp;gt; &amp;gt; Indeed, it’s a general way to request a batch of transactions. I’ll&lt;br/&gt;&amp;gt; &amp;gt; highlight that it is “all or nothing,” i.e. if the sender is missing any&lt;br/&gt;&amp;gt; of&lt;br/&gt;&amp;gt; &amp;gt; them, they’ll just send a notfound.&lt;br/&gt;&amp;gt; &amp;gt; The idea here was to avoid downloading any transactions that can’t be&lt;br/&gt;&amp;gt; &amp;gt; validated right away.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Right; maybe I should just be calling a &amp;#34;batch of packages to be validated&lt;br/&gt;&amp;gt; together&amp;#34; a &amp;#34;tx package&amp;#34; in the first place.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Maybe it would be worth emphasising that you should be expecting to&lt;br/&gt;&amp;gt; validate all the txs you receive as a response to getpckgtxns (getpkgtxs&lt;br/&gt;&amp;gt; :) all at the same time, and immediately upon receiving them?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; The &amp;#34;only be sent if both peers agreed to do package relay&amp;#34; rule could&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; simply be dropped, I think.&lt;br/&gt;&amp;gt; &amp;gt; Wouldn’t we need some way of saying “hey I support batchtxns?” Otherwise&lt;br/&gt;&amp;gt; &amp;gt; you would have to guess by sending a request and waiting to see if it’s&lt;br/&gt;&amp;gt; &amp;gt; ignored?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Sure, perhaps I should have said leave that rule, but drop the following&lt;br/&gt;&amp;gt; &amp;#34;should be disconnected&amp;#34; rule, so that other BIPs could add in other&lt;br/&gt;&amp;gt; ways of negotiating the connection in future? *shrug*&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; Shouldn&amp;#39;t the sender only be sending package announcements when they&lt;br/&gt;&amp;gt; know&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; the recipient will be interested in the package, based on their&lt;br/&gt;&amp;gt; feefilter?&lt;br/&gt;&amp;gt; &amp;gt; I think there are cases where the sender doesn’t necessarily know.&lt;br/&gt;&amp;gt; &amp;gt; Consider this example:&lt;br/&gt;&amp;gt; &amp;gt;&lt;br/&gt;&amp;gt;  &lt;img src=&#34;https://raw.githubusercontent.com/glozow/bitcoin-notes/master/mempool_garden/rich_parent_bad_cpfp.png&#34;&gt; &lt;br/&gt;&amp;gt; &amp;gt; D (5sat/vB) has 2 parents, A (0sat/vB) and B (20sat/vB). All same size.&lt;br/&gt;&amp;gt; &amp;gt; Feefilter is 3sat/vB.&lt;br/&gt;&amp;gt; &amp;gt; If the receiver already has B, they’ll know they can just reject the&lt;br/&gt;&amp;gt; &amp;gt; package already based on the pckginfo.&lt;br/&gt;&amp;gt; &amp;gt; But the sender doesn’t really know that. The sender just knows A is below&lt;br/&gt;&amp;gt; &amp;gt; feerate and D is above. D is above the fee filter, and its ancestor&lt;br/&gt;&amp;gt; feerate&lt;br/&gt;&amp;gt; &amp;gt; is above the fee filter.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The sender would also need to know whether or not there&amp;#39;s some other&lt;br/&gt;&amp;gt; child E that pays for A sufficiently?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If you&amp;#39;re asking for the package for &amp;#34;D&amp;#34;, would a response telling you:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   txid_D (500 sat, 100vB)&lt;br/&gt;&amp;gt;   txid_A (0 sat, 100vB)&lt;br/&gt;&amp;gt;   txid_B (2000 sat, 100 vB)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; be better, in that case? Then the receiver can maybe do the logic&lt;br/&gt;&amp;gt; themselves to figure out that they already have A in their mempool&lt;br/&gt;&amp;gt; so it&amp;#39;s fine, or not?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If you&amp;#39;ve got a package for X, and its direct parents P1..Pn, then&lt;br/&gt;&amp;gt; I think the logic would be:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;   * is X alone above my fee rate? no, then forget it&lt;br/&gt;&amp;gt;   * otherwise, s := X.size, f := X.fees, R := [X]&lt;br/&gt;&amp;gt;   * for P = P1..Pn:&lt;br/&gt;&amp;gt;     * do I already have P? then skip to the next parent&lt;br/&gt;&amp;gt;     * s &#43;= P.size, f &#43;= P.fees, R &#43;= [P]&lt;br/&gt;&amp;gt;   * if f/s above my fee rate floor? if so, request all the txs in R&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; and you&amp;#39;d request txs if-and-only-if they&amp;#39;re a match for you mempool rate?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If you have a tx with 20 in-mempool parents, then the pkginfo1 message&lt;br/&gt;&amp;gt; as proposed would be 737 bytes; including all the fee/size info would be&lt;br/&gt;&amp;gt; 957 bytes, maybe a 30% increase. Might be worth it though?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; aj&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220523/c502fd7c/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220523/c502fd7c/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-08T01:09:47&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsxjpudsgav3smntljs75tv5lpq0xuju44zc2gp2l44jteecw6uqlgzyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2q467qkf</id>
    
      <title type="html">📅 Original date posted:2022-05-18 📝 Original message:(To ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsxjpudsgav3smntljs75tv5lpq0xuju44zc2gp2l44jteecw6uqlgzyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2q467qkf" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsfx9n2lmf57w72klc76mjwmfprk7nts5hduduwya674gv8wjhmp5qv6m8v2&#39;&gt;nevent1q…m8v2&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-05-18&lt;br/&gt;📝 Original message:(To everyone):&lt;br/&gt;I should have made it much clearer that version 1 is only supposed to solve&lt;br/&gt;1 of the 2 use cases. I was a lot more focused on the fee-bumping use case,&lt;br/&gt;since it’s more important. Orphan-fetching was added to the motivation&lt;br/&gt;section last-minute because John Newbery mentioned to me “hey you could&lt;br/&gt;deal with orphans really easily with this.” Of course,&lt;br/&gt;child-with-unconfirmed-parents packages aren’t very useful for&lt;br/&gt;orphan-fetching since non-parent ancestors are quite common.&lt;br/&gt;&lt;br/&gt;Maybe a version 2 package for orphan-fetching could look like this:&lt;br/&gt;&lt;br/&gt;“pckginfo2” message contains a tx with all of its ancestors&lt;br/&gt;&lt;br/&gt;“MSG_PCKG2” inv type refers to a “pckginfo2” for a tx. You don’t send&lt;br/&gt;inv(MSG_PCKG2), but a node can request getdata(MSG_PCKG2) for a transaction&lt;br/&gt;they want the ancestors for, provided they sent sendpackages(version=2)&lt;br/&gt;ahead of time. It seems to me that orphan-fetching only ever needs to be&lt;br/&gt;receiver-initiated.&lt;br/&gt;&lt;br/&gt;Protocol flow would look like this:&lt;br/&gt; &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/168891185-1630f583-de47-4937-86b1-2652cf8852f2.png&#34;&gt; &lt;br/&gt;&lt;br/&gt;We don’t have a policy for dealing with anything more than a child with its&lt;br/&gt;direct parents, but I also don’t think anybody is relying on fee-bumping&lt;br/&gt;more than 2 generations, so the validation logic here could probably just&lt;br/&gt;submit them all individually. Maybe they can request a pckginfo1 if they&lt;br/&gt;see something that’s too-low-fee, and/or use the&lt;br/&gt;child-with-unconfirmed-parents logic opportunistically.&lt;br/&gt;&lt;br/&gt;Thanks aj for the feedback! Responding:&lt;br/&gt;&lt;br/&gt;&amp;gt; The &amp;#34;PCKG&amp;#34; abbreviation threw me for a loop; isn&amp;#39;t the usual&lt;br/&gt;&amp;gt; abbreviation &amp;#34;PKG&amp;#34; ?&lt;br/&gt;&lt;br/&gt;Oh I didn&amp;#39;t know that. I could change it if people feel strongly.&lt;br/&gt;&lt;br/&gt;&amp;gt; Does it make sense for these to be configurable, rather than implied&lt;br/&gt;&amp;gt; by the version?&lt;br/&gt;&amp;gt; … would it be better to either just not do sendpackages&lt;br/&gt;&amp;gt; at all if you&amp;#39;re limiting ancestors in the mempool incompatibly&lt;br/&gt;&lt;br/&gt;Effectively: if you’re setting your ancestor/descendant limits lower than&lt;br/&gt;the default, you can’t do package relay. I wonder if this might be&lt;br/&gt;controversial, since it adds pressure to adhere to Bitcoin Core’s current&lt;br/&gt;mempool policy? I would be happy to do it this way, though - makes things&lt;br/&gt;easier to implement.&lt;br/&gt;&lt;br/&gt;&amp;gt; &amp;gt; 5. If &amp;#39;fRelay==false&amp;#39; in a peer&amp;#39;s version message, the node must not&lt;br/&gt;&amp;gt; &amp;gt;    send &amp;#34;sendpackages&amp;#34; to them. If a &amp;#34;sendpackages&amp;#34; message is&lt;br/&gt;&amp;gt; &amp;gt; received by a peer after sending `fRelay==false` in their version&lt;br/&gt;&amp;gt; &amp;gt; message, the sender should be disconnected.&lt;br/&gt;&lt;br/&gt;&amp;gt; Seems better to just say &amp;#34;if you set fRelay=false in your version&lt;br/&gt;&amp;gt; message, you must not send sendpackages&amp;#34;? You already won&amp;#39;t do packages&lt;br/&gt;&amp;gt; with the peer if they don&amp;#39;t also announce sendpackages.&lt;br/&gt;&lt;br/&gt;I guess, theoretically, if you allow bloom filters with this peer, it’s&lt;br/&gt;plausible they’re saying “fRelay=false, I’ll send you a bloom filter later,&lt;br/&gt;and I’ll also want to talk about packages.”&lt;br/&gt;I don’t know if that’s a use case we want to support - my gut reaction is&lt;br/&gt;no.&lt;br/&gt;&lt;br/&gt;&amp;gt; Maybe: &amp;#34;You must not send sendpackages unless you also send wtxidrelay&amp;#34; ?&lt;br/&gt;&lt;br/&gt;Do you mean if we get a verack, and the peer sent “sendpackages” but not&lt;br/&gt;“wtxidrelay,” we should disconnect them?&lt;br/&gt;&lt;br/&gt;&amp;gt; As I understand it, the two cases for the protocol flow are &amp;#34;I received&lt;br/&gt;&amp;gt; an orphan, and I&amp;#39;d like its ancestors please&amp;#34; which seems simple enough,&lt;br/&gt;&amp;gt; and &amp;#34;here&amp;#39;s a child you may be interested in, even though you possibly&lt;br/&gt;&amp;gt; weren&amp;#39;t interested in the parents of that child&amp;#34;.&lt;br/&gt;&lt;br/&gt;(Btw, please see my notes at the top of this email about separating those&lt;br/&gt;two use cases. sorry for the confusion).&lt;br/&gt;&lt;br/&gt;&amp;gt; I think the logic for the latter is: […]&lt;br/&gt;&lt;br/&gt;I have it as: we send a PCKG INV when this transaction’s feerate is above&lt;br/&gt;the fee filter, but one or more of its parents don’t. I don’t think using&lt;br/&gt;ancestor feerate is better.&lt;br/&gt;See this counterexample:&lt;br/&gt; &lt;img src=&#34;https://raw.githubusercontent.com/glozow/bitcoin-notes/master/mempool_garden/abc_1parent_2kids.png&#34;&gt; &lt;br/&gt;A (0fee) has 2 kids, B (3sat/vB) and C (20sat/vB), everything’s the same&lt;br/&gt;vsize. Let’s say the fee filter is 3sat/vB.&lt;br/&gt;If we do it based on ancestor feerate, we won’t send B. But B is actually&lt;br/&gt;fine; C is paying for A.&lt;br/&gt;&lt;br/&gt;&amp;gt; Are &amp;#34;getpckgtxns&amp;#34; / &amp;#34;pcktxns&amp;#34; really limited to packages, or are they&lt;br/&gt;&amp;gt; just a general way to request a batch of transactions?&lt;br/&gt;&lt;br/&gt;&amp;gt; Maybe call those messages &amp;#34;getbatchtxns&amp;#34; and &amp;#34;batchtxns&amp;#34; and allow them to&lt;br/&gt;&amp;gt; be used more generally, potentially in ways unrelated to packages/cpfp?&lt;br/&gt;&lt;br/&gt;Indeed, it’s a general way to request a batch of transactions. I’ll&lt;br/&gt;highlight that it is “all or nothing,” i.e. if the sender is missing any of&lt;br/&gt;them, they’ll just send a notfound.&lt;br/&gt;The idea here was to avoid downloading any transactions that can’t be&lt;br/&gt;validated right away. With packages, this makes sense, because there are&lt;br/&gt;dependency relationships. But if you’re requesting multiple unrelated&lt;br/&gt;transactions, for example, it’s unnecessary. You might end up with even&lt;br/&gt;more transaction data that’s just sitting around waiting to be validated.&lt;br/&gt;&lt;br/&gt;&amp;gt; The &amp;#34;only be sent if both peers agreed to do package relay&amp;#34; rule could&lt;br/&gt;&amp;gt; simply be dropped, I think.&lt;br/&gt;&lt;br/&gt;Wouldn’t we need some way of saying “hey I support batchtxns?” Otherwise&lt;br/&gt;you would have to guess by sending a request and waiting to see if it’s&lt;br/&gt;ignored?&lt;br/&gt;&lt;br/&gt;&amp;gt; Shouldn&amp;#39;t the sender only be sending package announcements when they know&lt;br/&gt;&amp;gt; the recipient will be interested in the package, based on their feefilter?&lt;br/&gt;&lt;br/&gt;I think there are cases where the sender doesn’t necessarily know.&lt;br/&gt;Consider this example:&lt;br/&gt; &lt;img src=&#34;https://raw.githubusercontent.com/glozow/bitcoin-notes/master/mempool_garden/rich_parent_bad_cpfp.png&#34;&gt; &lt;br/&gt;D (5sat/vB) has 2 parents, A (0sat/vB) and B (20sat/vB). All same size.&lt;br/&gt;Feefilter is 3sat/vB.&lt;br/&gt;If the receiver already has B, they’ll know they can just reject the&lt;br/&gt;package already based on the pckginfo.&lt;br/&gt;But the sender doesn’t really know that. The sender just knows A is below&lt;br/&gt;feerate and D is above. D is above the fee filter, and its ancestor feerate&lt;br/&gt;is above the fee filter.&lt;br/&gt;&lt;br/&gt;&amp;gt; CAmount in consensus/amount.h is a int64_t&lt;br/&gt;&amp;gt; The maximum block weight is 4M…&lt;br/&gt;&lt;br/&gt; Oops yes. I think we just usually use int64_t for vsizes afaik. Agree that&lt;br/&gt;it should be 8 bytes for fee, and 4 bytes is enough for vsize.&lt;br/&gt;&lt;br/&gt;&amp;gt; I guess tx relay is low priority enough that it wouldn&amp;#39;t be worth tagging&lt;br/&gt;&amp;gt; some peers as &amp;#34;high bandwidth&amp;#34; and having them immediately announce the&lt;br/&gt;&amp;gt; PCKGINFO1 message, and skip the INV/GETDATA step?&lt;br/&gt;&lt;br/&gt;I had the same idea as well, but seemed unnecessary. It would reduce the&lt;br/&gt;number of round trips, but I don’t think an extra round trip is that big of&lt;br/&gt;a deal for transaction relay. Block relay, yes of course, but I don’t think&lt;br/&gt;we care that much if it takes an extra second to send a transaction?&lt;br/&gt;&lt;br/&gt;Best,&lt;br/&gt;Gloria&lt;br/&gt;&lt;br/&gt;On Tue, May 17, 2022 at 8:35 PM Anthony Towns &amp;lt;aj at erisian.com.au&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; On Tue, May 17, 2022 at 12:01:04PM -0400, Gloria Zhao via bitcoin-dev&lt;br/&gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt; &amp;gt; ====New Messages====&lt;br/&gt;&amp;gt; &amp;gt; Three new protocol messages are added for use in any version of&lt;br/&gt;&amp;gt; &amp;gt; package relay. Additionally, each version of package relay must define&lt;br/&gt;&amp;gt; &amp;gt; its own inv type and &amp;#34;pckginfo&amp;#34; message version, referred to in this&lt;br/&gt;&amp;gt; &amp;gt; document as &amp;#34;MSG_PCKG&amp;#34; and &amp;#34;pckginfo&amp;#34; respectively. See&lt;br/&gt;&amp;gt; &amp;gt; BIP-v1-packages for a concrete example.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The &amp;#34;PCKG&amp;#34; abbreviation threw me for a loop; isn&amp;#39;t the usual&lt;br/&gt;&amp;gt; abbreviation &amp;#34;PKG&amp;#34; ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; =====sendpackages=====&lt;br/&gt;&amp;gt; &amp;gt; |version || uint32_t || 4 || Denotes a package version supported by the&lt;br/&gt;&amp;gt; &amp;gt; node.&lt;br/&gt;&amp;gt; &amp;gt; |max_count || uint32_t || 4 ||Specifies the maximum number of&lt;br/&gt;&amp;gt; transactions&lt;br/&gt;&amp;gt; &amp;gt; per package this node is&lt;br/&gt;&amp;gt; &amp;gt; willing to accept.&lt;br/&gt;&amp;gt; &amp;gt; |max_weight || uint32_t || 4 ||Specifies the maximum total weight per&lt;br/&gt;&amp;gt; &amp;gt; package this node is willing&lt;br/&gt;&amp;gt; &amp;gt; to accept.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Does it make sense for these to be configurable, rather than implied&lt;br/&gt;&amp;gt; by the version?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I presume the idea is to cope with people specifying different values for&lt;br/&gt;&amp;gt; -limitancestorcount or -limitancestorsize, but if people are regularly&lt;br/&gt;&amp;gt; relaying packages around, it seems like it becomes hard to have those&lt;br/&gt;&amp;gt; values really be configurable while being compatible with that?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I guess I&amp;#39;m asking: would it be better to either just not do sendpackages&lt;br/&gt;&amp;gt; at all if you&amp;#39;re limiting ancestors in the mempool incompatibly; or&lt;br/&gt;&amp;gt; alternatively, would it be better to do the package relay, then reject&lt;br/&gt;&amp;gt; the particular package if it turns out too big, and log that you&amp;#39;ve&lt;br/&gt;&amp;gt; dropped it so that the node operator has some way of realising &amp;#34;whoops,&lt;br/&gt;&amp;gt; I&amp;#39;m not relaying packages properly because of how I configured my node&amp;#34;?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; 5. If &amp;#39;fRelay==false&amp;#39; in a peer&amp;#39;s version message, the node must not&lt;br/&gt;&amp;gt; &amp;gt;    send &amp;#34;sendpackages&amp;#34; to them. If a &amp;#34;sendpackages&amp;#34; message is&lt;br/&gt;&amp;gt; &amp;gt; received by a peer after sending `fRelay==false` in their version&lt;br/&gt;&amp;gt; &amp;gt; message, the sender should be disconnected.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Seems better to just say &amp;#34;if you set fRelay=false in your version&lt;br/&gt;&amp;gt; message, you must not send sendpackages&amp;#34;? You already won&amp;#39;t do packages&lt;br/&gt;&amp;gt; with the peer if they don&amp;#39;t also announce sendpackages.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; 7. If both peers send &amp;#34;wtxidrelay&amp;#34; and &amp;#34;sendpackages&amp;#34; with the same&lt;br/&gt;&amp;gt; &amp;gt;    version, the peers should announce, request, and send package&lt;br/&gt;&amp;gt; &amp;gt; information to each other.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Maybe: &amp;#34;You must not send sendpackages unless you also send wtxidrelay&amp;#34; ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; As I understand it, the two cases for the protocol flow are &amp;#34;I received&lt;br/&gt;&amp;gt; an orphan, and I&amp;#39;d like its ancestors please&amp;#34; which seems simple enough,&lt;br/&gt;&amp;gt; and &amp;#34;here&amp;#39;s a child you may be interested in, even though you possibly&lt;br/&gt;&amp;gt; weren&amp;#39;t interested in the parents of that child&amp;#34;. I think the logic for&lt;br/&gt;&amp;gt; the latter is:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;  * if tx C&amp;#39;s fee rate is less than the peer&amp;#39;s feefilter, skip it&lt;br/&gt;&amp;gt;    (will maybe treat it as a parent in some package later though)&lt;br/&gt;&amp;gt;  * if tx C&amp;#39;s ancestor fee rate is less than the peer&amp;#39;s feefilter, skip&lt;br/&gt;&amp;gt;    it?&lt;br/&gt;&amp;gt;  * look at the lowest ancestor fee rate for any of C&amp;#39;s in-mempool&lt;br/&gt;&amp;gt;    parents&lt;br/&gt;&amp;gt;  * if that is higher than the peer&amp;#39;s fee filter, send a normal INV&lt;br/&gt;&amp;gt;  * if it&amp;#39;s lower than the peer&amp;#39;s fee filter, send a PCKG INV&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Are &amp;#34;getpckgtxns&amp;#34; / &amp;#34;pcktxns&amp;#34; really limited to packages, or are they&lt;br/&gt;&amp;gt; just a general way to request a batch of transactions? Particularly in&lt;br/&gt;&amp;gt; the case of requesting the parents of an orphan tx you already have,&lt;br/&gt;&amp;gt; it seems hard for the node receiving getpckgtxns to validate that the&lt;br/&gt;&amp;gt; txs are related in some way; but also it doesn&amp;#39;t seem very necessary?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Maybe call those messages &amp;#34;getbatchtxns&amp;#34; and &amp;#34;batchtxns&amp;#34; and allow them to&lt;br/&gt;&amp;gt; be used more generally, potentially in ways unrelated to packages/cpfp?&lt;br/&gt;&amp;gt; The &amp;#34;only be sent if both peers agreed to do package relay&amp;#34; rule could&lt;br/&gt;&amp;gt; simply be dropped, I think.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; 4. The reciever uses the package information to decide how to request&lt;br/&gt;&amp;gt; &amp;gt;    the transactions. For example, if the receiver already has some of&lt;br/&gt;&amp;gt; &amp;gt; the transactions in their mempool, they only request the missing ones.&lt;br/&gt;&amp;gt; &amp;gt; They could also decide not to request the package at all based on the&lt;br/&gt;&amp;gt; &amp;gt; fee information provided.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Shouldn&amp;#39;t the sender only be sending package announcements when they know&lt;br/&gt;&amp;gt; the recipient will be interested in the package, based on their feefilter?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; =====pckginfo1=====&lt;br/&gt;&amp;gt; &amp;gt; {|&lt;br/&gt;&amp;gt; &amp;gt; |  Field Name  ||  Type  ||  Size  ||   Purpose&lt;br/&gt;&amp;gt; &amp;gt; |-&lt;br/&gt;&amp;gt; &amp;gt; |blockhash || uint256 || 32 || The chain tip at which this package is&lt;br/&gt;&amp;gt; &amp;gt; defined.&lt;br/&gt;&amp;gt; &amp;gt; |-&lt;br/&gt;&amp;gt; &amp;gt; |pckg_fee||CAmount||4|| The sum total fees paid by all transactions in&lt;br/&gt;&amp;gt; the&lt;br/&gt;&amp;gt; &amp;gt; package.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; CAmount in consensus/amount.h is a int64_t so shouldn&amp;#39;t this be 8&lt;br/&gt;&amp;gt; bytes? If you limit a package to 101kvB, an int32_t is enough to cover&lt;br/&gt;&amp;gt; any package with a fee rate of about 212 BTC/block or lower, though.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; |pckg_weight||int64_t||8|| The sum total weight of all transactions in&lt;br/&gt;&amp;gt; the&lt;br/&gt;&amp;gt; &amp;gt; package.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The maximum block weight is 4M, and the default -limitancestorsize&lt;br/&gt;&amp;gt; presumably implies a max package weight of 404k; seems odd to provide&lt;br/&gt;&amp;gt; a uint64_t rather than an int32_t here, which easily allows either of&lt;br/&gt;&amp;gt; those values?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; 2. &amp;#39;&amp;#39;Only 1 child with unconfirmed parents.&amp;#39;&amp;#39; The package must consist&lt;br/&gt;&amp;gt; &amp;gt;    of one transaction and its unconfirmed parents. There must not be&lt;br/&gt;&amp;gt; &amp;gt; any other transactions in the package. Other dependency relationships&lt;br/&gt;&amp;gt; &amp;gt; may exist within the package (e.g. one parent may spend the output of&lt;br/&gt;&amp;gt; &amp;gt; another parent) provided that topological order is respected.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think this means that some of the parents could also have unconfirmed&lt;br/&gt;&amp;gt; parents, but they won&amp;#39;t be included in the package, and must be requested&lt;br/&gt;&amp;gt; via the recipient-initiated approach?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; 5. &amp;#39;&amp;#39;Total fees and weight.&amp;#39;&amp;#39; The &amp;#39;total_fee&amp;#39; and &amp;#39;total_weight&amp;#39;&lt;br/&gt;&amp;gt; &amp;gt;    fields must accurately represent the sum total of all transactions&amp;#39;&lt;br/&gt;&amp;gt; &amp;gt;    fees and weights as defined in BIP141, respectively.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Presumably this excludes any unconfirmed grandparents and earlier&lt;br/&gt;&amp;gt; ancestors since they aren&amp;#39;t part of the package, in this approach? Doesn&amp;#39;t&lt;br/&gt;&amp;gt; that make this both harder to calculate (assuming we already have&lt;br/&gt;&amp;gt; ancestor summaries) and less useful, in the case where those ancestors&lt;br/&gt;&amp;gt; have a lower fee rate?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; &amp;#39;&amp;#39;Q: Can &amp;#34;getpckgtxns&amp;#34; and &amp;#34;pckgtxns&amp;#34; messages contain only one&lt;br/&gt;&amp;gt; &amp;gt; transaction?&amp;#39;&amp;#39;&lt;br/&gt;&amp;gt; &amp;gt; Yes.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This would be normal if you&amp;#39;re requesting a single missing parent for&lt;br/&gt;&amp;gt; an orphan you&amp;#39;ve received, I think?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I&amp;#39;m slightly surprised the process is:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;  -&amp;gt;  INV PCKG1 C&lt;br/&gt;&amp;gt;   &amp;lt;- GETDATA PCKG1 C&lt;br/&gt;&amp;gt;  -&amp;gt;  PCKGINFO1 blockhash A B C fee weight&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; rather than announcing the package fee info in the first message.&lt;br/&gt;&amp;gt; But if the sender is already applying the feefilter to the package before&lt;br/&gt;&amp;gt; announcing it, it probably doesn&amp;#39;t matter, and means you&amp;#39;re only getting&lt;br/&gt;&amp;gt; a 32B INV from every peer, rather than a 32*(n&#43;2) PCKGINFO1 message from&lt;br/&gt;&amp;gt; every peer.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I guess tx relay is low priority enough that it wouldn&amp;#39;t be worth tagging&lt;br/&gt;&amp;gt; some peers as &amp;#34;high bandwidth&amp;#34; and having them immediately announce the&lt;br/&gt;&amp;gt; PCKGINFO1 message, and skip the INV/GETDATA step?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; aj&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220518/f022b65c/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220518/f022b65c/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-08T01:09:46&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqstqgc7r0h7jx506chjhgfslad2gazrx2fwe63vc6jeejl78h3alkszyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2quwnrjv</id>
    
      <title type="html">📅 Original date posted:2022-05-17 📝 Original message:Hi ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqstqgc7r0h7jx506chjhgfslad2gazrx2fwe63vc6jeejl78h3alkszyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2quwnrjv" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqszla6hnxvz00nwfefh53z24kq9vtqsq8jw24fhdgj3luhw00sfctg6k0ve3&#39;&gt;nevent1q…0ve3&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-05-17&lt;br/&gt;📝 Original message:Hi everybody,&lt;br/&gt;&lt;br/&gt;I’m writing to propose a set of p2p protocol changes to enable package&lt;br/&gt;relay, soliciting feedback on the design and approach. Here is a link&lt;br/&gt;to the most up-to-date proposal:&lt;br/&gt;&lt;br/&gt;&lt;a href=&#34;https://github.com/bitcoin/bips/pull/1324&#34;&gt;https://github.com/bitcoin/bips/pull/1324&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;If you have concept or approach feedback, *please respond on the&lt;br/&gt;mailing list* to allow everybody to view and participate in the&lt;br/&gt;discussion. If you find a typo or inaccurate wording, please feel free&lt;br/&gt;to leave suggestions on the PR.&lt;br/&gt;&lt;br/&gt;I’m also working on an implementation for Bitcoin Core.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;The rest of this post will include the same contents as the proposal,&lt;br/&gt;with a bit of reordering and additional context. If you are not 100%&lt;br/&gt;up-to-date on package relay and find the proposal hard to follow, I&lt;br/&gt;hope you find this format more informative and persuasive.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;==Background and Motivation==&lt;br/&gt;&lt;br/&gt;Users may create and broadcast transactions that depend upon, i.e.&lt;br/&gt;spend outputs of, unconfirmed transactions. A “package” is the&lt;br/&gt;widely-used term for a group of transactions representable by a&lt;br/&gt;connected Directed Acyclic Graph (where a directed edge exists between&lt;br/&gt;a transaction that spends the output of another transaction).&lt;br/&gt;&lt;br/&gt;Incentive-compatible mempool and miner policies help create a fair,&lt;br/&gt;fee-based market for block space. While miners maximize transaction&lt;br/&gt;fees in order to earn higher block rewards, non-mining users&lt;br/&gt;participating in transaction relay reap many benefits from employing&lt;br/&gt;policies that result in a mempool with the same contents, including&lt;br/&gt;faster compact block relay and more accurate fee estimation.&lt;br/&gt;Additionally, users may take advantage of mempool and miner policy to&lt;br/&gt;bump the priority of their transactions by attaching high-fee&lt;br/&gt;descendants (Child Pays for Parent or CPFP).  Only considering&lt;br/&gt;transactions one at a time for submission to the mempool creates a&lt;br/&gt;limitation in the node&amp;#39;s ability to determine which transactions have&lt;br/&gt;the highest feerates, since it cannot take into account descendants&lt;br/&gt;until all the transactions are in the mempool. Similarly, it cannot&lt;br/&gt;use a transaction&amp;#39;s descendants when considering which of two&lt;br/&gt;conflicting transactions to keep (Replace by Fee or RBF).&lt;br/&gt;&lt;br/&gt;When a user&amp;#39;s transaction does not meet a mempool&amp;#39;s minimum feerate&lt;br/&gt;and they cannot create a replacement transaction directly, their&lt;br/&gt;transaction will simply be rejected by this mempool. They also cannot&lt;br/&gt;attach a descendant to pay for replacing a conflicting transaction.&lt;br/&gt;This limitation harms users&amp;#39; ability to fee-bump their transactions.&lt;br/&gt;Further, it presents a security issue in contracting protocols which&lt;br/&gt;rely on **presigned**, time-sensitive transactions to prevent cheating&lt;br/&gt;(HTLC-Timeout in LN Penalty [1] [2] [3], Unvault Cancel in Revault&lt;br/&gt;[4], Refund Transaction in Discreet Log Contracts [5], Updates in&lt;br/&gt;eltoo [6]). In other words, a key security assumption of many&lt;br/&gt;contracting protocols is that all parties can propagate and confirm&lt;br/&gt;transactions in a timely manner.&lt;br/&gt;&lt;br/&gt;In the past few years, increasing attention [0][1][2][3][6] has been&lt;br/&gt;brought to **pinning attacks**, a type of censorship in which the&lt;br/&gt;attacker uses mempool policy restrictions to prevent a transaction&lt;br/&gt;from being relayed or getting mined.  TLDR: revocation transactions&lt;br/&gt;must meet a certain confirmation target to be effective, but their&lt;br/&gt;feerates are negotiated well ahead of broadcast time. If the&lt;br/&gt;forecasted feerate was too low and no fee-bumping options are&lt;br/&gt;available, attackers can steal money from their counterparties. I walk&lt;br/&gt;through a concrete example for stealing Lightning HTLC outputs at&lt;br/&gt;~23:58 in this talk [7][8].  Note that most attacks are only possible&lt;br/&gt;when the market for blockspace at broadcast time  demands much higher&lt;br/&gt;feerates than originally anticipated at signing time. Always&lt;br/&gt;overestimating fees may sidestep this issue temporarily (while mempool&lt;br/&gt;traffic is low and predictable), but this solution is not foolproof&lt;br/&gt;and wastes users&amp;#39; money. The feerate market can change due to sudden&lt;br/&gt;spikes in traffic (e.g. huge 12sat/vB dump a few days ago [9]) or&lt;br/&gt;sustained, high volume of Bitcoin payments (e.g.  April 2021 and&lt;br/&gt;December 2017).&lt;br/&gt;&lt;br/&gt;The best solution is to enable nodes to consider packages of&lt;br/&gt;transactions as a unit, e.g. one or more low-fee parent transactions&lt;br/&gt;with a high-fee child, instead of separately. A package-aware mempool&lt;br/&gt;policy can help determine if it would actually be economically&lt;br/&gt;rational to accept a transaction to the mempool if it doesn&amp;#39;t meet fee&lt;br/&gt;requirements individually. Network-wide adoption of these policies&lt;br/&gt;would create a more purely-feerate-based market for block space and&lt;br/&gt;allow contracting protocols to adjust fees (and therefore mining&lt;br/&gt;priority) at broadcast time.  Some support for packages has existed in&lt;br/&gt;Bitcoin Core for years. Since v0.13, Bitcoin Core has used ancestor&lt;br/&gt;packages instead of individual transactions to evaluate the incentive&lt;br/&gt;compatibility of transactions in the mempool [10] and select them for&lt;br/&gt;inclusion in blocks [11].&lt;br/&gt;&lt;br/&gt;Package Relay, the concept of {announcing, requesting, downloading}&lt;br/&gt;packages between nodes on the p2p network, has also been discussed for&lt;br/&gt;many years. The earliest public mention I can find is from 2015 [12].&lt;br/&gt;The two most common use cases for package relay are fee-bumping&lt;br/&gt;otherwise-too-low-fee transactions and reducing the amount of orphans.&lt;br/&gt;It seems uncontroversial to say that everybody desires package relay&lt;br/&gt;conceptually, with varying degrees of urgency. Lots of work has been&lt;br/&gt;done by others over the past few years, from which I&amp;#39;ve taken&lt;br/&gt;inspiration from [13][14][15][16].&lt;br/&gt;&lt;br/&gt;My approach has been to split the project into two components: (1) Package&lt;br/&gt;Mempool Accept, which includes validation logic and mempool policy.&lt;br/&gt;(3) Package Relay, which includes the p2p protocol changes.&lt;br/&gt;&lt;br/&gt;Progress so far:&lt;br/&gt;After discussions with various developers of contracting protocols&lt;br/&gt;(with heavier emphasis towards LN), it was determined that a&lt;br/&gt;package containing a child with all of its unconfirmed parents&lt;br/&gt;(child-with-unconfirmed-parents or 1-child-multi-parent package) would&lt;br/&gt;be sufficient for their use case, i.e. fee-bumping presigned&lt;br/&gt;transactions. A child-with-unconfirmed-parents package has several&lt;br/&gt;properties that make many things easier to reason about.&lt;br/&gt;&lt;br/&gt;A few months ago, I proposed a set of policies for safe package&lt;br/&gt;validation and fee assessment for packages of this restricted&lt;br/&gt;topology [17]. A series of PRs implementing this proposal have&lt;br/&gt;been merged into Bitcoin Core [18].&lt;br/&gt;&lt;br/&gt;Theoretically, developing a safe and incentive-compatible package&lt;br/&gt;mempool acceptance policy is sufficient to solve this issue. Nodes&lt;br/&gt;could opportunistically accept packages (e.g. by trying combinations&lt;br/&gt;of transactions rejected from their mempools), but this practice would&lt;br/&gt;likely be inefficient at best and open new Denial of Service attacks&lt;br/&gt;at worst. Additional p2p messages may enable nodes to request and&lt;br/&gt;share package validation-related information with one another in a&lt;br/&gt;more communication-efficient way.&lt;br/&gt;&lt;br/&gt;Given that only package RBF remains for package mempool accept, and we&lt;br/&gt;can make progress on p2p and mempool in parallel, I think it’s&lt;br/&gt;appropriate to put forward a package relay proposal.&lt;br/&gt;&lt;br/&gt;==Proposal==&lt;br/&gt;&lt;br/&gt;This proposal contains 2 components: a “generic” package relay&lt;br/&gt;protocol and an extension of it, child-with-unconfirmed-parents&lt;br/&gt;packages, as version 1 package relay. Another version of packages,&lt;br/&gt;“tx-with-unconfirmed-ancestors” can be created to extend package relay&lt;br/&gt;for eliminating orphans.&lt;br/&gt;&lt;br/&gt;===Generic Package Relay===&lt;br/&gt;&lt;br/&gt;Two main ideas are introduced:&lt;br/&gt;&lt;br/&gt;Download and validate packages of transactions together.&lt;br/&gt;&lt;br/&gt;Provide information to help peers decide whether to request and/or how&lt;br/&gt;to validate transactions which are part of a package.&lt;br/&gt;&lt;br/&gt;====Intended Protocol Flow====&lt;br/&gt;&lt;br/&gt;Due to the asynchronous nature of a distributed transaction relay&lt;br/&gt;network, nodes may not receive all of the information needed to&lt;br/&gt;validate a transaction at once. For example, after a node completes&lt;br/&gt;Initial Block Download (IBD) and first starts participating in&lt;br/&gt;transaction relay with an empty mempool, it is common to receive&lt;br/&gt;orphans. In such scenarios where a node is aware that it is missing&lt;br/&gt;information, a &amp;#39;&amp;#39;receiver-initiated&amp;#39;&amp;#39; dialogue is appropriate:&lt;br/&gt;&lt;br/&gt;1. Receiver requests package information.&lt;br/&gt;&lt;br/&gt;2. The sender provides package information, including the wtxids of&lt;br/&gt;   the transactions in the package and anything else that might be&lt;br/&gt;relevant (e.g. total fees and size).&lt;br/&gt;&lt;br/&gt;3. The reciever uses the package information to decide how to request&lt;br/&gt;   and validate the transactions.&lt;br/&gt;&lt;br/&gt;Sometimes, no matter what order transactions are received by a node,&lt;br/&gt;validating them individually is insufficient. When the sender is aware&lt;br/&gt;of additional information that the receiver needs to accept a package,&lt;br/&gt;a proactive &amp;#39;&amp;#39;sender-initiated&amp;#39;&amp;#39; dialogue should be enabled:&lt;br/&gt;&lt;br/&gt;1. Sender announces they have package information pertaining to a&lt;br/&gt;   transaction that might otherwise be undesired on its own.&lt;br/&gt;&lt;br/&gt;2. The receiver requests package information.&lt;br/&gt;&lt;br/&gt;3. The sender provides package information, including the wtxids of&lt;br/&gt;   the transactions in the package and anything else that might be&lt;br/&gt;relevant (e.g. total fees and size).&lt;br/&gt;&lt;br/&gt;4. The reciever uses the package information to decide how to request&lt;br/&gt;   and validate the transactions.&lt;br/&gt;&lt;br/&gt;Package relay is negotiated between two peers during the version&lt;br/&gt;handshake. Package relay requires both peers to support wtxid-based&lt;br/&gt;relay because package transactions are referenced by their wtxid.&lt;br/&gt;&lt;br/&gt;====New Messages====&lt;br/&gt;&lt;br/&gt;Three new protocol messages are added for use in any version of&lt;br/&gt;package relay. Additionally, each version of package relay must define&lt;br/&gt;its own inv type and &amp;#34;pckginfo&amp;#34; message version, referred to in this&lt;br/&gt;document as &amp;#34;MSG_PCKG&amp;#34; and &amp;#34;pckginfo&amp;#34; respectively. See&lt;br/&gt;BIP-v1-packages for a concrete example.&lt;br/&gt;&lt;br/&gt;=====sendpackages=====&lt;br/&gt;&lt;br/&gt;{|&lt;br/&gt;|  Field Name  ||  Type  ||  Size  ||  Purpose&lt;br/&gt;|-&lt;br/&gt;|version || uint32_t || 4 || Denotes a package version supported by the&lt;br/&gt;node.&lt;br/&gt;|-&lt;br/&gt;|max_count || uint32_t || 4 ||Specifies the maximum number of transactions&lt;br/&gt;per package this node is&lt;br/&gt;willing to accept.&lt;br/&gt;|-&lt;br/&gt;|max_weight || uint32_t || 4 ||Specifies the maximum total weight per&lt;br/&gt;package this node is willing&lt;br/&gt;to accept.&lt;br/&gt;|-&lt;br/&gt;|}&lt;br/&gt;&lt;br/&gt;1. The &amp;#34;sendpackages&amp;#34; message has the structure defined above, with&lt;br/&gt;   pchCommand == &amp;#34;sendpackages&amp;#34;.&lt;br/&gt;&lt;br/&gt;2. During version handshake, nodes should send a &amp;#34;sendpackages&amp;#34;&lt;br/&gt;   message indicate they support package relay and may request&lt;br/&gt;packages.&lt;br/&gt;&lt;br/&gt;3. The message should contain a version supported by the node. Nodes&lt;br/&gt;   should send a &amp;#34;sendpackages&amp;#34; message for each version they support.&lt;br/&gt;&lt;br/&gt;4. The &amp;#34;sendpackages&amp;#34; message MUST be sent before sending a &amp;#34;verack&amp;#34;&lt;br/&gt;   message. If a &amp;#34;sendpackages&amp;#34; message is received afer &amp;#34;verack&amp;#34;, the&lt;br/&gt;sender should be disconnected.&lt;br/&gt;&lt;br/&gt;5. If &amp;#39;fRelay==false&amp;#39; in a peer&amp;#39;s version message, the node must not&lt;br/&gt;   send &amp;#34;sendpackages&amp;#34; to them. If a &amp;#34;sendpackages&amp;#34; message is&lt;br/&gt;received by a peer after sending `fRelay==false` in their version&lt;br/&gt;message, the sender should be disconnected.&lt;br/&gt;&lt;br/&gt;6.. Upon receipt of a &amp;#34;sendpackages&amp;#34; message with a version that is&lt;br/&gt;not supported, a node must treat the peer as if it never received the&lt;br/&gt;message.&lt;br/&gt;&lt;br/&gt;7. If both peers send &amp;#34;wtxidrelay&amp;#34; and &amp;#34;sendpackages&amp;#34; with the same&lt;br/&gt;   version, the peers should announce, request, and send package&lt;br/&gt;information to each other.&lt;br/&gt;&lt;br/&gt;=====getpckgtxns=====&lt;br/&gt;&lt;br/&gt;{|&lt;br/&gt;|  Field Name  ||  Type  ||  Size  ||   Purpose&lt;br/&gt;|-&lt;br/&gt;|txns_length||CompactSize||1 or 3 bytes|| The number of transactions&lt;br/&gt;requested.&lt;br/&gt;|-&lt;br/&gt;|txns||List of wtxids||txns_length * 32|| The wtxids of each transaction in&lt;br/&gt;the package.&lt;br/&gt;|}&lt;br/&gt;&lt;br/&gt;1. The &amp;#34;getpckgtxns&amp;#34; message has the structure defined above, with&lt;br/&gt;   pchCommand == &amp;#34;getpckgtxns&amp;#34;.&lt;br/&gt;&lt;br/&gt;2. A &amp;#34;getpckgtxns&amp;#34; message should be used to request all or some of&lt;br/&gt;   the transactions previously announced in a &amp;#34;pckginfo&amp;#34; message,&lt;br/&gt;specified by witness transactiosome id.&lt;br/&gt;&lt;br/&gt;3. Upon receipt of a &amp;#34;getpckgtxns&amp;#34; message, a node must respond with&lt;br/&gt;   either a &amp;#34;pckgtxns&amp;#34; containing the requested transactions or a&lt;br/&gt;&amp;#34;notfound&amp;#34; message indicating one or more of the transactions is&lt;br/&gt;unavailable. This allows the receiver to avoid downloading and storing&lt;br/&gt;transactions that cannot be validated immediately.&lt;br/&gt;&lt;br/&gt;4. A &amp;#34;getpckgtxns&amp;#34; message should only be sent if both peers agreed to&lt;br/&gt;   send packages in the version handshake. If a &amp;#34;getpckgtxns&amp;#34; message&lt;br/&gt;is received from a peer with which package relay was not negotiated,&lt;br/&gt;the sender should be disconnected.&lt;br/&gt;&lt;br/&gt;=====pckgtxns=====&lt;br/&gt;&lt;br/&gt;{|&lt;br/&gt;|  Field Name  ||  Type  ||  Size  ||   Purpose&lt;br/&gt;|-&lt;br/&gt;|txns_length||CompactSize||1 or 3 bytes|| The number of transactions&lt;br/&gt;provided.&lt;br/&gt;|-&lt;br/&gt;|txns||List of transactions||variable|| The transactions in the package.&lt;br/&gt;|}&lt;br/&gt;&lt;br/&gt;1. The &amp;#34;pckgtxns&amp;#34; message has the structure defined above, with&lt;br/&gt;   pchCommand == &amp;#34;pckgtxns&amp;#34;.&lt;br/&gt;&lt;br/&gt;2. A &amp;#34;pckgtxns&amp;#34; message should contain the transaction data requested&lt;br/&gt;   using &amp;#34;getpckgtxns&amp;#34;.&lt;br/&gt;&lt;br/&gt;3. A &amp;#34;pckgtxns&amp;#34; message should only be sent to a peer that requested&lt;br/&gt;   the package using &amp;#34;getpckgtxns&amp;#34;. If a node receives an unsolicited&lt;br/&gt;package, the sender should be disconnected.&lt;br/&gt;&lt;br/&gt;4. A &amp;#34;pckgtxns&amp;#34; message should only be sent if both peers agreed to&lt;br/&gt;   send packages in the version handshake. If a &amp;#34;pckgtxns&amp;#34; message is&lt;br/&gt;received from a peer with which package relay was not negotiated, the&lt;br/&gt;sender should be disconnected.&lt;br/&gt;&lt;br/&gt;===Version 1 Packages: child-with-unconfirmed-parents===&lt;br/&gt;&lt;br/&gt;This extends package relay for packages consisting of one transaction&lt;br/&gt;and all of its unconfirmed parents,by defining version 1 packages, a&lt;br/&gt;pckginfo1 message, and a MSG_PCKG1 inv type. It enables the use case&lt;br/&gt;in which a child pays for its otherwise-too-low-fee parents and their&lt;br/&gt;mempool conflict(s).&lt;br/&gt;&lt;br/&gt;====Intended Protocol Flow====&lt;br/&gt;&lt;br/&gt;When relaying a package of low-fee parent(s) and high-fee child, the&lt;br/&gt;sender and receiver do the following:&lt;br/&gt;&lt;br/&gt;1. Sender announces they have a child-with-unconfirmed-parents package&lt;br/&gt;   for a child that pays for otherwise-too-low-fee parent(s) using&lt;br/&gt;&amp;#34;inv(MSG_PCKG1)&amp;#34;.&lt;br/&gt;&lt;br/&gt;2. The receiver requests package information using&lt;br/&gt;   &amp;#34;getdata(MSG_PCKG1)&amp;#34;.&lt;br/&gt;&lt;br/&gt;3. The sender provides package information using &amp;#34;pckginfo1&amp;#34;,&lt;br/&gt;   including the blockhash of the sender&amp;#39;s best block, the wtxids of&lt;br/&gt;the transactions in the package, their total fees and total weight.&lt;br/&gt;&lt;br/&gt;4. The reciever uses the package information to decide how to request&lt;br/&gt;   the transactions. For example, if the receiver already has some of&lt;br/&gt;the transactions in their mempool, they only request the missing ones.&lt;br/&gt;They could also decide not to request the package at all based on the&lt;br/&gt;fee information provided.&lt;br/&gt;&lt;br/&gt;5. Upon receiving a &amp;#34;pckgtxns&amp;#34;, the receiver submits the transactions&lt;br/&gt;   together as a package.&lt;br/&gt;&lt;br/&gt;====New Messages====&lt;br/&gt;&lt;br/&gt;A new inv type, &amp;#34;MSG_PCKG1&amp;#34;, and new protocol message, &amp;#34;PCKGINFO1&amp;#34;,&lt;br/&gt;are added.&lt;br/&gt;&lt;br/&gt;=====pckginfo1=====&lt;br/&gt;&lt;br/&gt;{|&lt;br/&gt;|  Field Name  ||  Type  ||  Size  ||   Purpose&lt;br/&gt;|-&lt;br/&gt;|blockhash || uint256 || 32 || The chain tip at which this package is&lt;br/&gt;defined.&lt;br/&gt;|-&lt;br/&gt;|pckg_fee||CAmount||4|| The sum total fees paid by all transactions in the&lt;br/&gt;package.&lt;br/&gt;|-&lt;br/&gt;|pckg_weight||int64_t||8|| The sum total weight of all transactions in the&lt;br/&gt;package.&lt;br/&gt;|-&lt;br/&gt;|txns_length||CompactSize||1 or 3 bytes|| The number of transactions&lt;br/&gt;provided.&lt;br/&gt;|-&lt;br/&gt;|txns||List of wtxids||txns_length * 32|| The wtxids of each transaction in&lt;br/&gt;the package.&lt;br/&gt;|}&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;1. The &amp;#34;pckginfo1&amp;#34; message has the structure defined above, with&lt;br/&gt;   pchCommand == &amp;#34;pckginfo1&amp;#34;.&lt;br/&gt;&lt;br/&gt;2. A &amp;#34;pckginfo1&amp;#34; message contains information about a version 1&lt;br/&gt;   package (defined below), referenced by the wtxid of the transaction&lt;br/&gt;it pertains to and the current blockhash.&lt;br/&gt;&lt;br/&gt;3. Upon receipt of a &amp;#34;pckginfo1&amp;#34; message, the node should decide if it&lt;br/&gt;   wants to validate the package, request transaction data if&lt;br/&gt;necessary, etc.&lt;br/&gt;&lt;br/&gt;4. Upon receipt of a malformed &amp;#34;pckginfo1&amp;#34; message or package that&lt;br/&gt;   does not abide by the max_count, max_weight, or other rules&lt;br/&gt;specified by the version agreed upon in the initial negotiation, the&lt;br/&gt;sender should be disconnected.  If a node receives a &amp;#34;pckginfo1&amp;#34;&lt;br/&gt;message for which the &amp;#34;pckg_fee&amp;#34; or &amp;#34;pckg_weight&amp;#34; do not reflect the&lt;br/&gt;true total fees and weight, respectively, or the transactions in the&lt;br/&gt;package, the message is malformed.&lt;br/&gt;&lt;br/&gt;5. A node MUST NOT send a &amp;#34;pckginfo1&amp;#34; message that has not been&lt;br/&gt;   requested by the recipient. Upon receipt of an unsolicited&lt;br/&gt;&amp;#34;pckginfo1&amp;#34;, a node should disconnect the sender.&lt;br/&gt;&lt;br/&gt;6. A &amp;#34;pckginfo1&amp;#34; message should only be sent if both peers agreed to&lt;br/&gt;   send version 1 packages in the version handshake. If a &amp;#34;pckginfo1&amp;#34;&lt;br/&gt;message is received from a peer with which package relay was not&lt;br/&gt;negotiated, the sender should be disconnected.&lt;br/&gt;&lt;br/&gt;=====MSG_PCKG1=====&lt;br/&gt;&lt;br/&gt;1. A new inv type (MSG_PCKG1 == 0x6) is added, for use in inv messages&lt;br/&gt;   and getdata requests pertaining to version 1 packages.&lt;br/&gt;&lt;br/&gt;2. As an inv type, it indicates that both transaction data and version&lt;br/&gt;   1 package information are available for the transaction. The&lt;br/&gt;transaction is referenced by its wtxid. As a getdata request type, it&lt;br/&gt;indicates that the sender wants package information for the&lt;br/&gt;transaction.&lt;br/&gt;&lt;br/&gt;3. Upon receipt of a &amp;#34;getdata&amp;#34; request for &amp;#34;MSG_PCKG1&amp;#34;, the node&lt;br/&gt;   should respond with the version 1 package corresponding to the&lt;br/&gt;requested transaction and its current chain tip, or with NOTFOUND.&lt;br/&gt;The node should not assume that the sender is requesting the&lt;br/&gt;transaction data as well.&lt;br/&gt;&lt;br/&gt;====Child With Parent Packages Rules====&lt;br/&gt;&lt;br/&gt;A child-with-unconfirmed-parents package sent between nodes must abide&lt;br/&gt;by the rules below, otherwise the package is malformed and the sender&lt;br/&gt;should be disconnected.&lt;br/&gt;&lt;br/&gt;A version 1 or &amp;#39;&amp;#39;child-with-unconfirmed-parents&amp;#39;&amp;#39; package can be&lt;br/&gt;defined for any transaction that spends unconfirmed inputs. The child&lt;br/&gt;can be thought of as the &amp;#34;representative&amp;#34; of the package. This package&lt;br/&gt;can be uniquely identified by the transaction&amp;#39;s wtxid and the current&lt;br/&gt;chain tip block hash.&lt;br/&gt;&lt;br/&gt;A &amp;#39;&amp;#39;child-with-unconfirmed-parents&amp;#39;&amp;#39; package MUST be:&lt;br/&gt;&lt;br/&gt;1. &amp;#39;&amp;#39;Sorted topologically.&amp;#39;&amp;#39; For every transaction t in the package,&lt;br/&gt;   if any of t&amp;#39;s parents are present in the package, the parent must&lt;br/&gt;appear somewhere in the list before t. In other words, the&lt;br/&gt;transactions must be sorted in ascending order of the number of&lt;br/&gt;ancestors present in the package.&lt;br/&gt;&lt;br/&gt;2. &amp;#39;&amp;#39;Only 1 child with unconfirmed parents.&amp;#39;&amp;#39; The package must consist&lt;br/&gt;   of one transaction and its unconfirmed parents. There must not be&lt;br/&gt;any other transactions in the package. Other dependency relationships&lt;br/&gt;may exist within the package (e.g. one parent may spend the output of&lt;br/&gt;another parent) provided that topological order is respected.&lt;br/&gt;&lt;br/&gt;3. &amp;#39;&amp;#39;All unconfirmed parents.&amp;#39;&amp;#39; All of the child&amp;#39;s unconfirmed parents&lt;br/&gt;   must be present.&lt;br/&gt;&lt;br/&gt;4. &amp;#39;&amp;#39;No conflicts.&amp;#39;&amp;#39; None of the transactions in the package may&lt;br/&gt;   conflict with each other (i.e.  spend the same prevout).&lt;br/&gt;&lt;br/&gt;5. &amp;#39;&amp;#39;Total fees and weight.&amp;#39;&amp;#39; The &amp;#39;total_fee&amp;#39; and &amp;#39;total_weight&amp;#39;&lt;br/&gt;   fields must accurately represent the sum total of all transactions&amp;#39;&lt;br/&gt;fees and weights as defined in BIP141, respectively.&lt;br/&gt;&lt;br/&gt;Not all of the child&amp;#39;s parents must be present; the child transaction&lt;br/&gt;may also spend confirmed inputs. However, if the child has confirmed&lt;br/&gt;parents, they must not be in the package.&lt;br/&gt;&lt;br/&gt;While a child-with-unconfirmed-parents package is perhaps most&lt;br/&gt;relevant when the child has a higher feerate than its parents, this&lt;br/&gt;property is not required to construct a valid package.&lt;br/&gt;&lt;br/&gt;====Clarifications====&lt;br/&gt;&lt;br/&gt;&amp;#39;&amp;#39;Q: Under what circumstances should a sender announce a&lt;br/&gt;child-with-unconfirmed-parents package?&amp;#39;&amp;#39;&lt;br/&gt;&lt;br/&gt;A child-with-unconfirmed-parents package for a transaction should be&lt;br/&gt;announced when it meets the peer&amp;#39;s fee filter but one or more of its&lt;br/&gt;parents don&amp;#39;t; a &amp;#34;inv(MSG_PCKG1)&amp;#34; instead of &amp;#34;inv(WTX)&amp;#34; should be sent&lt;br/&gt;for the child. Each of the parents which meet the peer&amp;#39;s fee filter&lt;br/&gt;should still be announced normally.&lt;br/&gt;&lt;br/&gt;&amp;#39;&amp;#39;Q: What if a new block arrives in between messages?&amp;#39;&amp;#39;&lt;br/&gt;&lt;br/&gt;A child-with-unconfirmed-parents package is defined for a transaction&lt;br/&gt;based on the current chain state. As such, a new block extending the&lt;br/&gt;tip may decrease the number of transactions in the package (i.e. if&lt;br/&gt;any of the transaction&amp;#39;s parents were included in the block). In a&lt;br/&gt;reorg, the number of transactions in the package may decrease or&lt;br/&gt;increase (i.e. if any of the transaction&amp;#39;s parents were included in a&lt;br/&gt;block in the previous chain but not the new one).&lt;br/&gt;&lt;br/&gt;If the new block arrives before the &amp;#34;getdata&amp;#34; or &amp;#34;pckginfo1&amp;#34;, nothing&lt;br/&gt;needs to change.&lt;br/&gt;&lt;br/&gt;If the new block arrives before &amp;#34;getpckgtxns&amp;#34; or before &amp;#34;pckgtxns&amp;#34;,&lt;br/&gt;the receiver may need to re-request package information if the block&lt;br/&gt;contained a transaction in the package. If the block doesn&amp;#39;t contain&lt;br/&gt;any transactions in the package, whether it extends the previous tip&lt;br/&gt;or causes a reorg, nothing needs to change.&lt;br/&gt;&lt;br/&gt;&amp;#39;&amp;#39;Q: Can &amp;#34;getpckgtxns&amp;#34; and &amp;#34;pckgtxns&amp;#34; messages contain only one&lt;br/&gt;transaction?&amp;#39;&amp;#39;&lt;br/&gt;&lt;br/&gt;Yes.&lt;br/&gt;&lt;br/&gt;===Further Protocol Extensions===&lt;br/&gt;&lt;br/&gt;When introducing a new type of package, assign it a version number &amp;#34;n&amp;#34;&lt;br/&gt;and use an additional &amp;#34;sendpackages&amp;#34; message during version handshake&lt;br/&gt;to negotiate support for it. An additional package information message&lt;br/&gt;&amp;#34;pckginfon&amp;#34; and inv type &amp;#34;MSG_PCKGn&amp;#34; should be defined for the type of&lt;br/&gt;package.  However, &amp;#34;getpckgtxns&amp;#34; and &amp;#34;pckgtxns&amp;#34; do not need to be&lt;br/&gt;changed.&lt;br/&gt;&lt;br/&gt;Example proposal for tx-with-unconfirmed-ancestors package relay: [19]&lt;br/&gt;&lt;br/&gt;===Compatibility===&lt;br/&gt;&lt;br/&gt;Older clients remain fully compatible and interoperable after this&lt;br/&gt;change. Clients implementing this protocol will only attempt to send&lt;br/&gt;and request packages if agreed upon during the version handshake.&lt;br/&gt;&lt;br/&gt;===Package Erlay===&lt;br/&gt;&lt;br/&gt;Clients using BIP330 reconciliation-based transaction relay (Erlay)&lt;br/&gt;are able to use package relay without interference. In fact, a package&lt;br/&gt;of transactions may be announced using both Erlay and package relay.&lt;br/&gt;After reconciliation, if the initiator would have announced a&lt;br/&gt;transaction by wtxid but also has package information for it, they may&lt;br/&gt;send &amp;#34;inv(MSG_PCKG)&amp;#34; instead of &amp;#34;inv(WTX)&amp;#34;.&lt;br/&gt;&lt;br/&gt;===Rationale===&lt;br/&gt;&lt;br/&gt;====P2P Message Design====&lt;br/&gt;&lt;br/&gt;These p2p messages are added for communication efficiency and, as&lt;br/&gt;such, one should measure alternative solutions based on the resources&lt;br/&gt;used to communicate (not necessarily trustworthy) information: We&lt;br/&gt;would like to minimize network bandwidth, avoid downloading a&lt;br/&gt;transaction more than once, avoid downloading transactions that are&lt;br/&gt;eventually rejected, and minimize storage allocated for&lt;br/&gt;not-yet-validated transactions.&lt;br/&gt;&lt;br/&gt;Consider these (plausible) scenarios in transaction relay:&lt;br/&gt;&lt;br/&gt;Alice (the &amp;#34;sender&amp;#34;) is relaying transactions to Bob (the &amp;#34;receiver&amp;#34;).&lt;br/&gt;Alice&amp;#39;s mempool has a minimum feerate of 1sat/vB and Bob&amp;#39;s has a&lt;br/&gt;minimum feerate of 3sat/vB. For simplicity, all transactions are&lt;br/&gt;1600Wu in virtual size and 500 bytes in serialized size. Apart from&lt;br/&gt;the spending relationships specified, all other inputs are from&lt;br/&gt;confirmed UTXOs.&lt;br/&gt;&lt;br/&gt;1. Package {A, B} where A pays 0 satoshis and B pays 8000 satoshis in&lt;br/&gt;   fees.&lt;br/&gt;&lt;br/&gt;2. Package {C, D} where C pays 0 satoshis and D pays 1200 satoshis in&lt;br/&gt;   fees.&lt;br/&gt;&lt;br/&gt;3. Package {E, F, G, H, J} that pays 4000, 8000, 0, 2000, and 4000&lt;br/&gt;   satoshis in fees, respectively.&lt;br/&gt;&lt;br/&gt;====Alternative Designs Considered====&lt;br/&gt;&lt;br/&gt;&amp;#39;&amp;#39;Package Information Only:&amp;#39;&amp;#39; Just having &amp;#34;pckginfo&amp;#34; gives enough&lt;br/&gt;information for the receiver to accept the package. Omit the&lt;br/&gt;&amp;#34;getpckgtxns&amp;#34; and &amp;#34;pckgtxns&amp;#34; messages. While this option is a good&lt;br/&gt;fallback if batched transaction download fails for some reason, it&lt;br/&gt;shouldn&amp;#39;t be used as the default because it &amp;#39;always&amp;#39; requires storage&lt;br/&gt;of unvalidated transactions.&lt;br/&gt;&lt;br/&gt;&amp;#39;&amp;#39;No Package Information Round:&amp;#39;&amp;#39; Instead of having a package&lt;br/&gt;information round, just use the child&amp;#39;s wtxid to refer to the package&lt;br/&gt;and always send the entire package together. This would cause nodes to&lt;br/&gt;redownload duplicate transactions.&lt;br/&gt;&lt;br/&gt;I have also created a slidedeck exploring various alternative designs&lt;br/&gt;and some examples in which they fall flat [20]. Please feel free to&lt;br/&gt;suggest other alternatives.&lt;br/&gt;&lt;br/&gt;====Versioning System====&lt;br/&gt;&lt;br/&gt;This protocol should be extensible to support multiple types of&lt;br/&gt;packages based on future desired use cases. Two &amp;#34;flavors&amp;#34; of&lt;br/&gt;versioning were considered:&lt;br/&gt;&lt;br/&gt;1. When package mempool acceptance is upgraded to support more types&lt;br/&gt;   of packages, increment the version number (similar to Erlay).&lt;br/&gt;During version handshake, peers negotiate which version of package&lt;br/&gt;relay they will use by each sending one &amp;#34;sendpackages&amp;#34; message.&lt;br/&gt;&lt;br/&gt;2. When introducing another type of package, assign a version number&lt;br/&gt;   to it and announce it as an additional supported version (similar&lt;br/&gt;to Compact Block Relay). During version handshake, peers send one&lt;br/&gt;&amp;#34;sendpackages&amp;#34; message for each version supported.&lt;br/&gt;&lt;br/&gt;The second option was favored because it allows different parameters&lt;br/&gt;for different versions.  For example, it should be possible to support&lt;br/&gt;both &amp;#34;arbitrary topology but maximum 3-transaction&amp;#34; package as well as&lt;br/&gt;&amp;#34;child-with-unconfirmed-parents with default mempool ancestor limits&amp;#34;&lt;br/&gt;packages simultaneously.&lt;br/&gt;&lt;br/&gt;==Acknowledgements==&lt;br/&gt;&lt;br/&gt;I hope to have made it abundantly clear that this proposal isn’t&lt;br/&gt;inventing the concept of package relay, and in fact builds upon years&lt;br/&gt;of work by many others, including Suhas Daftuar and Antoine Riard.&lt;br/&gt;&lt;br/&gt;Thank you to John Newbery and Martin Zumsande for input on the design.&lt;br/&gt;&lt;br/&gt;Thank you to Matt Corallo, Christian Decker, David Harding, Antoine&lt;br/&gt;Poinsot, Antoine Riard, Gregory Sanders, Chris Stewart, Bastien&lt;br/&gt;Teinturier, and others for input on the desired interface for&lt;br/&gt;contracting protocols.&lt;br/&gt;&lt;br/&gt;Looking forward to hearing your thoughts!&lt;br/&gt;&lt;br/&gt;Best,&lt;br/&gt;Gloria&lt;br/&gt;&lt;br/&gt;[0]:&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-January/019817.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-January/019817.html&lt;/a&gt;&lt;br/&gt;[1]:&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-April/002639.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-April/002639.html&lt;/a&gt;&lt;br/&gt;[2]:&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-June/002758.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-June/002758.html&lt;/a&gt;&lt;br/&gt;[3]: &lt;a href=&#34;https://github.com/t-bast/lightning-docs/blob/master/pinning-attacks.md&#34;&gt;https://github.com/t-bast/lightning-docs/blob/master/pinning-attacks.md&lt;/a&gt;&lt;br/&gt;[4]:&lt;br/&gt;&lt;a href=&#34;https://github.com/revault/practical-revault/blob/master/transactions.md#cancel_tx&#34;&gt;https://github.com/revault/practical-revault/blob/master/transactions.md#cancel_tx&lt;/a&gt;&lt;br/&gt;[5]:&lt;br/&gt;&lt;a href=&#34;https://github.com/discreetlogcontracts/dlcspecs/blob/master/Transactions.md#refund-transaction&#34;&gt;https://github.com/discreetlogcontracts/dlcspecs/blob/master/Transactions.md#refund-transaction&lt;/a&gt;&lt;br/&gt;[6]: &lt;a href=&#34;https://gist.github.com/instagibbs/60264606e181451e977e439a49f69fe1&#34;&gt;https://gist.github.com/instagibbs/60264606e181451e977e439a49f69fe1&lt;/a&gt;&lt;br/&gt;[7]:&lt;br/&gt;&lt;a href=&#34;https://btctranscripts.com/adopting-bitcoin/2021/2021-11-16-gloria-zhao-transaction-relay-policy/#lightning-attacks&#34;&gt;https://btctranscripts.com/adopting-bitcoin/2021/2021-11-16-gloria-zhao-transaction-relay-policy/#lightning-attacks&lt;/a&gt;&lt;br/&gt;[8]: &lt;a href=&#34;https://youtu.be/fbWSQvJjKFs?t=1438&#34;&gt;https://youtu.be/fbWSQvJjKFs?t=1438&lt;/a&gt;&lt;br/&gt;[9]:&lt;br/&gt;&lt;a href=&#34;https://www.reddit.com/r/Bitcoin/comments/unew4e/looks_like_70_mvb_of_transactions_just_got_dumped/&#34;&gt;https://www.reddit.com/r/Bitcoin/comments/unew4e/looks_like_70_mvb_of_transactions_just_got_dumped/&lt;/a&gt;&lt;br/&gt;[10]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/7594&#34;&gt;https://github.com/bitcoin/bitcoin/pull/7594&lt;/a&gt;&lt;br/&gt;[11]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/7600&#34;&gt;https://github.com/bitcoin/bitcoin/pull/7600&lt;/a&gt;&lt;br/&gt;[12]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/6455#issuecomment-122716820&#34;&gt;https://github.com/bitcoin/bitcoin/pull/6455#issuecomment-122716820&lt;/a&gt;&lt;br/&gt;[13]: &lt;a href=&#34;https://gist.github.com/sdaftuar/8756699bfcad4d3806ba9f3396d4e66a&#34;&gt;https://gist.github.com/sdaftuar/8756699bfcad4d3806ba9f3396d4e66a&lt;/a&gt;&lt;br/&gt;[14]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/issues/14895&#34;&gt;https://github.com/bitcoin/bitcoin/issues/14895&lt;/a&gt;&lt;br/&gt;[15]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/16401&#34;&gt;https://github.com/bitcoin/bitcoin/pull/16401&lt;/a&gt;&lt;br/&gt;[16]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/19621&#34;&gt;https://github.com/bitcoin/bitcoin/pull/19621&lt;/a&gt;&lt;br/&gt;[17]:&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019464.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019464.html&lt;/a&gt;&lt;br/&gt;[18]: &lt;a href=&#34;https://github.com/users/glozow/projects/5/views/4?layout=board&#34;&gt;https://github.com/users/glozow/projects/5/views/4?layout=board&lt;/a&gt;&lt;br/&gt;[19]: &lt;a href=&#34;https://gist.github.com/glozow/9b321cd3ef6505135c763112033ff2a7&#34;&gt;https://gist.github.com/glozow/9b321cd3ef6505135c763112033ff2a7&lt;/a&gt;&lt;br/&gt;[20]:&lt;br/&gt;&lt;a href=&#34;https://docs.google.com/presentation/d/1B__KlZO1VzxJGx-0DYChlWawaEmGJ9EGApEzrHqZpQc/edit?usp=sharing&#34;&gt;https://docs.google.com/presentation/d/1B__KlZO1VzxJGx-0DYChlWawaEmGJ9EGApEzrHqZpQc/edit?usp=sharing&lt;/a&gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220517/f2e7c128/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220517/f2e7c128/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-08T01:09:41&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsq09uuj24tt47yt8ldq0gga57vuatpmd9xkzjujpr2335qmy0cg2qzyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2q4mrdaq</id>
    
      <title type="html">📅 Original date posted:2022-01-27 📝 Original message:Hi ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsq09uuj24tt47yt8ldq0gga57vuatpmd9xkzjujpr2335qmy0cg2qzyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2q4mrdaq" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsdemuq9cce3pvhjeshku7fpk4vzrfke66zl2fx27u95zekyjpj92q6twr3n&#39;&gt;nevent1q…wr3n&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-01-27&lt;br/&gt;📝 Original message:Hi everyone,&lt;br/&gt;&lt;br/&gt;This post discusses limitations of current Bitcoin Core RBF policy and&lt;br/&gt;attempts to start a conversation about how we can improve it,&lt;br/&gt;summarizing some ideas that have been discussed. Please reply if you&lt;br/&gt;have any new input on issues to be solved and ideas for improvement!&lt;br/&gt;&lt;br/&gt;Just in case I&amp;#39;ve screwed up the text wrapping again, another copy can be&lt;br/&gt;found here: &lt;a href=&#34;https://gist.github.com/glozow/25d9662c52453bd08b4b4b1d3783b9ff&#34;&gt;https://gist.github.com/glozow/25d9662c52453bd08b4b4b1d3783b9ff&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;## Background&lt;br/&gt;&lt;br/&gt;Please feel free to skip this section if you are already familiar&lt;br/&gt;with RBF.&lt;br/&gt;&lt;br/&gt;Nodes may receive *conflicting* unconfirmed transactions, aka&lt;br/&gt;&amp;#34;double spends&amp;#34; of the same inputs. Instead of always keeping the&lt;br/&gt;first transaction, since v0.12, Bitcoin Core mempool policy has&lt;br/&gt;included a set of Replace-by-Fee (RBF) criteria that allows the second&lt;br/&gt;transaction to replace the first one and any descendants it may have.&lt;br/&gt;&lt;br/&gt;Bitcoin Core RBF policy was previously documented as BIP 125.&lt;br/&gt;The current RBF policy is documented [here][1]. In summary:&lt;br/&gt;&lt;br/&gt;1. The directly conflicting transactions all signal replaceability&lt;br/&gt;   explicitly.&lt;br/&gt;&lt;br/&gt;2. The replacement transaction only includes an unconfirmed input if&lt;br/&gt;   that input was included in one of the directly conflicting&lt;br/&gt;transactions.&lt;br/&gt;&lt;br/&gt;3. The replacement transaction pays an absolute fee of at least the&lt;br/&gt;   sum paid by the original transactions.&lt;br/&gt;&lt;br/&gt;4. The additional fees pays for the replacement transaction&amp;#39;s&lt;br/&gt;   bandwidth at or above the rate set by the node&amp;#39;s *incremental relay&lt;br/&gt;feerate*.&lt;br/&gt;&lt;br/&gt;5. The sum of all directly conflicting transactions&amp;#39; descendant counts&lt;br/&gt;   (number of transactions inclusive of itself and its descendants)&lt;br/&gt;does not exceed 100.&lt;br/&gt;&lt;br/&gt;We can split these rules into 3 categories/goals:&lt;br/&gt;&lt;br/&gt;- **Allow Opting Out**: Some applications/businesses are unable to&lt;br/&gt;  handle transactions that are replaceable (e.g. merchants that use&lt;br/&gt;zero-confirmation transactions). We (try to) help these businesses by&lt;br/&gt;honoring BIP125 signaling; we won&amp;#39;t replace transactions that have not&lt;br/&gt;opted in.&lt;br/&gt;&lt;br/&gt;- **Incentive Compatibility**: Ensure that our RBF policy would not&lt;br/&gt;  accept replacement transactions which would decrease fee profits&lt;br/&gt;  of a miner. In general, if our mempool policy deviates from what is&lt;br/&gt;economically rational, it&amp;#39;s likely that the transactions in our&lt;br/&gt;mempool will not match the ones in miners&amp;#39; mempools, making our&lt;br/&gt;fee estimation, compact block relay, and other mempool-dependent&lt;br/&gt;functions unreliable. Incentive-incompatible policy may also&lt;br/&gt;encourage transaction submission through routes other than the p2p&lt;br/&gt;network, harming censorship-resistance and privacy of Bitcoin payments.&lt;br/&gt;&lt;br/&gt;- **DoS Protection**: Limit two types of DoS attacks on the node&amp;#39;s&lt;br/&gt;  mempool: (1) the number of times a transaction can be replaced and&lt;br/&gt;(2) the volume of transactions that can be evicted during a&lt;br/&gt;replacement.&lt;br/&gt;&lt;br/&gt;Even more abstract: our goal is to make a replacement policy that&lt;br/&gt;results in a useful interface for users and safe policy for&lt;br/&gt;node operators.&lt;br/&gt;&lt;br/&gt;## Motivation&lt;br/&gt;&lt;br/&gt;There are a number of known problems with the current RBF policy.&lt;br/&gt;Many of these shortcomings exist due to mempool limitations at the&lt;br/&gt;time RBF was implemented or result from new types of Bitcoin usage;&lt;br/&gt;they are not criticisms of the original design.&lt;br/&gt;&lt;br/&gt;### Pinning Attacks&lt;br/&gt;&lt;br/&gt;The most pressing concern is that attackers may take advantage of&lt;br/&gt;limitations in RBF policy to prevent other users&amp;#39; transactions from&lt;br/&gt;being mined or getting accepted as a replacement.&lt;br/&gt;&lt;br/&gt;#### SIGHASH_ANYONECANPAY Pinning&lt;br/&gt;&lt;br/&gt;BIP125#2 can be bypassed by creating intermediary transactions to be&lt;br/&gt;replaced together. Anyone can simply split a 1-input 1-output&lt;br/&gt;transaction off from the replacement transaction, then broadcast the&lt;br/&gt;transaction as is. This can always be done, and quite cheaply. More&lt;br/&gt;details in [this comment][2].&lt;br/&gt;&lt;br/&gt;In general, if a transaction is signed with SIGHASH\_ANYONECANPAY,&lt;br/&gt;anybody can just attach a low feerate parent to this transaction and&lt;br/&gt;lower its ancestor feerate.  Even if you require SIGHASH\_ALL which&lt;br/&gt;prevents an attacker from changing any outputs, the input can be a&lt;br/&gt;very low amount (e.g. just above the dust limit) from a low-fee&lt;br/&gt;ancestor and still bring down the ancestor feerate of the transaction.&lt;br/&gt;&lt;br/&gt;TLDR: if your transaction is signed with SIGHASH\_ANYONECANPAY and&lt;br/&gt;signals replaceability, regardless of the feerate you broadcast at, an&lt;br/&gt;attacker can lower its mining priority by adding an ancestor.&lt;br/&gt;&lt;br/&gt;#### Absolute Fee&lt;br/&gt;&lt;br/&gt;The restriction of requiring replacement transactions to increase the&lt;br/&gt;absolute fee of the mempool has been described as &amp;#34;bonkers.&amp;#34; If the&lt;br/&gt;original transaction has a very large descendant that pays a large&lt;br/&gt;amount of fees, even if it has a low feerate, the replacement&lt;br/&gt;transaction must now pay those fees in order to meet Rule #3.&lt;br/&gt;&lt;br/&gt;#### Package RBF&lt;br/&gt;&lt;br/&gt;There are a number of reasons why, in order to enable Package RBF, we&lt;br/&gt;cannot use the same criteria.&lt;br/&gt;&lt;br/&gt;For starters, the absolute fee pinning attack is especially&lt;br/&gt;problematic if we apply the same rules (i.e. Rule #3 and #4) in&lt;br/&gt;Package RBF. Imagine that Alice (honest) and Bob (adversary) share a&lt;br/&gt;LN channel. The mempool is rather full, so their pre-negotiated&lt;br/&gt;commitment transactions&amp;#39; feerates would not be considered high&lt;br/&gt;priority by miners.  Bob broadcasts his commitment transaction and&lt;br/&gt;attaches a very large child (100KvB with 100,000sat in fees) to his&lt;br/&gt;anchor output. Alice broadcasts her commitment transaction with a&lt;br/&gt;fee-bumping child (200vB with 50,000sat fees which is a generous&lt;br/&gt;250sat/vB), but this does not meet the absolute fee requirement. She&lt;br/&gt;would need to add another 50,000sat to replace Bob&amp;#39;s commitment&lt;br/&gt;transaction.&lt;br/&gt;&lt;br/&gt;Disallowing new unconfirmed inputs (Rule #2) in Package RBF would be&lt;br/&gt;broken for packages containing transactions already in the mempool,&lt;br/&gt;explained [here][7].&lt;br/&gt;&lt;br/&gt;Note: I originally [proposed][6] Package RBF using the same Rule #3&lt;br/&gt;and #4 before I realized how significant this pinning attack is. I&amp;#39;m&lt;br/&gt;retracting that proposal, and a new set of Package RBF rules would&lt;br/&gt;follow from whatever the new individual RBF rules end up being.&lt;br/&gt;&lt;br/&gt;#### Same Txid Different Witness&lt;br/&gt;&lt;br/&gt;Two transactions with the same non-witness data but different&lt;br/&gt;witnesses have the same txid but different wtxid, and the same fee but&lt;br/&gt;not necessarily the same feerate. Currently, if we see a transaction&lt;br/&gt;that has the same txid as one in the mempool, we reject it as a&lt;br/&gt;duplicate, even if the feerate is much higher. It&amp;#39;s unclear to me if&lt;br/&gt;we have a very strong reason to change this, but noting it as a&lt;br/&gt;limitation of our current replacement policy. See [#24007][12].&lt;br/&gt;&lt;br/&gt;### User Interface&lt;br/&gt;&lt;br/&gt;#### Using Unconfirmed UTXOs to Fund Replacements&lt;br/&gt;&lt;br/&gt;The restriction of only allowing confirmed UTXOs for funding a&lt;br/&gt;fee-bump (Rule #2) can hurt users trying to fee-bump their&lt;br/&gt;transactions and complicate wallet implementations. If the original&lt;br/&gt;transaction&amp;#39;s output value isn&amp;#39;t sufficient to fund a fee-bump and/or&lt;br/&gt;all of the user&amp;#39;s other UTXOs are unconfirmed, they might not be able&lt;br/&gt;to fund a replacement transaction. Wallet developers also need to&lt;br/&gt;treat self-owned unconfirmed UTXOs as unusable for fee-bumping, which&lt;br/&gt;adds complexity to wallet logic. For example, see BDK issues [#144][4]&lt;br/&gt;and [#414][5].&lt;br/&gt;&lt;br/&gt;#### Interface Not Suitable for Coin Selection&lt;br/&gt;&lt;br/&gt;Currently, a user cannot simply create a replacement transaction&lt;br/&gt;targeting a specific feerate or meeting a minimum fee amount and&lt;br/&gt;expect to meet the RBF criteria. The fee amount depends on the size of&lt;br/&gt;the replacement transaction, and feerate is almost irrelevant.&lt;br/&gt;&lt;br/&gt;Bitcoin Core&amp;#39;s `bumpfee` doesn&amp;#39;t use the RBF rules when funding the&lt;br/&gt;replacement. It [estimates][13] a feerate which is &amp;#34;wallet incremental&lt;br/&gt;relay fee&amp;#34; (a conservative overestimation of the node&amp;#39;s incremental&lt;br/&gt;relay fee) higher than the original transaction, selects coins for&lt;br/&gt;that feerate, and hopes that it meets the RBF rules. It never fails&lt;br/&gt;Rule #3 and #4 because it uses all original inputs and refuses to&lt;br/&gt;bump a transaction with mempool descendants.&lt;br/&gt;&lt;br/&gt;This is suboptimal, but is designed to work with the coin selection&lt;br/&gt;engine: select a feerate first, and then add fees to cover it.&lt;br/&gt;Following the exact RBF rules would require working the other way&lt;br/&gt;around: based on how much fees we&amp;#39;ve added to the transaction and its&lt;br/&gt;current size, calculate the feerate to see if we meet Rule #4.&lt;br/&gt;&lt;br/&gt;While this isn&amp;#39;t completely broken, and the user interface is&lt;br/&gt;secondary to the safety of the mempool policy, we can do much better.&lt;br/&gt;A much more user-friendly interface would depend *only* on the&lt;br/&gt;fee and size of the original transactions.&lt;br/&gt;&lt;br/&gt;### Updates to Mempool and Mining&lt;br/&gt;&lt;br/&gt;Since RBF was first implemented, a number of improvements have been&lt;br/&gt;made to mempool and mining logic. For example, we now use ancestor&lt;br/&gt;feerates in mining (allowing CPFP), and keep track of ancestor&lt;br/&gt;packages in the mempool.&lt;br/&gt;&lt;br/&gt;## Ideas for Improvements&lt;br/&gt;&lt;br/&gt;### Goals&lt;br/&gt;&lt;br/&gt;To summarize, these seem to be desired changes, in order of priority:&lt;br/&gt;&lt;br/&gt;1. Remove Rule #3. The replacement should not be *required* to pay&lt;br/&gt;higher absolute fees.&lt;br/&gt;&lt;br/&gt;2. Make it impossible for a replacement transaction to have a lower&lt;br/&gt;mining score than the original transaction(s). This would eliminate&lt;br/&gt;the `SIGHASH\_ANYONECANPAY` pinning attack.&lt;br/&gt;&lt;br/&gt;3. Remove Rule #2. Adding new unconfirmed inputs should be allowed.&lt;br/&gt;&lt;br/&gt;4. Create a more helpful interface that helps wallet fund replacement&lt;br/&gt;transactions that aim for a feerate and fee.&lt;br/&gt;&lt;br/&gt;### A Different Model for Fees&lt;br/&gt;&lt;br/&gt;For incentive compatibility, I believe there are different&lt;br/&gt;formulations we should consider.  Most importantly, if we want to get&lt;br/&gt;rid of the absolute fee rule, we can no longer think of it as &amp;#34;the&lt;br/&gt;transaction needs to pay for its own bandwidth,&amp;#34; since we won&amp;#39;t always&lt;br/&gt;be getting additional fees. That means we need a new method of&lt;br/&gt;rate-limiting replacements that doesn&amp;#39;t require additional fees every&lt;br/&gt;time.&lt;br/&gt;&lt;br/&gt;While it makes sense to think about monetary costs when launching a&lt;br/&gt;specific type of attack, given that the fees are paid to the miner and&lt;br/&gt;not to the mempool operators, maybe it doesn&amp;#39;t make much sense to&lt;br/&gt;think about &amp;#34;paying for bandwidth&amp;#34;. Maybe we should implement&lt;br/&gt;transaction validation rate-limiting differently, e.g. building it&lt;br/&gt;into the P2P layer instead of the mempool policy layer.&lt;br/&gt;&lt;br/&gt;Recently, Suhas gave a [formulation][8] for incentive compatibility&lt;br/&gt;that made sense to me: &amp;#34;are the fees expected to be paid in the next&lt;br/&gt;(N?) blocks higher or lower if we process this transaction?&amp;#34;&lt;br/&gt;&lt;br/&gt;I started by thinking about this where N=1 or `1 &#43; p`.&lt;br/&gt;Here, a rational miner is looking at what fees they would&lt;br/&gt;collect in the next block, and then some proportion `p` of the rest of&lt;br/&gt;the blocks based on their hashrate. We&amp;#39;re assuming `p` isn&amp;#39;t *so high*&lt;br/&gt;that they would be okay with lower absolute fees in the next 1 block.&lt;br/&gt;We&amp;#39;re also assuming `p` isn&amp;#39;t *so low* that the miner doesn&amp;#39;t care&lt;br/&gt;about what&amp;#39;s left of the mempool after this block.&lt;br/&gt;&lt;br/&gt;A tweak to this formulation is &amp;#34;if we process this transaction, would&lt;br/&gt;the fees in the next 1 block higher or lower, and is the feerate&lt;br/&gt;density of the rest of the mempool higher or lower?&amp;#34; This is pretty&lt;br/&gt;similar, where N=1, but we consider the rest of the mempool by feerate&lt;br/&gt;rather than fees.&lt;br/&gt;&lt;br/&gt;### Mining Score of a Mempool Transaction&lt;br/&gt;&lt;br/&gt;We are often interested in finding out what&lt;br/&gt;the &amp;#34;mining score&amp;#34; of a transaction in the mempool is. That is, when&lt;br/&gt;the transaction is considered in block template building, what is the&lt;br/&gt;feerate it is considered at?&lt;br/&gt;&lt;br/&gt;Obviously, it&amp;#39;s not the transaction&amp;#39;s individual feerate. Bitcoin Core&lt;br/&gt;[mining code sorts][14] transactions by their ancestor feerate and&lt;br/&gt;includes them packages at a time, keeping track of how this affects the&lt;br/&gt;package feerates of remaining transactions in the mempool.&lt;br/&gt;&lt;br/&gt;*ancestor feerate*: Ancestor feerate is easily accessible information,&lt;br/&gt;but it&amp;#39;s not accurate either, because it doesn&amp;#39;t take into account the&lt;br/&gt;fact that subsets of a transaction&amp;#39;s ancestor set can be included&lt;br/&gt;without it. For example, ancestors may have high feerates on their own&lt;br/&gt;or we may have [high feerate siblings][8].&lt;br/&gt;&lt;br/&gt;TLDR: *Looking at the current ancestor feerate of a transaction is&lt;br/&gt;insufficient to tell us what feerate it will be considered at when&lt;br/&gt;building a block template in the future.*&lt;br/&gt;&lt;br/&gt;*min(individual feerate, ancestor feerate)*: Another&lt;br/&gt;heuristic that is simple to calculate based on current mempool tooling&lt;br/&gt;is to use the [minimum of a transaction&amp;#39;s individual score and its&lt;br/&gt;ancestor score][10] as a conservative measure.  But this can&lt;br/&gt;overestimate as well (see the example below).&lt;br/&gt;&lt;br/&gt;*min ancestor feerate(tx &#43; possible ancestor subsets)* We can also&lt;br/&gt;take the minimum of every possible ancestor subset, but this can be&lt;br/&gt;computationally expensive since there can be lots and lots of ancestor&lt;br/&gt;subsets.&lt;br/&gt;&lt;br/&gt;*max ancestor feerate(tx &#43; possible descendant subsets)*: Another idea&lt;br/&gt;is to use the [maximum ancestor score of the transaction &#43; each of its&lt;br/&gt;descendants][9]. This doesn&amp;#39;t work either; it has the same blindspot&lt;br/&gt;of ancestor subsets being mined on their own.&lt;br/&gt;&lt;br/&gt;#### Mining Score Example&lt;br/&gt;&lt;br/&gt;Here&amp;#39;s an example illustrating why mining score is tricky to&lt;br/&gt;efficiently calculate for mempool transactions:&lt;br/&gt;&lt;br/&gt;Let&amp;#39;s say you have same-size transactions A (21sat/vB), B (1sat/vB),&lt;br/&gt;C(9sat/vB), D(5sat/vB).&lt;br/&gt;The layout is: grandparent A, parent B, and two children C and D.&lt;br/&gt;&lt;br/&gt;```&lt;br/&gt;    A&lt;br/&gt;    ^&lt;br/&gt;    B&lt;br/&gt;   ^ ^&lt;br/&gt;   C D&lt;br/&gt;```&lt;br/&gt;&lt;br/&gt;A miner using ancestor packages to build block templates will first&lt;br/&gt;include A with a mining score of 21. Next, the miner will include B and&lt;br/&gt;C with a mining score of 6. This leaves D, with a mining score of 5.&lt;br/&gt;&lt;br/&gt;Note: in this case, mining by ancestor feerate results in the most&lt;br/&gt;rational decisions, but [a candidate set-based approach][10] which&lt;br/&gt;makes ancestor feerate much less relevant could&lt;br/&gt;be more advantageous in other situations.&lt;br/&gt;&lt;br/&gt;Here is a chart showing the &amp;#34;true&amp;#34; mining score alongside the values&lt;br/&gt;calculating using imperfect heuristics described above. All of them&lt;br/&gt;can overestimate or underestimate.&lt;br/&gt;&lt;br/&gt;```&lt;br/&gt;   A     B       C     D&lt;br/&gt;mining score |   21   |   6   |   6   |   5   |&lt;br/&gt;ancestor feerate   |   21   |  11   | 10.3  |   9   |&lt;br/&gt;min(individual, ancestor) |   21   |   1   |   9   |   5   |&lt;br/&gt;min(tx &#43; ancestor subsets)      |   21   |   1   |   5   |   3   |&lt;br/&gt;max(tx &#43; descendants subsets) |   21   |   9   |   9   |   5   |&lt;br/&gt;&lt;br/&gt;```&lt;br/&gt;&lt;br/&gt;Possibly the best solution for finding the &amp;#34;mining score&amp;#34; of a&lt;br/&gt;transaction is to build a block template, see what feerate each&lt;br/&gt;package is included at. Perhaps at some cutoff, remaining mempool&lt;br/&gt;transactions can be estimated using some heuristic that leans&lt;br/&gt;{overestimating, underestimating} depending on the situation.&lt;br/&gt;&lt;br/&gt;Mining score seems to be relevant in multiple places: Murch and I&lt;br/&gt;recently [found][3] that it would be very important in&lt;br/&gt;&amp;#34;ancestor-aware&amp;#34; funding of transactions (the wallet doesn&amp;#39;t&lt;br/&gt;incorporate ancestor fees when using unconfirmed transactions in coin&lt;br/&gt;selection, which is a bug we want to fix).&lt;br/&gt;&lt;br/&gt;In general, it would be nice to know the exact mining priority of&lt;br/&gt;one&amp;#39;s unconfirmed transaction is.  I can think of a few block/mempool&lt;br/&gt;explorers who might want to display this information for users.&lt;br/&gt;&lt;br/&gt;### RBF Improvement Proposals&lt;br/&gt;&lt;br/&gt;After speaking to quite a few people, here are some suggestions&lt;br/&gt;for improvements that I have heard:&lt;br/&gt;&lt;br/&gt;* The ancestor score of the replacement must be {5, 10, N}% higher&lt;br/&gt;  than that of every original transaction.&lt;br/&gt;&lt;br/&gt;* The ancestor score of the replacement must be 1sat/vB higher than&lt;br/&gt;  that of every original transaction.&lt;br/&gt;&lt;br/&gt;* If the original transaction is in the top {0.75MvB, 1MvB} of the&lt;br/&gt;  mempool, apply the current rules (absolute fees must increase and&lt;br/&gt;pay for the replacement transaction&amp;#39;s new bandwidth). Otherwise, use a&lt;br/&gt;feerate-only rule.&lt;br/&gt;&lt;br/&gt;* If fees don&amp;#39;t increase, the size of the replacement transaction must&lt;br/&gt;  decrease by at least N%.&lt;br/&gt;&lt;br/&gt;* Rate-limit how many replacements we allow per prevout.&lt;br/&gt;&lt;br/&gt;* Rate-limit transaction validation in general, per peer.&lt;br/&gt;&lt;br/&gt;Perhaps some others on the mailing list can chime in to throw other&lt;br/&gt;ideas into the ring and/or combine some of these rules into a sensible&lt;br/&gt;policy.&lt;br/&gt;&lt;br/&gt;#### Replace by Feerate Only&lt;br/&gt;&lt;br/&gt;I don&amp;#39;t think there&amp;#39;s going to be a single-line feerate-based&lt;br/&gt;rule that can incorporate everything we need.&lt;br/&gt;On one hand, a feerate-only approach helps eliminate the issues&lt;br/&gt;associated with Rule #3. On the other hand, I believe the main concern&lt;br/&gt;with a feerate-only approach is how to rate limit replacements. We&lt;br/&gt;don&amp;#39;t want to enable an attack such as:&lt;br/&gt;&lt;br/&gt;1. Attacker broadcasts large, low-feerate transaction, and attaches a&lt;br/&gt;chain of descendants.&lt;br/&gt;&lt;br/&gt;2. The attacker replaces the transaction with a smaller but higher&lt;br/&gt;feerate transaction, attaching a new chain of descendants.&lt;br/&gt;&lt;br/&gt;3. Repeat 1000 times.&lt;br/&gt;&lt;br/&gt;#### Fees in Next Block and Feerate for the Rest of the Mempool&lt;br/&gt;&lt;br/&gt;Perhaps we can look at replacements like this:&lt;br/&gt;&lt;br/&gt;1. Calculate the directly conflicting transactions and, with their&lt;br/&gt;descendants, the original transactions. Check signaling. Limit the&lt;br/&gt;total volume (e.g. can&amp;#39;t be more than 100 total or 1MvB or something).&lt;br/&gt;&lt;br/&gt;2. Find which original transactions would be in the next ~1 block. The&lt;br/&gt;replacement must pay at least this amount &#43; X% in absolute fees. This&lt;br/&gt;guarantees that the fees of the next block doesn&amp;#39;t decrease.&lt;br/&gt;&lt;br/&gt;3. Find which transactions would be left in the mempool after that ~1&lt;br/&gt;block. The replacement&amp;#39;s feerate must be Y% higher than the maximum&lt;br/&gt;mining score of these transactions. This guarantees that you now have&lt;br/&gt;only *better* candidates in your after-this-block mempool than you did&lt;br/&gt;before, even if the size and fees the transactions decrease.&lt;br/&gt;&lt;br/&gt;4. Now you have two numbers: a minimum absolute fee amount and a&lt;br/&gt;minimum feerate. Check to see if the replacement(s) meet these&lt;br/&gt;minimums. Also, a wallet would be able to ask the node &amp;#34;What fee and&lt;br/&gt;feerate would I need to put on a transaction replacing this?&amp;#34; and use&lt;br/&gt;this information to fund a replacement transaction, without needing to&lt;br/&gt;guess or overshoot.&lt;br/&gt;&lt;br/&gt;Obviously, there are some magic numbers missing here. X and Y are&lt;br/&gt;TBD constants to ensure we have some kind of rate limiting for the&lt;br/&gt;number of replacements allowed using some set of fees.&lt;br/&gt;&lt;br/&gt;What should they be? We can do some arithmetic to see what happens if&lt;br/&gt;you start with the biggest/lowest feerate transaction and do a bunch&lt;br/&gt;of replacements. Maybe we end up with values that are high enough to&lt;br/&gt;prevent abuse and make sense for applications/users that do RBF.&lt;br/&gt;&lt;br/&gt;### Mempool Changes Need for Implementation&lt;br/&gt;&lt;br/&gt;As described in the mining score section above,&lt;br/&gt;we may want additional tooling to more accurately assess&lt;br/&gt;the economic gain of replacing transactions in our mempool.&lt;br/&gt;&lt;br/&gt;A few options have been discussed:&lt;br/&gt;&lt;br/&gt;* Calculate block templates on the fly when we need to consider a&lt;br/&gt;  replacement. However, since replacements are [quite common][11]&lt;br/&gt;  and the information might be useful for other things as well,&lt;br/&gt;  it may be worth it to cache a block template.&lt;br/&gt;&lt;br/&gt;* Keep a persistent block template so that we know what transactions&lt;br/&gt;  we would put in the next block. We need to remember the feerate&lt;br/&gt;at which each transaction was included in the template, because an&lt;br/&gt;ancestor package may be included in the same block template in&lt;br/&gt;multiple subsets. Transactions included earlier alter the ancestor&lt;br/&gt;feerate of the remaining transactions in the package. We also need&lt;br/&gt;to keep track of the new feerates of transactions left over.&lt;br/&gt;&lt;br/&gt;* Divide the mempool into two layers, &amp;#34;high feerate&amp;#34; and &amp;#34;low&lt;br/&gt;  feerate.&amp;#34; The high feerate layer contains ~1 block of packages with&lt;br/&gt;the highest ancestor feerates, and the low feerate layer contains&lt;br/&gt;everything else. At the edge of a block, we have a Knapsacky problem&lt;br/&gt;where the next highest ancestor feerate package might not fit, so we&lt;br/&gt;would probably want the high feerate layer ~2MvB or something to avoid&lt;br/&gt;underestimating the fees.&lt;br/&gt;&lt;br/&gt;## Acknowledgements&lt;br/&gt;&lt;br/&gt;Thank you to everyone whose RBF-related suggestions, grievances,&lt;br/&gt;criticisms and ideas were incorporated in this document:&lt;br/&gt;Andrew Chow, Matt Corallo, Suhas Daftuar, Christian Decker,&lt;br/&gt;Mark Erhardt, Lloyd Fournier, Lisa Neigut, John Newbery,&lt;br/&gt;Antoine Poinsot, Antoine Riard, Larry Ruane,&lt;br/&gt;S3RK and Bastien Teinturier.&lt;br/&gt;&lt;br/&gt;Thanks for reading!&lt;br/&gt;&lt;br/&gt;Best,&lt;br/&gt;Gloria&lt;br/&gt;&lt;br/&gt;[1]:&lt;br/&gt;&lt;a href=&#34;https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md&#34;&gt;https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md&lt;/a&gt;&lt;br/&gt;[2]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/23121#issuecomment-929475999&#34;&gt;https://github.com/bitcoin/bitcoin/pull/23121#issuecomment-929475999&lt;/a&gt;&lt;br/&gt;[3]:&lt;br/&gt;&lt;a href=&#34;https://github.com/Xekyo/bitcoin/commit/d754b0242ec69d42c570418aebf9c1335af0b8ea&#34;&gt;https://github.com/Xekyo/bitcoin/commit/d754b0242ec69d42c570418aebf9c1335af0b8ea&lt;/a&gt;&lt;br/&gt;[4]: &lt;a href=&#34;https://github.com/bitcoindevkit/bdk/issues/144&#34;&gt;https://github.com/bitcoindevkit/bdk/issues/144&lt;/a&gt;&lt;br/&gt;[5]: &lt;a href=&#34;https://github.com/bitcoindevkit/bdk/issues/414&#34;&gt;https://github.com/bitcoindevkit/bdk/issues/414&lt;/a&gt;&lt;br/&gt;[6]:&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019464.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-September/019464.html&lt;/a&gt;&lt;br/&gt;[7]:&lt;br/&gt;&lt;a href=&#34;https://gist.github.com/glozow/dc4e9d5c5b14ade7cdfac40f43adb18a#new-unconfirmed-inputs-rule-2&#34;&gt;https://gist.github.com/glozow/dc4e9d5c5b14ade7cdfac40f43adb18a#new-unconfirmed-inputs-rule-2&lt;/a&gt;&lt;br/&gt;[8]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/23121#discussion_r777131366&#34;&gt;https://github.com/bitcoin/bitcoin/pull/23121#discussion_r777131366&lt;/a&gt;&lt;br/&gt;[9]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22290#issuecomment-865887922&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22290#issuecomment-865887922&lt;/a&gt;&lt;br/&gt;[10]:&lt;br/&gt;&lt;a href=&#34;https://gist.github.com/Xekyo/5cb413fe9f26dbce57abfd344ebbfaf2#file-candidate-set-based-block-building-md&#34;&gt;https://gist.github.com/Xekyo/5cb413fe9f26dbce57abfd344ebbfaf2#file-candidate-set-based-block-building-md&lt;/a&gt;&lt;br/&gt;[11]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22539#issuecomment-885763670&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22539#issuecomment-885763670&lt;/a&gt;&lt;br/&gt;[12]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/24007&#34;&gt;https://github.com/bitcoin/bitcoin/pull/24007&lt;/a&gt;&lt;br/&gt;[13]:&lt;br/&gt;&lt;a href=&#34;https://github.com/bitcoin/bitcoin/blob/1a369f006fd0bec373b95001ed84b480e852f191/src/wallet/feebumper.cpp#L114&#34;&gt;https://github.com/bitcoin/bitcoin/blob/1a369f006fd0bec373b95001ed84b480e852f191/src/wallet/feebumper.cpp#L114&lt;/a&gt;&lt;br/&gt;[14]:&lt;br/&gt;&lt;a href=&#34;https://github.com/bitcoin/bitcoin/blob/cf5bb048e80d4cde8828787b266b7f5f2e3b6d7b/src/node/miner.cpp#L310-L320&#34;&gt;https://github.com/bitcoin/bitcoin/blob/cf5bb048e80d4cde8828787b266b7f5f2e3b6d7b/src/node/miner.cpp#L310-L320&lt;/a&gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220127/ec8ff818/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220127/ec8ff818/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-08T01:03:00&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsq0hn67rakm9vpthjxlr4x09jfqfvv9z933fu8rfesrenusfs3lrqzyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2q2x2w0l</id>
    
      <title type="html">📅 Original date posted:2021-12-07 📝 Original message:Hi ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsq0hn67rakm9vpthjxlr4x09jfqfvv9z933fu8rfesrenusfs3lrqzyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2q2x2w0l" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsr9fc7kt0hznylpe2mwtzel9p4hv7c9q03nraqvh46n97tn7pr8lqz9dcvm&#39;&gt;nevent1q…dcvm&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2021-12-07&lt;br/&gt;📝 Original message:Hi Darosior and Ariard,&lt;br/&gt;&lt;br/&gt;Thank you for your work looking into fee-bumping so thoroughly, and for&lt;br/&gt;sharing your results. I agree about fee-bumping&amp;#39;s importance in contract&lt;br/&gt;security and feel that it&amp;#39;s often under-prioritized. In general, what&lt;br/&gt;you&amp;#39;ve described in this post, to me, is strong motivation for some of the&lt;br/&gt;proposed changes to RBF we&amp;#39;ve been discussing. Mostly, I have some&lt;br/&gt;questions.&lt;br/&gt;&lt;br/&gt;&amp;gt; The part of Revault we are interested in for this study is the delegation&lt;br/&gt;process, and more&lt;br/&gt;&amp;gt; specifically the application of spending policies by network monitors&lt;br/&gt;(watchtowers).&lt;br/&gt;&lt;br/&gt;I&amp;#39;d like to better understand how fee-bumping would be used, i.e. how the&lt;br/&gt;watchtower model works:&lt;br/&gt;- Do all of the vault parties both deposit to the vault and a refill/fee to&lt;br/&gt;the watchtower, is there a reward the watchtower collects for a successful&lt;br/&gt;Cancel, or something else? (Apologies if there&amp;#39;s a thorough explanation&lt;br/&gt;somewhere that I haven&amp;#39;t already seen).&lt;br/&gt;- Do we expect watchtowers tracking multiple vaults to be batching multiple&lt;br/&gt;Cancel transaction fee-bumps?&lt;br/&gt;- Do we expect vault users to be using multiple watchtowers for a better&lt;br/&gt;trust model? If so, and we&amp;#39;re expecting batched fee-bumps, won&amp;#39;t those&lt;br/&gt;conflict?&lt;br/&gt;&lt;br/&gt;&amp;gt; For Revault we can afford to introduce malleability in the Cancel&lt;br/&gt;transaction since there is no&lt;br/&gt;&amp;gt; second-stage transaction depending on its txid. Therefore it is&lt;br/&gt;pre-signed with ANYONECANPAY. We&lt;br/&gt;&amp;gt; can&amp;#39;t use ANYONECANPAY|SINGLE since it would open a pinning vector [3].&lt;br/&gt;Note how we can&amp;#39;t leverage&lt;br/&gt;&amp;gt; the carve out rule, and neither can any other more-than-two-parties&lt;br/&gt;contract.&lt;br/&gt;&lt;br/&gt;We&amp;#39;ve already talked about this offline, but I&amp;#39;d like to point out here&lt;br/&gt;that even transactions signed with ANYONECANPAY|ALL can be pinned by RBF&lt;br/&gt;unless we add an ancestor score rule. [0], [1] (numbers are inaccurate,&lt;br/&gt;Cancel Tx feerates wouldn&amp;#39;t be that low, but just to illustrate what the&lt;br/&gt;attack would look like)&lt;br/&gt;&lt;br/&gt;[0]:&lt;br/&gt; &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/135104603-9e775062-5c8d-4d55-9bc9-6e9db92cfe6d.png&#34;&gt; &lt;br/&gt;[1]:&lt;br/&gt; &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/145044333-2f85da4a-af71-44a1-bc21-30c388713a0d.png&#34;&gt; &lt;br/&gt;&lt;br/&gt;&amp;gt; can&amp;#39;t use ANYONECANPAY|SINGLE since it would open a pinning vector [3].&lt;br/&gt;Note how we can&amp;#39;t leverage&lt;br/&gt;&amp;gt; the carve out rule, and neither can any other more-than-two-parties&lt;br/&gt;contract.&lt;br/&gt;&lt;br/&gt;Well stated about CPFP carve out. I suppose the generalization is that&lt;br/&gt;allowing n extra ancestorcount=2 descendants to a transaction means it can&lt;br/&gt;help contracts with &amp;lt;=n&#43;1 parties (more accurately, outputs)? I wonder if&lt;br/&gt;it&amp;#39;s possible to devise a different approach for limiting&lt;br/&gt;ancestors/descendants, e.g. by height/width/branching factor of the family&lt;br/&gt;instead of count... :shrug:&lt;br/&gt;&lt;br/&gt;&amp;gt; You could keep a single large UTxO and peel it as you need to sponsor&lt;br/&gt;transactions. But this means&lt;br/&gt;&amp;gt; that you need to create a coin of a specific value according to your need&lt;br/&gt;at the current feerate&lt;br/&gt;&amp;gt; estimation, hope to have it confirmed in a few blocks (at least for now!&lt;br/&gt;[5]), and hope that the&lt;br/&gt;&amp;gt; value won&amp;#39;t be obsolete by the time it confirmed.&lt;br/&gt;&lt;br/&gt;IIUC, a Cancel transaction can be generalized as a 1-in-1-out where the&lt;br/&gt;input is presigned with counterparties, SIGHASH_ANYONECANPAY. The fan-out&lt;br/&gt;UTXO pool approach is a clever solution. I also think this smells like a&lt;br/&gt;case where improving lower-level RBF rules is more appropriate than&lt;br/&gt;requiring applications to write workarounds and generate extra&lt;br/&gt;transactions. Seeing that the BIP125#2 (no new unconfirmed inputs)&lt;br/&gt;restriction really hurts in this case, if that rule were removed, would you&lt;br/&gt;be able to simply keep the 1 big UTXO per vault and cut out the exact&lt;br/&gt;nValue you need to fee-bump Cancel transactions? Would that feel less like&lt;br/&gt;&amp;#34;burning&amp;#34; for the sake of fee-bumping?&lt;br/&gt;&lt;br/&gt;&amp;gt; First of all, when to fee-bump? At fixed time intervals? At each block&lt;br/&gt;connection? It sounds like,&lt;br/&gt;&amp;gt; given a large enough timelock, you could try to greed by &amp;#34;trying your&lt;br/&gt;luck&amp;#34; at a lower feerate and&lt;br/&gt;&amp;gt; only re-bumping every N blocks. You would then start aggressively bumping&lt;br/&gt;at every block after M&lt;br/&gt;&amp;gt; blocks have passed.&lt;br/&gt;&lt;br/&gt;I&amp;#39;m wondering if you also considered other questions like:&lt;br/&gt;- Should a fee-bumping strategy be dependent upon the rate of incoming&lt;br/&gt;transactions? To me, it seems like the two components are (1) what&amp;#39;s in the&lt;br/&gt;mempool and (2) what&amp;#39;s going to trickle into the mempool between now and&lt;br/&gt;the target block. The first component is best-effort keeping&lt;br/&gt;incentive-compatible mempool; historical data and crystal ball look like&lt;br/&gt;the only options for incorporating the 2nd component.&lt;br/&gt;- Should the fee-bumping strategy depend on how close you are to your&lt;br/&gt;timelock expiry? (though this seems like a potential privacy leak, and the&lt;br/&gt;game theory could get weird as you mentioned).&lt;br/&gt;- As long as you have a good fee estimator (i.e. given a current mempool,&lt;br/&gt;can get an accurate feerate given a % probability of getting into target&lt;br/&gt;block n), is there any reason to devise a fee-bumping strategy beyond&lt;br/&gt;picking a time interval?&lt;br/&gt;&lt;br/&gt;It would be interesting to see stats on the spread of feerates in blocks&lt;br/&gt;during periods of fee fluctuation.&lt;br/&gt;&lt;br/&gt;&amp;gt; &amp;gt; In the event that you notice a consequent portion of the block is&lt;br/&gt;filled with transactions paying&lt;br/&gt;&amp;gt; &amp;gt; less than your own, you might want to start panicking and bump your&lt;br/&gt;transaction fees by a certain&lt;br/&gt;&amp;gt; &amp;gt; percentage with no consideration for your fee estimator. You might skew&lt;br/&gt;miners incentives in doing&lt;br/&gt;&amp;gt; &amp;gt; so: if you increase the fees by a factor of N, any miner with a&lt;br/&gt;fraction larger than 1/N of the&lt;br/&gt;&amp;gt; &amp;gt; network hashrate now has an incentive to censor your transaction at&lt;br/&gt;first to get you to panic.&lt;br/&gt;&lt;br/&gt;&amp;gt; Yes I think miner-harvesting attacks should be weighed carefully in the&lt;br/&gt;design of offchain contracts fee-bumping strategies, at least in the future&lt;br/&gt;when the mining reward exhausts further.&lt;br/&gt;&lt;br/&gt;Miner-harvesting (such cool naming!) is interesting, but I want to clarify&lt;br/&gt;the value of N - I don&amp;#39;t think it&amp;#39;s the factor by which you increase the&lt;br/&gt;fees on just your transaction.&lt;br/&gt;&lt;br/&gt;To codify: your transaction pays a fee of `f1` right now and might pay a&lt;br/&gt;fee of `f2` in a later block that the miner expects to mine with 1/N&lt;br/&gt;probability. The economically rational miner isn&amp;#39;t incentivized if simply&lt;br/&gt;`f2 = N * f1` unless their mempool is otherwise empty.&lt;br/&gt;By omitting your transaction in this block, the miner can include another&lt;br/&gt;transaction/package paying `g1` fees instead, so they lose `f1-g1` in fees&lt;br/&gt;right now. In the future block, they have the choice between collecting&lt;br/&gt;`f2` or `g2` (from another transaction/package) in fees, so their gain is&lt;br/&gt;`max(f2-g2, 0)`.&lt;br/&gt;So the equation is more like: a miner with 1/N of the hashrate, employing&lt;br/&gt;this censorship strategy, gains only if `max(f2-g2, 0) &amp;gt; N * (f1-g1)`. More&lt;br/&gt;broadly, the miner only profits if `f2` is significantly higher than `g2`&lt;br/&gt;and `f1` is about the same feerate as everything else in your mempool: it&lt;br/&gt;seems like they&amp;#39;re betting on how much you _overshoot_, not how much you&lt;br/&gt;bump.&lt;br/&gt;&lt;br/&gt;In general, I agree it would really suck to inadvertently create a game&lt;br/&gt;where miners can drive feerates up by triggering desperation-driven&lt;br/&gt;fee-bumping procedures. I guess this is a reason to avoid&lt;br/&gt;increasingly-aggressive feebumping, or strategies where we predictably&lt;br/&gt;overshoot.&lt;br/&gt;&lt;br/&gt;Slightly related question: in contracts, generally, the timelock deadline&lt;br/&gt;is revealed in the script, so the miner knows how &amp;#34;desperate&amp;#34; we are right?&lt;br/&gt;Is that a problem? For Revault, if your Cancel transaction is a keypath&lt;br/&gt;spend (I think I remember reading that somewhere?) and you don&amp;#39;t reveal the&lt;br/&gt;script, they don&amp;#39;t see your timelock deadline yes?&lt;br/&gt;&lt;br/&gt;Again, thanks for the digging and sharing. :)&lt;br/&gt;&lt;br/&gt;Best,&lt;br/&gt;Gloria&lt;br/&gt;&lt;br/&gt;On Tue, Nov 30, 2021 at 3:27 PM darosior via bitcoin-dev &amp;lt;&lt;br/&gt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hi Antoine,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thanks for your comment. I believe for Lightning it&amp;#39;s simpler with regard&lt;br/&gt;&amp;gt; to the management of the UTxO pool, but harder with regard to choosing&lt;br/&gt;&amp;gt; a threat model.&lt;br/&gt;&amp;gt; Responses inline.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; For any opened channel, ensure the confirmation of a Commitment&lt;br/&gt;&amp;gt; transaction and the children HTLC-Success/HTLC-Timeout transactions. Note,&lt;br/&gt;&amp;gt; in the Lightning security game you have to consider (at least) 4 types of&lt;br/&gt;&amp;gt; players moves and incentives : your node, your channel counterparties, the&lt;br/&gt;&amp;gt; miners, the crowd of bitcoin users. The number of the last type of players&lt;br/&gt;&amp;gt; is unknown from your node, however it should not be forgotten you&amp;#39;re in&lt;br/&gt;&amp;gt; competition for block space, therefore their block demands bids should be&lt;br/&gt;&amp;gt; anticipated and reacted to in consequence. With that remark in mind,&lt;br/&gt;&amp;gt; implications for your LN fee-bumping strategy will be raised afterwards.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; For a LN service provider, on-chain overpayments are bearing on your&lt;br/&gt;&amp;gt; operational costs, thus downgrading your economic competitiveness. For the&lt;br/&gt;&amp;gt; average LN user, overpayment might price out outside a LN non-custodial&lt;br/&gt;&amp;gt; deployment, as you don&amp;#39;t have the minimal security budget to be on your own.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think this problem statement can be easily generalised to any offchain&lt;br/&gt;&amp;gt; contract. And your points stand for all of them.&lt;br/&gt;&amp;gt; &amp;#34;For any opened contract, ensure at any point the confirmation of a (set&lt;br/&gt;&amp;gt; of) transaction(s) in a given number of blocks&amp;#34;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Same issue with Lightning, we can be pinned today on the basis of&lt;br/&gt;&amp;gt; replace-by-fee rule 3. We can be also blinded by network mempool&lt;br/&gt;&amp;gt; partitions, a pinning counterparty can segregate all the full-nodes  in as&lt;br/&gt;&amp;gt; many subsets by broadcasting a revoked Commitment transaction different for&lt;br/&gt;&amp;gt; each. For Revault, I think you can also do unlimited partitions by mutating&lt;br/&gt;&amp;gt; the ANYONECANPAY-input of the Cancel.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Well you can already do unlimited partitions by adding different inputs to&lt;br/&gt;&amp;gt; it. You could malleate the witness, but since we are using Miniscript i&amp;#39;m&lt;br/&gt;&amp;gt; confident you would only be able in a marginal way.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; That said, if you have a distributed towers deployment, spread across the&lt;br/&gt;&amp;gt; p2p network topology, and they can&amp;#39;t be clustered together through&lt;br/&gt;&amp;gt; cross-layers or intra-layer heuristics, you should be able to reliably&lt;br/&gt;&amp;gt; observe such partitions. I think such distributed monitors are deployed by&lt;br/&gt;&amp;gt; few L1 merchants accepting 0-conf to detect naive double-spend.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; We should aim to more than 0-conf (in)security level..&lt;br/&gt;&amp;gt; It seems to me the only policy-level mitigation for RBF pinning around the&lt;br/&gt;&amp;gt; &amp;#34;don&amp;#39;t decrease the abolute fees of a less-than-a-block mempool&amp;#34; would be&lt;br/&gt;&amp;gt; to drop the requirement on increasing absolute fees if the mempool is &amp;#34;full&lt;br/&gt;&amp;gt; enough&amp;#34; (and the feerate increases exponentially, of course).&lt;br/&gt;&amp;gt; Another approach could be by introducing new consensus rules as proposed&lt;br/&gt;&amp;gt; by Jeremy last year [0]. If we go in the realm of new consensus rules, then&lt;br/&gt;&amp;gt; i think that simply committing to a maximum tx size would fix pinning by&lt;br/&gt;&amp;gt; RBF rule 3. Could be in the annex, or in the unused sequence bits (although&lt;br/&gt;&amp;gt; they currently are by Lightning, meh). You could also check in the output&lt;br/&gt;&amp;gt; script that the input commits to this.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [0]&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-September/018168.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-September/018168.html&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Have we already discussed a fee-bumping &amp;#34;shared cache&amp;#34;, a CPFP variation ?&lt;br/&gt;&amp;gt; Strawman idea: Alice and Bob commit collateral inputs to a separate UTXO&lt;br/&gt;&amp;gt; from the main &amp;#34;offchain contract&amp;#34; one. This UTXO is locked by a multi-sig.&lt;br/&gt;&amp;gt; For any Commitment transaction pre-signed, also counter-sign a CPFP with&lt;br/&gt;&amp;gt; top mempool feerate included, spending a Commitment anchor output and the&lt;br/&gt;&amp;gt; shared-cache UTXO. If the fees spike,  you can re-sign a high-feerate CPFP,&lt;br/&gt;&amp;gt; assuming interactivity. As the CPFP is counter-signed by everyone, the&lt;br/&gt;&amp;gt; outputs can be CSV-1 encumbered to prevent pinnings. If the share-cache is&lt;br/&gt;&amp;gt; feeded at parity, there shouldn&amp;#39;t be an incentive to waste or maliciously&lt;br/&gt;&amp;gt; inflate the feerate. I think this solution can be easily generalized to&lt;br/&gt;&amp;gt; more than 2 counterparties by using a multi-signature scheme. Big issue, if&lt;br/&gt;&amp;gt; the feerate is short due to fee spikes and you need to re-sign a&lt;br/&gt;&amp;gt; higher-feerate CPFP, you&amp;#39;re trusting your counterparty to interact, though&lt;br/&gt;&amp;gt; arguably not worse than the current update fee mechanism.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; It really looks just like `update_fee`. Except maybe with the property&lt;br/&gt;&amp;gt; that you have the channel liquidity not depend on the onchain feerate.&lt;br/&gt;&amp;gt; In any case, for Lightning i think it&amp;#39;s a bad idea to re-introduce trust&lt;br/&gt;&amp;gt; on this side post anchor outputs. For Revault it&amp;#39;s clearly out of the&lt;br/&gt;&amp;gt; question to introduce trust in your counterparties (why would you bother&lt;br/&gt;&amp;gt; having a fee-bumping mechanism in the first place then?). Probably the same&lt;br/&gt;&amp;gt; holds for all offchain contracts.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; For Lightning, it&amp;#39;d mean keeping an equivalent amount of funds as the&lt;br/&gt;&amp;gt; sum of all your&lt;br/&gt;&amp;gt; channels balances sitting there unallocated &amp;#34;just in case&amp;#34;. This is not&lt;br/&gt;&amp;gt; reasonable.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Agree, game-theory wise, you would like to keep a full fee-bumping&lt;br/&gt;&amp;gt; reserve, ready to burn as much in fees as the contested HTLC value, as it&amp;#39;s&lt;br/&gt;&amp;gt; the maximum gain of your counterparty. Though perfect equilibrium is hard&lt;br/&gt;&amp;gt; to achieve because your malicious counterparty might have an edge pushing&lt;br/&gt;&amp;gt; you to broadcast your Commitment first by witholding HTLC resolution.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Fractional fee-bumping reserves are much more realistic to expect in the&lt;br/&gt;&amp;gt; LN network. Lower fee-bumping reserve, higher liquidity deployed, in theory&lt;br/&gt;&amp;gt; higher routing fees. By observing historical feerates, average offchain&lt;br/&gt;&amp;gt; balances at risk and routing fees expected gains, you should be able to&lt;br/&gt;&amp;gt; discover an equilibrium where higher levels of reserve aren&amp;#39;t worth the&lt;br/&gt;&amp;gt; opportunity cost. I guess this  equilibrium could be your LN fee-bumping&lt;br/&gt;&amp;gt; reserve max feerate.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Note, I think the LN approach is a bit different from what suits a custody&lt;br/&gt;&amp;gt; protocol like Revault,  as you compute a direct return of the frozen&lt;br/&gt;&amp;gt; fee-bumping liquidity. With Revault, if you have numerous bitcoins&lt;br/&gt;&amp;gt; protected, it&amp;#39;s might be more interesting to adopt a &amp;#34;buy the mempool,&lt;br/&gt;&amp;gt; stupid&amp;#34; strategy than risking fund safety for few percentages of interest&lt;br/&gt;&amp;gt; returns.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; True for routing nodes. For wallets (if receiving funds), it&amp;#39;s not about&lt;br/&gt;&amp;gt; an investment: just users expectations to being able to transact without&lt;br/&gt;&amp;gt; risking to lose their funds (ie being able to enforce their contract&lt;br/&gt;&amp;gt; onchain). Although wallets they are much less at risk.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This is where the &amp;#34;anticipate the crowd of bitcoin users move&amp;#34; point can&lt;br/&gt;&amp;gt; be laid out. As the crowd of bitcoin users&amp;#39; fee-bumping reserves are&lt;br/&gt;&amp;gt; ultimately unknown from your node knowledge, you should be ready to be a&lt;br/&gt;&amp;gt; bit more conservative than the vanilla fee-bumping strategies shipped by&lt;br/&gt;&amp;gt; default. In case of massive mempool congestion, your additional&lt;br/&gt;&amp;gt; conservatism might get your time-sensitive transactions and game on the&lt;br/&gt;&amp;gt; crowd of bitcoin users. First Problem: if all offchain bitcoin software&lt;br/&gt;&amp;gt; adopt that strategy we might inflate the worst-case feerate rate at the&lt;br/&gt;&amp;gt; benefit of the miners, without holistically improving block throughput.&lt;br/&gt;&amp;gt; Second problem : your class of offchain bitcoin softwares might have&lt;br/&gt;&amp;gt; ridiculous fee-bumping reserve compared&lt;br/&gt;&amp;gt; to other classes of offchain bitcoin softwares (Revault &amp;gt; Lightning) and&lt;br/&gt;&amp;gt; just be priced out bydesign in case of mempool congestion. Third problem :&lt;br/&gt;&amp;gt; as the number of offchain bitcoin applications should go up with time, your&lt;br/&gt;&amp;gt; fee-bumping reserve levels based from historical data might be always late&lt;br/&gt;&amp;gt; by one &amp;#34;bank-run&amp;#34; scenario.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Black swan event 2.0? Just rule n°3 is inherent to any kind of fee&lt;br/&gt;&amp;gt; estimation.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; For Lightning, if you&amp;#39;re short in fee-bumping reserves you might still do&lt;br/&gt;&amp;gt; preemptive channel closures, either cooperatively or unilaterally and get&lt;br/&gt;&amp;gt; back the off-chain liquidity to protect the more economically interesting&lt;br/&gt;&amp;gt; channels. Though again, that kind of automatic behavior might be compelling&lt;br/&gt;&amp;gt; at the individual node-level, but make the mempol congestion worse&lt;br/&gt;&amp;gt; holistically.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yeah so we are back to the &amp;#34;fractional reserve&amp;#34; model: you can only&lt;br/&gt;&amp;gt; enforce X% of the offchain contracts your participate in.. Actually it&amp;#39;s&lt;br/&gt;&amp;gt; even an added assumption: that you still have operating contracts, with&lt;br/&gt;&amp;gt; honest counterparties.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In case of massive mempool congestion, you might try to front-run the&lt;br/&gt;&amp;gt; crowd of bitcoin users relying on block connections for fee-bumping, and&lt;br/&gt;&amp;gt; thus start your fee-bumping as soon as you observe feerate groups&lt;br/&gt;&amp;gt; fluctuations in your local mempool(s).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I don&amp;#39;t think any kind of mempool-based estimate generalizes well, since&lt;br/&gt;&amp;gt; at any point the expected time before the next block is 10 minutes (and a&lt;br/&gt;&amp;gt; lot can happen in 10min).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Also you might proceed your fee-bumping ticks on a local clock instead of&lt;br/&gt;&amp;gt; block connections in case of time-dilation or deeper eclipse attacks of&lt;br/&gt;&amp;gt; your local node. Your view of the chain might be compromised but not your&lt;br/&gt;&amp;gt; ability to broadcast transactions thanks to emergency channels (in the&lt;br/&gt;&amp;gt; non-LN sense...though in fact quid of txn wrapped in onions ?) of&lt;br/&gt;&amp;gt; communication.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Oh, yeah, i didn&amp;#39;t explicit &amp;#34;not getting eclipsed&amp;#34; (or more generally&lt;br/&gt;&amp;gt; &amp;#34;data availability&amp;#34;) as an assumption since it&amp;#39;s generally one made by&lt;br/&gt;&amp;gt; participants of any offchain contract. In this case you can&amp;#39;t even have&lt;br/&gt;&amp;gt; decent fee estimation, so you are screwed anyways.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yes, stay open the question on how you enforce this block insurance&lt;br/&gt;&amp;gt; market. Reputation, which might be to avoid due to the latent&lt;br/&gt;&amp;gt; centralization effect, might be hard to stack and audit reliably for an&lt;br/&gt;&amp;gt; emergency mechanism running, hopefully, once in a halvening period. Maybe&lt;br/&gt;&amp;gt; maybe some cryptographic or economically based mechanism on slashing or&lt;br/&gt;&amp;gt; swaps could be found...&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Unfortunately, given current mining centralisation, pools are in a very&lt;br/&gt;&amp;gt; good position to offer pretty decent SLAs around that. With a block space&lt;br/&gt;&amp;gt; insurance, you of course don&amp;#39;t need all these convoluted fee-bumping hacks.&lt;br/&gt;&amp;gt; I&amp;#39;m very concerned that large stakeholders of the &amp;#34;offchain contracts&lt;br/&gt;&amp;gt; ecosystem&amp;#34; would just go this (easier) way and further increase mining&lt;br/&gt;&amp;gt; centralisation pressure.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I agree that a cryptography-based scheme around this type of insurance&lt;br/&gt;&amp;gt; services would be the best way out.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Antoine&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Le lun. 29 nov. 2021 à 09:34, darosior via bitcoin-dev &amp;lt;&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&amp;gt; a écrit :&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Hi everyone,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Fee-bumping is paramount to the security of many protocols building on&lt;br/&gt;&amp;gt;&amp;gt; Bitcoin, as they require the&lt;br/&gt;&amp;gt;&amp;gt; confirmation of a transaction (which might be presigned) before the&lt;br/&gt;&amp;gt;&amp;gt; expiration of a timelock at any&lt;br/&gt;&amp;gt;&amp;gt; point after the establishment of the contract.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The part of Revault using presigned transactions (the delegation from a&lt;br/&gt;&amp;gt;&amp;gt; large to a smaller multisig)&lt;br/&gt;&amp;gt;&amp;gt; is no exception. We have been working on how to approach this for a while&lt;br/&gt;&amp;gt;&amp;gt; now and i&amp;#39;d like to share&lt;br/&gt;&amp;gt;&amp;gt; what we have in order to open a discussion on this problem so central to&lt;br/&gt;&amp;gt;&amp;gt; what seem to be The Right&lt;br/&gt;&amp;gt;&amp;gt; Way [0] to build on Bitcoin but which has yet to be discussed in details&lt;br/&gt;&amp;gt;&amp;gt; (at least publicly).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I&amp;#39;ll discuss what we came up with for Revault (at least for what will be&lt;br/&gt;&amp;gt;&amp;gt; its first iteration) but my&lt;br/&gt;&amp;gt;&amp;gt; intent with posting to the mailing list is more to frame the questions to&lt;br/&gt;&amp;gt;&amp;gt; this problem we are all&lt;br/&gt;&amp;gt;&amp;gt; going to face rather than present the results of our study tailored to&lt;br/&gt;&amp;gt;&amp;gt; the Revault usecase.&lt;br/&gt;&amp;gt;&amp;gt; The discussion is still pretty Revault-centric (as it&amp;#39;s the case study)&lt;br/&gt;&amp;gt;&amp;gt; but hopefully this can help&lt;br/&gt;&amp;gt;&amp;gt; future protocol designers and/or start a discussion around what&lt;br/&gt;&amp;gt;&amp;gt; everyone&amp;#39;s doing for existing ones.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## 1. Reminder about Revault&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The part of Revault we are interested in for this study is the delegation&lt;br/&gt;&amp;gt;&amp;gt; process, and more&lt;br/&gt;&amp;gt;&amp;gt; specifically the application of spending policies by network monitors&lt;br/&gt;&amp;gt;&amp;gt; (watchtowers).&lt;br/&gt;&amp;gt;&amp;gt; Coins are received on a large multisig. Participants of this large&lt;br/&gt;&amp;gt;&amp;gt; multisig create 2 [1]&lt;br/&gt;&amp;gt;&amp;gt; transactions. The Unvault, spending a deposit UTxO, creates an output&lt;br/&gt;&amp;gt;&amp;gt; paying either to the small&lt;br/&gt;&amp;gt;&amp;gt; multisig after a timelock or to the large multisig immediately. The&lt;br/&gt;&amp;gt;&amp;gt; Cancel, spending the Unvault&lt;br/&gt;&amp;gt;&amp;gt; output through the non-timelocked path, creates a new deposit UTxO.&lt;br/&gt;&amp;gt;&amp;gt; Participants regularly exchange the Cancel transaction signatures for&lt;br/&gt;&amp;gt;&amp;gt; each deposit, sharing the&lt;br/&gt;&amp;gt;&amp;gt; signatures with the watchtowers they operate. They then optionally [2]&lt;br/&gt;&amp;gt;&amp;gt; sign the Unvault transaction&lt;br/&gt;&amp;gt;&amp;gt; and share the signatures with the small multisig participants who can in&lt;br/&gt;&amp;gt;&amp;gt; turn use them to proceed&lt;br/&gt;&amp;gt;&amp;gt; with a spending. Watchtowers can enforce spending policies (say, can&amp;#39;t&lt;br/&gt;&amp;gt;&amp;gt; Unvault outside of business&lt;br/&gt;&amp;gt;&amp;gt; hours) by having the Cancel transaction be confirmed before the&lt;br/&gt;&amp;gt;&amp;gt; expiration of the timelock.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## 2. Problem statement&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; For any delegated vault, ensure the confirmation of a Cancel transaction&lt;br/&gt;&amp;gt;&amp;gt; in a configured number of&lt;br/&gt;&amp;gt;&amp;gt; blocks at any point. In so doing, minimize the overpayments and the UTxO&lt;br/&gt;&amp;gt;&amp;gt; set footprint. Overpayments&lt;br/&gt;&amp;gt;&amp;gt; increase the burden on the watchtower operator by increasing the required&lt;br/&gt;&amp;gt;&amp;gt; frequency of refills of the&lt;br/&gt;&amp;gt;&amp;gt; fee-bumping wallet, which is already the worst user experience. You are&lt;br/&gt;&amp;gt;&amp;gt; likely to manage a number of&lt;br/&gt;&amp;gt;&amp;gt; UTxOs with your number of vaults, which comes at a cost for you as well&lt;br/&gt;&amp;gt;&amp;gt; as everyone running a full&lt;br/&gt;&amp;gt;&amp;gt; node.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Note that this assumes miners are economically rationale, are&lt;br/&gt;&amp;gt;&amp;gt; incentivized by *public* fees and that&lt;br/&gt;&amp;gt;&amp;gt; you have a way to propagate your fee-bumped transaction to them. We also&lt;br/&gt;&amp;gt;&amp;gt; don&amp;#39;t consider the block&lt;br/&gt;&amp;gt;&amp;gt; space bounds.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In the previous paragraph and the following text, &amp;#34;vault&amp;#34; can generally&lt;br/&gt;&amp;gt;&amp;gt; be replaced with &amp;#34;offchain&lt;br/&gt;&amp;gt;&amp;gt; contract&amp;#34;.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## 3. With presigned transactions&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; As you all know, the first difficulty is to get to be able to&lt;br/&gt;&amp;gt;&amp;gt; unilaterally enforce your contract&lt;br/&gt;&amp;gt;&amp;gt; onchain. That is, any participant must be able to unilaterally bump the&lt;br/&gt;&amp;gt;&amp;gt; fees of a transaction even&lt;br/&gt;&amp;gt;&amp;gt; if it was co-signed by other participants.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; For Revault we can afford to introduce malleability in the Cancel&lt;br/&gt;&amp;gt;&amp;gt; transaction since there is no&lt;br/&gt;&amp;gt;&amp;gt; second-stage transaction depending on its txid. Therefore it is&lt;br/&gt;&amp;gt;&amp;gt; pre-signed with ANYONECANPAY. We&lt;br/&gt;&amp;gt;&amp;gt; can&amp;#39;t use ANYONECANPAY|SINGLE since it would open a pinning vector [3].&lt;br/&gt;&amp;gt;&amp;gt; Note how we can&amp;#39;t leverage&lt;br/&gt;&amp;gt;&amp;gt; the carve out rule, and neither can any other more-than-two-parties&lt;br/&gt;&amp;gt;&amp;gt; contract.&lt;br/&gt;&amp;gt;&amp;gt; This has a significant implication for the rest, as we are entirely&lt;br/&gt;&amp;gt;&amp;gt; burning fee-bumping UTxOs.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This opens up a pinning vector, or at least a significant nuisance: any&lt;br/&gt;&amp;gt;&amp;gt; other party can largely&lt;br/&gt;&amp;gt;&amp;gt; increase the absolute fee without increasing the feerate, leveraging the&lt;br/&gt;&amp;gt;&amp;gt; RBF rules to prevent you&lt;br/&gt;&amp;gt;&amp;gt; from replacing it without paying an insane fee. And you might not see it&lt;br/&gt;&amp;gt;&amp;gt; in your own mempool and&lt;br/&gt;&amp;gt;&amp;gt; could only suppose it&amp;#39;s happening by receiving non-full blocks or with&lt;br/&gt;&amp;gt;&amp;gt; transactions paying a lower&lt;br/&gt;&amp;gt;&amp;gt; feerate.&lt;br/&gt;&amp;gt;&amp;gt; Unfortunately i know of no other primitive that can be used by&lt;br/&gt;&amp;gt;&amp;gt; multi-party (i mean, &amp;gt;2) presigned&lt;br/&gt;&amp;gt;&amp;gt; transactions protocols for fee-bumping that aren&amp;#39;t (more) vulnerable to&lt;br/&gt;&amp;gt;&amp;gt; pinning.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## 4. We are still betting on future feerate&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The problem is still missing one more constraint. &amp;#34;Ensuring confirmation&lt;br/&gt;&amp;gt;&amp;gt; at any time&amp;#34; involves ensuring&lt;br/&gt;&amp;gt;&amp;gt; confirmation at *any* feerate, which you *cannot* do. So what&amp;#39;s the&lt;br/&gt;&amp;gt;&amp;gt; limit? In theory you should be ready&lt;br/&gt;&amp;gt;&amp;gt; to burn as much in fees as the value of the funds you want to get out of&lt;br/&gt;&amp;gt;&amp;gt; the contract. So... For us&lt;br/&gt;&amp;gt;&amp;gt; it&amp;#39;d mean keeping for each vault an equivalent amount of funds sitting&lt;br/&gt;&amp;gt;&amp;gt; there on the watchtower&amp;#39;s hot&lt;br/&gt;&amp;gt;&amp;gt; wallet. For Lightning, it&amp;#39;d mean keeping an equivalent amount of funds as&lt;br/&gt;&amp;gt;&amp;gt; the sum of all your&lt;br/&gt;&amp;gt;&amp;gt; channels balances sitting there unallocated &amp;#34;just in case&amp;#34;. This is not&lt;br/&gt;&amp;gt;&amp;gt; reasonable.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; So you need to keep a maximum feerate, above which you won&amp;#39;t be able to&lt;br/&gt;&amp;gt;&amp;gt; ensure the enforcement of&lt;br/&gt;&amp;gt;&amp;gt; all your contracts onchain at the same time. We call that the &amp;#34;reserve&lt;br/&gt;&amp;gt;&amp;gt; feerate&amp;#34; and you can have&lt;br/&gt;&amp;gt;&amp;gt; different strategies for choosing it, for instance:&lt;br/&gt;&amp;gt;&amp;gt; - The 85th percentile over the last year of transactions feerates&lt;br/&gt;&amp;gt;&amp;gt; - The maximum historical feerate&lt;br/&gt;&amp;gt;&amp;gt; - The maximum historical feerate adjusted in dollars (makes more sense&lt;br/&gt;&amp;gt;&amp;gt; but introduces a (set of?)&lt;br/&gt;&amp;gt;&amp;gt;   trusted oracle(s) in a security-critical component)&lt;br/&gt;&amp;gt;&amp;gt; - Picking a random high feerate (why not? It&amp;#39;s an arbitrary assumption&lt;br/&gt;&amp;gt;&amp;gt; anyways)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Therefore, even if we don&amp;#39;t have to bet on the broadcast-time feerate&lt;br/&gt;&amp;gt;&amp;gt; market at signing time anymore&lt;br/&gt;&amp;gt;&amp;gt; (since we can unilaterally bump), we still need some kind of prediction&lt;br/&gt;&amp;gt;&amp;gt; in preparation of making&lt;br/&gt;&amp;gt;&amp;gt; funds available to bump the fees at broadcast time.&lt;br/&gt;&amp;gt;&amp;gt; Apart from judging that 500sat/vb is probably more reasonable than&lt;br/&gt;&amp;gt;&amp;gt; 10sat/vbyte, this unfortunately&lt;br/&gt;&amp;gt;&amp;gt; sounds pretty much crystal-ball-driven.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; We currently use the maximum of the 95th percentiles over 90-days windows&lt;br/&gt;&amp;gt;&amp;gt; over historical block chain&lt;br/&gt;&amp;gt;&amp;gt; feerates. [4]&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## 5. How much funds does my watchtower need?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; That&amp;#39;s what we call the &amp;#34;reserve&amp;#34;. Depending on your reserve feerate&lt;br/&gt;&amp;gt;&amp;gt; strategy it might vary over&lt;br/&gt;&amp;gt;&amp;gt; time. This is easier to reason about with a per-contract reserve. For&lt;br/&gt;&amp;gt;&amp;gt; Revault it&amp;#39;s pretty&lt;br/&gt;&amp;gt;&amp;gt; straightforward since the Cancel transaction size is static:&lt;br/&gt;&amp;gt;&amp;gt; `reserve_feerate * cancel_size`. For&lt;br/&gt;&amp;gt;&amp;gt; other protocols with dynamic transaction sizes (or even packages of&lt;br/&gt;&amp;gt;&amp;gt; transactions) it&amp;#39;s less so. For&lt;br/&gt;&amp;gt;&amp;gt; your Lightning channel you would probably take the maximum size of your&lt;br/&gt;&amp;gt;&amp;gt; commitment transaction&lt;br/&gt;&amp;gt;&amp;gt; according to your HTLC exposure settings &#43; the size of as many&lt;br/&gt;&amp;gt;&amp;gt; `htlc_success` transaction?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Then you either have your software or your user guesstimate how many&lt;br/&gt;&amp;gt;&amp;gt; offchain contracts the&lt;br/&gt;&amp;gt;&amp;gt; watchtower will have to watch, time that by the per-contract reserve and&lt;br/&gt;&amp;gt;&amp;gt; refill this amount (plus&lt;br/&gt;&amp;gt;&amp;gt; some slack in practice). Once again, a UX tradeoff (not even mentioning&lt;br/&gt;&amp;gt;&amp;gt; the guesstimation UX):&lt;br/&gt;&amp;gt;&amp;gt; overestimating leads to too many unallocated funds sitting on a hot&lt;br/&gt;&amp;gt;&amp;gt; wallet, underestimating means&lt;br/&gt;&amp;gt;&amp;gt; (at best) inability to participate in new contracts or being &amp;#34;at risk&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt; (not being able to enforce&lt;br/&gt;&amp;gt;&amp;gt; all your contracts onchain at your reserve feerate) before a new refill.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; For vaults you likely have large-value UTxOs and small transactions (the&lt;br/&gt;&amp;gt;&amp;gt; Cancel is one-in one-out in&lt;br/&gt;&amp;gt;&amp;gt; Revault). For some other applications with large transactions and&lt;br/&gt;&amp;gt;&amp;gt; lower-value UTxOs on average it&amp;#39;s&lt;br/&gt;&amp;gt;&amp;gt; likely that only part of the offchain contracts might be enforceable at a&lt;br/&gt;&amp;gt;&amp;gt; reasonable feerate. Is it&lt;br/&gt;&amp;gt;&amp;gt; reasonable?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## 6. UTxO pool layout&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Now that you somehow managed to settle on a refill amount, how are you&lt;br/&gt;&amp;gt;&amp;gt; going to use these funds?&lt;br/&gt;&amp;gt;&amp;gt; Also, you&amp;#39;ll need to manage your pool across time (consolidating small&lt;br/&gt;&amp;gt;&amp;gt; coins, and probably fanning&lt;br/&gt;&amp;gt;&amp;gt; out large ones).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; You could keep a single large UTxO and peel it as you need to sponsor&lt;br/&gt;&amp;gt;&amp;gt; transactions. But this means&lt;br/&gt;&amp;gt;&amp;gt; that you need to create a coin of a specific value according to your need&lt;br/&gt;&amp;gt;&amp;gt; at the current feerate&lt;br/&gt;&amp;gt;&amp;gt; estimation, hope to have it confirmed in a few blocks (at least for now!&lt;br/&gt;&amp;gt;&amp;gt; [5]), and hope that the&lt;br/&gt;&amp;gt;&amp;gt; value won&amp;#39;t be obsolete by the time it confirmed. Also, you&amp;#39;d have to do&lt;br/&gt;&amp;gt;&amp;gt; that for any number of&lt;br/&gt;&amp;gt;&amp;gt; Cancel, chaining feebump coin creation transactions off the change of the&lt;br/&gt;&amp;gt;&amp;gt; previous ones or replacing&lt;br/&gt;&amp;gt;&amp;gt; them with more outputs. Both seem to become really un-manageable (and&lt;br/&gt;&amp;gt;&amp;gt; expensive) in many edge-cases,&lt;br/&gt;&amp;gt;&amp;gt; shortening the time you have to confirm the actual Cancel transaction and&lt;br/&gt;&amp;gt;&amp;gt; creating uncertainty about&lt;br/&gt;&amp;gt;&amp;gt; the reserve (how much is my just-in-time fanout going to cost me in fees&lt;br/&gt;&amp;gt;&amp;gt; that i need to refill in&lt;br/&gt;&amp;gt;&amp;gt; advance on my watchtower wallet?).&lt;br/&gt;&amp;gt;&amp;gt; This is less of a concern for protocols using CPFP to sponsor&lt;br/&gt;&amp;gt;&amp;gt; transactions, but they rely on a&lt;br/&gt;&amp;gt;&amp;gt; policy rule specific to 2-parties contracts.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Therefore for Revault we fan-out the coins per-vault in advance. We do so&lt;br/&gt;&amp;gt;&amp;gt; at refill time so the&lt;br/&gt;&amp;gt;&amp;gt; refiller can give an excess to pay for the fees of the fanout transaction&lt;br/&gt;&amp;gt;&amp;gt; (which is reasonable since&lt;br/&gt;&amp;gt;&amp;gt; it will occur just after the refilling transaction confirms). When the&lt;br/&gt;&amp;gt;&amp;gt; watchtower is asked to watch&lt;br/&gt;&amp;gt;&amp;gt; for a new delegated vault it will allocate coins from the pool of&lt;br/&gt;&amp;gt;&amp;gt; fanned-out UTxOs to it (failing&lt;br/&gt;&amp;gt;&amp;gt; that, it would refuse the delegation).&lt;br/&gt;&amp;gt;&amp;gt; What is a good distribution of UTxOs amounts per vault? We want to&lt;br/&gt;&amp;gt;&amp;gt; minimize the number of coins,&lt;br/&gt;&amp;gt;&amp;gt; still have coins small enough to not overpay (remember, we can&amp;#39;t have&lt;br/&gt;&amp;gt;&amp;gt; change) and be able to bump a&lt;br/&gt;&amp;gt;&amp;gt; Cancel up to the reserve feerate using these coins. The two latter&lt;br/&gt;&amp;gt;&amp;gt; constraints are directly in&lt;br/&gt;&amp;gt;&amp;gt; contradiction as the minimal value of a coin usable at the reserve&lt;br/&gt;&amp;gt;&amp;gt; feerate (paying for its own input&lt;br/&gt;&amp;gt;&amp;gt; fee &#43; bumping the feerate by, say, 5sat/vb) is already pretty high.&lt;br/&gt;&amp;gt;&amp;gt; Therefore we decided to go with&lt;br/&gt;&amp;gt;&amp;gt; two distributions per vault. The &amp;#34;reserve distribution&amp;#34; alone ensures&lt;br/&gt;&amp;gt;&amp;gt; that we can bump up to the&lt;br/&gt;&amp;gt;&amp;gt; reserve feerate and is usable for high feerates. The &amp;#34;bonus distribution&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt; is not, but contains&lt;br/&gt;&amp;gt;&amp;gt; smaller coins useful to prevent overpayments during low and medium fee&lt;br/&gt;&amp;gt;&amp;gt; periods (which is most of the&lt;br/&gt;&amp;gt;&amp;gt; time).&lt;br/&gt;&amp;gt;&amp;gt; Both distributions are based on a basic geometric suite [6]. Each value&lt;br/&gt;&amp;gt;&amp;gt; is half the previous one.&lt;br/&gt;&amp;gt;&amp;gt; This exponentially decreases the value, limiting the number of coins. But&lt;br/&gt;&amp;gt;&amp;gt; this also allows for&lt;br/&gt;&amp;gt;&amp;gt; pretty small coins to exist and each coin&amp;#39;s value is equal to the sum of&lt;br/&gt;&amp;gt;&amp;gt; the smaller coins,&lt;br/&gt;&amp;gt;&amp;gt; or smaller by at most the value of the smallest coin. Therefore bounding&lt;br/&gt;&amp;gt;&amp;gt; the maximum overpayment to&lt;br/&gt;&amp;gt;&amp;gt; the smallest coin&amp;#39;s value [7].&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; For the management of the UTxO pool across time we merged the&lt;br/&gt;&amp;gt;&amp;gt; consolidation with the fanout. When&lt;br/&gt;&amp;gt;&amp;gt; fanning out a refilled UTxO, we scan the pool for coins that need to be&lt;br/&gt;&amp;gt;&amp;gt; consolidated according to a&lt;br/&gt;&amp;gt;&amp;gt; heuristic. An instance of a heuristic is &amp;#34;the coin isn&amp;#39;t allocated and&lt;br/&gt;&amp;gt;&amp;gt; would not have been able to&lt;br/&gt;&amp;gt;&amp;gt; increase the fee at the median feerate over the past 90 days of blocks&amp;#34;.&lt;br/&gt;&amp;gt;&amp;gt; We had this assumption that feerate would tend to go up with time and&lt;br/&gt;&amp;gt;&amp;gt; therefore discarded having to&lt;br/&gt;&amp;gt;&amp;gt; split some UTxOs from the pool. We however overlooked that a large&lt;br/&gt;&amp;gt;&amp;gt; increase in the exchange price of&lt;br/&gt;&amp;gt;&amp;gt; BTC as we&amp;#39;ve seen during the past year could invalidate this assumption&lt;br/&gt;&amp;gt;&amp;gt; and that should arguably be&lt;br/&gt;&amp;gt;&amp;gt; reconsidered.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## 7. Bumping and re-bumping&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; First of all, when to fee-bump? At fixed time intervals? At each block&lt;br/&gt;&amp;gt;&amp;gt; connection? It sounds like,&lt;br/&gt;&amp;gt;&amp;gt; given a large enough timelock, you could try to greed by &amp;#34;trying your&lt;br/&gt;&amp;gt;&amp;gt; luck&amp;#34; at a lower feerate and&lt;br/&gt;&amp;gt;&amp;gt; only re-bumping every N blocks. You would then start aggressively bumping&lt;br/&gt;&amp;gt;&amp;gt; at every block after M&lt;br/&gt;&amp;gt;&amp;gt; blocks have passed. But that&amp;#39;s actually a bet (in disguised?) that the&lt;br/&gt;&amp;gt;&amp;gt; next block feerate in M blocks&lt;br/&gt;&amp;gt;&amp;gt; will be lower than the current one. In the absence of any predictive&lt;br/&gt;&amp;gt;&amp;gt; model it is more reasonable to&lt;br/&gt;&amp;gt;&amp;gt; just start being aggressive immediately.&lt;br/&gt;&amp;gt;&amp;gt; You probably want to base your estimates on `estimatesmartfee` and as a&lt;br/&gt;&amp;gt;&amp;gt; consequence you would re-bump&lt;br/&gt;&amp;gt;&amp;gt; (if needed )after each block connection, when your estimates get updated&lt;br/&gt;&amp;gt;&amp;gt; and you notice your&lt;br/&gt;&amp;gt;&amp;gt; transaction was not included in the block.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In the event that you notice a consequent portion of the block is filled&lt;br/&gt;&amp;gt;&amp;gt; with transactions paying&lt;br/&gt;&amp;gt;&amp;gt; less than your own, you might want to start panicking and bump your&lt;br/&gt;&amp;gt;&amp;gt; transaction fees by a certain&lt;br/&gt;&amp;gt;&amp;gt; percentage with no consideration for your fee estimator. You might skew&lt;br/&gt;&amp;gt;&amp;gt; miners incentives in doing&lt;br/&gt;&amp;gt;&amp;gt; so: if you increase the fees by a factor of N, any miner with a fraction&lt;br/&gt;&amp;gt;&amp;gt; larger than 1/N of the&lt;br/&gt;&amp;gt;&amp;gt; network hashrate now has an incentive to censor your transaction at first&lt;br/&gt;&amp;gt;&amp;gt; to get you to panic. Also&lt;br/&gt;&amp;gt;&amp;gt; note this can happen if you want to pay the absolute fees for the&lt;br/&gt;&amp;gt;&amp;gt; &amp;#39;pinning&amp;#39; attack mentioned in&lt;br/&gt;&amp;gt;&amp;gt; section #2, and that might actually incentivize miners to perform it&lt;br/&gt;&amp;gt;&amp;gt; themselves..&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The gist is that the most effective way to bump and rebump (RBF the&lt;br/&gt;&amp;gt;&amp;gt; Cancel tx) seems to just be to&lt;br/&gt;&amp;gt;&amp;gt; consider the `estimatesmartfee 2 CONSERVATIVE` feerate at every block&lt;br/&gt;&amp;gt;&amp;gt; your tx isn&amp;#39;t included in, and&lt;br/&gt;&amp;gt;&amp;gt; to RBF it if the feerate is higher.&lt;br/&gt;&amp;gt;&amp;gt; In addition, we fallback to a block chain based estimation when estimates&lt;br/&gt;&amp;gt;&amp;gt; aren&amp;#39;t available (eg if&lt;br/&gt;&amp;gt;&amp;gt; the user stopped their WT for say a hour and we come back up): we use the&lt;br/&gt;&amp;gt;&amp;gt; 85th percentile over the&lt;br/&gt;&amp;gt;&amp;gt; feerates in the last 6 blocks. Sure, miners can try to have an influence&lt;br/&gt;&amp;gt;&amp;gt; on that by stuffing their&lt;br/&gt;&amp;gt;&amp;gt; blocks with large fee self-paying transactions, but they would need to:&lt;br/&gt;&amp;gt;&amp;gt; 1. Be sure to catch a significant portion of the 6 blocks (at least 2,&lt;br/&gt;&amp;gt;&amp;gt; actually)&lt;br/&gt;&amp;gt;&amp;gt; 2. Give up on 25% of the highest fee-paying transactions (assuming they&lt;br/&gt;&amp;gt;&amp;gt; got the 6 blocks, it&amp;#39;s&lt;br/&gt;&amp;gt;&amp;gt;    proportionally larger and incertain as they get less of them)&lt;br/&gt;&amp;gt;&amp;gt; 3. Hope that our estimator will fail and we need to fall back to the&lt;br/&gt;&amp;gt;&amp;gt; chain-based estimation&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## 8. Our study&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; We essentially replayed the historical data with different deployment&lt;br/&gt;&amp;gt;&amp;gt; configurations (number of&lt;br/&gt;&amp;gt;&amp;gt; participants and timelock) and probability of an event occurring (event&lt;br/&gt;&amp;gt;&amp;gt; being say an Unvault, an&lt;br/&gt;&amp;gt;&amp;gt; invalid Unvault, a new delegation, ..). We then observed different&lt;br/&gt;&amp;gt;&amp;gt; metrics such as the time at risk&lt;br/&gt;&amp;gt;&amp;gt; (when we can&amp;#39;t enforce all our contracts at the reserve feerate at the&lt;br/&gt;&amp;gt;&amp;gt; same time), or the&lt;br/&gt;&amp;gt;&amp;gt; operational cost.&lt;br/&gt;&amp;gt;&amp;gt; We got the historical fee estimates data from Statoshi [9], Txstats [10]&lt;br/&gt;&amp;gt;&amp;gt; and the historical chain&lt;br/&gt;&amp;gt;&amp;gt; data from Riccardo Casatta&amp;#39;s `blocks_iterator` [11]. Thanks!&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The (research-quality..) code can be found at&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/revault/research&#34;&gt;https://github.com/revault/research&lt;/a&gt; under the section&lt;br/&gt;&amp;gt;&amp;gt; &amp;#34;Fee bumping&amp;#34;. Again it&amp;#39;s very Revault specific, but at least the data&lt;br/&gt;&amp;gt;&amp;gt; can probably be reused for&lt;br/&gt;&amp;gt;&amp;gt; studying other protocols.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## 9. Insurances&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Of course, given it&amp;#39;s all hacks and workarounds and there is no good&lt;br/&gt;&amp;gt;&amp;gt; answer to &amp;#34;what is a reasonable&lt;br/&gt;&amp;gt;&amp;gt; feerate up to which we need to make contracts enforceable onchain?&amp;#34;,&lt;br/&gt;&amp;gt;&amp;gt; there is definitely room for an&lt;br/&gt;&amp;gt;&amp;gt; insurance market. But this enters the realm of opinions. Although i do&lt;br/&gt;&amp;gt;&amp;gt; have some (having discussed&lt;br/&gt;&amp;gt;&amp;gt; this topic for the past years with different people), i would like to&lt;br/&gt;&amp;gt;&amp;gt; keep this post focused on the&lt;br/&gt;&amp;gt;&amp;gt; technical aspects of this problem.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [0] As far as i can tell, having offchain contracts be enforceable&lt;br/&gt;&amp;gt;&amp;gt; onchain by confirming a&lt;br/&gt;&amp;gt;&amp;gt; transaction before the expiration of a timelock is a widely agreed-upon&lt;br/&gt;&amp;gt;&amp;gt; approach. And i don&amp;#39;t think&lt;br/&gt;&amp;gt;&amp;gt; we can opt for any other fundamentally different one, as you want to know&lt;br/&gt;&amp;gt;&amp;gt; you can claim back your&lt;br/&gt;&amp;gt;&amp;gt; coins from a contract after a deadline before taking part in it.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [1] The Real Revault (tm) involves more transactions, but for the sake of&lt;br/&gt;&amp;gt;&amp;gt; conciseness i only&lt;br/&gt;&amp;gt;&amp;gt; detailed a minimum instance of the problem.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [2] Only presigning part of the Unvault transactions allows to only&lt;br/&gt;&amp;gt;&amp;gt; delegate part of the coins,&lt;br/&gt;&amp;gt;&amp;gt; which can be abstracted as &amp;#34;delegate x% of your stash&amp;#34; in the user&lt;br/&gt;&amp;gt;&amp;gt; interface.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [3]&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-May/017835.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-May/017835.html&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [4]&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/revault/research/blob/1df953813708287c32a15e771ba74957ec44f354/feebumping/model/statemachine.py#L323-L329&#34;&gt;https://github.com/revault/research/blob/1df953813708287c32a15e771ba74957ec44f354/feebumping/model/statemachine.py#L323-L329&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [5] &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/23121&#34;&gt;https://github.com/bitcoin/bitcoin/pull/23121&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [6]&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/revault/research/blob/1df953813708287c32a15e771ba74957ec44f354/feebumping/model/statemachine.py#L494-L507&#34;&gt;https://github.com/revault/research/blob/1df953813708287c32a15e771ba74957ec44f354/feebumping/model/statemachine.py#L494-L507&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [7] Of course this assumes a combinatorial coin selection, but i believe&lt;br/&gt;&amp;gt;&amp;gt; it&amp;#39;s ok given we limit the&lt;br/&gt;&amp;gt;&amp;gt; number of coins beforehand.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [8] Although there is the argument to outbid a censorship, anyone&lt;br/&gt;&amp;gt;&amp;gt; censoring you isn&amp;#39;t necessarily a&lt;br/&gt;&amp;gt;&amp;gt; miner.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [9] &lt;a href=&#34;https://www.statoshi.info/&#34;&gt;https://www.statoshi.info/&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [10] &lt;a href=&#34;https://www.statoshi.info/&#34;&gt;https://www.statoshi.info/&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [11] &lt;a href=&#34;https://github.com/RCasatta/blocks_iterator&#34;&gt;https://github.com/RCasatta/blocks_iterator&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20211207/79ed7638/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20211207/79ed7638/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-08T01:00:54&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsge5k27z24qev9gmsx79txqk7t67vrefrl0aryejs7z2lrax9qnuczyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2q5y7jea</id>
    
      <title type="html">📅 Original date posted:2021-10-26 📝 Original message:Hi ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsge5k27z24qev9gmsx79txqk7t67vrefrl0aryejs7z2lrax9qnuczyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2q5y7jea" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqswm6qqrsxpvvcgtrxuc77utvptq74czna3ve8smlhn4sffykk5cjgelyz8p&#39;&gt;nevent1q…yz8p&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2021-10-26&lt;br/&gt;📝 Original message:Hi Lisa,&lt;br/&gt;&lt;br/&gt;Some background for people who are not familiar with mempool:&lt;br/&gt;&lt;br/&gt;The mempool is a cache of unconfirmed transactions, designed in a way&lt;br/&gt;to help miners efficiently pick the highest feerate packages to&lt;br/&gt;include in new blocks. It stores more than a block&amp;#39;s worth of&lt;br/&gt;transactions because transaction volume fluctuates and any rational&lt;br/&gt;miner would try to maximize the fees in their blocks; in a reorg, we&lt;br/&gt;also don&amp;#39;t want to completely forget what transactions were in the&lt;br/&gt;now-stale tip.&lt;br/&gt;&lt;br/&gt;In Bitcoin Core, full nodes keep a mempool by default. The additional&lt;br/&gt;requirements for keeping a mempool are minimal (300MB storage, can be&lt;br/&gt;configured to be lower) because anyone, anywhere in the world, should&lt;br/&gt;be able to run a node and broadcast a Bitcoin payment without special&lt;br/&gt;connectivity to some specific set of people or expensive/inaccessible&lt;br/&gt;hardware. Perhaps connecting directly to miners can be a solution for&lt;br/&gt;some people, but I don&amp;#39;t think it&amp;#39;s healthy for the network.&lt;br/&gt;&lt;br/&gt;Some benefits of keeping a mempool as a non-mining node include:&lt;br/&gt;- Fee estimation based on your node&amp;#39;s knowledge of unconfirmed&lt;br/&gt;transactions &#43; historical data.&lt;br/&gt;- Dramatically increased block validation (and thus propagation)&lt;br/&gt;speed, since you cache signature and script results of transactions&lt;br/&gt;before they are confirmed.&lt;br/&gt;- Reduced block relay bandwidth usage (Bitcoin Core nodes use BIP152&lt;br/&gt;compact block relay), as you don&amp;#39;t need to re-request the block&lt;br/&gt;transactions you already have in your mempool.&lt;br/&gt;- Wallet ability to send/receive transactions that spend unconfirmed outputs.&lt;br/&gt;&lt;br/&gt;&amp;gt; I had the realization that the mempool is obsolete and should be eliminated.&lt;br/&gt;&lt;br/&gt;I assume you mean that the mempool should still exist but be turned&lt;br/&gt;off for non-mining nodes. A block template producer needs to keep&lt;br/&gt;unconfirmed transactions somewhere.&lt;br/&gt;On Bitcoin Core today, you can use the -blocksonly config option to&lt;br/&gt;ignore incoming transactions (effectively switching off your mempool),&lt;br/&gt;but there are strong reasons not to do this:&lt;br/&gt;- It is trivial for your peers to detect that all transactions&lt;br/&gt;broadcasted by your node = from your wallet. Linking your node to your&lt;br/&gt;transactions is a very bad privacy leak.&lt;br/&gt;- You must query someone else for what feerate to put on your transaction.&lt;br/&gt;- You can&amp;#39;t use BIP152 compact block relay, so your network bandwidth&lt;br/&gt;usage spikes at every block. You also can&amp;#39;t cache validation results,&lt;br/&gt;so your block validation speed slows down.&lt;br/&gt;&lt;br/&gt;&amp;gt; Removing the mempool would greatly reduce the bandwidth requirement for running a node...&lt;br/&gt;&lt;br/&gt;If you&amp;#39;re having problems with your individual node&amp;#39;s bandwidth usage,&lt;br/&gt;you can also decrease the number of connections you make or turn off&lt;br/&gt;incoming connections. There are efforts to reduce transaction relay&lt;br/&gt;bandwidth usage network-wide [1].&lt;br/&gt;&lt;br/&gt;&amp;gt; Removing the mempool would... keep intentionality of transactions private until confirmed/irrevocable...&lt;br/&gt;&lt;br/&gt;I&amp;#39;m confused - what is the purpose of keeping a transaction private&lt;br/&gt;until it confirms? Don&amp;#39;t miners still see your transaction? A&lt;br/&gt;confirmed transaction is not irrevocable; reorgs happen.&lt;br/&gt;&lt;br/&gt;&amp;gt; Removing the mempool would... naturally resolve all current issues inherent in package relay and rbf rules.&lt;br/&gt;&lt;br/&gt;Removing the mempool does not help with this. How does a miner decide&lt;br/&gt;whether a conflicting transaction is an economically-advantageous&lt;br/&gt;replacement or a DoS attack? How do you submit your CPFP if the parent&lt;br/&gt;is below the mempool minimum feerate? Do they already have a different&lt;br/&gt;relay/mempool implementation handling all of these problems but don&amp;#39;t&lt;br/&gt;aren&amp;#39;t sharing it with the rest of the community?&lt;br/&gt;&lt;br/&gt;&amp;gt; Initial feerate estimation would need to be based on published blocks, not pending transactions (as this information would no longer be available), or from direct interactions with block producers.&lt;br/&gt;&lt;br/&gt;There are many reasons why using only published blocks for fee&lt;br/&gt;estimates is a flawed design, including:&lt;br/&gt;&lt;br/&gt;- The miner of a block can artificially inflate the feerate of the&lt;br/&gt;transactions in their mempool simply by including a few of their own&lt;br/&gt;transactions that pay extremely high feerates. This costs them&lt;br/&gt;nothing, as they collect the fees.&lt;br/&gt;- A miner constructs a block based on the transactions in their&lt;br/&gt;mempool. Your transaction&amp;#39;s feerate may have been enough to be&lt;br/&gt;included 2 blocks ago or a week ago, but it will be compared to the&lt;br/&gt;other unconfirmed transactions available to the miner now. They can&lt;br/&gt;tell you what&amp;#39;s in their mempool or what the next-block feerate is,&lt;br/&gt;but you would be a fool to believe them.&lt;br/&gt;&lt;br/&gt;See also [2],[3].&lt;br/&gt;&lt;br/&gt;&amp;gt; Provided the number of block template producing actors remains beneath, say 1000, it’d be quite feasible to publish a list of tor endpoints that nodes can independently  &#43; directly submit their transactions to. In fact, merely allowing users to select their own list of endpoints to use alternatively to the mempool would be a low effort starting point for the eventual replacement.&lt;br/&gt;&lt;br/&gt;As a thought experiment, let&amp;#39;s imagine we have some public registry of&lt;br/&gt;mining nodes&amp;#39; tor endpoints and we use it for this secondary&lt;br/&gt;direct-to-miner transaction relay network. If the registry is&lt;br/&gt;maintained (by who?) and accurate (based on whose word?), it is a&lt;br/&gt;point of failure for transaction censorship and deanonymization, as&lt;br/&gt;well as an additional barrier to becoming a miner, encouraging&lt;br/&gt;centralization.&lt;br/&gt;The other possibility is that the registry is not accurate. In fact,&lt;br/&gt;unless the registry requires miners to identify themselves (which&lt;br/&gt;others on this thread have already pointed out is ill-advised), this&lt;br/&gt;should be treated similarly to regular addr gossip. We would never&lt;br/&gt;automatically trust that the entity behind the endpoint provides the&lt;br/&gt;service it advertises, is an honest node that won&amp;#39;t simply blackhole&lt;br/&gt;our transaction, or even belongs to a Bitcoin node at all.&lt;br/&gt;&lt;br/&gt;Best,&lt;br/&gt;Gloria&lt;br/&gt;&lt;br/&gt;[1]: &lt;a href=&#34;https://arxiv.org/pdf/1905.10518.pdf&#34;&gt;https://arxiv.org/pdf/1905.10518.pdf&lt;/a&gt;&lt;br/&gt;[2]: &lt;a href=&#34;https://bitcointechtalk.com/an-introduction-to-bitcoin-core-fee-estimation-27920880ad0&#34;&gt;https://bitcointechtalk.com/an-introduction-to-bitcoin-core-fee-estimation-27920880ad0&lt;/a&gt;&lt;br/&gt;[3]: &lt;a href=&#34;https://gist.github.com/morcos/d3637f015bc4e607e1fd10d8351e9f41&#34;&gt;https://gist.github.com/morcos/d3637f015bc4e607e1fd10d8351e9f41&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Tue, Oct 26, 2021 at 8:38 AM lisa neigut via bitcoin-dev &amp;lt;&lt;br/&gt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hi all,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In a recent conversation with @glozow, I had the realization that the&lt;br/&gt;&amp;gt; mempool is obsolete and should be eliminated.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Instead, users should submit their transactions directly to mining pools,&lt;br/&gt;&amp;gt; preferably over an anonymous communication network such as tor. This can&lt;br/&gt;&amp;gt; easily be achieved by mining pools running a tor onion node for this&lt;br/&gt;&amp;gt; express purpose (or via a lightning network extension etc)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Mempools make sense in a world where mining is done by a large number of&lt;br/&gt;&amp;gt; participating nodes, eg where the block template is constructed by a&lt;br/&gt;&amp;gt; majority of the participants on the network. In this case, it is necessary&lt;br/&gt;&amp;gt; to socialize pending transaction data to all participants, as you don’t&lt;br/&gt;&amp;gt; know which participant will be constructing the winning block template.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In reality however, mempool relay is unnecessary where the majority of&lt;br/&gt;&amp;gt; hashpower and thus block template creation is concentrated in a&lt;br/&gt;&amp;gt; semi-restricted set.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Removing the mempool would greatly reduce the bandwidth requirement for&lt;br/&gt;&amp;gt; running a node, keep intentionality of transactions private until&lt;br/&gt;&amp;gt; confirmed/irrevocable, and naturally resolve all current issues inherent in&lt;br/&gt;&amp;gt; package relay and rbf rules. It also resolves the recent minimum relay&lt;br/&gt;&amp;gt; questions, as relay is no longer a concern for unmined transactions.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Provided the number of block template producing actors remains beneath,&lt;br/&gt;&amp;gt; say 1000, it’d be quite feasible to publish a list of tor endpoints that&lt;br/&gt;&amp;gt; nodes can independently  &#43; directly submit their transactions to. In fact,&lt;br/&gt;&amp;gt; merely allowing users to select their own list of endpoints to use&lt;br/&gt;&amp;gt; alternatively to the mempool would be a low effort starting point for the&lt;br/&gt;&amp;gt; eventual replacement.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; On the other hand, removing the mempool would greatly complicate solo&lt;br/&gt;&amp;gt; mining and would also make BetterHash proposals, which move the block&lt;br/&gt;&amp;gt; template construction away from a centralized mining pool back to the&lt;br/&gt;&amp;gt; individual miner, much more difficult. It also makes explicit the target&lt;br/&gt;&amp;gt; for DoS attacks.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; A direct communication channel between block template construction venues&lt;br/&gt;&amp;gt; and transaction proposers also provides a venue for direct feedback wrt&lt;br/&gt;&amp;gt; acceptable feerates at the time, which both makes transaction confirmation&lt;br/&gt;&amp;gt; timelines less variable as well as provides block producers a mechanism for&lt;br/&gt;&amp;gt; (independently) enforcing their own minimum security budget. In other&lt;br/&gt;&amp;gt; words, expressing a minimum acceptable feerate for continued operation.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Initial feerate estimation would need to be based on published blocks, not&lt;br/&gt;&amp;gt; pending transactions (as this information would no longer be available), or&lt;br/&gt;&amp;gt; from direct interactions with block producers.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ~niftynei&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20211026/9477b0b5/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20211026/9477b0b5/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-08T01:00:20&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqs2s74wvvp5rg3nnrjdpfcz4gxdlygmakkf5qc9wkyermchnn8fvtczyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2qt8pfau</id>
    
      <title type="html">📅 Original date posted:2021-09-21 📝 Original message:Hi ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqs2s74wvvp5rg3nnrjdpfcz4gxdlygmakkf5qc9wkyermchnn8fvtczyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2qt8pfau" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsyr6uky8fjrlka7efq48wk4ref98l9celpa99z74p9esnveu5mczcry7jfz&#39;&gt;nevent1q…7jfz&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2021-09-21&lt;br/&gt;📝 Original message:Hi Bastien,&lt;br/&gt;&lt;br/&gt;Thank you for your feedback!&lt;br/&gt;&lt;br/&gt;&amp;gt; In your example we have a parent transaction A already in the mempool&lt;br/&gt;&amp;gt; and an unrelated child B. We submit a package C &#43; D where C spends&lt;br/&gt;&amp;gt; another of A&amp;#39;s inputs. You&amp;#39;re highlighting that this package may be&lt;br/&gt;&amp;gt; rejected because of the unrelated transaction(s) B.&lt;br/&gt;&lt;br/&gt;&amp;gt; The way I see this, an attacker can abuse this rule to ensure&lt;br/&gt;&amp;gt; transaction A stays pinned in the mempool without confirming by&lt;br/&gt;&amp;gt; broadcasting a set of child transactions that reach these limits&lt;br/&gt;&amp;gt; and pay low fees (where A would be a commit tx in LN).&lt;br/&gt;&lt;br/&gt;I believe you are describing a pinning attack in which your adversarial&lt;br/&gt;counterparty attempts to monopolize the mempool descendant limit of the&lt;br/&gt;shared  transaction A in order to prevent you from submitting a fee-bumping&lt;br/&gt;child C; I&amp;#39;ve tried to illustrate this as diagram A here:&lt;br/&gt; &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/134159860-068080d0-bbb6-4356-ae74-00df00644c74.png&#34;&gt; &lt;br/&gt;(please let me know if I&amp;#39;m misunderstanding).&lt;br/&gt;&lt;br/&gt;I believe this attack is mitigated as long as we attempt to submit&lt;br/&gt;transactions individually (and thus take advantage of CPFP carve out)&lt;br/&gt;before attempting package validation. So, in scenario A2, even if the&lt;br/&gt;mempool receives a package with A&#43;C, it would deduplicate A, submit C as an&lt;br/&gt;individual transaction, and allow it due to the CPFP carve out exemption. A&lt;br/&gt;more general goal is: if a transaction would propagate successfully on its&lt;br/&gt;own now, it should still propagate regardless of whether it is included in&lt;br/&gt;a package. The best way to ensure this, as far as I can tell, is to always&lt;br/&gt;try to submit them individually first.&lt;br/&gt;&lt;br/&gt;I would note that this proposal doesn&amp;#39;t accommodate something like diagram&lt;br/&gt;B, where C is getting CPFP carve out and wants to bring a &#43;1 (e.g. C has&lt;br/&gt;very low fees and is bumped by D). I don&amp;#39;t think this is a use case since C&lt;br/&gt;should be the one fee-bumping A, but since we&amp;#39;re talking about limitations&lt;br/&gt;around the CPFP carve out, this is it.&lt;br/&gt;&lt;br/&gt;Let me know if this addresses your concerns?&lt;br/&gt;&lt;br/&gt;Thanks,&lt;br/&gt;Gloria&lt;br/&gt;&lt;br/&gt;On Mon, Sep 20, 2021 at 10:19 AM Bastien TEINTURIER &amp;lt;bastien at acinq.fr&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hi Gloria,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thanks for this detailed post!&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The illustrations you provided are very useful for this kind of graph&lt;br/&gt;&amp;gt; topology problems.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The rules you lay out for package RBF look good to me at first glance&lt;br/&gt;&amp;gt; as there are some subtle improvements compared to BIP 125.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; 1. A package cannot exceed `MAX_PACKAGE_COUNT=25` count and&lt;br/&gt;&amp;gt; &amp;gt; `MAX_PACKAGE_SIZE=101KvB` total size [8]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I have a question regarding this rule, as your example 2C could be&lt;br/&gt;&amp;gt; concerning for LN (unless I didn&amp;#39;t understand it correctly).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This also touches on the package RBF rule 5 (&amp;#34;The package cannot&lt;br/&gt;&amp;gt; replace more than 100 mempool transactions.&amp;#34;)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In your example we have a parent transaction A already in the mempool&lt;br/&gt;&amp;gt; and an unrelated child B. We submit a package C &#43; D where C spends&lt;br/&gt;&amp;gt; another of A&amp;#39;s inputs. You&amp;#39;re highlighting that this package may be&lt;br/&gt;&amp;gt; rejected because of the unrelated transaction(s) B.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The way I see this, an attacker can abuse this rule to ensure&lt;br/&gt;&amp;gt; transaction A stays pinned in the mempool without confirming by&lt;br/&gt;&amp;gt; broadcasting a set of child transactions that reach these limits&lt;br/&gt;&amp;gt; and pay low fees (where A would be a commit tx in LN).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; We had to create the CPFP carve-out rule explicitly to work around&lt;br/&gt;&amp;gt; this limitation, and I think it would be necessary for package RBF&lt;br/&gt;&amp;gt; as well, because in such cases we do want to be able to submit a&lt;br/&gt;&amp;gt; package A &#43; C where C pays high fees to speed up A&amp;#39;s confirmation,&lt;br/&gt;&amp;gt; regardless of unrelated unconfirmed children of A...&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; We could submit only C to benefit from the existing CPFP carve-out&lt;br/&gt;&amp;gt; rule, but that wouldn&amp;#39;t work if our local mempool doesn&amp;#39;t have A yet,&lt;br/&gt;&amp;gt; but other remote mempools do.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Is my concern justified? Is this something that we should dig into a&lt;br/&gt;&amp;gt; bit deeper?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thanks,&lt;br/&gt;&amp;gt; Bastien&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Le jeu. 16 sept. 2021 à 09:55, Gloria Zhao via bitcoin-dev &amp;lt;&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&amp;gt; a écrit :&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Hi there,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I&amp;#39;m writing to propose a set of mempool policy changes to enable package&lt;br/&gt;&amp;gt;&amp;gt; validation (in preparation for package relay) in Bitcoin Core. These&lt;br/&gt;&amp;gt;&amp;gt; would not&lt;br/&gt;&amp;gt;&amp;gt; be consensus or P2P protocol changes. However, since mempool policy&lt;br/&gt;&amp;gt;&amp;gt; significantly affects transaction propagation, I believe this is relevant&lt;br/&gt;&amp;gt;&amp;gt; for&lt;br/&gt;&amp;gt;&amp;gt; the mailing list.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; My proposal enables packages consisting of multiple parents and 1 child.&lt;br/&gt;&amp;gt;&amp;gt; If you&lt;br/&gt;&amp;gt;&amp;gt; develop software that relies on specific transaction relay assumptions&lt;br/&gt;&amp;gt;&amp;gt; and/or&lt;br/&gt;&amp;gt;&amp;gt; are interested in using package relay in the future, I&amp;#39;m very interested&lt;br/&gt;&amp;gt;&amp;gt; to hear&lt;br/&gt;&amp;gt;&amp;gt; your feedback on the utility or restrictiveness of these package policies&lt;br/&gt;&amp;gt;&amp;gt; for&lt;br/&gt;&amp;gt;&amp;gt; your use cases.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; A draft implementation of this proposal can be found in [Bitcoin Core&lt;br/&gt;&amp;gt;&amp;gt; PR#22290][1].&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; An illustrated version of this post can be found at&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://gist.github.com/glozow/dc4e9d5c5b14ade7cdfac40f43adb18a&#34;&gt;https://gist.github.com/glozow/dc4e9d5c5b14ade7cdfac40f43adb18a&lt;/a&gt;.&lt;br/&gt;&amp;gt;&amp;gt; I have also linked the images below.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## Background&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Feel free to skip this section if you are already familiar with mempool&lt;br/&gt;&amp;gt;&amp;gt; policy&lt;br/&gt;&amp;gt;&amp;gt; and package relay terminology.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Terminology Clarifications&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; * Package = an ordered list of related transactions, representable by a&lt;br/&gt;&amp;gt;&amp;gt; Directed&lt;br/&gt;&amp;gt;&amp;gt;   Acyclic Graph.&lt;br/&gt;&amp;gt;&amp;gt; * Package Feerate = the total modified fees divided by the total virtual&lt;br/&gt;&amp;gt;&amp;gt; size of&lt;br/&gt;&amp;gt;&amp;gt;   all transactions in the package.&lt;br/&gt;&amp;gt;&amp;gt;     - Modified fees = a transaction&amp;#39;s base fees &#43; fee delta applied by&lt;br/&gt;&amp;gt;&amp;gt; the user&lt;br/&gt;&amp;gt;&amp;gt;       with `prioritisetransaction`. As such, we expect this to vary across&lt;br/&gt;&amp;gt;&amp;gt; mempools.&lt;br/&gt;&amp;gt;&amp;gt;     - Virtual Size = the maximum of virtual sizes calculated using [BIP141&lt;br/&gt;&amp;gt;&amp;gt;       virtual size][2] and sigop weight. [Implemented here in Bitcoin&lt;br/&gt;&amp;gt;&amp;gt; Core][3].&lt;br/&gt;&amp;gt;&amp;gt;     - Note that feerate is not necessarily based on the base fees and&lt;br/&gt;&amp;gt;&amp;gt; serialized&lt;br/&gt;&amp;gt;&amp;gt;       size.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; * Fee-Bumping = user/wallet actions that take advantage of miner&lt;br/&gt;&amp;gt;&amp;gt; incentives to&lt;br/&gt;&amp;gt;&amp;gt;   boost a transaction&amp;#39;s candidacy for inclusion in a block, including&lt;br/&gt;&amp;gt;&amp;gt; Child Pays&lt;br/&gt;&amp;gt;&amp;gt; for Parent (CPFP) and [BIP125][12] Replace-by-Fee (RBF). Our intention in&lt;br/&gt;&amp;gt;&amp;gt; mempool policy is to recognize when the new transaction is more&lt;br/&gt;&amp;gt;&amp;gt; economical to&lt;br/&gt;&amp;gt;&amp;gt; mine than the original one(s) but not open DoS vectors, so there are some&lt;br/&gt;&amp;gt;&amp;gt; limitations.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Policy&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The purpose of the mempool is to store the best (to be most&lt;br/&gt;&amp;gt;&amp;gt; incentive-compatible&lt;br/&gt;&amp;gt;&amp;gt; with miners, highest feerate) candidates for inclusion in a block. Miners&lt;br/&gt;&amp;gt;&amp;gt; use&lt;br/&gt;&amp;gt;&amp;gt; the mempool to build block templates. The mempool is also useful as a&lt;br/&gt;&amp;gt;&amp;gt; cache for&lt;br/&gt;&amp;gt;&amp;gt; boosting block relay and validation performance, aiding transaction&lt;br/&gt;&amp;gt;&amp;gt; relay, and&lt;br/&gt;&amp;gt;&amp;gt; generating feerate estimations.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Ideally, all consensus-valid transactions paying reasonable fees should&lt;br/&gt;&amp;gt;&amp;gt; make it&lt;br/&gt;&amp;gt;&amp;gt; to miners through normal transaction relay, without any special&lt;br/&gt;&amp;gt;&amp;gt; connectivity or&lt;br/&gt;&amp;gt;&amp;gt; relationships with miners. On the other hand, nodes do not have unlimited&lt;br/&gt;&amp;gt;&amp;gt; resources, and a P2P network designed to let any honest node broadcast&lt;br/&gt;&amp;gt;&amp;gt; their&lt;br/&gt;&amp;gt;&amp;gt; transactions also exposes the transaction validation engine to DoS&lt;br/&gt;&amp;gt;&amp;gt; attacks from&lt;br/&gt;&amp;gt;&amp;gt; malicious peers.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; As such, for unconfirmed transactions we are considering for our mempool,&lt;br/&gt;&amp;gt;&amp;gt; we&lt;br/&gt;&amp;gt;&amp;gt; apply a set of validation rules in addition to consensus, primarily to&lt;br/&gt;&amp;gt;&amp;gt; protect&lt;br/&gt;&amp;gt;&amp;gt; us from resource exhaustion and aid our efforts to keep the highest fee&lt;br/&gt;&amp;gt;&amp;gt; transactions. We call this mempool _policy_: a set of (configurable,&lt;br/&gt;&amp;gt;&amp;gt; node-specific) rules that transactions must abide by in order to be&lt;br/&gt;&amp;gt;&amp;gt; accepted&lt;br/&gt;&amp;gt;&amp;gt; into our mempool. Transaction &amp;#34;Standardness&amp;#34; rules and mempool&lt;br/&gt;&amp;gt;&amp;gt; restrictions such&lt;br/&gt;&amp;gt;&amp;gt; as &amp;#34;too-long-mempool-chain&amp;#34; are both examples of policy.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Package Relay and Package Mempool Accept&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In transaction relay, we currently consider transactions one at a time for&lt;br/&gt;&amp;gt;&amp;gt; submission to the mempool. This creates a limitation in the node&amp;#39;s&lt;br/&gt;&amp;gt;&amp;gt; ability to&lt;br/&gt;&amp;gt;&amp;gt; determine which transactions have the highest feerates, since we cannot&lt;br/&gt;&amp;gt;&amp;gt; take&lt;br/&gt;&amp;gt;&amp;gt; into account descendants (i.e. cannot use CPFP) until all the&lt;br/&gt;&amp;gt;&amp;gt; transactions are&lt;br/&gt;&amp;gt;&amp;gt; in the mempool. Similarly, we cannot use a transaction&amp;#39;s descendants when&lt;br/&gt;&amp;gt;&amp;gt; considering it for RBF. When an individual transaction does not meet the&lt;br/&gt;&amp;gt;&amp;gt; mempool&lt;br/&gt;&amp;gt;&amp;gt; minimum feerate and the user isn&amp;#39;t able to create a replacement&lt;br/&gt;&amp;gt;&amp;gt; transaction&lt;br/&gt;&amp;gt;&amp;gt; directly, it will not be accepted by mempools.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This limitation presents a security issue for applications and users&lt;br/&gt;&amp;gt;&amp;gt; relying on&lt;br/&gt;&amp;gt;&amp;gt; time-sensitive transactions. For example, Lightning and other protocols&lt;br/&gt;&amp;gt;&amp;gt; create&lt;br/&gt;&amp;gt;&amp;gt; UTXOs with multiple spending paths, where one counterparty&amp;#39;s spending&lt;br/&gt;&amp;gt;&amp;gt; path opens&lt;br/&gt;&amp;gt;&amp;gt; up after a timelock, and users are protected from cheating scenarios as&lt;br/&gt;&amp;gt;&amp;gt; long as&lt;br/&gt;&amp;gt;&amp;gt; they redeem on-chain in time. A key security assumption is that all&lt;br/&gt;&amp;gt;&amp;gt; parties&amp;#39;&lt;br/&gt;&amp;gt;&amp;gt; transactions will propagate and confirm in a timely manner. This&lt;br/&gt;&amp;gt;&amp;gt; assumption can&lt;br/&gt;&amp;gt;&amp;gt; be broken if fee-bumping does not work as intended.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The end goal for Package Relay is to consider multiple transactions at&lt;br/&gt;&amp;gt;&amp;gt; the same&lt;br/&gt;&amp;gt;&amp;gt; time, e.g. a transaction with its high-fee child. This may help us better&lt;br/&gt;&amp;gt;&amp;gt; determine whether transactions should be accepted to our mempool,&lt;br/&gt;&amp;gt;&amp;gt; especially if&lt;br/&gt;&amp;gt;&amp;gt; they don&amp;#39;t meet fee requirements individually or are better RBF&lt;br/&gt;&amp;gt;&amp;gt; candidates as a&lt;br/&gt;&amp;gt;&amp;gt; package. A combination of changes to mempool validation logic, policy, and&lt;br/&gt;&amp;gt;&amp;gt; transaction relay allows us to better propagate the transactions with the&lt;br/&gt;&amp;gt;&amp;gt; highest package feerates to miners, and makes fee-bumping tools more&lt;br/&gt;&amp;gt;&amp;gt; powerful&lt;br/&gt;&amp;gt;&amp;gt; for users.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The &amp;#34;relay&amp;#34; part of Package Relay suggests P2P messaging changes, but a&lt;br/&gt;&amp;gt;&amp;gt; large&lt;br/&gt;&amp;gt;&amp;gt; part of the changes are in the mempool&amp;#39;s package validation logic. We&lt;br/&gt;&amp;gt;&amp;gt; call this&lt;br/&gt;&amp;gt;&amp;gt; *Package Mempool Accept*.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Previous Work&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; * Given that mempool validation is DoS-sensitive and complex, it would be&lt;br/&gt;&amp;gt;&amp;gt;   dangerous to haphazardly tack on package validation logic. Many efforts&lt;br/&gt;&amp;gt;&amp;gt; have&lt;br/&gt;&amp;gt;&amp;gt; been made to make mempool validation less opaque (see [#16400][4],&lt;br/&gt;&amp;gt;&amp;gt; [#21062][5],&lt;br/&gt;&amp;gt;&amp;gt; [#22675][6], [#22796][7]).&lt;br/&gt;&amp;gt;&amp;gt; * [#20833][8] Added basic capabilities for package validation, test&lt;br/&gt;&amp;gt;&amp;gt; accepts only&lt;br/&gt;&amp;gt;&amp;gt;   (no submission to mempool).&lt;br/&gt;&amp;gt;&amp;gt; * [#21800][9] Implemented package ancestor/descendant limit checks for&lt;br/&gt;&amp;gt;&amp;gt; arbitrary&lt;br/&gt;&amp;gt;&amp;gt;   packages. Still test accepts only.&lt;br/&gt;&amp;gt;&amp;gt; * Previous package relay proposals (see [#16401][10], [#19621][11]).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Existing Package Rules&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; These are in master as introduced in [#20833][8] and [#21800][9]. I&amp;#39;ll&lt;br/&gt;&amp;gt;&amp;gt; consider&lt;br/&gt;&amp;gt;&amp;gt; them as &amp;#34;given&amp;#34; in the rest of this document, though they can be changed,&lt;br/&gt;&amp;gt;&amp;gt; since&lt;br/&gt;&amp;gt;&amp;gt; package validation is test-accept only right now.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1. A package cannot exceed `MAX_PACKAGE_COUNT=25` count and&lt;br/&gt;&amp;gt;&amp;gt; `MAX_PACKAGE_SIZE=101KvB` total size [8]&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;    *Rationale*: This is already enforced as mempool ancestor/descendant&lt;br/&gt;&amp;gt;&amp;gt; limits.&lt;br/&gt;&amp;gt;&amp;gt; Presumably, transactions in a package are all related, so exceeding this&lt;br/&gt;&amp;gt;&amp;gt; limit&lt;br/&gt;&amp;gt;&amp;gt; would mean that the package can either be split up or it wouldn&amp;#39;t pass&lt;br/&gt;&amp;gt;&amp;gt; this&lt;br/&gt;&amp;gt;&amp;gt; mempool policy.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 2. Packages must be topologically sorted: if any dependencies exist&lt;br/&gt;&amp;gt;&amp;gt; between&lt;br/&gt;&amp;gt;&amp;gt; transactions, parents must appear somewhere before children. [8]&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 3. A package cannot have conflicting transactions, i.e. none of them can&lt;br/&gt;&amp;gt;&amp;gt; spend&lt;br/&gt;&amp;gt;&amp;gt; the same inputs. This also means there cannot be duplicate transactions.&lt;br/&gt;&amp;gt;&amp;gt; [8]&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 4. When packages are evaluated against ancestor/descendant limits in a&lt;br/&gt;&amp;gt;&amp;gt; test&lt;br/&gt;&amp;gt;&amp;gt; accept, the union of all of their descendants and ancestors is&lt;br/&gt;&amp;gt;&amp;gt; considered. This&lt;br/&gt;&amp;gt;&amp;gt; is essentially a &amp;#34;worst case&amp;#34; heuristic where every transaction in the&lt;br/&gt;&amp;gt;&amp;gt; package&lt;br/&gt;&amp;gt;&amp;gt; is treated as each other&amp;#39;s ancestor and descendant. [8]&lt;br/&gt;&amp;gt;&amp;gt; Packages for which ancestor/descendant limits are accurately captured by&lt;br/&gt;&amp;gt;&amp;gt; this&lt;br/&gt;&amp;gt;&amp;gt; heuristic: [19]&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; There are also limitations such as the fact that CPFP carve out is not&lt;br/&gt;&amp;gt;&amp;gt; applied&lt;br/&gt;&amp;gt;&amp;gt; to package transactions. #20833 also disables RBF in package validation;&lt;br/&gt;&amp;gt;&amp;gt; this&lt;br/&gt;&amp;gt;&amp;gt; proposal overrides that to allow packages to use RBF.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## Proposed Changes&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The next step in the Package Mempool Accept project is to implement&lt;br/&gt;&amp;gt;&amp;gt; submission&lt;br/&gt;&amp;gt;&amp;gt; to mempool, initially through RPC only. This allows us to test the&lt;br/&gt;&amp;gt;&amp;gt; submission&lt;br/&gt;&amp;gt;&amp;gt; logic before exposing it on P2P.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Summary&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; - Packages may contain already-in-mempool transactions.&lt;br/&gt;&amp;gt;&amp;gt; - Packages are 2 generations, Multi-Parent-1-Child.&lt;br/&gt;&amp;gt;&amp;gt; - Fee-related checks use the package feerate. This means that wallets can&lt;br/&gt;&amp;gt;&amp;gt; create a package that utilizes CPFP.&lt;br/&gt;&amp;gt;&amp;gt; - Parents are allowed to RBF mempool transactions with a set of rules&lt;br/&gt;&amp;gt;&amp;gt; similar&lt;br/&gt;&amp;gt;&amp;gt;   to BIP125. This enables a combination of CPFP and RBF, where a&lt;br/&gt;&amp;gt;&amp;gt; transaction&amp;#39;s descendant fees pay for replacing mempool conflicts.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; There is a draft implementation in [#22290][1]. It is WIP, but feedback is&lt;br/&gt;&amp;gt;&amp;gt; always welcome.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Details&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; #### Packages May Contain Already-in-Mempool Transactions&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; A package may contain transactions that are already in the mempool. We&lt;br/&gt;&amp;gt;&amp;gt; remove&lt;br/&gt;&amp;gt;&amp;gt; (&amp;#34;deduplicate&amp;#34;) those transactions from the package for the purposes of&lt;br/&gt;&amp;gt;&amp;gt; package&lt;br/&gt;&amp;gt;&amp;gt; mempool acceptance. If a package is empty after deduplication, we do&lt;br/&gt;&amp;gt;&amp;gt; nothing.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; *Rationale*: Mempools vary across the network. It&amp;#39;s possible for a parent&lt;br/&gt;&amp;gt;&amp;gt; to be&lt;br/&gt;&amp;gt;&amp;gt; accepted to the mempool of a peer on its own due to differences in policy&lt;br/&gt;&amp;gt;&amp;gt; and&lt;br/&gt;&amp;gt;&amp;gt; fee market fluctuations. We should not reject or penalize the entire&lt;br/&gt;&amp;gt;&amp;gt; package for&lt;br/&gt;&amp;gt;&amp;gt; an individual transaction as that could be a censorship vector.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; #### Packages Are Multi-Parent-1-Child&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Only packages of a specific topology are permitted. Namely, a package is&lt;br/&gt;&amp;gt;&amp;gt; exactly&lt;br/&gt;&amp;gt;&amp;gt; 1 child with all of its unconfirmed parents. After deduplication, the&lt;br/&gt;&amp;gt;&amp;gt; package&lt;br/&gt;&amp;gt;&amp;gt; may be exactly the same, empty, 1 child, 1 child with just some of its&lt;br/&gt;&amp;gt;&amp;gt; unconfirmed parents, etc. Note that it&amp;#39;s possible for the parents to be&lt;br/&gt;&amp;gt;&amp;gt; indirect&lt;br/&gt;&amp;gt;&amp;gt; descendants/ancestors of one another, or for parent and child to share a&lt;br/&gt;&amp;gt;&amp;gt; parent,&lt;br/&gt;&amp;gt;&amp;gt; so we cannot make any other topology assumptions.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; *Rationale*: This allows for fee-bumping by CPFP. Allowing multiple&lt;br/&gt;&amp;gt;&amp;gt; parents&lt;br/&gt;&amp;gt;&amp;gt; makes it possible to fee-bump a batch of transactions. Restricting&lt;br/&gt;&amp;gt;&amp;gt; packages to a&lt;br/&gt;&amp;gt;&amp;gt; defined topology is also easier to reason about and simplifies the&lt;br/&gt;&amp;gt;&amp;gt; validation&lt;br/&gt;&amp;gt;&amp;gt; logic greatly. Multi-parent-1-child allows us to think of the package as&lt;br/&gt;&amp;gt;&amp;gt; one big&lt;br/&gt;&amp;gt;&amp;gt; transaction, where:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; - Inputs = all the inputs of parents &#43; inputs of the child that come from&lt;br/&gt;&amp;gt;&amp;gt;   confirmed UTXOs&lt;br/&gt;&amp;gt;&amp;gt; - Outputs = all the outputs of the child &#43; all outputs of the parents that&lt;br/&gt;&amp;gt;&amp;gt;   aren&amp;#39;t spent by other transactions in the package&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Examples of packages that follow this rule (variations of example A show&lt;br/&gt;&amp;gt;&amp;gt; some&lt;br/&gt;&amp;gt;&amp;gt; possibilities after deduplication): ![image][15]&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; #### Fee-Related Checks Use Package Feerate&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Package Feerate = the total modified fees divided by the total virtual&lt;br/&gt;&amp;gt;&amp;gt; size of&lt;br/&gt;&amp;gt;&amp;gt; all transactions in the package.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; To meet the two feerate requirements of a mempool, i.e., the&lt;br/&gt;&amp;gt;&amp;gt; pre-configured&lt;br/&gt;&amp;gt;&amp;gt; minimum relay feerate (`minRelayTxFee`) and dynamic mempool minimum&lt;br/&gt;&amp;gt;&amp;gt; feerate, the&lt;br/&gt;&amp;gt;&amp;gt; total package feerate is used instead of the individual feerate. The&lt;br/&gt;&amp;gt;&amp;gt; individual&lt;br/&gt;&amp;gt;&amp;gt; transactions are allowed to be below feerate requirements if the package&lt;br/&gt;&amp;gt;&amp;gt; meets&lt;br/&gt;&amp;gt;&amp;gt; the feerate requirements. For example, the parent(s) in the package can&lt;br/&gt;&amp;gt;&amp;gt; have 0&lt;br/&gt;&amp;gt;&amp;gt; fees but be paid for by the child.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; *Rationale*: This can be thought of as &amp;#34;CPFP within a package,&amp;#34; solving&lt;br/&gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt; issue of a parent not meeting minimum fees on its own. This allows L2&lt;br/&gt;&amp;gt;&amp;gt; applications to adjust their fees at broadcast time instead of&lt;br/&gt;&amp;gt;&amp;gt; overshooting or&lt;br/&gt;&amp;gt;&amp;gt; risking getting stuck/pinned.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; We use the package feerate of the package *after deduplication*.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; *Rationale*:  It would be incorrect to use the fees of transactions that&lt;br/&gt;&amp;gt;&amp;gt; are&lt;br/&gt;&amp;gt;&amp;gt; already in the mempool, as we do not want a transaction&amp;#39;s fees to be&lt;br/&gt;&amp;gt;&amp;gt; double-counted for both its individual RBF and package RBF.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Examples F and G [14] show the same package, but P1 is submitted&lt;br/&gt;&amp;gt;&amp;gt; individually before&lt;br/&gt;&amp;gt;&amp;gt; the package in example G. In example F, we can see that the 300vB package&lt;br/&gt;&amp;gt;&amp;gt; pays&lt;br/&gt;&amp;gt;&amp;gt; an additional 200sat in fees, which is not enough to pay for its own&lt;br/&gt;&amp;gt;&amp;gt; bandwidth&lt;br/&gt;&amp;gt;&amp;gt; (BIP125#4). In example G, we can see that P1 pays enough to replace M1,&lt;br/&gt;&amp;gt;&amp;gt; but&lt;br/&gt;&amp;gt;&amp;gt; using P1&amp;#39;s fees again during package submission would make it look like a&lt;br/&gt;&amp;gt;&amp;gt; 300sat&lt;br/&gt;&amp;gt;&amp;gt; increase for a 200vB package. Even including its fees and size would not&lt;br/&gt;&amp;gt;&amp;gt; be&lt;br/&gt;&amp;gt;&amp;gt; sufficient in this example, since the 300sat looks like enough for the&lt;br/&gt;&amp;gt;&amp;gt; 300vB&lt;br/&gt;&amp;gt;&amp;gt; package. The calculcation after deduplication is 100sat increase for a&lt;br/&gt;&amp;gt;&amp;gt; package&lt;br/&gt;&amp;gt;&amp;gt; of size 200vB, which correctly fails BIP125#4. Assume all transactions&lt;br/&gt;&amp;gt;&amp;gt; have a&lt;br/&gt;&amp;gt;&amp;gt; size of 100vB.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; #### Package RBF&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; If a package meets feerate requirements as a package, the parents in the&lt;br/&gt;&amp;gt;&amp;gt; transaction are allowed to replace-by-fee mempool transactions. The child&lt;br/&gt;&amp;gt;&amp;gt; cannot&lt;br/&gt;&amp;gt;&amp;gt; replace mempool transactions. Multiple transactions can replace the same&lt;br/&gt;&amp;gt;&amp;gt; transaction, but in order to be valid, none of the transactions can try to&lt;br/&gt;&amp;gt;&amp;gt; replace an ancestor of another transaction in the same package (which&lt;br/&gt;&amp;gt;&amp;gt; would thus&lt;br/&gt;&amp;gt;&amp;gt; make its inputs unavailable).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; *Rationale*: Even if we are using package feerate, a package will not&lt;br/&gt;&amp;gt;&amp;gt; propagate&lt;br/&gt;&amp;gt;&amp;gt; as intended if RBF still requires each individual transaction to meet the&lt;br/&gt;&amp;gt;&amp;gt; feerate requirements.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; We use a set of rules slightly modified from BIP125 as follows:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ##### Signaling (Rule #1)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; All mempool transactions to be replaced must signal replaceability.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; *Rationale*: Package RBF signaling logic should be the same for package&lt;br/&gt;&amp;gt;&amp;gt; RBF and&lt;br/&gt;&amp;gt;&amp;gt; single transaction acceptance. This would be updated if single transaction&lt;br/&gt;&amp;gt;&amp;gt; validation moves to full RBF.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ##### New Unconfirmed Inputs (Rule #2)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; A package may include new unconfirmed inputs, but the ancestor feerate of&lt;br/&gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt; child must be at least as high as the ancestor feerates of every&lt;br/&gt;&amp;gt;&amp;gt; transaction&lt;br/&gt;&amp;gt;&amp;gt; being replaced. This is contrary to BIP125#2, which states &amp;#34;The&lt;br/&gt;&amp;gt;&amp;gt; replacement&lt;br/&gt;&amp;gt;&amp;gt; transaction may only include an unconfirmed input if that input was&lt;br/&gt;&amp;gt;&amp;gt; included in&lt;br/&gt;&amp;gt;&amp;gt; one of the original transactions. (An unconfirmed input spends an output&lt;br/&gt;&amp;gt;&amp;gt; from a&lt;br/&gt;&amp;gt;&amp;gt; currently-unconfirmed transaction.)&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; *Rationale*: The purpose of BIP125#2 is to ensure that the replacement&lt;br/&gt;&amp;gt;&amp;gt; transaction has a higher ancestor score than the original transaction(s)&lt;br/&gt;&amp;gt;&amp;gt; (see&lt;br/&gt;&amp;gt;&amp;gt; [comment][13]). Example H [16] shows how adding a new unconfirmed input&lt;br/&gt;&amp;gt;&amp;gt; can lower the&lt;br/&gt;&amp;gt;&amp;gt; ancestor score of the replacement transaction. P1 is trying to replace&lt;br/&gt;&amp;gt;&amp;gt; M1, and&lt;br/&gt;&amp;gt;&amp;gt; spends an unconfirmed output of M2. P1 pays 800sat, M1 pays 600sat, and&lt;br/&gt;&amp;gt;&amp;gt; M2 pays&lt;br/&gt;&amp;gt;&amp;gt; 100sat. Assume all transactions have a size of 100vB. While, in&lt;br/&gt;&amp;gt;&amp;gt; isolation, P1&lt;br/&gt;&amp;gt;&amp;gt; looks like a better mining candidate than M1, it must be mined with M2,&lt;br/&gt;&amp;gt;&amp;gt; so its&lt;br/&gt;&amp;gt;&amp;gt; ancestor feerate is actually 4.5sat/vB.  This is lower than M1&amp;#39;s ancestor&lt;br/&gt;&amp;gt;&amp;gt; feerate, which is 6sat/vB.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In package RBF, the rule analogous to BIP125#2 would be &amp;#34;none of the&lt;br/&gt;&amp;gt;&amp;gt; transactions in the package can spend new unconfirmed inputs.&amp;#34; Example J&lt;br/&gt;&amp;gt;&amp;gt; [17] shows&lt;br/&gt;&amp;gt;&amp;gt; why, if any of the package transactions have ancestors, package feerate&lt;br/&gt;&amp;gt;&amp;gt; is no&lt;br/&gt;&amp;gt;&amp;gt; longer accurate. Even though M2 and M3 are not ancestors of P1 (which is&lt;br/&gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt; replacement transaction in an RBF), we&amp;#39;re actually interested in the&lt;br/&gt;&amp;gt;&amp;gt; entire&lt;br/&gt;&amp;gt;&amp;gt; package. A miner should mine M1 which is 5sat/vB instead of M2, M3, P1,&lt;br/&gt;&amp;gt;&amp;gt; P2, and&lt;br/&gt;&amp;gt;&amp;gt; P3, which is only 4sat/vB. The Package RBF rule cannot be loosened to&lt;br/&gt;&amp;gt;&amp;gt; only allow&lt;br/&gt;&amp;gt;&amp;gt; the child to have new unconfirmed inputs, either, because it can still&lt;br/&gt;&amp;gt;&amp;gt; cause us&lt;br/&gt;&amp;gt;&amp;gt; to overestimate the package&amp;#39;s ancestor score.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; However, enforcing a rule analogous to BIP125#2 would not only make&lt;br/&gt;&amp;gt;&amp;gt; Package RBF&lt;br/&gt;&amp;gt;&amp;gt; less useful, but would also break Package RBF for packages with parents&lt;br/&gt;&amp;gt;&amp;gt; already&lt;br/&gt;&amp;gt;&amp;gt; in the mempool: if a package parent has already been submitted, it would&lt;br/&gt;&amp;gt;&amp;gt; look&lt;br/&gt;&amp;gt;&amp;gt; like the child is spending a &amp;#34;new&amp;#34; unconfirmed input. In example K [18],&lt;br/&gt;&amp;gt;&amp;gt; we&amp;#39;re&lt;br/&gt;&amp;gt;&amp;gt; looking to replace M1 with the entire package including P1, P2, and P3.&lt;br/&gt;&amp;gt;&amp;gt; We must&lt;br/&gt;&amp;gt;&amp;gt; consider the case where one of the parents is already in the mempool (in&lt;br/&gt;&amp;gt;&amp;gt; this&lt;br/&gt;&amp;gt;&amp;gt; case, P2), which means we must allow P3 to have new unconfirmed inputs.&lt;br/&gt;&amp;gt;&amp;gt; However,&lt;br/&gt;&amp;gt;&amp;gt; M2 lowers the ancestor score of P3 to 4.3sat/vB, so we should not replace&lt;br/&gt;&amp;gt;&amp;gt; M1&lt;br/&gt;&amp;gt;&amp;gt; with this package.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Thus, the package RBF rule regarding new unconfirmed inputs is less&lt;br/&gt;&amp;gt;&amp;gt; strict than&lt;br/&gt;&amp;gt;&amp;gt; BIP125#2. However, we still achieve the same goal of requiring the&lt;br/&gt;&amp;gt;&amp;gt; replacement&lt;br/&gt;&amp;gt;&amp;gt; transactions to have a ancestor score at least as high as the original&lt;br/&gt;&amp;gt;&amp;gt; ones. As&lt;br/&gt;&amp;gt;&amp;gt; a result, the entire package is required to be a higher feerate mining&lt;br/&gt;&amp;gt;&amp;gt; candidate&lt;br/&gt;&amp;gt;&amp;gt; than each of the replaced transactions.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Another note: the [comment][13] above the BIP125#2 code in the original&lt;br/&gt;&amp;gt;&amp;gt; RBF&lt;br/&gt;&amp;gt;&amp;gt; implementation suggests that the rule was intended to be temporary.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ##### Absolute Fee (Rule #3)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The package must increase the absolute fee of the mempool, i.e. the total&lt;br/&gt;&amp;gt;&amp;gt; fees&lt;br/&gt;&amp;gt;&amp;gt; of the package must be higher than the absolute fees of the mempool&lt;br/&gt;&amp;gt;&amp;gt; transactions&lt;br/&gt;&amp;gt;&amp;gt; it replaces. Combined with the CPFP rule above, this differs from BIP125&lt;br/&gt;&amp;gt;&amp;gt; Rule #3&lt;br/&gt;&amp;gt;&amp;gt; - an individual transaction in the package may have lower fees than the&lt;br/&gt;&amp;gt;&amp;gt;   transaction(s) it is replacing. In fact, it may have 0 fees, and the&lt;br/&gt;&amp;gt;&amp;gt; child&lt;br/&gt;&amp;gt;&amp;gt; pays for RBF.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ##### Feerate (Rule #4)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The package must pay for its own bandwidth; the package feerate must be&lt;br/&gt;&amp;gt;&amp;gt; higher&lt;br/&gt;&amp;gt;&amp;gt; than the replaced transactions by at least minimum relay feerate&lt;br/&gt;&amp;gt;&amp;gt; (`incrementalRelayFee`). Combined with the CPFP rule above, this differs&lt;br/&gt;&amp;gt;&amp;gt; from&lt;br/&gt;&amp;gt;&amp;gt; BIP125 Rule #4 - an individual transaction in the package can have a lower&lt;br/&gt;&amp;gt;&amp;gt; feerate than the transaction(s) it is replacing. In fact, it may have 0&lt;br/&gt;&amp;gt;&amp;gt; fees,&lt;br/&gt;&amp;gt;&amp;gt; and the child pays for RBF.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ##### Total Number of Replaced Transactions (Rule #5)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The package cannot replace more than 100 mempool transactions. This is&lt;br/&gt;&amp;gt;&amp;gt; identical&lt;br/&gt;&amp;gt;&amp;gt; to BIP125 Rule #5.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Expected FAQs&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1. Is it possible for only some of the package to make it into the&lt;br/&gt;&amp;gt;&amp;gt; mempool?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;    Yes, it is. However, since we evict transactions from the mempool by&lt;br/&gt;&amp;gt;&amp;gt; descendant score and the package child is supposed to be sponsoring the&lt;br/&gt;&amp;gt;&amp;gt; fees of&lt;br/&gt;&amp;gt;&amp;gt; its parents, the most common scenario would be all-or-nothing. This is&lt;br/&gt;&amp;gt;&amp;gt; incentive-compatible. In fact, to be conservative, package validation&lt;br/&gt;&amp;gt;&amp;gt; should&lt;br/&gt;&amp;gt;&amp;gt; begin by trying to submit all of the transactions individually, and only&lt;br/&gt;&amp;gt;&amp;gt; use the&lt;br/&gt;&amp;gt;&amp;gt; package mempool acceptance logic if the parents fail due to low feerate.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 2. Should we allow packages to contain already-confirmed transactions?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;     No, for practical reasons. In mempool validation, we actually aren&amp;#39;t&lt;br/&gt;&amp;gt;&amp;gt; able to&lt;br/&gt;&amp;gt;&amp;gt; tell with 100% confidence if we are looking at a transaction that has&lt;br/&gt;&amp;gt;&amp;gt; already&lt;br/&gt;&amp;gt;&amp;gt; confirmed, because we look up inputs using a UTXO set. If we have&lt;br/&gt;&amp;gt;&amp;gt; historical&lt;br/&gt;&amp;gt;&amp;gt; block data, it&amp;#39;s possible to look for it, but this is inefficient, not&lt;br/&gt;&amp;gt;&amp;gt; always&lt;br/&gt;&amp;gt;&amp;gt; possible for pruning nodes, and unnecessary because we&amp;#39;re not going to do&lt;br/&gt;&amp;gt;&amp;gt; anything with the transaction anyway. As such, we already have the&lt;br/&gt;&amp;gt;&amp;gt; expectation&lt;br/&gt;&amp;gt;&amp;gt; that transaction relay is somewhat &amp;#34;stateful&amp;#34; i.e. nobody should be&lt;br/&gt;&amp;gt;&amp;gt; relaying&lt;br/&gt;&amp;gt;&amp;gt; transactions that have already been confirmed. Similarly, we shouldn&amp;#39;t be&lt;br/&gt;&amp;gt;&amp;gt; relaying packages that contain already-confirmed transactions.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [1]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22290&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22290&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [2]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bips/blob/1f0b563738199ca60d32b4ba779797fc97d040fe/bip-0141.mediawiki#transaction-size-calculations&#34;&gt;https://github.com/bitcoin/bips/blob/1f0b563738199ca60d32b4ba779797fc97d040fe/bip-0141.mediawiki#transaction-size-calculations&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [3]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bitcoin/blob/94f83534e4b771944af7d9ed0f40746f392eb75e/src/policy/policy.cpp#L282&#34;&gt;https://github.com/bitcoin/bitcoin/blob/94f83534e4b771944af7d9ed0f40746f392eb75e/src/policy/policy.cpp#L282&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [4]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/16400&#34;&gt;https://github.com/bitcoin/bitcoin/pull/16400&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [5]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/21062&#34;&gt;https://github.com/bitcoin/bitcoin/pull/21062&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [6]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22675&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22675&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [7]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22796&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22796&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [8]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/20833&#34;&gt;https://github.com/bitcoin/bitcoin/pull/20833&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [9]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/21800&#34;&gt;https://github.com/bitcoin/bitcoin/pull/21800&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [10]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/16401&#34;&gt;https://github.com/bitcoin/bitcoin/pull/16401&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [11]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/19621&#34;&gt;https://github.com/bitcoin/bitcoin/pull/19621&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [12]: &lt;a href=&#34;https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki&#34;&gt;https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [13]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/6871/files#diff-34d21af3c614ea3cee120df276c9c4ae95053830d7f1d3deaf009a4625409ad2R1101-R1104&#34;&gt;https://github.com/bitcoin/bitcoin/pull/6871/files#diff-34d21af3c614ea3cee120df276c9c4ae95053830d7f1d3deaf009a4625409ad2R1101-R1104&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [14]:&lt;br/&gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133567078-075a971c-0619-4339-9168-b41fd2b90c28.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt; [15]:&lt;br/&gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/132856734-fc17da75-f875-44bb-b954-cb7a1725cc0d.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt; [16]:&lt;br/&gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133567347-a3e2e4a8-ae9c-49f8-abb9-81e8e0aba224.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt; [17]:&lt;br/&gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133567370-21566d0e-36c8-4831-b1a8-706634540af3.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt; [18]:&lt;br/&gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133567444-bfff1142-439f-4547-800a-2ba2b0242bcb.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt; [19]:&lt;br/&gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133456219-0bb447cb-dcb4-4a31-b9c1-7d86205b68bc.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt; [20]:&lt;br/&gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/132857787-7b7c6f56-af96-44c8-8d78-983719888c19.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20210921/505919a9/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20210921/505919a9/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-08T00:59:26&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsff5vwfgaskw6t39fc93uy4xwkh0zt27u8kq23rwq0t4d4lk5405szyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2qxmk9un</id>
    
      <title type="html">📅 Original date posted:2021-09-23 📝 Original message:Hi ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsff5vwfgaskw6t39fc93uy4xwkh0zt27u8kq23rwq0t4d4lk5405szyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2qxmk9un" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsv3ugsfntv7d7kdj3xk634za9eex8vaeu6fhepzn5vhlk7jgqu0aq9mhzja&#39;&gt;nevent1q…hzja&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2021-09-23&lt;br/&gt;📝 Original message:Hi Antoine,&lt;br/&gt;&lt;br/&gt;Thanks as always for your input. I&amp;#39;m glad we agree on so much!&lt;br/&gt;&lt;br/&gt;In summary, it seems that the decisions that might still need&lt;br/&gt;attention/input from devs on this mailing list are:&lt;br/&gt;1. Whether we should start with multiple-parent-1-child or 1-parent-1-child.&lt;br/&gt;2. Whether it&amp;#39;s ok to require that the child not have conflicts with&lt;br/&gt;mempool transactions.&lt;br/&gt;&lt;br/&gt;Responding to your comments...&lt;br/&gt;&lt;br/&gt;&amp;gt; IIUC, you have package A&#43;B, during the dedup phase early in&lt;br/&gt;`AcceptMultipleTransactions` if you observe same-txid-different-wtixd A&amp;#39;&lt;br/&gt;and A&amp;#39; is higher feerate than A, you trim A and replace by A&amp;#39; ?&lt;br/&gt;&lt;br/&gt;&amp;gt; I think this approach is safe, the one who appears unsafe to me is when&lt;br/&gt;A&amp;#39; has a _lower_ feerate, even if A&amp;#39; is already accepted by our mempool ?&lt;br/&gt;In that case iirc that would be a pinning.&lt;br/&gt;&lt;br/&gt;Right, the fact that we essentially always choose the first-seen witness is&lt;br/&gt;an unfortunate limitation that exists already. Adding package mempool&lt;br/&gt;accept doesn&amp;#39;t worsen this, but the procedure in the future is to replace&lt;br/&gt;the witness when it makes sense economically. We can also add logic to&lt;br/&gt;allow package feerate to pay for witness replacements as well. This is&lt;br/&gt;pretty far into the future, though.&lt;br/&gt;&lt;br/&gt;&amp;gt; It sounds uneconomical for an attacker but I think it&amp;#39;s not when you&lt;br/&gt;consider than you can &amp;#34;batch&amp;#34; attack against multiple honest&lt;br/&gt;counterparties. E.g, Mallory broadcast A&amp;#39; &#43; B&amp;#39; &#43; C&amp;#39; &#43; D&amp;#39; where A&amp;#39; conflicts&lt;br/&gt;with Alice&amp;#39;s honest package P1, B&amp;#39; conflicts with Bob&amp;#39;s honest package P2,&lt;br/&gt;C&amp;#39; conflicts with Caroll&amp;#39;s honest package P3. And D&amp;#39; is a high-fee child of&lt;br/&gt;A&amp;#39; &#43; B&amp;#39; &#43; C&amp;#39;.&lt;br/&gt;&lt;br/&gt;&amp;gt; If D&amp;#39; is higher-fee than P1 or P2 or P3 but inferior to the sum of HTLCs&lt;br/&gt;confirmed by P1&#43;P2&#43;P3, I think it&amp;#39;s lucrative for the attacker ?&lt;br/&gt;&lt;br/&gt;I could be misunderstanding, but an attacker wouldn&amp;#39;t be able to&lt;br/&gt;batch-attack like this. Alice&amp;#39;s package only conflicts with A&amp;#39; &#43; D&amp;#39;, not A&amp;#39;&lt;br/&gt;&#43; B&amp;#39; &#43; C&amp;#39; &#43; D&amp;#39;. She only needs to pay for evicting 2 transactions.&lt;br/&gt;&lt;br/&gt;&amp;gt; Do we assume that broadcasted packages are &amp;#34;honest&amp;#34; by default and that&lt;br/&gt;the parent(s) always need the child to pass the fee checks, that way saving&lt;br/&gt;the processing of individual transactions which are expected to fail in 99%&lt;br/&gt;of cases or more ad hoc composition of packages at relay ?&lt;br/&gt;&amp;gt; I think this point is quite dependent on the p2p packages format/logic&lt;br/&gt;we&amp;#39;ll end up on and that we should feel free to revisit it later ?&lt;br/&gt;&lt;br/&gt;I think it&amp;#39;s the opposite; there&amp;#39;s no way for us to assume that p2p&lt;br/&gt;packages will be &amp;#34;honest.&amp;#34; I&amp;#39;d like to have two things before we expose on&lt;br/&gt;P2P: (1) ensure that the amount of resources potentially allocated for&lt;br/&gt;package validation isn&amp;#39;t disproportionately higher than that of single&lt;br/&gt;transaction validation and (2) only use package validation when we&amp;#39;re&lt;br/&gt;unsatisifed with the single validation result, e.g. we might get better&lt;br/&gt;fees.&lt;br/&gt;Yes, let&amp;#39;s revisit this later :)&lt;br/&gt;&lt;br/&gt; &amp;gt; Yes, if you receive A&#43;B, and A is already in-mempoo, I agree you can&lt;br/&gt;discard its feerate as B should pay for all fees checked on its own. Where&lt;br/&gt;I&amp;#39;m unclear is when you have in-mempool A&#43;B and receive A&#43;B&amp;#39;. Should B&amp;#39;&lt;br/&gt;have a fee high enough to cover the bandwidth penalty replacement&lt;br/&gt;(`PaysForRBF`, 2nd check) of both A&#43;B&amp;#39; or only B&amp;#39; ?&lt;br/&gt;&lt;br/&gt; B&amp;#39; only needs to pay for itself in this case.&lt;br/&gt;&lt;br/&gt;&amp;gt; &amp;gt; Do we want the child to be able to replace mempool transactions as well?&lt;br/&gt;&lt;br/&gt;&amp;gt; If we mean when you have replaceable A&#43;B then A&amp;#39;&#43;B&amp;#39; try to replace with a&lt;br/&gt;higher-feerate ? I think that&amp;#39;s exactly the case we need for Lightning as&lt;br/&gt;A&#43;B is coming from Alice and A&amp;#39;&#43;B&amp;#39; is coming from Bob :/&lt;br/&gt;&lt;br/&gt;Let me clarify this because I can see that my wording was ambiguous, and&lt;br/&gt;then please let me know if it fits Lightning&amp;#39;s needs?&lt;br/&gt;&lt;br/&gt;In my proposal, I wrote &amp;#34;If a package meets feerate requirements as a&lt;br/&gt;package, the parents in the transaction are allowed to replace-by-fee&lt;br/&gt;mempool transactions. The child cannot replace mempool transactions.&amp;#34; What&lt;br/&gt;I meant was: the package can replace mempool transactions if any of the&lt;br/&gt;parents conflict with mempool transactions. The child cannot not conflict&lt;br/&gt;with any mempool transactions.&lt;br/&gt;The Lightning use case this attempts to address is: Alice and Mallory are&lt;br/&gt;LN counterparties, and have packages A&#43;B and A&amp;#39;&#43;B&amp;#39;, respectively. A and A&amp;#39;&lt;br/&gt;are their commitment transactions and conflict with each other; they have&lt;br/&gt;shared inputs and different txids.&lt;br/&gt;B spends Alice&amp;#39;s anchor output from A. B&amp;#39; spends Mallory&amp;#39;s anchor output&lt;br/&gt;from A&amp;#39;. Thus, B and B&amp;#39; do not conflict with each other.&lt;br/&gt;Alice can broadcast her package, A&#43;B, to replace Mallory&amp;#39;s package, A&amp;#39;&#43;B&amp;#39;,&lt;br/&gt;since B doesn&amp;#39;t conflict with the mempool.&lt;br/&gt;&lt;br/&gt;Would this be ok?&lt;br/&gt;&lt;br/&gt;&amp;gt; The second option, a child of A&amp;#39;, In the LN case I think the CPFP is&lt;br/&gt;attached on one&amp;#39;s anchor output.&lt;br/&gt;&lt;br/&gt;While it would be nice to have full RBF, malleability of the child won&amp;#39;t&lt;br/&gt;block RBF here. If we&amp;#39;re trying to replace A&amp;#39;, we only require that A&amp;#39;&lt;br/&gt;signals replaceability, and don&amp;#39;t mind if its child doesn&amp;#39;t.&lt;br/&gt;&lt;br/&gt;&amp;gt; &amp;gt; B has an ancestor score of 10sat/vb and D has an&lt;br/&gt;&amp;gt; &amp;gt; ancestor score of ~2.9sat/vb. Since D&amp;#39;s ancestor score is lower than&lt;br/&gt;B&amp;#39;s,&lt;br/&gt;&amp;gt; &amp;gt; it fails the proposed package RBF Rule #2, so this package would be&lt;br/&gt;&amp;gt; &amp;gt; rejected. Does this meet your expectations?&lt;br/&gt;&lt;br/&gt;&amp;gt; Well what sounds odd to me, in my example, we fail D even if it has a&lt;br/&gt;higher-fee than B. Like A&#43;B absolute fees are 2000 sats and A&#43;C&#43;D absolute&lt;br/&gt;fees are 4500 sats ?&lt;br/&gt;&lt;br/&gt;Yes, A&#43;C&#43;D pays 2500sat more in fees, but it is also 1000vB larger. A miner&lt;br/&gt;should prefer to utilize their block space more effectively.&lt;br/&gt;&lt;br/&gt;&amp;gt; Is this compatible with a model where a miner prioritizes absolute fees&lt;br/&gt;over ancestor score, in the case that mempools aren&amp;#39;t full-enough to&lt;br/&gt;fulfill a block ?&lt;br/&gt;&lt;br/&gt;No, because we don&amp;#39;t use that model.&lt;br/&gt;&lt;br/&gt;Thanks,&lt;br/&gt;Gloria&lt;br/&gt;&lt;br/&gt;On Thu, Sep 23, 2021 at 5:29 AM Antoine Riard &amp;lt;antoine.riard at gmail.com&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; &amp;gt; Correct, if B&#43;C is too low feerate to be accepted, we will reject it. I&lt;br/&gt;&amp;gt; &amp;gt; prefer this because it is incentive compatible: A can be mined by itself,&lt;br/&gt;&amp;gt; &amp;gt; so there&amp;#39;s no reason to prefer A&#43;B&#43;C instead of A.&lt;br/&gt;&amp;gt; &amp;gt; As another way of looking at this, consider the case where we do accept&lt;br/&gt;&amp;gt; &amp;gt; A&#43;B&#43;C and it sits at the &amp;#34;bottom&amp;#34; of our mempool. If our mempool reaches&lt;br/&gt;&amp;gt; &amp;gt; capacity, we evict the lowest descendant feerate transactions, which are&lt;br/&gt;&amp;gt; &amp;gt; B&#43;C in this case. This gives us the same resulting mempool, with A and&lt;br/&gt;&amp;gt; not&lt;br/&gt;&amp;gt; &amp;gt; B&#43;C.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I agree here. Doing otherwise, we might evict other transactions mempool&lt;br/&gt;&amp;gt; in `MempoolAccept::Finalize` with a higher-feerate than B&#43;C while those&lt;br/&gt;&amp;gt; evicted transactions are the most compelling for block construction.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I thought at first missing this acceptance requirement would break a&lt;br/&gt;&amp;gt; fee-bumping scheme like Parent-Pay-For-Child where a high-fee parent is&lt;br/&gt;&amp;gt; attached to a child signed with SIGHASH_ANYONECANPAY but in this case the&lt;br/&gt;&amp;gt; child fee is capturing the parent value. I can&amp;#39;t think of other fee-bumping&lt;br/&gt;&amp;gt; schemes potentially affected. If they do exist I would say they&amp;#39;re wrong in&lt;br/&gt;&amp;gt; their design assumptions.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; If or when we have witness replacement, the logic is: if the individual&lt;br/&gt;&amp;gt; &amp;gt; transaction is enough to replace the mempool one, the replacement will&lt;br/&gt;&amp;gt; &amp;gt; happen during the preceding individual transaction acceptance, and&lt;br/&gt;&amp;gt; &amp;gt; deduplication logic will work. Otherwise, we will try to deduplicate by&lt;br/&gt;&amp;gt; &amp;gt; wtxid, see that we need a package witness replacement, and use the&lt;br/&gt;&amp;gt; package&lt;br/&gt;&amp;gt; &amp;gt; feerate to evaluate whether this is economically rational.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; IIUC, you have package A&#43;B, during the dedup phase early in&lt;br/&gt;&amp;gt; `AcceptMultipleTransactions` if you observe same-txid-different-wtixd A&amp;#39;&lt;br/&gt;&amp;gt; and A&amp;#39; is higher feerate than A, you trim A and replace by A&amp;#39; ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think this approach is safe, the one who appears unsafe to me is when A&amp;#39;&lt;br/&gt;&amp;gt; has a _lower_ feerate, even if A&amp;#39; is already accepted by our mempool ? In&lt;br/&gt;&amp;gt; that case iirc that would be a pinning.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Good to see progress on witness replacement before we see usage of Taproot&lt;br/&gt;&amp;gt; tree in the context of multi-party, where a malicious counterparty inflates&lt;br/&gt;&amp;gt; its witness to jam a honest spending.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; (Note, the commit linked currently points nowhere :))&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; Please note that A may replace A&amp;#39; even if A&amp;#39; has higher fees than A&lt;br/&gt;&amp;gt; &amp;gt; individually, because the proposed package RBF utilizes the fees and size&lt;br/&gt;&amp;gt; &amp;gt; of the entire package. This just requires E to pay enough fees, although&lt;br/&gt;&amp;gt; &amp;gt; this can be pretty high if there are also potential B&amp;#39; and C&amp;#39; competing&lt;br/&gt;&amp;gt; &amp;gt; commitment transactions that we don&amp;#39;t know about.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Ah right, if the package acceptance waives `PaysMoreThanConflicts` for the&lt;br/&gt;&amp;gt; individual check on A, the honest package should replace the pinning&lt;br/&gt;&amp;gt; attempt. I&amp;#39;ve not fully parsed the proposed implementation yet.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Though note, I think it&amp;#39;s still unsafe for a Lightning&lt;br/&gt;&amp;gt; multi-commitment-broadcast-as-one-package as a malicious A&amp;#39; might have an&lt;br/&gt;&amp;gt; absolute fee higher than E. It sounds uneconomical for&lt;br/&gt;&amp;gt; an attacker but I think it&amp;#39;s not when you consider than you can &amp;#34;batch&amp;#34;&lt;br/&gt;&amp;gt; attack against multiple honest counterparties. E.g, Mallory broadcast A&amp;#39; &#43;&lt;br/&gt;&amp;gt; B&amp;#39; &#43; C&amp;#39; &#43; D&amp;#39; where A&amp;#39; conflicts with Alice&amp;#39;s honest package P1, B&amp;#39;&lt;br/&gt;&amp;gt; conflicts with Bob&amp;#39;s honest package P2, C&amp;#39; conflicts with Caroll&amp;#39;s honest&lt;br/&gt;&amp;gt; package P3. And D&amp;#39; is a high-fee child of A&amp;#39; &#43; B&amp;#39; &#43; C&amp;#39;.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If D&amp;#39; is higher-fee than P1 or P2 or P3 but inferior to the sum of HTLCs&lt;br/&gt;&amp;gt; confirmed by P1&#43;P2&#43;P3, I think it&amp;#39;s lucrative for the attacker ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; So far, my understanding is that multi-parent-1-child is desired for&lt;br/&gt;&amp;gt; &amp;gt; batched fee-bumping (&lt;br/&gt;&amp;gt; &amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22674#issuecomment-897951289&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22674#issuecomment-897951289&lt;/a&gt;)&lt;br/&gt;&amp;gt; and&lt;br/&gt;&amp;gt; &amp;gt; I&amp;#39;ve also seen your response which I have less context on (&lt;br/&gt;&amp;gt; &amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22674#issuecomment-900352202&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22674#issuecomment-900352202&lt;/a&gt;).&lt;br/&gt;&amp;gt; That&lt;br/&gt;&amp;gt; &amp;gt; being said, I am happy to create a new proposal for 1 parent &#43; 1 child&lt;br/&gt;&amp;gt; &amp;gt; (which would be slightly simpler) and plan for moving to&lt;br/&gt;&amp;gt; &amp;gt; multi-parent-1-child later if that is preferred. I am very interested in&lt;br/&gt;&amp;gt; &amp;gt; hearing feedback on that approach.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think batched fee-bumping is okay as long as you don&amp;#39;t have&lt;br/&gt;&amp;gt; time-sensitive outputs encumbering your commitment transactions. For the&lt;br/&gt;&amp;gt; reasons mentioned above, I think that&amp;#39;s unsafe.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; What I&amp;#39;m worried about is  L2 developers, potentially not aware about all&lt;br/&gt;&amp;gt; the mempool subtleties blurring the difference and always batching their&lt;br/&gt;&amp;gt; broadcast by default.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; IMO, a good thing by restraining to 1-parent &#43; 1 child,  we artificially&lt;br/&gt;&amp;gt; constraint L2 design space for now and minimize risks of unsafe usage of&lt;br/&gt;&amp;gt; the package API :)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think that&amp;#39;s a point where it would be relevant to have the opinion of&lt;br/&gt;&amp;gt; more L2 devs.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; I think there is a misunderstanding here - let me describe what I&amp;#39;m&lt;br/&gt;&amp;gt; &amp;gt; proposing we&amp;#39;d do in this situation: we&amp;#39;ll try individual submission for&lt;br/&gt;&amp;gt; A,&lt;br/&gt;&amp;gt; &amp;gt; see that it fails due to &amp;#34;insufficient fees.&amp;#34; Then, we&amp;#39;ll try package&lt;br/&gt;&amp;gt; &amp;gt; validation for A&#43;B and use package RBF. If A&#43;B pays enough, it can still&lt;br/&gt;&amp;gt; &amp;gt; replace A&amp;#39;. If A fails for a bad signature, we won&amp;#39;t look at B or A&#43;B.&lt;br/&gt;&amp;gt; Does&lt;br/&gt;&amp;gt; &amp;gt; this meet your expectations?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yes there was a misunderstanding, I think this approach is correct, it&amp;#39;s&lt;br/&gt;&amp;gt; more a question of performance. Do we assume that broadcasted packages are&lt;br/&gt;&amp;gt; &amp;#34;honest&amp;#34; by default and that the parent(s) always need the child to pass&lt;br/&gt;&amp;gt; the fee checks, that way saving the processing of individual transactions&lt;br/&gt;&amp;gt; which are expected to fail in 99% of cases or more ad hoc composition of&lt;br/&gt;&amp;gt; packages at relay ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think this point is quite dependent on the p2p packages format/logic&lt;br/&gt;&amp;gt; we&amp;#39;ll end up on and that we should feel free to revisit it later ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; What problem are you trying to solve by the package feerate *after* dedup&lt;br/&gt;&amp;gt; rule ?&lt;br/&gt;&amp;gt; &amp;gt; My understanding is that an in-package transaction might be already in&lt;br/&gt;&amp;gt; the mempool. Therefore, to compute a correct RBF penalty replacement, the&lt;br/&gt;&amp;gt; vsize of this transaction could be discarded lowering the cost of package&lt;br/&gt;&amp;gt; RBF.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; I&amp;#39;m proposing that, when a transaction has already been submitted to&lt;br/&gt;&amp;gt; &amp;gt; mempool, we would ignore both its fees and vsize when calculating package&lt;br/&gt;&amp;gt; &amp;gt; feerate.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Yes, if you receive A&#43;B, and A is already in-mempoo, I agree you can&lt;br/&gt;&amp;gt; discard its feerate as B should pay for all fees checked on its own. Where&lt;br/&gt;&amp;gt; I&amp;#39;m unclear is when you have in-mempool A&#43;B and receive A&#43;B&amp;#39;. Should B&amp;#39;&lt;br/&gt;&amp;gt; have a fee high enough to cover the bandwidth penalty replacement&lt;br/&gt;&amp;gt; (`PaysForRBF`, 2nd check) of both A&#43;B&amp;#39; or only B&amp;#39; ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If you have a second-layer like current Lightning, you might have a&lt;br/&gt;&amp;gt; counterparty commitment to replace and should always expect to have to pay&lt;br/&gt;&amp;gt; for parent replacement bandwidth.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Where a potential discount sounds interesting is when you have an univoque&lt;br/&gt;&amp;gt; state on the first-stage of transactions. E.g DLC&amp;#39;s funding transaction&lt;br/&gt;&amp;gt; which might be CPFP by any participant iirc.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; Note that, if C&amp;#39; conflicts with C, it also conflicts with D, since D is a&lt;br/&gt;&amp;gt; &amp;gt; descendant of C and would thus need to be evicted along with it.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Ah once again I think it&amp;#39;s a misunderstanding without the code under my&lt;br/&gt;&amp;gt; eyes! If we do C&amp;#39; `PreChecks`, solve the conflicts provoked by it, i.e mark&lt;br/&gt;&amp;gt; for potential eviction D and don&amp;#39;t consider it for future conflicts in the&lt;br/&gt;&amp;gt; rest of the package, I think D&amp;#39; `PreChecks` should be good ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; More generally, this example is surprising to me because I didn&amp;#39;t think&lt;br/&gt;&amp;gt; &amp;gt; packages would be used to fee-bump replaceable transactions. Do we want&lt;br/&gt;&amp;gt; the&lt;br/&gt;&amp;gt; &amp;gt; child to be able to replace mempool transactions as well?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If we mean when you have replaceable A&#43;B then A&amp;#39;&#43;B&amp;#39; try to replace with a&lt;br/&gt;&amp;gt; higher-feerate ? I think that&amp;#39;s exactly the case we need for Lightning as&lt;br/&gt;&amp;gt; A&#43;B is coming from Alice and A&amp;#39;&#43;B&amp;#39; is coming from Bob :/&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; I&amp;#39;m not sure what you mean? Let&amp;#39;s say we have a package of parent A &#43;&lt;br/&gt;&amp;gt; child&lt;br/&gt;&amp;gt; &amp;gt; B, where A is supposed to replace a mempool transaction A&amp;#39;. Are you&lt;br/&gt;&amp;gt; saying&lt;br/&gt;&amp;gt; &amp;gt; that counterparties are able to malleate the package child B, or a child&lt;br/&gt;&amp;gt; of&lt;br/&gt;&amp;gt; &amp;gt; A&amp;#39;?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The second option, a child of A&amp;#39;, In the LN case I think the CPFP is&lt;br/&gt;&amp;gt; attached on one&amp;#39;s anchor output.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think it&amp;#39;s good if we assume the&lt;br/&gt;&amp;gt; solve-conflicts-after-parent&amp;#39;s`&amp;#39;PreChecks` mentioned above or fixing&lt;br/&gt;&amp;gt; inherited signaling or full-rbf ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; Sorry, I don&amp;#39;t understand what you mean by &amp;#34;preserve the package&lt;br/&gt;&amp;gt; &amp;gt; integrity?&amp;#34; Could you elaborate?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; After thinking the relaxation about the &amp;#34;new&amp;#34; unconfirmed input is not&lt;br/&gt;&amp;gt; linked to trimming but I would say more to the multi-parent support.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Let&amp;#39;s say you have A&#43;B trying to replace C&#43;D where B is also spending&lt;br/&gt;&amp;gt; already in-mempool E. To succeed, you need to waive the no-new-unconfirmed&lt;br/&gt;&amp;gt; input as D isn&amp;#39;t spending E.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; So good, I think we agree on the problem description here.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; I am in agreement with your calculations but unsure if we disagree on the&lt;br/&gt;&amp;gt; &amp;gt; expected outcome. Yes, B has an ancestor score of 10sat/vb and D has an&lt;br/&gt;&amp;gt; &amp;gt; ancestor score of ~2.9sat/vb. Since D&amp;#39;s ancestor score is lower than B&amp;#39;s,&lt;br/&gt;&amp;gt; &amp;gt; it fails the proposed package RBF Rule #2, so this package would be&lt;br/&gt;&amp;gt; &amp;gt; rejected. Does this meet your expectations?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Well what sounds odd to me, in my example, we fail D even if it has a&lt;br/&gt;&amp;gt; higher-fee than B. Like A&#43;B absolute fees are 2000 sats and A&#43;C&#43;D absolute&lt;br/&gt;&amp;gt; fees are 4500 sats ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Is this compatible with a model where a miner prioritizes absolute fees&lt;br/&gt;&amp;gt; over ancestor score, in the case that mempools aren&amp;#39;t full-enough to&lt;br/&gt;&amp;gt; fulfill a block ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Let me know if I can clarify a point.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Antoine&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Le lun. 20 sept. 2021 à 11:10, Gloria Zhao &amp;lt;gloriajzhao at gmail.com&amp;gt; a&lt;br/&gt;&amp;gt; écrit :&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Hi Antoine,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; First of all, thank you for the thorough review. I appreciate your&lt;br/&gt;&amp;gt;&amp;gt; insight on LN requirements.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; IIUC, you have a package A&#43;B&#43;C submitted for acceptance and A is&lt;br/&gt;&amp;gt;&amp;gt; already in your mempool. You trim out A from the package and then evaluate&lt;br/&gt;&amp;gt;&amp;gt; B&#43;C.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; I think this might be an issue if A is the higher-fee element of the&lt;br/&gt;&amp;gt;&amp;gt; ABC package. B&#43;C package fees might be under the mempool min fee and will&lt;br/&gt;&amp;gt;&amp;gt; be rejected, potentially breaking the acceptance expectations of the&lt;br/&gt;&amp;gt;&amp;gt; package issuer ?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Correct, if B&#43;C is too low feerate to be accepted, we will reject it. I&lt;br/&gt;&amp;gt;&amp;gt; prefer this because it is incentive compatible: A can be mined by itself,&lt;br/&gt;&amp;gt;&amp;gt; so there&amp;#39;s no reason to prefer A&#43;B&#43;C instead of A.&lt;br/&gt;&amp;gt;&amp;gt; As another way of looking at this, consider the case where we do accept&lt;br/&gt;&amp;gt;&amp;gt; A&#43;B&#43;C and it sits at the &amp;#34;bottom&amp;#34; of our mempool. If our mempool reaches&lt;br/&gt;&amp;gt;&amp;gt; capacity, we evict the lowest descendant feerate transactions, which are&lt;br/&gt;&amp;gt;&amp;gt; B&#43;C in this case. This gives us the same resulting mempool, with A and not&lt;br/&gt;&amp;gt;&amp;gt; B&#43;C.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Further, I think the dedup should be done on wtxid, as you might have&lt;br/&gt;&amp;gt;&amp;gt; multiple valid witnesses. Though with varying vsizes and as such offering&lt;br/&gt;&amp;gt;&amp;gt; different feerates.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I agree that variations of the same package with different witnesses is a&lt;br/&gt;&amp;gt;&amp;gt; case that must be handled. I consider witness replacement to be a project&lt;br/&gt;&amp;gt;&amp;gt; that can be done in parallel to package mempool acceptance because being&lt;br/&gt;&amp;gt;&amp;gt; able to accept packages does not worsen the problem of a&lt;br/&gt;&amp;gt;&amp;gt; same-txid-different-witness &amp;#34;pinning&amp;#34; attack.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; If or when we have witness replacement, the logic is: if the individual&lt;br/&gt;&amp;gt;&amp;gt; transaction is enough to replace the mempool one, the replacement will&lt;br/&gt;&amp;gt;&amp;gt; happen during the preceding individual transaction acceptance, and&lt;br/&gt;&amp;gt;&amp;gt; deduplication logic will work. Otherwise, we will try to deduplicate by&lt;br/&gt;&amp;gt;&amp;gt; wtxid, see that we need a package witness replacement, and use the package&lt;br/&gt;&amp;gt;&amp;gt; feerate to evaluate whether this is economically rational.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; See the #22290 &amp;#34;handle package transactions already in mempool&amp;#34; commit (&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22290/commits/fea75a2237b46cf76145242fecad7e274bfcb5ff&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22290/commits/fea75a2237b46cf76145242fecad7e274bfcb5ff&lt;/a&gt;),&lt;br/&gt;&amp;gt;&amp;gt; which handles the case of same-txid-different-witness by simply using the&lt;br/&gt;&amp;gt;&amp;gt; transaction in the mempool for now, with TODOs for what I just described.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; I&amp;#39;m not clearly understanding the accepted topologies. By &amp;#34;parent and&lt;br/&gt;&amp;gt;&amp;gt; child to share a parent&amp;#34;, do you mean the set of transactions A, B, C,&lt;br/&gt;&amp;gt;&amp;gt; where B is spending A and C is spending A and B would be correct ?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Yes, that is what I meant. Yes, that would a valid package under these&lt;br/&gt;&amp;gt;&amp;gt; rules.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; If yes, is there a width-limit introduced or we fallback on&lt;br/&gt;&amp;gt;&amp;gt; MAX_PACKAGE_COUNT=25 ?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; No, there is no limit on connectivity other than &amp;#34;child with all&lt;br/&gt;&amp;gt;&amp;gt; unconfirmed parents.&amp;#34; We will enforce MAX_PACKAGE_COUNT=25 and child&amp;#39;s&lt;br/&gt;&amp;gt;&amp;gt; in-mempool &#43; in-package ancestor limits.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Considering the current Core&amp;#39;s mempool acceptance rules, I think CPFP&lt;br/&gt;&amp;gt;&amp;gt; batching is unsafe for LN time-sensitive closure. A malicious tx-relay&lt;br/&gt;&amp;gt;&amp;gt; jamming successful on one channel commitment transaction would contamine&lt;br/&gt;&amp;gt;&amp;gt; the remaining commitments sharing the same package.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; E.g, you broadcast the package A&#43;B&#43;C&#43;D&#43;E where A,B,C,D are commitment&lt;br/&gt;&amp;gt;&amp;gt; transactions and E a shared CPFP. If a malicious A&amp;#39; transaction has a&lt;br/&gt;&amp;gt;&amp;gt; better feerate than A, the whole package acceptance will fail. Even if A&amp;#39;&lt;br/&gt;&amp;gt;&amp;gt; confirms in the following block,&lt;br/&gt;&amp;gt;&amp;gt; the propagation and confirmation of B&#43;C&#43;D have been delayed. This could&lt;br/&gt;&amp;gt;&amp;gt; carry on a loss of funds.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Please note that A may replace A&amp;#39; even if A&amp;#39; has higher fees than A&lt;br/&gt;&amp;gt;&amp;gt; individually, because the proposed package RBF utilizes the fees and size&lt;br/&gt;&amp;gt;&amp;gt; of the entire package. This just requires E to pay enough fees, although&lt;br/&gt;&amp;gt;&amp;gt; this can be pretty high if there are also potential B&amp;#39; and C&amp;#39; competing&lt;br/&gt;&amp;gt;&amp;gt; commitment transactions that we don&amp;#39;t know about.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; IMHO, I&amp;#39;m leaning towards deploying during a first phase&lt;br/&gt;&amp;gt;&amp;gt; 1-parent/1-child. I think it&amp;#39;s the most conservative step still improving&lt;br/&gt;&amp;gt;&amp;gt; second-layer safety.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; So far, my understanding is that multi-parent-1-child is desired for&lt;br/&gt;&amp;gt;&amp;gt; batched fee-bumping (&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22674#issuecomment-897951289&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22674#issuecomment-897951289&lt;/a&gt;)&lt;br/&gt;&amp;gt;&amp;gt; and I&amp;#39;ve also seen your response which I have less context on (&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22674#issuecomment-900352202&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22674#issuecomment-900352202&lt;/a&gt;).&lt;br/&gt;&amp;gt;&amp;gt; That being said, I am happy to create a new proposal for 1 parent &#43; 1 child&lt;br/&gt;&amp;gt;&amp;gt; (which would be slightly simpler) and plan for moving to&lt;br/&gt;&amp;gt;&amp;gt; multi-parent-1-child later if that is preferred. I am very interested in&lt;br/&gt;&amp;gt;&amp;gt; hearing feedback on that approach.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; If A&#43;B is submitted to replace A&amp;#39;, where A pays 0 sats, B pays 200 sats&lt;br/&gt;&amp;gt;&amp;gt; and A&amp;#39; pays 100 sats. If we apply the individual RBF on A, A&#43;B acceptance&lt;br/&gt;&amp;gt;&amp;gt; fails. For this reason I think the individual RBF should be bypassed and&lt;br/&gt;&amp;gt;&amp;gt; only the package RBF apply ?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I think there is a misunderstanding here - let me describe what I&amp;#39;m&lt;br/&gt;&amp;gt;&amp;gt; proposing we&amp;#39;d do in this situation: we&amp;#39;ll try individual submission for A,&lt;br/&gt;&amp;gt;&amp;gt; see that it fails due to &amp;#34;insufficient fees.&amp;#34; Then, we&amp;#39;ll try package&lt;br/&gt;&amp;gt;&amp;gt; validation for A&#43;B and use package RBF. If A&#43;B pays enough, it can still&lt;br/&gt;&amp;gt;&amp;gt; replace A&amp;#39;. If A fails for a bad signature, we won&amp;#39;t look at B or A&#43;B. Does&lt;br/&gt;&amp;gt;&amp;gt; this meet your expectations?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; What problem are you trying to solve by the package feerate *after*&lt;br/&gt;&amp;gt;&amp;gt; dedup rule ?&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; My understanding is that an in-package transaction might be already in&lt;br/&gt;&amp;gt;&amp;gt; the mempool. Therefore, to compute a correct RBF penalty replacement, the&lt;br/&gt;&amp;gt;&amp;gt; vsize of this transaction could be discarded lowering the cost of package&lt;br/&gt;&amp;gt;&amp;gt; RBF.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I&amp;#39;m proposing that, when a transaction has already been submitted to&lt;br/&gt;&amp;gt;&amp;gt; mempool, we would ignore both its fees and vsize when calculating package&lt;br/&gt;&amp;gt;&amp;gt; feerate. In example G2, we shouldn&amp;#39;t count M1 fees after its submission to&lt;br/&gt;&amp;gt;&amp;gt; mempool, since M1&amp;#39;s fees have already been used to pay for its individual&lt;br/&gt;&amp;gt;&amp;gt; bandwidth, and it shouldn&amp;#39;t be used again to pay for P2 and P3&amp;#39;s bandwidth.&lt;br/&gt;&amp;gt;&amp;gt; We also shouldn&amp;#39;t count its vsize, since it has already been paid for.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; I think this is a footgunish API, as if a package issuer send the&lt;br/&gt;&amp;gt;&amp;gt; multiple-parent-one-child package A,B,C,D where D is the child of A,B,C.&lt;br/&gt;&amp;gt;&amp;gt; Then try to broadcast the higher-feerate C&amp;#39;&#43;D&amp;#39; package, it should be&lt;br/&gt;&amp;gt;&amp;gt; rejected. So it&amp;#39;s breaking the naive broadcaster assumption that a&lt;br/&gt;&amp;gt;&amp;gt; higher-feerate/higher-fee package always replaces ?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Note that, if C&amp;#39; conflicts with C, it also conflicts with D, since D is a&lt;br/&gt;&amp;gt;&amp;gt; descendant of C and would thus need to be evicted along with it.&lt;br/&gt;&amp;gt;&amp;gt; Implicitly, D&amp;#39; would not be in conflict with D.&lt;br/&gt;&amp;gt;&amp;gt; More generally, this example is surprising to me because I didn&amp;#39;t think&lt;br/&gt;&amp;gt;&amp;gt; packages would be used to fee-bump replaceable transactions. Do we want the&lt;br/&gt;&amp;gt;&amp;gt; child to be able to replace mempool transactions as well? This can be&lt;br/&gt;&amp;gt;&amp;gt; implemented with a bit of additional logic.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; I think this is unsafe for L2s if counterparties have malleability of&lt;br/&gt;&amp;gt;&amp;gt; the child transaction. They can block your package replacement by&lt;br/&gt;&amp;gt;&amp;gt; opting-out from RBF signaling. IIRC, LN&amp;#39;s &amp;#34;anchor output&amp;#34; presents such an&lt;br/&gt;&amp;gt;&amp;gt; ability.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I&amp;#39;m not sure what you mean? Let&amp;#39;s say we have a package of parent A &#43;&lt;br/&gt;&amp;gt;&amp;gt; child B, where A is supposed to replace a mempool transaction A&amp;#39;. Are you&lt;br/&gt;&amp;gt;&amp;gt; saying that counterparties are able to malleate the package child B, or a&lt;br/&gt;&amp;gt;&amp;gt; child of A&amp;#39;? If they can malleate a child of A&amp;#39;, that shouldn&amp;#39;t matter as&lt;br/&gt;&amp;gt;&amp;gt; long as A&amp;#39; is signaling replacement. This would be handled identically with&lt;br/&gt;&amp;gt;&amp;gt; full RBF and what Core currently implements.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; I think this is an issue brought by the trimming during the dedup&lt;br/&gt;&amp;gt;&amp;gt; phase. If we preserve the package integrity, only re-using the tx-level&lt;br/&gt;&amp;gt;&amp;gt; checks results of already in-mempool transactions to gain in CPU time we&lt;br/&gt;&amp;gt;&amp;gt; won&amp;#39;t have this issue. Package childs can add unconfirmed inputs as long as&lt;br/&gt;&amp;gt;&amp;gt; they&amp;#39;re in-package, the bip125 rule2 is only evaluated against parents ?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Sorry, I don&amp;#39;t understand what you mean by &amp;#34;preserve the package&lt;br/&gt;&amp;gt;&amp;gt; integrity?&amp;#34; Could you elaborate?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Let&amp;#39;s say you have in-mempool A, B where A pays 10 sat/vb for 100&lt;br/&gt;&amp;gt;&amp;gt; vbytes and B pays 10 sat/vb for 100 vbytes. You have the candidate&lt;br/&gt;&amp;gt;&amp;gt; replacement D spending both A and C where D pays 15sat/vb for 100 vbytes&lt;br/&gt;&amp;gt;&amp;gt; and C pays 1 sat/vb for 1000 vbytes.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Package A &#43; B ancestor score is 10 sat/vb.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; D has a higher feerate/absolute fee than B.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt; Package A &#43; C &#43; D ancestor score is ~ 3 sat/vb ((A&amp;#39;s 1000 sats &#43; C&amp;#39;s&lt;br/&gt;&amp;gt;&amp;gt; 1000 sats &#43; D&amp;#39;s 1500 sats) / A&amp;#39;s 100 vb &#43; C&amp;#39;s 1000 vb &#43; D&amp;#39;s 100 vb)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I am in agreement with your calculations but unsure if we disagree on the&lt;br/&gt;&amp;gt;&amp;gt; expected outcome. Yes, B has an ancestor score of 10sat/vb and D has an&lt;br/&gt;&amp;gt;&amp;gt; ancestor score of ~2.9sat/vb. Since D&amp;#39;s ancestor score is lower than B&amp;#39;s,&lt;br/&gt;&amp;gt;&amp;gt; it fails the proposed package RBF Rule #2, so this package would be&lt;br/&gt;&amp;gt;&amp;gt; rejected. Does this meet your expectations?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Thank you for linking to projects that might be interested in package&lt;br/&gt;&amp;gt;&amp;gt; relay :)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Thanks,&lt;br/&gt;&amp;gt;&amp;gt; Gloria&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; On Mon, Sep 20, 2021 at 12:16 AM Antoine Riard &amp;lt;antoine.riard at gmail.com&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; wrote:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Hi Gloria,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; A package may contain transactions that are already in the mempool. We&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; remove&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; (&amp;#34;deduplicate&amp;#34;) those transactions from the package for the purposes of&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; mempool acceptance. If a package is empty after deduplication, we do&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; nothing.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; IIUC, you have a package A&#43;B&#43;C submitted for acceptance and A is already&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; in your mempool. You trim out A from the package and then evaluate B&#43;C.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; I think this might be an issue if A is the higher-fee element of the ABC&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; package. B&#43;C package fees might be under the mempool min fee and will be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; rejected, potentially breaking the acceptance expectations of the package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; issuer ?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Further, I think the dedup should be done on wtxid, as you might have&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; multiple valid witnesses. Though with varying vsizes and as such offering&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; different feerates.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; E.g you&amp;#39;re going to evaluate the package A&#43;B and A&amp;#39; is already in your&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; mempool with a bigger valid witness. You trim A based on txid, then you&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; evaluate A&amp;#39;&#43;B, which fails the fee checks. However, evaluating A&#43;B would&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; have been a success.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; AFAICT, the dedup rationale would be to save on CPU time/IO disk, to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; avoid repeated signatures verification and parent UTXOs fetches ? Can we&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; achieve the same goal by bypassing tx-level checks for already-in txn while&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; conserving the package integrity for package-level checks ?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; Note that it&amp;#39;s possible for the parents to be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; indirect&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; descendants/ancestors of one another, or for parent and child to share&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; parent,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; so we cannot make any other topology assumptions.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; I&amp;#39;m not clearly understanding the accepted topologies. By &amp;#34;parent and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; child to share a parent&amp;#34;, do you mean the set of transactions A, B, C,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; where B is spending A and C is spending A and B would be correct ?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; If yes, is there a width-limit introduced or we fallback on&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; MAX_PACKAGE_COUNT=25 ?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; IIRC, one rationale to come with this topology limitation was to lower&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the DoS risks when potentially deploying p2p packages.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Considering the current Core&amp;#39;s mempool acceptance rules, I think CPFP&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; batching is unsafe for LN time-sensitive closure. A malicious tx-relay&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; jamming successful on one channel commitment transaction would contamine&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the remaining commitments sharing the same package.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; E.g, you broadcast the package A&#43;B&#43;C&#43;D&#43;E where A,B,C,D are commitment&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; transactions and E a shared CPFP. If a malicious A&amp;#39; transaction has a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; better feerate than A, the whole package acceptance will fail. Even if A&amp;#39;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; confirms in the following block,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the propagation and confirmation of B&#43;C&#43;D have been delayed. This could&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; carry on a loss of funds.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; That said, if you&amp;#39;re broadcasting commitment transactions without&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; time-sensitive HTLC outputs, I think the batching is effectively a fee&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; saving as you don&amp;#39;t have to duplicate the CPFP.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; IMHO, I&amp;#39;m leaning towards deploying during a first phase&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; 1-parent/1-child. I think it&amp;#39;s the most conservative step still improving&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; second-layer safety.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; *Rationale*:  It would be incorrect to use the fees of transactions&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; that are&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; already in the mempool, as we do not want a transaction&amp;#39;s fees to be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; double-counted for both its individual RBF and package RBF.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; I&amp;#39;m unsure about the logical order of the checks proposed.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; If A&#43;B is submitted to replace A&amp;#39;, where A pays 0 sats, B pays 200 sats&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; and A&amp;#39; pays 100 sats. If we apply the individual RBF on A, A&#43;B acceptance&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; fails. For this reason I think the individual RBF should be bypassed and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; only the package RBF apply ?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Note this situation is plausible, with current LN design, your&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; counterparty can have a commitment transaction with a better fee just by&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; selecting a higher `dust_limit_satoshis` than yours.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; Examples F and G [14] show the same package, but P1 is submitted&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; individually before&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; the package in example G. In example F, we can see that the 300vB&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; pays&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; an additional 200sat in fees, which is not enough to pay for its own&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; bandwidth&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; (BIP125#4). In example G, we can see that P1 pays enough to replace&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; M1, but&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; using P1&amp;#39;s fees again during package submission would make it look&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; like a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; 300sat&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; increase for a 200vB package. Even including its fees and size would&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; not be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; sufficient in this example, since the 300sat looks like enough for the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; 300vB&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; package. The calculcation after deduplication is 100sat increase for a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; of size 200vB, which correctly fails BIP125#4. Assume all transactions&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; have&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; size of 100vB.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; What problem are you trying to solve by the package feerate *after*&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; dedup rule ?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; My understanding is that an in-package transaction might be already in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the mempool. Therefore, to compute a correct RBF penalty replacement, the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; vsize of this transaction could be discarded lowering the cost of package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; RBF.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; If we keep a &amp;#34;safe&amp;#34; dedup mechanism (see my point above), I think this&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; discount is justified, as the validation cost of node operators is paid for&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; The child cannot replace mempool transactions.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Let&amp;#39;s say you issue package A&#43;B, then package C&#43;B&amp;#39;, where B&amp;#39; is a child&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; of both A and C. This rule fails the acceptance of C&#43;B&amp;#39; ?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; I think this is a footgunish API, as if a package issuer send the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; multiple-parent-one-child package A,B,C,D where D is the child of A,B,C.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Then try to broadcast the higher-feerate C&amp;#39;&#43;D&amp;#39; package, it should be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; rejected. So it&amp;#39;s breaking the naive broadcaster assumption that a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; higher-feerate/higher-fee package always replaces ? And it might be unsafe&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; in protocols where states are symmetric. E.g a malicious counterparty&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; broadcasts first S&#43;A, then you honestly broadcast S&#43;B, where B pays better&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; fees.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; All mempool transactions to be replaced must signal replaceability.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; I think this is unsafe for L2s if counterparties have malleability of&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; the child transaction. They can block your package replacement by&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; opting-out from RBF signaling. IIRC, LN&amp;#39;s &amp;#34;anchor output&amp;#34; presents such an&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; ability.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; I think it&amp;#39;s better to either fix inherited signaling or move towards&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; full-rbf.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; if a package parent has already been submitted, it would&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; look&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt;like the child is spending a &amp;#34;new&amp;#34; unconfirmed input.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; I think this is an issue brought by the trimming during the dedup phase.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; If we preserve the package integrity, only re-using the tx-level checks&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; results of already in-mempool transactions to gain in CPU time we won&amp;#39;t&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; have this issue. Package childs can add unconfirmed inputs as long as&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; they&amp;#39;re in-package, the bip125 rule2 is only evaluated against parents ?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; However, we still achieve the same goal of requiring the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; replacement&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; transactions to have a ancestor score at least as high as the original&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; ones.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; I&amp;#39;m not sure if this holds...&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Let&amp;#39;s say you have in-mempool A, B where A pays 10 sat/vb for 100 vbytes&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; and B pays 10 sat/vb for 100 vbytes. You have the candidate replacement D&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; spending both A and C where D pays 15sat/vb for 100 vbytes and C pays 1&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; sat/vb for 1000 vbytes.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Package A &#43; B ancestor score is 10 sat/vb.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; D has a higher feerate/absolute fee than B.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Package A &#43; C &#43; D ancestor score is ~ 3 sat/vb ((A&amp;#39;s 1000 sats &#43; C&amp;#39;s&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; 1000 sats &#43; D&amp;#39;s 1500 sats) /&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; A&amp;#39;s 100 vb &#43; C&amp;#39;s 1000 vb &#43; D&amp;#39;s 100 vb)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Overall, this is a review through the lenses of LN requirements. I think&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; other L2 protocols/applications&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; could be candidates to using package accept/relay such as:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; * &lt;a href=&#34;https://github.com/lightninglabs/pool&#34;&gt;https://github.com/lightninglabs/pool&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; * &lt;a href=&#34;https://github.com/discreetlogcontracts/dlcspecs&#34;&gt;https://github.com/discreetlogcontracts/dlcspecs&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; * &lt;a href=&#34;https://github.com/bitcoin-teleport/teleport-transactions/&#34;&gt;https://github.com/bitcoin-teleport/teleport-transactions/&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; * &lt;a href=&#34;https://github.com/sapio-lang/sapio&#34;&gt;https://github.com/sapio-lang/sapio&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; *&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/commerceblock/mercury/blob/master/doc/statechains.md&#34;&gt;https://github.com/commerceblock/mercury/blob/master/doc/statechains.md&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; * &lt;a href=&#34;https://github.com/revault/practical-revault&#34;&gt;https://github.com/revault/practical-revault&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Thanks for rolling forward the ball on this subject.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Antoine&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; Le jeu. 16 sept. 2021 à 03:55, Gloria Zhao via bitcoin-dev &amp;lt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&amp;gt; a écrit :&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Hi there,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I&amp;#39;m writing to propose a set of mempool policy changes to enable package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; validation (in preparation for package relay) in Bitcoin Core. These&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; would not&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; be consensus or P2P protocol changes. However, since mempool policy&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; significantly affects transaction propagation, I believe this is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; relevant for&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the mailing list.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; My proposal enables packages consisting of multiple parents and 1&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; child. If you&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; develop software that relies on specific transaction relay assumptions&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; and/or&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; are interested in using package relay in the future, I&amp;#39;m very&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; interested to hear&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; your feedback on the utility or restrictiveness of these package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; policies for&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; your use cases.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; A draft implementation of this proposal can be found in [Bitcoin Core&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; PR#22290][1].&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; An illustrated version of this post can be found at&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://gist.github.com/glozow/dc4e9d5c5b14ade7cdfac40f43adb18a&#34;&gt;https://gist.github.com/glozow/dc4e9d5c5b14ade7cdfac40f43adb18a&lt;/a&gt;.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I have also linked the images below.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ## Background&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Feel free to skip this section if you are already familiar with mempool&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; policy&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; and package relay terminology.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ### Terminology Clarifications&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; * Package = an ordered list of related transactions, representable by a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Directed&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;   Acyclic Graph.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; * Package Feerate = the total modified fees divided by the total&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; virtual size of&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;   all transactions in the package.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;     - Modified fees = a transaction&amp;#39;s base fees &#43; fee delta applied by&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the user&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;       with `prioritisetransaction`. As such, we expect this to vary&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; across&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; mempools.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;     - Virtual Size = the maximum of virtual sizes calculated using&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [BIP141&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;       virtual size][2] and sigop weight. [Implemented here in Bitcoin&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Core][3].&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;     - Note that feerate is not necessarily based on the base fees and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; serialized&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;       size.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; * Fee-Bumping = user/wallet actions that take advantage of miner&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; incentives to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;   boost a transaction&amp;#39;s candidacy for inclusion in a block, including&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Child Pays&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; for Parent (CPFP) and [BIP125][12] Replace-by-Fee (RBF). Our intention&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; mempool policy is to recognize when the new transaction is more&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; economical to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; mine than the original one(s) but not open DoS vectors, so there are&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; some&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; limitations.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ### Policy&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; The purpose of the mempool is to store the best (to be most&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; incentive-compatible&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; with miners, highest feerate) candidates for inclusion in a block.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Miners use&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the mempool to build block templates. The mempool is also useful as a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; cache for&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; boosting block relay and validation performance, aiding transaction&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; relay, and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; generating feerate estimations.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Ideally, all consensus-valid transactions paying reasonable fees should&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; make it&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; to miners through normal transaction relay, without any special&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; connectivity or&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; relationships with miners. On the other hand, nodes do not have&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; unlimited&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; resources, and a P2P network designed to let any honest node broadcast&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; their&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transactions also exposes the transaction validation engine to DoS&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; attacks from&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; malicious peers.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; As such, for unconfirmed transactions we are considering for our&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; mempool, we&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; apply a set of validation rules in addition to consensus, primarily to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; protect&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; us from resource exhaustion and aid our efforts to keep the highest fee&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transactions. We call this mempool _policy_: a set of (configurable,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; node-specific) rules that transactions must abide by in order to be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; accepted&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; into our mempool. Transaction &amp;#34;Standardness&amp;#34; rules and mempool&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; restrictions such&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; as &amp;#34;too-long-mempool-chain&amp;#34; are both examples of policy.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ### Package Relay and Package Mempool Accept&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; In transaction relay, we currently consider transactions one at a time&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; for&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; submission to the mempool. This creates a limitation in the node&amp;#39;s&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ability to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; determine which transactions have the highest feerates, since we cannot&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; take&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; into account descendants (i.e. cannot use CPFP) until all the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transactions are&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; in the mempool. Similarly, we cannot use a transaction&amp;#39;s descendants&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; when&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; considering it for RBF. When an individual transaction does not meet&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the mempool&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; minimum feerate and the user isn&amp;#39;t able to create a replacement&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transaction&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; directly, it will not be accepted by mempools.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; This limitation presents a security issue for applications and users&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; relying on&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; time-sensitive transactions. For example, Lightning and other protocols&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; create&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; UTXOs with multiple spending paths, where one counterparty&amp;#39;s spending&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; path opens&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; up after a timelock, and users are protected from cheating scenarios as&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; long as&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; they redeem on-chain in time. A key security assumption is that all&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; parties&amp;#39;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transactions will propagate and confirm in a timely manner. This&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; assumption can&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; be broken if fee-bumping does not work as intended.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; The end goal for Package Relay is to consider multiple transactions at&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the same&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; time, e.g. a transaction with its high-fee child. This may help us&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; better&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; determine whether transactions should be accepted to our mempool,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; especially if&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; they don&amp;#39;t meet fee requirements individually or are better RBF&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; candidates as a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; package. A combination of changes to mempool validation logic, policy,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transaction relay allows us to better propagate the transactions with&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; highest package feerates to miners, and makes fee-bumping tools more&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; powerful&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; for users.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; The &amp;#34;relay&amp;#34; part of Package Relay suggests P2P messaging changes, but a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; large&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; part of the changes are in the mempool&amp;#39;s package validation logic. We&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; call this&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; *Package Mempool Accept*.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ### Previous Work&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; * Given that mempool validation is DoS-sensitive and complex, it would&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;   dangerous to haphazardly tack on package validation logic. Many&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; efforts have&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; been made to make mempool validation less opaque (see [#16400][4],&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [#21062][5],&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [#22675][6], [#22796][7]).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; * [#20833][8] Added basic capabilities for package validation, test&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; accepts only&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;   (no submission to mempool).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; * [#21800][9] Implemented package ancestor/descendant limit checks for&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; arbitrary&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;   packages. Still test accepts only.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; * Previous package relay proposals (see [#16401][10], [#19621][11]).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ### Existing Package Rules&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; These are in master as introduced in [#20833][8] and [#21800][9]. I&amp;#39;ll&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; consider&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; them as &amp;#34;given&amp;#34; in the rest of this document, though they can be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; changed, since&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; package validation is test-accept only right now.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 1. A package cannot exceed `MAX_PACKAGE_COUNT=25` count and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; `MAX_PACKAGE_SIZE=101KvB` total size [8]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;    *Rationale*: This is already enforced as mempool ancestor/descendant&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; limits.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Presumably, transactions in a package are all related, so exceeding&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; this limit&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; would mean that the package can either be split up or it wouldn&amp;#39;t pass&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; this&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; mempool policy.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 2. Packages must be topologically sorted: if any dependencies exist&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; between&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transactions, parents must appear somewhere before children. [8]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 3. A package cannot have conflicting transactions, i.e. none of them&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; can spend&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the same inputs. This also means there cannot be duplicate&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transactions. [8]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 4. When packages are evaluated against ancestor/descendant limits in a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; test&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; accept, the union of all of their descendants and ancestors is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; considered. This&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; is essentially a &amp;#34;worst case&amp;#34; heuristic where every transaction in the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; is treated as each other&amp;#39;s ancestor and descendant. [8]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Packages for which ancestor/descendant limits are accurately captured&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; by this&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; heuristic: [19]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; There are also limitations such as the fact that CPFP carve out is not&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; applied&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; to package transactions. #20833 also disables RBF in package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; validation; this&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; proposal overrides that to allow packages to use RBF.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ## Proposed Changes&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; The next step in the Package Mempool Accept project is to implement&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; submission&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; to mempool, initially through RPC only. This allows us to test the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; submission&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; logic before exposing it on P2P.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ### Summary&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; - Packages may contain already-in-mempool transactions.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; - Packages are 2 generations, Multi-Parent-1-Child.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; - Fee-related checks use the package feerate. This means that wallets&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; can&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; create a package that utilizes CPFP.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; - Parents are allowed to RBF mempool transactions with a set of rules&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; similar&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;   to BIP125. This enables a combination of CPFP and RBF, where a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transaction&amp;#39;s descendant fees pay for replacing mempool conflicts.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; There is a draft implementation in [#22290][1]. It is WIP, but feedback&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; always welcome.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ### Details&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; #### Packages May Contain Already-in-Mempool Transactions&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; A package may contain transactions that are already in the mempool. We&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; remove&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; (&amp;#34;deduplicate&amp;#34;) those transactions from the package for the purposes of&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; mempool acceptance. If a package is empty after deduplication, we do&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; nothing.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; *Rationale*: Mempools vary across the network. It&amp;#39;s possible for a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; parent to be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; accepted to the mempool of a peer on its own due to differences in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; policy and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; fee market fluctuations. We should not reject or penalize the entire&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; package for&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; an individual transaction as that could be a censorship vector.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; #### Packages Are Multi-Parent-1-Child&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Only packages of a specific topology are permitted. Namely, a package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; is exactly&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 1 child with all of its unconfirmed parents. After deduplication, the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; may be exactly the same, empty, 1 child, 1 child with just some of its&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; unconfirmed parents, etc. Note that it&amp;#39;s possible for the parents to be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; indirect&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; descendants/ancestors of one another, or for parent and child to share&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; a parent,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; so we cannot make any other topology assumptions.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; *Rationale*: This allows for fee-bumping by CPFP. Allowing multiple&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; parents&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; makes it possible to fee-bump a batch of transactions. Restricting&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; packages to a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; defined topology is also easier to reason about and simplifies the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; validation&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; logic greatly. Multi-parent-1-child allows us to think of the package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; as one big&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transaction, where:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; - Inputs = all the inputs of parents &#43; inputs of the child that come&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; from&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;   confirmed UTXOs&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; - Outputs = all the outputs of the child &#43; all outputs of the parents&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; that&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;   aren&amp;#39;t spent by other transactions in the package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Examples of packages that follow this rule (variations of example A&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; show some&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; possibilities after deduplication): ![image][15]&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; #### Fee-Related Checks Use Package Feerate&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Package Feerate = the total modified fees divided by the total virtual&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; size of&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; all transactions in the package.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; To meet the two feerate requirements of a mempool, i.e., the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; pre-configured&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; minimum relay feerate (`minRelayTxFee`) and dynamic mempool minimum&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; feerate, the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; total package feerate is used instead of the individual feerate. The&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; individual&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transactions are allowed to be below feerate requirements if the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; package meets&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the feerate requirements. For example, the parent(s) in the package can&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; have 0&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; fees but be paid for by the child.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; *Rationale*: This can be thought of as &amp;#34;CPFP within a package,&amp;#34; solving&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; issue of a parent not meeting minimum fees on its own. This allows L2&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; applications to adjust their fees at broadcast time instead of&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; overshooting or&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; risking getting stuck/pinned.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; We use the package feerate of the package *after deduplication*.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; *Rationale*:  It would be incorrect to use the fees of transactions&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; that are&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; already in the mempool, as we do not want a transaction&amp;#39;s fees to be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; double-counted for both its individual RBF and package RBF.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Examples F and G [14] show the same package, but P1 is submitted&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; individually before&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the package in example G. In example F, we can see that the 300vB&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; package pays&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; an additional 200sat in fees, which is not enough to pay for its own&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; bandwidth&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; (BIP125#4). In example G, we can see that P1 pays enough to replace M1,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; but&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; using P1&amp;#39;s fees again during package submission would make it look like&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; a 300sat&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; increase for a 200vB package. Even including its fees and size would&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; not be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; sufficient in this example, since the 300sat looks like enough for the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 300vB&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; package. The calculcation after deduplication is 100sat increase for a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; of size 200vB, which correctly fails BIP125#4. Assume all transactions&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; have a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; size of 100vB.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; #### Package RBF&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; If a package meets feerate requirements as a package, the parents in the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transaction are allowed to replace-by-fee mempool transactions. The&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; child cannot&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; replace mempool transactions. Multiple transactions can replace the same&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transaction, but in order to be valid, none of the transactions can try&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; replace an ancestor of another transaction in the same package (which&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; would thus&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; make its inputs unavailable).&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; *Rationale*: Even if we are using package feerate, a package will not&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; propagate&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; as intended if RBF still requires each individual transaction to meet&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; feerate requirements.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; We use a set of rules slightly modified from BIP125 as follows:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ##### Signaling (Rule #1)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; All mempool transactions to be replaced must signal replaceability.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; *Rationale*: Package RBF signaling logic should be the same for package&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RBF and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; single transaction acceptance. This would be updated if single&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transaction&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; validation moves to full RBF.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ##### New Unconfirmed Inputs (Rule #2)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; A package may include new unconfirmed inputs, but the ancestor feerate&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; of the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; child must be at least as high as the ancestor feerates of every&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transaction&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; being replaced. This is contrary to BIP125#2, which states &amp;#34;The&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; replacement&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transaction may only include an unconfirmed input if that input was&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; included in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; one of the original transactions. (An unconfirmed input spends an&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; output from a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; currently-unconfirmed transaction.)&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; *Rationale*: The purpose of BIP125#2 is to ensure that the replacement&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transaction has a higher ancestor score than the original&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transaction(s) (see&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [comment][13]). Example H [16] shows how adding a new unconfirmed input&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; can lower the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ancestor score of the replacement transaction. P1 is trying to replace&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; M1, and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; spends an unconfirmed output of M2. P1 pays 800sat, M1 pays 600sat, and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; M2 pays&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 100sat. Assume all transactions have a size of 100vB. While, in&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; isolation, P1&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; looks like a better mining candidate than M1, it must be mined with M2,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; so its&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ancestor feerate is actually 4.5sat/vB.  This is lower than M1&amp;#39;s&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ancestor&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; feerate, which is 6sat/vB.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; In package RBF, the rule analogous to BIP125#2 would be &amp;#34;none of the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transactions in the package can spend new unconfirmed inputs.&amp;#34; Example&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; J [17] shows&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; why, if any of the package transactions have ancestors, package feerate&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; is no&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; longer accurate. Even though M2 and M3 are not ancestors of P1 (which&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; is the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; replacement transaction in an RBF), we&amp;#39;re actually interested in the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; entire&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; package. A miner should mine M1 which is 5sat/vB instead of M2, M3, P1,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; P2, and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; P3, which is only 4sat/vB. The Package RBF rule cannot be loosened to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; only allow&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; the child to have new unconfirmed inputs, either, because it can still&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; cause us&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; to overestimate the package&amp;#39;s ancestor score.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; However, enforcing a rule analogous to BIP125#2 would not only make&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Package RBF&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; less useful, but would also break Package RBF for packages with parents&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; already&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; in the mempool: if a package parent has already been submitted, it&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; would look&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; like the child is spending a &amp;#34;new&amp;#34; unconfirmed input. In example K&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [18], we&amp;#39;re&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; looking to replace M1 with the entire package including P1, P2, and P3.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; We must&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; consider the case where one of the parents is already in the mempool&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; (in this&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; case, P2), which means we must allow P3 to have new unconfirmed inputs.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; However,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; M2 lowers the ancestor score of P3 to 4.3sat/vB, so we should not&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; replace M1&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; with this package.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Thus, the package RBF rule regarding new unconfirmed inputs is less&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; strict than&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; BIP125#2. However, we still achieve the same goal of requiring the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; replacement&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transactions to have a ancestor score at least as high as the original&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ones. As&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; a result, the entire package is required to be a higher feerate mining&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; candidate&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; than each of the replaced transactions.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Another note: the [comment][13] above the BIP125#2 code in the original&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; RBF&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; implementation suggests that the rule was intended to be temporary.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ##### Absolute Fee (Rule #3)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; The package must increase the absolute fee of the mempool, i.e. the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; total fees&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; of the package must be higher than the absolute fees of the mempool&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transactions&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; it replaces. Combined with the CPFP rule above, this differs from&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; BIP125 Rule #3&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; - an individual transaction in the package may have lower fees than the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;   transaction(s) it is replacing. In fact, it may have 0 fees, and the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; child&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; pays for RBF.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ##### Feerate (Rule #4)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; The package must pay for its own bandwidth; the package feerate must be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; higher&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; than the replaced transactions by at least minimum relay feerate&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; (`incrementalRelayFee`). Combined with the CPFP rule above, this&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; differs from&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; BIP125 Rule #4 - an individual transaction in the package can have a&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; lower&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; feerate than the transaction(s) it is replacing. In fact, it may have 0&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; fees,&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; and the child pays for RBF.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ##### Total Number of Replaced Transactions (Rule #5)&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; The package cannot replace more than 100 mempool transactions. This is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; identical&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; to BIP125 Rule #5.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; ### Expected FAQs&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 1. Is it possible for only some of the package to make it into the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; mempool?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;    Yes, it is. However, since we evict transactions from the mempool by&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; descendant score and the package child is supposed to be sponsoring the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; fees of&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; its parents, the most common scenario would be all-or-nothing. This is&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; incentive-compatible. In fact, to be conservative, package validation&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; should&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; begin by trying to submit all of the transactions individually, and&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; only use the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; package mempool acceptance logic if the parents fail due to low feerate.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; 2. Should we allow packages to contain already-confirmed transactions?&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;     No, for practical reasons. In mempool validation, we actually&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; aren&amp;#39;t able to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; tell with 100% confidence if we are looking at a transaction that has&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; already&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; confirmed, because we look up inputs using a UTXO set. If we have&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; historical&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; block data, it&amp;#39;s possible to look for it, but this is inefficient, not&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; always&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; possible for pruning nodes, and unnecessary because we&amp;#39;re not going to&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; do&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; anything with the transaction anyway. As such, we already have the&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; expectation&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; that transaction relay is somewhat &amp;#34;stateful&amp;#34; i.e. nobody should be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; relaying&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; transactions that have already been confirmed. Similarly, we shouldn&amp;#39;t&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; be&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; relaying packages that contain already-confirmed transactions.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [1]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22290&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22290&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [2]:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bips/blob/1f0b563738199ca60d32b4ba779797fc97d040fe/bip-0141.mediawiki#transaction-size-calculations&#34;&gt;https://github.com/bitcoin/bips/blob/1f0b563738199ca60d32b4ba779797fc97d040fe/bip-0141.mediawiki#transaction-size-calculations&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [3]:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bitcoin/blob/94f83534e4b771944af7d9ed0f40746f392eb75e/src/policy/policy.cpp#L282&#34;&gt;https://github.com/bitcoin/bitcoin/blob/94f83534e4b771944af7d9ed0f40746f392eb75e/src/policy/policy.cpp#L282&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [4]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/16400&#34;&gt;https://github.com/bitcoin/bitcoin/pull/16400&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [5]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/21062&#34;&gt;https://github.com/bitcoin/bitcoin/pull/21062&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [6]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22675&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22675&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [7]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22796&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22796&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [8]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/20833&#34;&gt;https://github.com/bitcoin/bitcoin/pull/20833&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [9]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/21800&#34;&gt;https://github.com/bitcoin/bitcoin/pull/21800&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [10]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/16401&#34;&gt;https://github.com/bitcoin/bitcoin/pull/16401&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [11]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/19621&#34;&gt;https://github.com/bitcoin/bitcoin/pull/19621&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [12]: &lt;a href=&#34;https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki&#34;&gt;https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [13]:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/6871/files#diff-34d21af3c614ea3cee120df276c9c4ae95053830d7f1d3deaf009a4625409ad2R1101-R1104&#34;&gt;https://github.com/bitcoin/bitcoin/pull/6871/files#diff-34d21af3c614ea3cee120df276c9c4ae95053830d7f1d3deaf009a4625409ad2R1101-R1104&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [14]:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133567078-075a971c-0619-4339-9168-b41fd2b90c28.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [15]:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/132856734-fc17da75-f875-44bb-b954-cb7a1725cc0d.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [16]:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133567347-a3e2e4a8-ae9c-49f8-abb9-81e8e0aba224.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [17]:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133567370-21566d0e-36c8-4831-b1a8-706634540af3.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [18]:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133567444-bfff1142-439f-4547-800a-2ba2b0242bcb.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [19]:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133456219-0bb447cb-dcb4-4a31-b9c1-7d86205b68bc.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; [20]:&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/132857787-7b7c6f56-af96-44c8-8d78-983719888c19.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20210923/d1576a8f/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20210923/d1576a8f/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-08T00:59:19&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsddc6c6t6rj96akpec5agz8s4khlm3l5nqhnv6phruzu2qdw3ju7czyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2quescq6</id>
    
      <title type="html">📅 Original date posted:2021-09-20 📝 Original message:Hi ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsddc6c6t6rj96akpec5agz8s4khlm3l5nqhnv6phruzu2qdw3ju7czyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2quescq6" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqstgcrezrfgrtjvvgfe6nn5f5cp09x58hph8gkju8v94tmx6h9zz6qrn520f&#39;&gt;nevent1q…520f&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2021-09-20&lt;br/&gt;📝 Original message:Hi Antoine,&lt;br/&gt;&lt;br/&gt;First of all, thank you for the thorough review. I appreciate your insight&lt;br/&gt;on LN requirements.&lt;br/&gt;&lt;br/&gt;&amp;gt; IIUC, you have a package A&#43;B&#43;C submitted for acceptance and A is already&lt;br/&gt;in your mempool. You trim out A from the package and then evaluate B&#43;C.&lt;br/&gt;&lt;br/&gt;&amp;gt; I think this might be an issue if A is the higher-fee element of the ABC&lt;br/&gt;package. B&#43;C package fees might be under the mempool min fee and will be&lt;br/&gt;rejected, potentially breaking the acceptance expectations of the package&lt;br/&gt;issuer ?&lt;br/&gt;&lt;br/&gt;Correct, if B&#43;C is too low feerate to be accepted, we will reject it. I&lt;br/&gt;prefer this because it is incentive compatible: A can be mined by itself,&lt;br/&gt;so there&amp;#39;s no reason to prefer A&#43;B&#43;C instead of A.&lt;br/&gt;As another way of looking at this, consider the case where we do accept&lt;br/&gt;A&#43;B&#43;C and it sits at the &amp;#34;bottom&amp;#34; of our mempool. If our mempool reaches&lt;br/&gt;capacity, we evict the lowest descendant feerate transactions, which are&lt;br/&gt;B&#43;C in this case. This gives us the same resulting mempool, with A and not&lt;br/&gt;B&#43;C.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; Further, I think the dedup should be done on wtxid, as you might have&lt;br/&gt;multiple valid witnesses. Though with varying vsizes and as such offering&lt;br/&gt;different feerates.&lt;br/&gt;&lt;br/&gt;I agree that variations of the same package with different witnesses is a&lt;br/&gt;case that must be handled. I consider witness replacement to be a project&lt;br/&gt;that can be done in parallel to package mempool acceptance because being&lt;br/&gt;able to accept packages does not worsen the problem of a&lt;br/&gt;same-txid-different-witness &amp;#34;pinning&amp;#34; attack.&lt;br/&gt;&lt;br/&gt;If or when we have witness replacement, the logic is: if the individual&lt;br/&gt;transaction is enough to replace the mempool one, the replacement will&lt;br/&gt;happen during the preceding individual transaction acceptance, and&lt;br/&gt;deduplication logic will work. Otherwise, we will try to deduplicate by&lt;br/&gt;wtxid, see that we need a package witness replacement, and use the package&lt;br/&gt;feerate to evaluate whether this is economically rational.&lt;br/&gt;&lt;br/&gt;See the #22290 &amp;#34;handle package transactions already in mempool&amp;#34; commit (&lt;br/&gt;&lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22290/commits/fea75a2237b46cf76145242fecad7e274bfcb5ff&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22290/commits/fea75a2237b46cf76145242fecad7e274bfcb5ff&lt;/a&gt;),&lt;br/&gt;which handles the case of same-txid-different-witness by simply using the&lt;br/&gt;transaction in the mempool for now, with TODOs for what I just described.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; I&amp;#39;m not clearly understanding the accepted topologies. By &amp;#34;parent and&lt;br/&gt;child to share a parent&amp;#34;, do you mean the set of transactions A, B, C,&lt;br/&gt;where B is spending A and C is spending A and B would be correct ?&lt;br/&gt;&lt;br/&gt;Yes, that is what I meant. Yes, that would a valid package under these&lt;br/&gt;rules.&lt;br/&gt;&lt;br/&gt;&amp;gt; If yes, is there a width-limit introduced or we fallback on&lt;br/&gt;MAX_PACKAGE_COUNT=25 ?&lt;br/&gt;&lt;br/&gt;No, there is no limit on connectivity other than &amp;#34;child with all&lt;br/&gt;unconfirmed parents.&amp;#34; We will enforce MAX_PACKAGE_COUNT=25 and child&amp;#39;s&lt;br/&gt;in-mempool &#43; in-package ancestor limits.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; Considering the current Core&amp;#39;s mempool acceptance rules, I think CPFP&lt;br/&gt;batching is unsafe for LN time-sensitive closure. A malicious tx-relay&lt;br/&gt;jamming successful on one channel commitment transaction would contamine&lt;br/&gt;the remaining commitments sharing the same package.&lt;br/&gt;&lt;br/&gt;&amp;gt; E.g, you broadcast the package A&#43;B&#43;C&#43;D&#43;E where A,B,C,D are commitment&lt;br/&gt;transactions and E a shared CPFP. If a malicious A&amp;#39; transaction has a&lt;br/&gt;better feerate than A, the whole package acceptance will fail. Even if A&amp;#39;&lt;br/&gt;confirms in the following block,&lt;br/&gt;the propagation and confirmation of B&#43;C&#43;D have been delayed. This could&lt;br/&gt;carry on a loss of funds.&lt;br/&gt;&lt;br/&gt;Please note that A may replace A&amp;#39; even if A&amp;#39; has higher fees than A&lt;br/&gt;individually, because the proposed package RBF utilizes the fees and size&lt;br/&gt;of the entire package. This just requires E to pay enough fees, although&lt;br/&gt;this can be pretty high if there are also potential B&amp;#39; and C&amp;#39; competing&lt;br/&gt;commitment transactions that we don&amp;#39;t know about.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; IMHO, I&amp;#39;m leaning towards deploying during a first phase&lt;br/&gt;1-parent/1-child. I think it&amp;#39;s the most conservative step still improving&lt;br/&gt;second-layer safety.&lt;br/&gt;&lt;br/&gt;So far, my understanding is that multi-parent-1-child is desired for&lt;br/&gt;batched fee-bumping (&lt;br/&gt;&lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22674#issuecomment-897951289&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22674#issuecomment-897951289&lt;/a&gt;) and&lt;br/&gt;I&amp;#39;ve also seen your response which I have less context on (&lt;br/&gt;&lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22674#issuecomment-900352202&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22674#issuecomment-900352202&lt;/a&gt;). That&lt;br/&gt;being said, I am happy to create a new proposal for 1 parent &#43; 1 child&lt;br/&gt;(which would be slightly simpler) and plan for moving to&lt;br/&gt;multi-parent-1-child later if that is preferred. I am very interested in&lt;br/&gt;hearing feedback on that approach.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; If A&#43;B is submitted to replace A&amp;#39;, where A pays 0 sats, B pays 200 sats&lt;br/&gt;and A&amp;#39; pays 100 sats. If we apply the individual RBF on A, A&#43;B acceptance&lt;br/&gt;fails. For this reason I think the individual RBF should be bypassed and&lt;br/&gt;only the package RBF apply ?&lt;br/&gt;&lt;br/&gt;I think there is a misunderstanding here - let me describe what I&amp;#39;m&lt;br/&gt;proposing we&amp;#39;d do in this situation: we&amp;#39;ll try individual submission for A,&lt;br/&gt;see that it fails due to &amp;#34;insufficient fees.&amp;#34; Then, we&amp;#39;ll try package&lt;br/&gt;validation for A&#43;B and use package RBF. If A&#43;B pays enough, it can still&lt;br/&gt;replace A&amp;#39;. If A fails for a bad signature, we won&amp;#39;t look at B or A&#43;B. Does&lt;br/&gt;this meet your expectations?&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; What problem are you trying to solve by the package feerate *after* dedup&lt;br/&gt;rule ?&lt;br/&gt;&amp;gt; My understanding is that an in-package transaction might be already in&lt;br/&gt;the mempool. Therefore, to compute a correct RBF penalty replacement, the&lt;br/&gt;vsize of this transaction could be discarded lowering the cost of package&lt;br/&gt;RBF.&lt;br/&gt;&lt;br/&gt;I&amp;#39;m proposing that, when a transaction has already been submitted to&lt;br/&gt;mempool, we would ignore both its fees and vsize when calculating package&lt;br/&gt;feerate. In example G2, we shouldn&amp;#39;t count M1 fees after its submission to&lt;br/&gt;mempool, since M1&amp;#39;s fees have already been used to pay for its individual&lt;br/&gt;bandwidth, and it shouldn&amp;#39;t be used again to pay for P2 and P3&amp;#39;s bandwidth.&lt;br/&gt;We also shouldn&amp;#39;t count its vsize, since it has already been paid for.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;gt; I think this is a footgunish API, as if a package issuer send the&lt;br/&gt;multiple-parent-one-child package A,B,C,D where D is the child of A,B,C.&lt;br/&gt;Then try to broadcast the higher-feerate C&amp;#39;&#43;D&amp;#39; package, it should be&lt;br/&gt;rejected. So it&amp;#39;s breaking the naive broadcaster assumption that a&lt;br/&gt;higher-feerate/higher-fee package always replaces ?&lt;br/&gt;&lt;br/&gt;Note that, if C&amp;#39; conflicts with C, it also conflicts with D, since D is a&lt;br/&gt;descendant of C and would thus need to be evicted along with it.&lt;br/&gt;Implicitly, D&amp;#39; would not be in conflict with D.&lt;br/&gt;More generally, this example is surprising to me because I didn&amp;#39;t think&lt;br/&gt;packages would be used to fee-bump replaceable transactions. Do we want the&lt;br/&gt;child to be able to replace mempool transactions as well? This can be&lt;br/&gt;implemented with a bit of additional logic.&lt;br/&gt;&lt;br/&gt;&amp;gt; I think this is unsafe for L2s if counterparties have malleability of the&lt;br/&gt;child transaction. They can block your package replacement by opting-out&lt;br/&gt;from RBF signaling. IIRC, LN&amp;#39;s &amp;#34;anchor output&amp;#34; presents such an ability.&lt;br/&gt;&lt;br/&gt;I&amp;#39;m not sure what you mean? Let&amp;#39;s say we have a package of parent A &#43; child&lt;br/&gt;B, where A is supposed to replace a mempool transaction A&amp;#39;. Are you saying&lt;br/&gt;that counterparties are able to malleate the package child B, or a child of&lt;br/&gt;A&amp;#39;? If they can malleate a child of A&amp;#39;, that shouldn&amp;#39;t matter as long as A&amp;#39;&lt;br/&gt;is signaling replacement. This would be handled identically with full RBF&lt;br/&gt;and what Core currently implements.&lt;br/&gt;&lt;br/&gt;&amp;gt; I think this is an issue brought by the trimming during the dedup phase.&lt;br/&gt;If we preserve the package integrity, only re-using the tx-level checks&lt;br/&gt;results of already in-mempool transactions to gain in CPU time we won&amp;#39;t&lt;br/&gt;have this issue. Package childs can add unconfirmed inputs as long as&lt;br/&gt;they&amp;#39;re in-package, the bip125 rule2 is only evaluated against parents ?&lt;br/&gt;&lt;br/&gt;Sorry, I don&amp;#39;t understand what you mean by &amp;#34;preserve the package&lt;br/&gt;integrity?&amp;#34; Could you elaborate?&lt;br/&gt;&lt;br/&gt;&amp;gt; Let&amp;#39;s say you have in-mempool A, B where A pays 10 sat/vb for 100 vbytes&lt;br/&gt;and B pays 10 sat/vb for 100 vbytes. You have the candidate replacement D&lt;br/&gt;spending both A and C where D pays 15sat/vb for 100 vbytes and C pays 1&lt;br/&gt;sat/vb for 1000 vbytes.&lt;br/&gt;&lt;br/&gt;&amp;gt; Package A &#43; B ancestor score is 10 sat/vb.&lt;br/&gt;&lt;br/&gt;&amp;gt; D has a higher feerate/absolute fee than B.&lt;br/&gt;&lt;br/&gt;&amp;gt; Package A &#43; C &#43; D ancestor score is ~ 3 sat/vb ((A&amp;#39;s 1000 sats &#43; C&amp;#39;s 1000&lt;br/&gt;sats &#43; D&amp;#39;s 1500 sats) / A&amp;#39;s 100 vb &#43; C&amp;#39;s 1000 vb &#43; D&amp;#39;s 100 vb)&lt;br/&gt;&lt;br/&gt;I am in agreement with your calculations but unsure if we disagree on the&lt;br/&gt;expected outcome. Yes, B has an ancestor score of 10sat/vb and D has an&lt;br/&gt;ancestor score of ~2.9sat/vb. Since D&amp;#39;s ancestor score is lower than B&amp;#39;s,&lt;br/&gt;it fails the proposed package RBF Rule #2, so this package would be&lt;br/&gt;rejected. Does this meet your expectations?&lt;br/&gt;&lt;br/&gt;Thank you for linking to projects that might be interested in package relay&lt;br/&gt;:)&lt;br/&gt;&lt;br/&gt;Thanks,&lt;br/&gt;Gloria&lt;br/&gt;&lt;br/&gt;On Mon, Sep 20, 2021 at 12:16 AM Antoine Riard &amp;lt;antoine.riard at gmail.com&amp;gt;&lt;br/&gt;wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hi Gloria,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; A package may contain transactions that are already in the mempool. We&lt;br/&gt;&amp;gt; &amp;gt; remove&lt;br/&gt;&amp;gt; &amp;gt; (&amp;#34;deduplicate&amp;#34;) those transactions from the package for the purposes of&lt;br/&gt;&amp;gt; &amp;gt; package&lt;br/&gt;&amp;gt; &amp;gt; mempool acceptance. If a package is empty after deduplication, we do&lt;br/&gt;&amp;gt; &amp;gt; nothing.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; IIUC, you have a package A&#43;B&#43;C submitted for acceptance and A is already&lt;br/&gt;&amp;gt; in your mempool. You trim out A from the package and then evaluate B&#43;C.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think this might be an issue if A is the higher-fee element of the ABC&lt;br/&gt;&amp;gt; package. B&#43;C package fees might be under the mempool min fee and will be&lt;br/&gt;&amp;gt; rejected, potentially breaking the acceptance expectations of the package&lt;br/&gt;&amp;gt; issuer ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Further, I think the dedup should be done on wtxid, as you might have&lt;br/&gt;&amp;gt; multiple valid witnesses. Though with varying vsizes and as such offering&lt;br/&gt;&amp;gt; different feerates.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; E.g you&amp;#39;re going to evaluate the package A&#43;B and A&amp;#39; is already in your&lt;br/&gt;&amp;gt; mempool with a bigger valid witness. You trim A based on txid, then you&lt;br/&gt;&amp;gt; evaluate A&amp;#39;&#43;B, which fails the fee checks. However, evaluating A&#43;B would&lt;br/&gt;&amp;gt; have been a success.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; AFAICT, the dedup rationale would be to save on CPU time/IO disk, to avoid&lt;br/&gt;&amp;gt; repeated signatures verification and parent UTXOs fetches ? Can we achieve&lt;br/&gt;&amp;gt; the same goal by bypassing tx-level checks for already-in txn while&lt;br/&gt;&amp;gt; conserving the package integrity for package-level checks ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; Note that it&amp;#39;s possible for the parents to be&lt;br/&gt;&amp;gt; &amp;gt; indirect&lt;br/&gt;&amp;gt; &amp;gt; descendants/ancestors of one another, or for parent and child to share a&lt;br/&gt;&amp;gt; &amp;gt; parent,&lt;br/&gt;&amp;gt; &amp;gt; so we cannot make any other topology assumptions.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I&amp;#39;m not clearly understanding the accepted topologies. By &amp;#34;parent and&lt;br/&gt;&amp;gt; child to share a parent&amp;#34;, do you mean the set of transactions A, B, C,&lt;br/&gt;&amp;gt; where B is spending A and C is spending A and B would be correct ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If yes, is there a width-limit introduced or we fallback on&lt;br/&gt;&amp;gt; MAX_PACKAGE_COUNT=25 ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; IIRC, one rationale to come with this topology limitation was to lower the&lt;br/&gt;&amp;gt; DoS risks when potentially deploying p2p packages.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Considering the current Core&amp;#39;s mempool acceptance rules, I think CPFP&lt;br/&gt;&amp;gt; batching is unsafe for LN time-sensitive closure. A malicious tx-relay&lt;br/&gt;&amp;gt; jamming successful on one channel commitment transaction would contamine&lt;br/&gt;&amp;gt; the remaining commitments sharing the same package.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; E.g, you broadcast the package A&#43;B&#43;C&#43;D&#43;E where A,B,C,D are commitment&lt;br/&gt;&amp;gt; transactions and E a shared CPFP. If a malicious A&amp;#39; transaction has a&lt;br/&gt;&amp;gt; better feerate than A, the whole package acceptance will fail. Even if A&amp;#39;&lt;br/&gt;&amp;gt; confirms in the following block,&lt;br/&gt;&amp;gt; the propagation and confirmation of B&#43;C&#43;D have been delayed. This could&lt;br/&gt;&amp;gt; carry on a loss of funds.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; That said, if you&amp;#39;re broadcasting commitment transactions without&lt;br/&gt;&amp;gt; time-sensitive HTLC outputs, I think the batching is effectively a fee&lt;br/&gt;&amp;gt; saving as you don&amp;#39;t have to duplicate the CPFP.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; IMHO, I&amp;#39;m leaning towards deploying during a first phase 1-parent/1-child.&lt;br/&gt;&amp;gt; I think it&amp;#39;s the most conservative step still improving second-layer safety.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; *Rationale*:  It would be incorrect to use the fees of transactions that&lt;br/&gt;&amp;gt; are&lt;br/&gt;&amp;gt; &amp;gt; already in the mempool, as we do not want a transaction&amp;#39;s fees to be&lt;br/&gt;&amp;gt; &amp;gt; double-counted for both its individual RBF and package RBF.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I&amp;#39;m unsure about the logical order of the checks proposed.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If A&#43;B is submitted to replace A&amp;#39;, where A pays 0 sats, B pays 200 sats&lt;br/&gt;&amp;gt; and A&amp;#39; pays 100 sats. If we apply the individual RBF on A, A&#43;B acceptance&lt;br/&gt;&amp;gt; fails. For this reason I think the individual RBF should be bypassed and&lt;br/&gt;&amp;gt; only the package RBF apply ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Note this situation is plausible, with current LN design, your&lt;br/&gt;&amp;gt; counterparty can have a commitment transaction with a better fee just by&lt;br/&gt;&amp;gt; selecting a higher `dust_limit_satoshis` than yours.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; Examples F and G [14] show the same package, but P1 is submitted&lt;br/&gt;&amp;gt; &amp;gt; individually before&lt;br/&gt;&amp;gt; &amp;gt; the package in example G. In example F, we can see that the 300vB package&lt;br/&gt;&amp;gt; &amp;gt; pays&lt;br/&gt;&amp;gt; &amp;gt; an additional 200sat in fees, which is not enough to pay for its own&lt;br/&gt;&amp;gt; &amp;gt; bandwidth&lt;br/&gt;&amp;gt; &amp;gt; (BIP125#4). In example G, we can see that P1 pays enough to replace M1,&lt;br/&gt;&amp;gt; but&lt;br/&gt;&amp;gt; &amp;gt; using P1&amp;#39;s fees again during package submission would make it look like a&lt;br/&gt;&amp;gt; &amp;gt; 300sat&lt;br/&gt;&amp;gt; &amp;gt; increase for a 200vB package. Even including its fees and size would not&lt;br/&gt;&amp;gt; be&lt;br/&gt;&amp;gt; &amp;gt; sufficient in this example, since the 300sat looks like enough for the&lt;br/&gt;&amp;gt; 300vB&lt;br/&gt;&amp;gt; &amp;gt; package. The calculcation after deduplication is 100sat increase for a&lt;br/&gt;&amp;gt; &amp;gt; package&lt;br/&gt;&amp;gt; &amp;gt; of size 200vB, which correctly fails BIP125#4. Assume all transactions&lt;br/&gt;&amp;gt; have&lt;br/&gt;&amp;gt; &amp;gt; a&lt;br/&gt;&amp;gt; &amp;gt; size of 100vB.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; What problem are you trying to solve by the package feerate *after* dedup&lt;br/&gt;&amp;gt; rule ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; My understanding is that an in-package transaction might be already in the&lt;br/&gt;&amp;gt; mempool. Therefore, to compute a correct RBF penalty replacement, the vsize&lt;br/&gt;&amp;gt; of this transaction could be discarded lowering the cost of package RBF.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; If we keep a &amp;#34;safe&amp;#34; dedup mechanism (see my point above), I think this&lt;br/&gt;&amp;gt; discount is justified, as the validation cost of node operators is paid for&lt;br/&gt;&amp;gt; ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; The child cannot replace mempool transactions.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Let&amp;#39;s say you issue package A&#43;B, then package C&#43;B&amp;#39;, where B&amp;#39; is a child of&lt;br/&gt;&amp;gt; both A and C. This rule fails the acceptance of C&#43;B&amp;#39; ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think this is a footgunish API, as if a package issuer send the&lt;br/&gt;&amp;gt; multiple-parent-one-child package A,B,C,D where D is the child of A,B,C.&lt;br/&gt;&amp;gt; Then try to broadcast the higher-feerate C&amp;#39;&#43;D&amp;#39; package, it should be&lt;br/&gt;&amp;gt; rejected. So it&amp;#39;s breaking the naive broadcaster assumption that a&lt;br/&gt;&amp;gt; higher-feerate/higher-fee package always replaces ? And it might be unsafe&lt;br/&gt;&amp;gt; in protocols where states are symmetric. E.g a malicious counterparty&lt;br/&gt;&amp;gt; broadcasts first S&#43;A, then you honestly broadcast S&#43;B, where B pays better&lt;br/&gt;&amp;gt; fees.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; All mempool transactions to be replaced must signal replaceability.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think this is unsafe for L2s if counterparties have malleability of the&lt;br/&gt;&amp;gt; child transaction. They can block your package replacement by opting-out&lt;br/&gt;&amp;gt; from RBF signaling. IIRC, LN&amp;#39;s &amp;#34;anchor output&amp;#34; presents such an ability.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think it&amp;#39;s better to either fix inherited signaling or move towards&lt;br/&gt;&amp;gt; full-rbf.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; if a package parent has already been submitted, it would&lt;br/&gt;&amp;gt; &amp;gt; look&lt;br/&gt;&amp;gt; &amp;gt;like the child is spending a &amp;#34;new&amp;#34; unconfirmed input.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I think this is an issue brought by the trimming during the dedup phase.&lt;br/&gt;&amp;gt; If we preserve the package integrity, only re-using the tx-level checks&lt;br/&gt;&amp;gt; results of already in-mempool transactions to gain in CPU time we won&amp;#39;t&lt;br/&gt;&amp;gt; have this issue. Package childs can add unconfirmed inputs as long as&lt;br/&gt;&amp;gt; they&amp;#39;re in-package, the bip125 rule2 is only evaluated against parents ?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;gt; However, we still achieve the same goal of requiring the&lt;br/&gt;&amp;gt; &amp;gt; replacement&lt;br/&gt;&amp;gt; &amp;gt; transactions to have a ancestor score at least as high as the original&lt;br/&gt;&amp;gt; &amp;gt; ones.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I&amp;#39;m not sure if this holds...&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Let&amp;#39;s say you have in-mempool A, B where A pays 10 sat/vb for 100 vbytes&lt;br/&gt;&amp;gt; and B pays 10 sat/vb for 100 vbytes. You have the candidate replacement D&lt;br/&gt;&amp;gt; spending both A and C where D pays 15sat/vb for 100 vbytes and C pays 1&lt;br/&gt;&amp;gt; sat/vb for 1000 vbytes.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Package A &#43; B ancestor score is 10 sat/vb.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; D has a higher feerate/absolute fee than B.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Package A &#43; C &#43; D ancestor score is ~ 3 sat/vb ((A&amp;#39;s 1000 sats &#43; C&amp;#39;s 1000&lt;br/&gt;&amp;gt; sats &#43; D&amp;#39;s 1500 sats) /&lt;br/&gt;&amp;gt; A&amp;#39;s 100 vb &#43; C&amp;#39;s 1000 vb &#43; D&amp;#39;s 100 vb)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Overall, this is a review through the lenses of LN requirements. I think&lt;br/&gt;&amp;gt; other L2 protocols/applications&lt;br/&gt;&amp;gt; could be candidates to using package accept/relay such as:&lt;br/&gt;&amp;gt; * &lt;a href=&#34;https://github.com/lightninglabs/pool&#34;&gt;https://github.com/lightninglabs/pool&lt;/a&gt;&lt;br/&gt;&amp;gt; * &lt;a href=&#34;https://github.com/discreetlogcontracts/dlcspecs&#34;&gt;https://github.com/discreetlogcontracts/dlcspecs&lt;/a&gt;&lt;br/&gt;&amp;gt; * &lt;a href=&#34;https://github.com/bitcoin-teleport/teleport-transactions/&#34;&gt;https://github.com/bitcoin-teleport/teleport-transactions/&lt;/a&gt;&lt;br/&gt;&amp;gt; * &lt;a href=&#34;https://github.com/sapio-lang/sapio&#34;&gt;https://github.com/sapio-lang/sapio&lt;/a&gt;&lt;br/&gt;&amp;gt; * &lt;a href=&#34;https://github.com/commerceblock/mercury/blob/master/doc/statechains.md&#34;&gt;https://github.com/commerceblock/mercury/blob/master/doc/statechains.md&lt;/a&gt;&lt;br/&gt;&amp;gt; * &lt;a href=&#34;https://github.com/revault/practical-revault&#34;&gt;https://github.com/revault/practical-revault&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thanks for rolling forward the ball on this subject.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Antoine&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Le jeu. 16 sept. 2021 à 03:55, Gloria Zhao via bitcoin-dev &amp;lt;&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&amp;gt; a écrit :&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Hi there,&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; I&amp;#39;m writing to propose a set of mempool policy changes to enable package&lt;br/&gt;&amp;gt;&amp;gt; validation (in preparation for package relay) in Bitcoin Core. These&lt;br/&gt;&amp;gt;&amp;gt; would not&lt;br/&gt;&amp;gt;&amp;gt; be consensus or P2P protocol changes. However, since mempool policy&lt;br/&gt;&amp;gt;&amp;gt; significantly affects transaction propagation, I believe this is relevant&lt;br/&gt;&amp;gt;&amp;gt; for&lt;br/&gt;&amp;gt;&amp;gt; the mailing list.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; My proposal enables packages consisting of multiple parents and 1 child.&lt;br/&gt;&amp;gt;&amp;gt; If you&lt;br/&gt;&amp;gt;&amp;gt; develop software that relies on specific transaction relay assumptions&lt;br/&gt;&amp;gt;&amp;gt; and/or&lt;br/&gt;&amp;gt;&amp;gt; are interested in using package relay in the future, I&amp;#39;m very interested&lt;br/&gt;&amp;gt;&amp;gt; to hear&lt;br/&gt;&amp;gt;&amp;gt; your feedback on the utility or restrictiveness of these package policies&lt;br/&gt;&amp;gt;&amp;gt; for&lt;br/&gt;&amp;gt;&amp;gt; your use cases.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; A draft implementation of this proposal can be found in [Bitcoin Core&lt;br/&gt;&amp;gt;&amp;gt; PR#22290][1].&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; An illustrated version of this post can be found at&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://gist.github.com/glozow/dc4e9d5c5b14ade7cdfac40f43adb18a&#34;&gt;https://gist.github.com/glozow/dc4e9d5c5b14ade7cdfac40f43adb18a&lt;/a&gt;.&lt;br/&gt;&amp;gt;&amp;gt; I have also linked the images below.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## Background&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Feel free to skip this section if you are already familiar with mempool&lt;br/&gt;&amp;gt;&amp;gt; policy&lt;br/&gt;&amp;gt;&amp;gt; and package relay terminology.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Terminology Clarifications&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; * Package = an ordered list of related transactions, representable by a&lt;br/&gt;&amp;gt;&amp;gt; Directed&lt;br/&gt;&amp;gt;&amp;gt;   Acyclic Graph.&lt;br/&gt;&amp;gt;&amp;gt; * Package Feerate = the total modified fees divided by the total virtual&lt;br/&gt;&amp;gt;&amp;gt; size of&lt;br/&gt;&amp;gt;&amp;gt;   all transactions in the package.&lt;br/&gt;&amp;gt;&amp;gt;     - Modified fees = a transaction&amp;#39;s base fees &#43; fee delta applied by&lt;br/&gt;&amp;gt;&amp;gt; the user&lt;br/&gt;&amp;gt;&amp;gt;       with `prioritisetransaction`. As such, we expect this to vary across&lt;br/&gt;&amp;gt;&amp;gt; mempools.&lt;br/&gt;&amp;gt;&amp;gt;     - Virtual Size = the maximum of virtual sizes calculated using [BIP141&lt;br/&gt;&amp;gt;&amp;gt;       virtual size][2] and sigop weight. [Implemented here in Bitcoin&lt;br/&gt;&amp;gt;&amp;gt; Core][3].&lt;br/&gt;&amp;gt;&amp;gt;     - Note that feerate is not necessarily based on the base fees and&lt;br/&gt;&amp;gt;&amp;gt; serialized&lt;br/&gt;&amp;gt;&amp;gt;       size.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; * Fee-Bumping = user/wallet actions that take advantage of miner&lt;br/&gt;&amp;gt;&amp;gt; incentives to&lt;br/&gt;&amp;gt;&amp;gt;   boost a transaction&amp;#39;s candidacy for inclusion in a block, including&lt;br/&gt;&amp;gt;&amp;gt; Child Pays&lt;br/&gt;&amp;gt;&amp;gt; for Parent (CPFP) and [BIP125][12] Replace-by-Fee (RBF). Our intention in&lt;br/&gt;&amp;gt;&amp;gt; mempool policy is to recognize when the new transaction is more&lt;br/&gt;&amp;gt;&amp;gt; economical to&lt;br/&gt;&amp;gt;&amp;gt; mine than the original one(s) but not open DoS vectors, so there are some&lt;br/&gt;&amp;gt;&amp;gt; limitations.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Policy&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The purpose of the mempool is to store the best (to be most&lt;br/&gt;&amp;gt;&amp;gt; incentive-compatible&lt;br/&gt;&amp;gt;&amp;gt; with miners, highest feerate) candidates for inclusion in a block. Miners&lt;br/&gt;&amp;gt;&amp;gt; use&lt;br/&gt;&amp;gt;&amp;gt; the mempool to build block templates. The mempool is also useful as a&lt;br/&gt;&amp;gt;&amp;gt; cache for&lt;br/&gt;&amp;gt;&amp;gt; boosting block relay and validation performance, aiding transaction&lt;br/&gt;&amp;gt;&amp;gt; relay, and&lt;br/&gt;&amp;gt;&amp;gt; generating feerate estimations.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Ideally, all consensus-valid transactions paying reasonable fees should&lt;br/&gt;&amp;gt;&amp;gt; make it&lt;br/&gt;&amp;gt;&amp;gt; to miners through normal transaction relay, without any special&lt;br/&gt;&amp;gt;&amp;gt; connectivity or&lt;br/&gt;&amp;gt;&amp;gt; relationships with miners. On the other hand, nodes do not have unlimited&lt;br/&gt;&amp;gt;&amp;gt; resources, and a P2P network designed to let any honest node broadcast&lt;br/&gt;&amp;gt;&amp;gt; their&lt;br/&gt;&amp;gt;&amp;gt; transactions also exposes the transaction validation engine to DoS&lt;br/&gt;&amp;gt;&amp;gt; attacks from&lt;br/&gt;&amp;gt;&amp;gt; malicious peers.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; As such, for unconfirmed transactions we are considering for our mempool,&lt;br/&gt;&amp;gt;&amp;gt; we&lt;br/&gt;&amp;gt;&amp;gt; apply a set of validation rules in addition to consensus, primarily to&lt;br/&gt;&amp;gt;&amp;gt; protect&lt;br/&gt;&amp;gt;&amp;gt; us from resource exhaustion and aid our efforts to keep the highest fee&lt;br/&gt;&amp;gt;&amp;gt; transactions. We call this mempool _policy_: a set of (configurable,&lt;br/&gt;&amp;gt;&amp;gt; node-specific) rules that transactions must abide by in order to be&lt;br/&gt;&amp;gt;&amp;gt; accepted&lt;br/&gt;&amp;gt;&amp;gt; into our mempool. Transaction &amp;#34;Standardness&amp;#34; rules and mempool&lt;br/&gt;&amp;gt;&amp;gt; restrictions such&lt;br/&gt;&amp;gt;&amp;gt; as &amp;#34;too-long-mempool-chain&amp;#34; are both examples of policy.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Package Relay and Package Mempool Accept&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In transaction relay, we currently consider transactions one at a time for&lt;br/&gt;&amp;gt;&amp;gt; submission to the mempool. This creates a limitation in the node&amp;#39;s&lt;br/&gt;&amp;gt;&amp;gt; ability to&lt;br/&gt;&amp;gt;&amp;gt; determine which transactions have the highest feerates, since we cannot&lt;br/&gt;&amp;gt;&amp;gt; take&lt;br/&gt;&amp;gt;&amp;gt; into account descendants (i.e. cannot use CPFP) until all the&lt;br/&gt;&amp;gt;&amp;gt; transactions are&lt;br/&gt;&amp;gt;&amp;gt; in the mempool. Similarly, we cannot use a transaction&amp;#39;s descendants when&lt;br/&gt;&amp;gt;&amp;gt; considering it for RBF. When an individual transaction does not meet the&lt;br/&gt;&amp;gt;&amp;gt; mempool&lt;br/&gt;&amp;gt;&amp;gt; minimum feerate and the user isn&amp;#39;t able to create a replacement&lt;br/&gt;&amp;gt;&amp;gt; transaction&lt;br/&gt;&amp;gt;&amp;gt; directly, it will not be accepted by mempools.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; This limitation presents a security issue for applications and users&lt;br/&gt;&amp;gt;&amp;gt; relying on&lt;br/&gt;&amp;gt;&amp;gt; time-sensitive transactions. For example, Lightning and other protocols&lt;br/&gt;&amp;gt;&amp;gt; create&lt;br/&gt;&amp;gt;&amp;gt; UTXOs with multiple spending paths, where one counterparty&amp;#39;s spending&lt;br/&gt;&amp;gt;&amp;gt; path opens&lt;br/&gt;&amp;gt;&amp;gt; up after a timelock, and users are protected from cheating scenarios as&lt;br/&gt;&amp;gt;&amp;gt; long as&lt;br/&gt;&amp;gt;&amp;gt; they redeem on-chain in time. A key security assumption is that all&lt;br/&gt;&amp;gt;&amp;gt; parties&amp;#39;&lt;br/&gt;&amp;gt;&amp;gt; transactions will propagate and confirm in a timely manner. This&lt;br/&gt;&amp;gt;&amp;gt; assumption can&lt;br/&gt;&amp;gt;&amp;gt; be broken if fee-bumping does not work as intended.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The end goal for Package Relay is to consider multiple transactions at&lt;br/&gt;&amp;gt;&amp;gt; the same&lt;br/&gt;&amp;gt;&amp;gt; time, e.g. a transaction with its high-fee child. This may help us better&lt;br/&gt;&amp;gt;&amp;gt; determine whether transactions should be accepted to our mempool,&lt;br/&gt;&amp;gt;&amp;gt; especially if&lt;br/&gt;&amp;gt;&amp;gt; they don&amp;#39;t meet fee requirements individually or are better RBF&lt;br/&gt;&amp;gt;&amp;gt; candidates as a&lt;br/&gt;&amp;gt;&amp;gt; package. A combination of changes to mempool validation logic, policy, and&lt;br/&gt;&amp;gt;&amp;gt; transaction relay allows us to better propagate the transactions with the&lt;br/&gt;&amp;gt;&amp;gt; highest package feerates to miners, and makes fee-bumping tools more&lt;br/&gt;&amp;gt;&amp;gt; powerful&lt;br/&gt;&amp;gt;&amp;gt; for users.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The &amp;#34;relay&amp;#34; part of Package Relay suggests P2P messaging changes, but a&lt;br/&gt;&amp;gt;&amp;gt; large&lt;br/&gt;&amp;gt;&amp;gt; part of the changes are in the mempool&amp;#39;s package validation logic. We&lt;br/&gt;&amp;gt;&amp;gt; call this&lt;br/&gt;&amp;gt;&amp;gt; *Package Mempool Accept*.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Previous Work&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; * Given that mempool validation is DoS-sensitive and complex, it would be&lt;br/&gt;&amp;gt;&amp;gt;   dangerous to haphazardly tack on package validation logic. Many efforts&lt;br/&gt;&amp;gt;&amp;gt; have&lt;br/&gt;&amp;gt;&amp;gt; been made to make mempool validation less opaque (see [#16400][4],&lt;br/&gt;&amp;gt;&amp;gt; [#21062][5],&lt;br/&gt;&amp;gt;&amp;gt; [#22675][6], [#22796][7]).&lt;br/&gt;&amp;gt;&amp;gt; * [#20833][8] Added basic capabilities for package validation, test&lt;br/&gt;&amp;gt;&amp;gt; accepts only&lt;br/&gt;&amp;gt;&amp;gt;   (no submission to mempool).&lt;br/&gt;&amp;gt;&amp;gt; * [#21800][9] Implemented package ancestor/descendant limit checks for&lt;br/&gt;&amp;gt;&amp;gt; arbitrary&lt;br/&gt;&amp;gt;&amp;gt;   packages. Still test accepts only.&lt;br/&gt;&amp;gt;&amp;gt; * Previous package relay proposals (see [#16401][10], [#19621][11]).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Existing Package Rules&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; These are in master as introduced in [#20833][8] and [#21800][9]. I&amp;#39;ll&lt;br/&gt;&amp;gt;&amp;gt; consider&lt;br/&gt;&amp;gt;&amp;gt; them as &amp;#34;given&amp;#34; in the rest of this document, though they can be changed,&lt;br/&gt;&amp;gt;&amp;gt; since&lt;br/&gt;&amp;gt;&amp;gt; package validation is test-accept only right now.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1. A package cannot exceed `MAX_PACKAGE_COUNT=25` count and&lt;br/&gt;&amp;gt;&amp;gt; `MAX_PACKAGE_SIZE=101KvB` total size [8]&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;    *Rationale*: This is already enforced as mempool ancestor/descendant&lt;br/&gt;&amp;gt;&amp;gt; limits.&lt;br/&gt;&amp;gt;&amp;gt; Presumably, transactions in a package are all related, so exceeding this&lt;br/&gt;&amp;gt;&amp;gt; limit&lt;br/&gt;&amp;gt;&amp;gt; would mean that the package can either be split up or it wouldn&amp;#39;t pass&lt;br/&gt;&amp;gt;&amp;gt; this&lt;br/&gt;&amp;gt;&amp;gt; mempool policy.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 2. Packages must be topologically sorted: if any dependencies exist&lt;br/&gt;&amp;gt;&amp;gt; between&lt;br/&gt;&amp;gt;&amp;gt; transactions, parents must appear somewhere before children. [8]&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 3. A package cannot have conflicting transactions, i.e. none of them can&lt;br/&gt;&amp;gt;&amp;gt; spend&lt;br/&gt;&amp;gt;&amp;gt; the same inputs. This also means there cannot be duplicate transactions.&lt;br/&gt;&amp;gt;&amp;gt; [8]&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 4. When packages are evaluated against ancestor/descendant limits in a&lt;br/&gt;&amp;gt;&amp;gt; test&lt;br/&gt;&amp;gt;&amp;gt; accept, the union of all of their descendants and ancestors is&lt;br/&gt;&amp;gt;&amp;gt; considered. This&lt;br/&gt;&amp;gt;&amp;gt; is essentially a &amp;#34;worst case&amp;#34; heuristic where every transaction in the&lt;br/&gt;&amp;gt;&amp;gt; package&lt;br/&gt;&amp;gt;&amp;gt; is treated as each other&amp;#39;s ancestor and descendant. [8]&lt;br/&gt;&amp;gt;&amp;gt; Packages for which ancestor/descendant limits are accurately captured by&lt;br/&gt;&amp;gt;&amp;gt; this&lt;br/&gt;&amp;gt;&amp;gt; heuristic: [19]&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; There are also limitations such as the fact that CPFP carve out is not&lt;br/&gt;&amp;gt;&amp;gt; applied&lt;br/&gt;&amp;gt;&amp;gt; to package transactions. #20833 also disables RBF in package validation;&lt;br/&gt;&amp;gt;&amp;gt; this&lt;br/&gt;&amp;gt;&amp;gt; proposal overrides that to allow packages to use RBF.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ## Proposed Changes&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The next step in the Package Mempool Accept project is to implement&lt;br/&gt;&amp;gt;&amp;gt; submission&lt;br/&gt;&amp;gt;&amp;gt; to mempool, initially through RPC only. This allows us to test the&lt;br/&gt;&amp;gt;&amp;gt; submission&lt;br/&gt;&amp;gt;&amp;gt; logic before exposing it on P2P.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Summary&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; - Packages may contain already-in-mempool transactions.&lt;br/&gt;&amp;gt;&amp;gt; - Packages are 2 generations, Multi-Parent-1-Child.&lt;br/&gt;&amp;gt;&amp;gt; - Fee-related checks use the package feerate. This means that wallets can&lt;br/&gt;&amp;gt;&amp;gt; create a package that utilizes CPFP.&lt;br/&gt;&amp;gt;&amp;gt; - Parents are allowed to RBF mempool transactions with a set of rules&lt;br/&gt;&amp;gt;&amp;gt; similar&lt;br/&gt;&amp;gt;&amp;gt;   to BIP125. This enables a combination of CPFP and RBF, where a&lt;br/&gt;&amp;gt;&amp;gt; transaction&amp;#39;s descendant fees pay for replacing mempool conflicts.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; There is a draft implementation in [#22290][1]. It is WIP, but feedback is&lt;br/&gt;&amp;gt;&amp;gt; always welcome.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Details&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; #### Packages May Contain Already-in-Mempool Transactions&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; A package may contain transactions that are already in the mempool. We&lt;br/&gt;&amp;gt;&amp;gt; remove&lt;br/&gt;&amp;gt;&amp;gt; (&amp;#34;deduplicate&amp;#34;) those transactions from the package for the purposes of&lt;br/&gt;&amp;gt;&amp;gt; package&lt;br/&gt;&amp;gt;&amp;gt; mempool acceptance. If a package is empty after deduplication, we do&lt;br/&gt;&amp;gt;&amp;gt; nothing.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; *Rationale*: Mempools vary across the network. It&amp;#39;s possible for a parent&lt;br/&gt;&amp;gt;&amp;gt; to be&lt;br/&gt;&amp;gt;&amp;gt; accepted to the mempool of a peer on its own due to differences in policy&lt;br/&gt;&amp;gt;&amp;gt; and&lt;br/&gt;&amp;gt;&amp;gt; fee market fluctuations. We should not reject or penalize the entire&lt;br/&gt;&amp;gt;&amp;gt; package for&lt;br/&gt;&amp;gt;&amp;gt; an individual transaction as that could be a censorship vector.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; #### Packages Are Multi-Parent-1-Child&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Only packages of a specific topology are permitted. Namely, a package is&lt;br/&gt;&amp;gt;&amp;gt; exactly&lt;br/&gt;&amp;gt;&amp;gt; 1 child with all of its unconfirmed parents. After deduplication, the&lt;br/&gt;&amp;gt;&amp;gt; package&lt;br/&gt;&amp;gt;&amp;gt; may be exactly the same, empty, 1 child, 1 child with just some of its&lt;br/&gt;&amp;gt;&amp;gt; unconfirmed parents, etc. Note that it&amp;#39;s possible for the parents to be&lt;br/&gt;&amp;gt;&amp;gt; indirect&lt;br/&gt;&amp;gt;&amp;gt; descendants/ancestors of one another, or for parent and child to share a&lt;br/&gt;&amp;gt;&amp;gt; parent,&lt;br/&gt;&amp;gt;&amp;gt; so we cannot make any other topology assumptions.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; *Rationale*: This allows for fee-bumping by CPFP. Allowing multiple&lt;br/&gt;&amp;gt;&amp;gt; parents&lt;br/&gt;&amp;gt;&amp;gt; makes it possible to fee-bump a batch of transactions. Restricting&lt;br/&gt;&amp;gt;&amp;gt; packages to a&lt;br/&gt;&amp;gt;&amp;gt; defined topology is also easier to reason about and simplifies the&lt;br/&gt;&amp;gt;&amp;gt; validation&lt;br/&gt;&amp;gt;&amp;gt; logic greatly. Multi-parent-1-child allows us to think of the package as&lt;br/&gt;&amp;gt;&amp;gt; one big&lt;br/&gt;&amp;gt;&amp;gt; transaction, where:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; - Inputs = all the inputs of parents &#43; inputs of the child that come from&lt;br/&gt;&amp;gt;&amp;gt;   confirmed UTXOs&lt;br/&gt;&amp;gt;&amp;gt; - Outputs = all the outputs of the child &#43; all outputs of the parents that&lt;br/&gt;&amp;gt;&amp;gt;   aren&amp;#39;t spent by other transactions in the package&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Examples of packages that follow this rule (variations of example A show&lt;br/&gt;&amp;gt;&amp;gt; some&lt;br/&gt;&amp;gt;&amp;gt; possibilities after deduplication): ![image][15]&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; #### Fee-Related Checks Use Package Feerate&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Package Feerate = the total modified fees divided by the total virtual&lt;br/&gt;&amp;gt;&amp;gt; size of&lt;br/&gt;&amp;gt;&amp;gt; all transactions in the package.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; To meet the two feerate requirements of a mempool, i.e., the&lt;br/&gt;&amp;gt;&amp;gt; pre-configured&lt;br/&gt;&amp;gt;&amp;gt; minimum relay feerate (`minRelayTxFee`) and dynamic mempool minimum&lt;br/&gt;&amp;gt;&amp;gt; feerate, the&lt;br/&gt;&amp;gt;&amp;gt; total package feerate is used instead of the individual feerate. The&lt;br/&gt;&amp;gt;&amp;gt; individual&lt;br/&gt;&amp;gt;&amp;gt; transactions are allowed to be below feerate requirements if the package&lt;br/&gt;&amp;gt;&amp;gt; meets&lt;br/&gt;&amp;gt;&amp;gt; the feerate requirements. For example, the parent(s) in the package can&lt;br/&gt;&amp;gt;&amp;gt; have 0&lt;br/&gt;&amp;gt;&amp;gt; fees but be paid for by the child.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; *Rationale*: This can be thought of as &amp;#34;CPFP within a package,&amp;#34; solving&lt;br/&gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt; issue of a parent not meeting minimum fees on its own. This allows L2&lt;br/&gt;&amp;gt;&amp;gt; applications to adjust their fees at broadcast time instead of&lt;br/&gt;&amp;gt;&amp;gt; overshooting or&lt;br/&gt;&amp;gt;&amp;gt; risking getting stuck/pinned.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; We use the package feerate of the package *after deduplication*.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; *Rationale*:  It would be incorrect to use the fees of transactions that&lt;br/&gt;&amp;gt;&amp;gt; are&lt;br/&gt;&amp;gt;&amp;gt; already in the mempool, as we do not want a transaction&amp;#39;s fees to be&lt;br/&gt;&amp;gt;&amp;gt; double-counted for both its individual RBF and package RBF.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Examples F and G [14] show the same package, but P1 is submitted&lt;br/&gt;&amp;gt;&amp;gt; individually before&lt;br/&gt;&amp;gt;&amp;gt; the package in example G. In example F, we can see that the 300vB package&lt;br/&gt;&amp;gt;&amp;gt; pays&lt;br/&gt;&amp;gt;&amp;gt; an additional 200sat in fees, which is not enough to pay for its own&lt;br/&gt;&amp;gt;&amp;gt; bandwidth&lt;br/&gt;&amp;gt;&amp;gt; (BIP125#4). In example G, we can see that P1 pays enough to replace M1,&lt;br/&gt;&amp;gt;&amp;gt; but&lt;br/&gt;&amp;gt;&amp;gt; using P1&amp;#39;s fees again during package submission would make it look like a&lt;br/&gt;&amp;gt;&amp;gt; 300sat&lt;br/&gt;&amp;gt;&amp;gt; increase for a 200vB package. Even including its fees and size would not&lt;br/&gt;&amp;gt;&amp;gt; be&lt;br/&gt;&amp;gt;&amp;gt; sufficient in this example, since the 300sat looks like enough for the&lt;br/&gt;&amp;gt;&amp;gt; 300vB&lt;br/&gt;&amp;gt;&amp;gt; package. The calculcation after deduplication is 100sat increase for a&lt;br/&gt;&amp;gt;&amp;gt; package&lt;br/&gt;&amp;gt;&amp;gt; of size 200vB, which correctly fails BIP125#4. Assume all transactions&lt;br/&gt;&amp;gt;&amp;gt; have a&lt;br/&gt;&amp;gt;&amp;gt; size of 100vB.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; #### Package RBF&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; If a package meets feerate requirements as a package, the parents in the&lt;br/&gt;&amp;gt;&amp;gt; transaction are allowed to replace-by-fee mempool transactions. The child&lt;br/&gt;&amp;gt;&amp;gt; cannot&lt;br/&gt;&amp;gt;&amp;gt; replace mempool transactions. Multiple transactions can replace the same&lt;br/&gt;&amp;gt;&amp;gt; transaction, but in order to be valid, none of the transactions can try to&lt;br/&gt;&amp;gt;&amp;gt; replace an ancestor of another transaction in the same package (which&lt;br/&gt;&amp;gt;&amp;gt; would thus&lt;br/&gt;&amp;gt;&amp;gt; make its inputs unavailable).&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; *Rationale*: Even if we are using package feerate, a package will not&lt;br/&gt;&amp;gt;&amp;gt; propagate&lt;br/&gt;&amp;gt;&amp;gt; as intended if RBF still requires each individual transaction to meet the&lt;br/&gt;&amp;gt;&amp;gt; feerate requirements.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; We use a set of rules slightly modified from BIP125 as follows:&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ##### Signaling (Rule #1)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; All mempool transactions to be replaced must signal replaceability.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; *Rationale*: Package RBF signaling logic should be the same for package&lt;br/&gt;&amp;gt;&amp;gt; RBF and&lt;br/&gt;&amp;gt;&amp;gt; single transaction acceptance. This would be updated if single transaction&lt;br/&gt;&amp;gt;&amp;gt; validation moves to full RBF.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ##### New Unconfirmed Inputs (Rule #2)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; A package may include new unconfirmed inputs, but the ancestor feerate of&lt;br/&gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt; child must be at least as high as the ancestor feerates of every&lt;br/&gt;&amp;gt;&amp;gt; transaction&lt;br/&gt;&amp;gt;&amp;gt; being replaced. This is contrary to BIP125#2, which states &amp;#34;The&lt;br/&gt;&amp;gt;&amp;gt; replacement&lt;br/&gt;&amp;gt;&amp;gt; transaction may only include an unconfirmed input if that input was&lt;br/&gt;&amp;gt;&amp;gt; included in&lt;br/&gt;&amp;gt;&amp;gt; one of the original transactions. (An unconfirmed input spends an output&lt;br/&gt;&amp;gt;&amp;gt; from a&lt;br/&gt;&amp;gt;&amp;gt; currently-unconfirmed transaction.)&amp;#34;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; *Rationale*: The purpose of BIP125#2 is to ensure that the replacement&lt;br/&gt;&amp;gt;&amp;gt; transaction has a higher ancestor score than the original transaction(s)&lt;br/&gt;&amp;gt;&amp;gt; (see&lt;br/&gt;&amp;gt;&amp;gt; [comment][13]). Example H [16] shows how adding a new unconfirmed input&lt;br/&gt;&amp;gt;&amp;gt; can lower the&lt;br/&gt;&amp;gt;&amp;gt; ancestor score of the replacement transaction. P1 is trying to replace&lt;br/&gt;&amp;gt;&amp;gt; M1, and&lt;br/&gt;&amp;gt;&amp;gt; spends an unconfirmed output of M2. P1 pays 800sat, M1 pays 600sat, and&lt;br/&gt;&amp;gt;&amp;gt; M2 pays&lt;br/&gt;&amp;gt;&amp;gt; 100sat. Assume all transactions have a size of 100vB. While, in&lt;br/&gt;&amp;gt;&amp;gt; isolation, P1&lt;br/&gt;&amp;gt;&amp;gt; looks like a better mining candidate than M1, it must be mined with M2,&lt;br/&gt;&amp;gt;&amp;gt; so its&lt;br/&gt;&amp;gt;&amp;gt; ancestor feerate is actually 4.5sat/vB.  This is lower than M1&amp;#39;s ancestor&lt;br/&gt;&amp;gt;&amp;gt; feerate, which is 6sat/vB.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; In package RBF, the rule analogous to BIP125#2 would be &amp;#34;none of the&lt;br/&gt;&amp;gt;&amp;gt; transactions in the package can spend new unconfirmed inputs.&amp;#34; Example J&lt;br/&gt;&amp;gt;&amp;gt; [17] shows&lt;br/&gt;&amp;gt;&amp;gt; why, if any of the package transactions have ancestors, package feerate&lt;br/&gt;&amp;gt;&amp;gt; is no&lt;br/&gt;&amp;gt;&amp;gt; longer accurate. Even though M2 and M3 are not ancestors of P1 (which is&lt;br/&gt;&amp;gt;&amp;gt; the&lt;br/&gt;&amp;gt;&amp;gt; replacement transaction in an RBF), we&amp;#39;re actually interested in the&lt;br/&gt;&amp;gt;&amp;gt; entire&lt;br/&gt;&amp;gt;&amp;gt; package. A miner should mine M1 which is 5sat/vB instead of M2, M3, P1,&lt;br/&gt;&amp;gt;&amp;gt; P2, and&lt;br/&gt;&amp;gt;&amp;gt; P3, which is only 4sat/vB. The Package RBF rule cannot be loosened to&lt;br/&gt;&amp;gt;&amp;gt; only allow&lt;br/&gt;&amp;gt;&amp;gt; the child to have new unconfirmed inputs, either, because it can still&lt;br/&gt;&amp;gt;&amp;gt; cause us&lt;br/&gt;&amp;gt;&amp;gt; to overestimate the package&amp;#39;s ancestor score.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; However, enforcing a rule analogous to BIP125#2 would not only make&lt;br/&gt;&amp;gt;&amp;gt; Package RBF&lt;br/&gt;&amp;gt;&amp;gt; less useful, but would also break Package RBF for packages with parents&lt;br/&gt;&amp;gt;&amp;gt; already&lt;br/&gt;&amp;gt;&amp;gt; in the mempool: if a package parent has already been submitted, it would&lt;br/&gt;&amp;gt;&amp;gt; look&lt;br/&gt;&amp;gt;&amp;gt; like the child is spending a &amp;#34;new&amp;#34; unconfirmed input. In example K [18],&lt;br/&gt;&amp;gt;&amp;gt; we&amp;#39;re&lt;br/&gt;&amp;gt;&amp;gt; looking to replace M1 with the entire package including P1, P2, and P3.&lt;br/&gt;&amp;gt;&amp;gt; We must&lt;br/&gt;&amp;gt;&amp;gt; consider the case where one of the parents is already in the mempool (in&lt;br/&gt;&amp;gt;&amp;gt; this&lt;br/&gt;&amp;gt;&amp;gt; case, P2), which means we must allow P3 to have new unconfirmed inputs.&lt;br/&gt;&amp;gt;&amp;gt; However,&lt;br/&gt;&amp;gt;&amp;gt; M2 lowers the ancestor score of P3 to 4.3sat/vB, so we should not replace&lt;br/&gt;&amp;gt;&amp;gt; M1&lt;br/&gt;&amp;gt;&amp;gt; with this package.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Thus, the package RBF rule regarding new unconfirmed inputs is less&lt;br/&gt;&amp;gt;&amp;gt; strict than&lt;br/&gt;&amp;gt;&amp;gt; BIP125#2. However, we still achieve the same goal of requiring the&lt;br/&gt;&amp;gt;&amp;gt; replacement&lt;br/&gt;&amp;gt;&amp;gt; transactions to have a ancestor score at least as high as the original&lt;br/&gt;&amp;gt;&amp;gt; ones. As&lt;br/&gt;&amp;gt;&amp;gt; a result, the entire package is required to be a higher feerate mining&lt;br/&gt;&amp;gt;&amp;gt; candidate&lt;br/&gt;&amp;gt;&amp;gt; than each of the replaced transactions.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; Another note: the [comment][13] above the BIP125#2 code in the original&lt;br/&gt;&amp;gt;&amp;gt; RBF&lt;br/&gt;&amp;gt;&amp;gt; implementation suggests that the rule was intended to be temporary.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ##### Absolute Fee (Rule #3)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The package must increase the absolute fee of the mempool, i.e. the total&lt;br/&gt;&amp;gt;&amp;gt; fees&lt;br/&gt;&amp;gt;&amp;gt; of the package must be higher than the absolute fees of the mempool&lt;br/&gt;&amp;gt;&amp;gt; transactions&lt;br/&gt;&amp;gt;&amp;gt; it replaces. Combined with the CPFP rule above, this differs from BIP125&lt;br/&gt;&amp;gt;&amp;gt; Rule #3&lt;br/&gt;&amp;gt;&amp;gt; - an individual transaction in the package may have lower fees than the&lt;br/&gt;&amp;gt;&amp;gt;   transaction(s) it is replacing. In fact, it may have 0 fees, and the&lt;br/&gt;&amp;gt;&amp;gt; child&lt;br/&gt;&amp;gt;&amp;gt; pays for RBF.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ##### Feerate (Rule #4)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The package must pay for its own bandwidth; the package feerate must be&lt;br/&gt;&amp;gt;&amp;gt; higher&lt;br/&gt;&amp;gt;&amp;gt; than the replaced transactions by at least minimum relay feerate&lt;br/&gt;&amp;gt;&amp;gt; (`incrementalRelayFee`). Combined with the CPFP rule above, this differs&lt;br/&gt;&amp;gt;&amp;gt; from&lt;br/&gt;&amp;gt;&amp;gt; BIP125 Rule #4 - an individual transaction in the package can have a lower&lt;br/&gt;&amp;gt;&amp;gt; feerate than the transaction(s) it is replacing. In fact, it may have 0&lt;br/&gt;&amp;gt;&amp;gt; fees,&lt;br/&gt;&amp;gt;&amp;gt; and the child pays for RBF.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ##### Total Number of Replaced Transactions (Rule #5)&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; The package cannot replace more than 100 mempool transactions. This is&lt;br/&gt;&amp;gt;&amp;gt; identical&lt;br/&gt;&amp;gt;&amp;gt; to BIP125 Rule #5.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; ### Expected FAQs&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 1. Is it possible for only some of the package to make it into the&lt;br/&gt;&amp;gt;&amp;gt; mempool?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;    Yes, it is. However, since we evict transactions from the mempool by&lt;br/&gt;&amp;gt;&amp;gt; descendant score and the package child is supposed to be sponsoring the&lt;br/&gt;&amp;gt;&amp;gt; fees of&lt;br/&gt;&amp;gt;&amp;gt; its parents, the most common scenario would be all-or-nothing. This is&lt;br/&gt;&amp;gt;&amp;gt; incentive-compatible. In fact, to be conservative, package validation&lt;br/&gt;&amp;gt;&amp;gt; should&lt;br/&gt;&amp;gt;&amp;gt; begin by trying to submit all of the transactions individually, and only&lt;br/&gt;&amp;gt;&amp;gt; use the&lt;br/&gt;&amp;gt;&amp;gt; package mempool acceptance logic if the parents fail due to low feerate.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; 2. Should we allow packages to contain already-confirmed transactions?&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt;     No, for practical reasons. In mempool validation, we actually aren&amp;#39;t&lt;br/&gt;&amp;gt;&amp;gt; able to&lt;br/&gt;&amp;gt;&amp;gt; tell with 100% confidence if we are looking at a transaction that has&lt;br/&gt;&amp;gt;&amp;gt; already&lt;br/&gt;&amp;gt;&amp;gt; confirmed, because we look up inputs using a UTXO set. If we have&lt;br/&gt;&amp;gt;&amp;gt; historical&lt;br/&gt;&amp;gt;&amp;gt; block data, it&amp;#39;s possible to look for it, but this is inefficient, not&lt;br/&gt;&amp;gt;&amp;gt; always&lt;br/&gt;&amp;gt;&amp;gt; possible for pruning nodes, and unnecessary because we&amp;#39;re not going to do&lt;br/&gt;&amp;gt;&amp;gt; anything with the transaction anyway. As such, we already have the&lt;br/&gt;&amp;gt;&amp;gt; expectation&lt;br/&gt;&amp;gt;&amp;gt; that transaction relay is somewhat &amp;#34;stateful&amp;#34; i.e. nobody should be&lt;br/&gt;&amp;gt;&amp;gt; relaying&lt;br/&gt;&amp;gt;&amp;gt; transactions that have already been confirmed. Similarly, we shouldn&amp;#39;t be&lt;br/&gt;&amp;gt;&amp;gt; relaying packages that contain already-confirmed transactions.&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&amp;gt; [1]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22290&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22290&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [2]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bips/blob/1f0b563738199ca60d32b4ba779797fc97d040fe/bip-0141.mediawiki#transaction-size-calculations&#34;&gt;https://github.com/bitcoin/bips/blob/1f0b563738199ca60d32b4ba779797fc97d040fe/bip-0141.mediawiki#transaction-size-calculations&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [3]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bitcoin/blob/94f83534e4b771944af7d9ed0f40746f392eb75e/src/policy/policy.cpp#L282&#34;&gt;https://github.com/bitcoin/bitcoin/blob/94f83534e4b771944af7d9ed0f40746f392eb75e/src/policy/policy.cpp#L282&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [4]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/16400&#34;&gt;https://github.com/bitcoin/bitcoin/pull/16400&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [5]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/21062&#34;&gt;https://github.com/bitcoin/bitcoin/pull/21062&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [6]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22675&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22675&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [7]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22796&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22796&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [8]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/20833&#34;&gt;https://github.com/bitcoin/bitcoin/pull/20833&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [9]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/21800&#34;&gt;https://github.com/bitcoin/bitcoin/pull/21800&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [10]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/16401&#34;&gt;https://github.com/bitcoin/bitcoin/pull/16401&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [11]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/19621&#34;&gt;https://github.com/bitcoin/bitcoin/pull/19621&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [12]: &lt;a href=&#34;https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki&#34;&gt;https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [13]:&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/6871/files#diff-34d21af3c614ea3cee120df276c9c4ae95053830d7f1d3deaf009a4625409ad2R1101-R1104&#34;&gt;https://github.com/bitcoin/bitcoin/pull/6871/files#diff-34d21af3c614ea3cee120df276c9c4ae95053830d7f1d3deaf009a4625409ad2R1101-R1104&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt; [14]:&lt;br/&gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133567078-075a971c-0619-4339-9168-b41fd2b90c28.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt; [15]:&lt;br/&gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/132856734-fc17da75-f875-44bb-b954-cb7a1725cc0d.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt; [16]:&lt;br/&gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133567347-a3e2e4a8-ae9c-49f8-abb9-81e8e0aba224.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt; [17]:&lt;br/&gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133567370-21566d0e-36c8-4831-b1a8-706634540af3.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt; [18]:&lt;br/&gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133567444-bfff1142-439f-4547-800a-2ba2b0242bcb.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt; [19]:&lt;br/&gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133456219-0bb447cb-dcb4-4a31-b9c1-7d86205b68bc.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt; [20]:&lt;br/&gt;&amp;gt;&amp;gt;  &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/132857787-7b7c6f56-af96-44c8-8d78-983719888c19.png&#34;&gt; &lt;br/&gt;&amp;gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20210920/09a51edf/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20210920/09a51edf/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-08T00:59:16&#43;02:00</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsqgxky2s8mesrvzksc3n286xykqce8gjvy68rpq2t5r7jegm37degzyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2q3zs00p</id>
    
      <title type="html">📅 Original date posted:2021-09-16 📝 Original message:Hi ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsqgxky2s8mesrvzksc3n286xykqce8gjvy68rpq2t5r7jegm37degzyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2q3zs00p" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsg94te9zq3mt0nyv6ypxh24vsvqapy7myk84jc7fns8n26x7vjaxssst2l6&#39;&gt;nevent1q…t2l6&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2021-09-16&lt;br/&gt;📝 Original message:Hi there,&lt;br/&gt;&lt;br/&gt;I&amp;#39;m writing to propose a set of mempool policy changes to enable package&lt;br/&gt;validation (in preparation for package relay) in Bitcoin Core. These would&lt;br/&gt;not&lt;br/&gt;be consensus or P2P protocol changes. However, since mempool policy&lt;br/&gt;significantly affects transaction propagation, I believe this is relevant&lt;br/&gt;for&lt;br/&gt;the mailing list.&lt;br/&gt;&lt;br/&gt;My proposal enables packages consisting of multiple parents and 1 child. If&lt;br/&gt;you&lt;br/&gt;develop software that relies on specific transaction relay assumptions&lt;br/&gt;and/or&lt;br/&gt;are interested in using package relay in the future, I&amp;#39;m very interested to&lt;br/&gt;hear&lt;br/&gt;your feedback on the utility or restrictiveness of these package policies&lt;br/&gt;for&lt;br/&gt;your use cases.&lt;br/&gt;&lt;br/&gt;A draft implementation of this proposal can be found in [Bitcoin Core&lt;br/&gt;PR#22290][1].&lt;br/&gt;&lt;br/&gt;An illustrated version of this post can be found at&lt;br/&gt;&lt;a href=&#34;https://gist.github.com/glozow/dc4e9d5c5b14ade7cdfac40f43adb18a&#34;&gt;https://gist.github.com/glozow/dc4e9d5c5b14ade7cdfac40f43adb18a&lt;/a&gt;.&lt;br/&gt;I have also linked the images below.&lt;br/&gt;&lt;br/&gt;## Background&lt;br/&gt;&lt;br/&gt;Feel free to skip this section if you are already familiar with mempool&lt;br/&gt;policy&lt;br/&gt;and package relay terminology.&lt;br/&gt;&lt;br/&gt;### Terminology Clarifications&lt;br/&gt;&lt;br/&gt;* Package = an ordered list of related transactions, representable by a&lt;br/&gt;Directed&lt;br/&gt;  Acyclic Graph.&lt;br/&gt;* Package Feerate = the total modified fees divided by the total virtual&lt;br/&gt;size of&lt;br/&gt;  all transactions in the package.&lt;br/&gt;    - Modified fees = a transaction&amp;#39;s base fees &#43; fee delta applied by the&lt;br/&gt;user&lt;br/&gt;      with `prioritisetransaction`. As such, we expect this to vary across&lt;br/&gt;mempools.&lt;br/&gt;    - Virtual Size = the maximum of virtual sizes calculated using [BIP141&lt;br/&gt;      virtual size][2] and sigop weight. [Implemented here in Bitcoin&lt;br/&gt;Core][3].&lt;br/&gt;    - Note that feerate is not necessarily based on the base fees and&lt;br/&gt;serialized&lt;br/&gt;      size.&lt;br/&gt;&lt;br/&gt;* Fee-Bumping = user/wallet actions that take advantage of miner incentives&lt;br/&gt;to&lt;br/&gt;  boost a transaction&amp;#39;s candidacy for inclusion in a block, including Child&lt;br/&gt;Pays&lt;br/&gt;for Parent (CPFP) and [BIP125][12] Replace-by-Fee (RBF). Our intention in&lt;br/&gt;mempool policy is to recognize when the new transaction is more economical&lt;br/&gt;to&lt;br/&gt;mine than the original one(s) but not open DoS vectors, so there are some&lt;br/&gt;limitations.&lt;br/&gt;&lt;br/&gt;### Policy&lt;br/&gt;&lt;br/&gt;The purpose of the mempool is to store the best (to be most&lt;br/&gt;incentive-compatible&lt;br/&gt;with miners, highest feerate) candidates for inclusion in a block. Miners&lt;br/&gt;use&lt;br/&gt;the mempool to build block templates. The mempool is also useful as a cache&lt;br/&gt;for&lt;br/&gt;boosting block relay and validation performance, aiding transaction relay,&lt;br/&gt;and&lt;br/&gt;generating feerate estimations.&lt;br/&gt;&lt;br/&gt;Ideally, all consensus-valid transactions paying reasonable fees should&lt;br/&gt;make it&lt;br/&gt;to miners through normal transaction relay, without any special&lt;br/&gt;connectivity or&lt;br/&gt;relationships with miners. On the other hand, nodes do not have unlimited&lt;br/&gt;resources, and a P2P network designed to let any honest node broadcast their&lt;br/&gt;transactions also exposes the transaction validation engine to DoS attacks&lt;br/&gt;from&lt;br/&gt;malicious peers.&lt;br/&gt;&lt;br/&gt;As such, for unconfirmed transactions we are considering for our mempool, we&lt;br/&gt;apply a set of validation rules in addition to consensus, primarily to&lt;br/&gt;protect&lt;br/&gt;us from resource exhaustion and aid our efforts to keep the highest fee&lt;br/&gt;transactions. We call this mempool _policy_: a set of (configurable,&lt;br/&gt;node-specific) rules that transactions must abide by in order to be accepted&lt;br/&gt;into our mempool. Transaction &amp;#34;Standardness&amp;#34; rules and mempool restrictions&lt;br/&gt;such&lt;br/&gt;as &amp;#34;too-long-mempool-chain&amp;#34; are both examples of policy.&lt;br/&gt;&lt;br/&gt;### Package Relay and Package Mempool Accept&lt;br/&gt;&lt;br/&gt;In transaction relay, we currently consider transactions one at a time for&lt;br/&gt;submission to the mempool. This creates a limitation in the node&amp;#39;s ability&lt;br/&gt;to&lt;br/&gt;determine which transactions have the highest feerates, since we cannot take&lt;br/&gt;into account descendants (i.e. cannot use CPFP) until all the transactions&lt;br/&gt;are&lt;br/&gt;in the mempool. Similarly, we cannot use a transaction&amp;#39;s descendants when&lt;br/&gt;considering it for RBF. When an individual transaction does not meet the&lt;br/&gt;mempool&lt;br/&gt;minimum feerate and the user isn&amp;#39;t able to create a replacement transaction&lt;br/&gt;directly, it will not be accepted by mempools.&lt;br/&gt;&lt;br/&gt;This limitation presents a security issue for applications and users&lt;br/&gt;relying on&lt;br/&gt;time-sensitive transactions. For example, Lightning and other protocols&lt;br/&gt;create&lt;br/&gt;UTXOs with multiple spending paths, where one counterparty&amp;#39;s spending path&lt;br/&gt;opens&lt;br/&gt;up after a timelock, and users are protected from cheating scenarios as&lt;br/&gt;long as&lt;br/&gt;they redeem on-chain in time. A key security assumption is that all parties&amp;#39;&lt;br/&gt;transactions will propagate and confirm in a timely manner. This assumption&lt;br/&gt;can&lt;br/&gt;be broken if fee-bumping does not work as intended.&lt;br/&gt;&lt;br/&gt;The end goal for Package Relay is to consider multiple transactions at the&lt;br/&gt;same&lt;br/&gt;time, e.g. a transaction with its high-fee child. This may help us better&lt;br/&gt;determine whether transactions should be accepted to our mempool,&lt;br/&gt;especially if&lt;br/&gt;they don&amp;#39;t meet fee requirements individually or are better RBF candidates&lt;br/&gt;as a&lt;br/&gt;package. A combination of changes to mempool validation logic, policy, and&lt;br/&gt;transaction relay allows us to better propagate the transactions with the&lt;br/&gt;highest package feerates to miners, and makes fee-bumping tools more&lt;br/&gt;powerful&lt;br/&gt;for users.&lt;br/&gt;&lt;br/&gt;The &amp;#34;relay&amp;#34; part of Package Relay suggests P2P messaging changes, but a&lt;br/&gt;large&lt;br/&gt;part of the changes are in the mempool&amp;#39;s package validation logic. We call&lt;br/&gt;this&lt;br/&gt;*Package Mempool Accept*.&lt;br/&gt;&lt;br/&gt;### Previous Work&lt;br/&gt;&lt;br/&gt;* Given that mempool validation is DoS-sensitive and complex, it would be&lt;br/&gt;  dangerous to haphazardly tack on package validation logic. Many efforts&lt;br/&gt;have&lt;br/&gt;been made to make mempool validation less opaque (see [#16400][4],&lt;br/&gt;[#21062][5],&lt;br/&gt;[#22675][6], [#22796][7]).&lt;br/&gt;* [#20833][8] Added basic capabilities for package validation, test accepts&lt;br/&gt;only&lt;br/&gt;  (no submission to mempool).&lt;br/&gt;* [#21800][9] Implemented package ancestor/descendant limit checks for&lt;br/&gt;arbitrary&lt;br/&gt;  packages. Still test accepts only.&lt;br/&gt;* Previous package relay proposals (see [#16401][10], [#19621][11]).&lt;br/&gt;&lt;br/&gt;### Existing Package Rules&lt;br/&gt;&lt;br/&gt;These are in master as introduced in [#20833][8] and [#21800][9]. I&amp;#39;ll&lt;br/&gt;consider&lt;br/&gt;them as &amp;#34;given&amp;#34; in the rest of this document, though they can be changed,&lt;br/&gt;since&lt;br/&gt;package validation is test-accept only right now.&lt;br/&gt;&lt;br/&gt;1. A package cannot exceed `MAX_PACKAGE_COUNT=25` count and&lt;br/&gt;`MAX_PACKAGE_SIZE=101KvB` total size [8]&lt;br/&gt;&lt;br/&gt;   *Rationale*: This is already enforced as mempool ancestor/descendant&lt;br/&gt;limits.&lt;br/&gt;Presumably, transactions in a package are all related, so exceeding this&lt;br/&gt;limit&lt;br/&gt;would mean that the package can either be split up or it wouldn&amp;#39;t pass this&lt;br/&gt;mempool policy.&lt;br/&gt;&lt;br/&gt;2. Packages must be topologically sorted: if any dependencies exist between&lt;br/&gt;transactions, parents must appear somewhere before children. [8]&lt;br/&gt;&lt;br/&gt;3. A package cannot have conflicting transactions, i.e. none of them can&lt;br/&gt;spend&lt;br/&gt;the same inputs. This also means there cannot be duplicate transactions. [8]&lt;br/&gt;&lt;br/&gt;4. When packages are evaluated against ancestor/descendant limits in a test&lt;br/&gt;accept, the union of all of their descendants and ancestors is considered.&lt;br/&gt;This&lt;br/&gt;is essentially a &amp;#34;worst case&amp;#34; heuristic where every transaction in the&lt;br/&gt;package&lt;br/&gt;is treated as each other&amp;#39;s ancestor and descendant. [8]&lt;br/&gt;Packages for which ancestor/descendant limits are accurately captured by&lt;br/&gt;this&lt;br/&gt;heuristic: [19]&lt;br/&gt;&lt;br/&gt;There are also limitations such as the fact that CPFP carve out is not&lt;br/&gt;applied&lt;br/&gt;to package transactions. #20833 also disables RBF in package validation;&lt;br/&gt;this&lt;br/&gt;proposal overrides that to allow packages to use RBF.&lt;br/&gt;&lt;br/&gt;## Proposed Changes&lt;br/&gt;&lt;br/&gt;The next step in the Package Mempool Accept project is to implement&lt;br/&gt;submission&lt;br/&gt;to mempool, initially through RPC only. This allows us to test the&lt;br/&gt;submission&lt;br/&gt;logic before exposing it on P2P.&lt;br/&gt;&lt;br/&gt;### Summary&lt;br/&gt;&lt;br/&gt;- Packages may contain already-in-mempool transactions.&lt;br/&gt;- Packages are 2 generations, Multi-Parent-1-Child.&lt;br/&gt;- Fee-related checks use the package feerate. This means that wallets can&lt;br/&gt;create a package that utilizes CPFP.&lt;br/&gt;- Parents are allowed to RBF mempool transactions with a set of rules&lt;br/&gt;similar&lt;br/&gt;  to BIP125. This enables a combination of CPFP and RBF, where a&lt;br/&gt;transaction&amp;#39;s descendant fees pay for replacing mempool conflicts.&lt;br/&gt;&lt;br/&gt;There is a draft implementation in [#22290][1]. It is WIP, but feedback is&lt;br/&gt;always welcome.&lt;br/&gt;&lt;br/&gt;### Details&lt;br/&gt;&lt;br/&gt;#### Packages May Contain Already-in-Mempool Transactions&lt;br/&gt;&lt;br/&gt;A package may contain transactions that are already in the mempool. We&lt;br/&gt;remove&lt;br/&gt;(&amp;#34;deduplicate&amp;#34;) those transactions from the package for the purposes of&lt;br/&gt;package&lt;br/&gt;mempool acceptance. If a package is empty after deduplication, we do&lt;br/&gt;nothing.&lt;br/&gt;&lt;br/&gt;*Rationale*: Mempools vary across the network. It&amp;#39;s possible for a parent&lt;br/&gt;to be&lt;br/&gt;accepted to the mempool of a peer on its own due to differences in policy&lt;br/&gt;and&lt;br/&gt;fee market fluctuations. We should not reject or penalize the entire&lt;br/&gt;package for&lt;br/&gt;an individual transaction as that could be a censorship vector.&lt;br/&gt;&lt;br/&gt;#### Packages Are Multi-Parent-1-Child&lt;br/&gt;&lt;br/&gt;Only packages of a specific topology are permitted. Namely, a package is&lt;br/&gt;exactly&lt;br/&gt;1 child with all of its unconfirmed parents. After deduplication, the&lt;br/&gt;package&lt;br/&gt;may be exactly the same, empty, 1 child, 1 child with just some of its&lt;br/&gt;unconfirmed parents, etc. Note that it&amp;#39;s possible for the parents to be&lt;br/&gt;indirect&lt;br/&gt;descendants/ancestors of one another, or for parent and child to share a&lt;br/&gt;parent,&lt;br/&gt;so we cannot make any other topology assumptions.&lt;br/&gt;&lt;br/&gt;*Rationale*: This allows for fee-bumping by CPFP. Allowing multiple parents&lt;br/&gt;makes it possible to fee-bump a batch of transactions. Restricting packages&lt;br/&gt;to a&lt;br/&gt;defined topology is also easier to reason about and simplifies the&lt;br/&gt;validation&lt;br/&gt;logic greatly. Multi-parent-1-child allows us to think of the package as&lt;br/&gt;one big&lt;br/&gt;transaction, where:&lt;br/&gt;&lt;br/&gt;- Inputs = all the inputs of parents &#43; inputs of the child that come from&lt;br/&gt;  confirmed UTXOs&lt;br/&gt;- Outputs = all the outputs of the child &#43; all outputs of the parents that&lt;br/&gt;  aren&amp;#39;t spent by other transactions in the package&lt;br/&gt;&lt;br/&gt;Examples of packages that follow this rule (variations of example A show&lt;br/&gt;some&lt;br/&gt;possibilities after deduplication): ![image][15]&lt;br/&gt;&lt;br/&gt;#### Fee-Related Checks Use Package Feerate&lt;br/&gt;&lt;br/&gt;Package Feerate = the total modified fees divided by the total virtual size&lt;br/&gt;of&lt;br/&gt;all transactions in the package.&lt;br/&gt;&lt;br/&gt;To meet the two feerate requirements of a mempool, i.e., the pre-configured&lt;br/&gt;minimum relay feerate (`minRelayTxFee`) and dynamic mempool minimum&lt;br/&gt;feerate, the&lt;br/&gt;total package feerate is used instead of the individual feerate. The&lt;br/&gt;individual&lt;br/&gt;transactions are allowed to be below feerate requirements if the package&lt;br/&gt;meets&lt;br/&gt;the feerate requirements. For example, the parent(s) in the package can&lt;br/&gt;have 0&lt;br/&gt;fees but be paid for by the child.&lt;br/&gt;&lt;br/&gt;*Rationale*: This can be thought of as &amp;#34;CPFP within a package,&amp;#34; solving the&lt;br/&gt;issue of a parent not meeting minimum fees on its own. This allows L2&lt;br/&gt;applications to adjust their fees at broadcast time instead of overshooting&lt;br/&gt;or&lt;br/&gt;risking getting stuck/pinned.&lt;br/&gt;&lt;br/&gt;We use the package feerate of the package *after deduplication*.&lt;br/&gt;&lt;br/&gt;*Rationale*:  It would be incorrect to use the fees of transactions that are&lt;br/&gt;already in the mempool, as we do not want a transaction&amp;#39;s fees to be&lt;br/&gt;double-counted for both its individual RBF and package RBF.&lt;br/&gt;&lt;br/&gt;Examples F and G [14] show the same package, but P1 is submitted&lt;br/&gt;individually before&lt;br/&gt;the package in example G. In example F, we can see that the 300vB package&lt;br/&gt;pays&lt;br/&gt;an additional 200sat in fees, which is not enough to pay for its own&lt;br/&gt;bandwidth&lt;br/&gt;(BIP125#4). In example G, we can see that P1 pays enough to replace M1, but&lt;br/&gt;using P1&amp;#39;s fees again during package submission would make it look like a&lt;br/&gt;300sat&lt;br/&gt;increase for a 200vB package. Even including its fees and size would not be&lt;br/&gt;sufficient in this example, since the 300sat looks like enough for the 300vB&lt;br/&gt;package. The calculcation after deduplication is 100sat increase for a&lt;br/&gt;package&lt;br/&gt;of size 200vB, which correctly fails BIP125#4. Assume all transactions have&lt;br/&gt;a&lt;br/&gt;size of 100vB.&lt;br/&gt;&lt;br/&gt;#### Package RBF&lt;br/&gt;&lt;br/&gt;If a package meets feerate requirements as a package, the parents in the&lt;br/&gt;transaction are allowed to replace-by-fee mempool transactions. The child&lt;br/&gt;cannot&lt;br/&gt;replace mempool transactions. Multiple transactions can replace the same&lt;br/&gt;transaction, but in order to be valid, none of the transactions can try to&lt;br/&gt;replace an ancestor of another transaction in the same package (which would&lt;br/&gt;thus&lt;br/&gt;make its inputs unavailable).&lt;br/&gt;&lt;br/&gt;*Rationale*: Even if we are using package feerate, a package will not&lt;br/&gt;propagate&lt;br/&gt;as intended if RBF still requires each individual transaction to meet the&lt;br/&gt;feerate requirements.&lt;br/&gt;&lt;br/&gt;We use a set of rules slightly modified from BIP125 as follows:&lt;br/&gt;&lt;br/&gt;##### Signaling (Rule #1)&lt;br/&gt;&lt;br/&gt;All mempool transactions to be replaced must signal replaceability.&lt;br/&gt;&lt;br/&gt;*Rationale*: Package RBF signaling logic should be the same for package RBF&lt;br/&gt;and&lt;br/&gt;single transaction acceptance. This would be updated if single transaction&lt;br/&gt;validation moves to full RBF.&lt;br/&gt;&lt;br/&gt;##### New Unconfirmed Inputs (Rule #2)&lt;br/&gt;&lt;br/&gt;A package may include new unconfirmed inputs, but the ancestor feerate of&lt;br/&gt;the&lt;br/&gt;child must be at least as high as the ancestor feerates of every transaction&lt;br/&gt;being replaced. This is contrary to BIP125#2, which states &amp;#34;The replacement&lt;br/&gt;transaction may only include an unconfirmed input if that input was&lt;br/&gt;included in&lt;br/&gt;one of the original transactions. (An unconfirmed input spends an output&lt;br/&gt;from a&lt;br/&gt;currently-unconfirmed transaction.)&amp;#34;&lt;br/&gt;&lt;br/&gt;*Rationale*: The purpose of BIP125#2 is to ensure that the replacement&lt;br/&gt;transaction has a higher ancestor score than the original transaction(s)&lt;br/&gt;(see&lt;br/&gt;[comment][13]). Example H [16] shows how adding a new unconfirmed input can&lt;br/&gt;lower the&lt;br/&gt;ancestor score of the replacement transaction. P1 is trying to replace M1,&lt;br/&gt;and&lt;br/&gt;spends an unconfirmed output of M2. P1 pays 800sat, M1 pays 600sat, and M2&lt;br/&gt;pays&lt;br/&gt;100sat. Assume all transactions have a size of 100vB. While, in isolation,&lt;br/&gt;P1&lt;br/&gt;looks like a better mining candidate than M1, it must be mined with M2, so&lt;br/&gt;its&lt;br/&gt;ancestor feerate is actually 4.5sat/vB.  This is lower than M1&amp;#39;s ancestor&lt;br/&gt;feerate, which is 6sat/vB.&lt;br/&gt;&lt;br/&gt;In package RBF, the rule analogous to BIP125#2 would be &amp;#34;none of the&lt;br/&gt;transactions in the package can spend new unconfirmed inputs.&amp;#34; Example J&lt;br/&gt;[17] shows&lt;br/&gt;why, if any of the package transactions have ancestors, package feerate is&lt;br/&gt;no&lt;br/&gt;longer accurate. Even though M2 and M3 are not ancestors of P1 (which is the&lt;br/&gt;replacement transaction in an RBF), we&amp;#39;re actually interested in the entire&lt;br/&gt;package. A miner should mine M1 which is 5sat/vB instead of M2, M3, P1, P2,&lt;br/&gt;and&lt;br/&gt;P3, which is only 4sat/vB. The Package RBF rule cannot be loosened to only&lt;br/&gt;allow&lt;br/&gt;the child to have new unconfirmed inputs, either, because it can still&lt;br/&gt;cause us&lt;br/&gt;to overestimate the package&amp;#39;s ancestor score.&lt;br/&gt;&lt;br/&gt;However, enforcing a rule analogous to BIP125#2 would not only make Package&lt;br/&gt;RBF&lt;br/&gt;less useful, but would also break Package RBF for packages with parents&lt;br/&gt;already&lt;br/&gt;in the mempool: if a package parent has already been submitted, it would&lt;br/&gt;look&lt;br/&gt;like the child is spending a &amp;#34;new&amp;#34; unconfirmed input. In example K [18],&lt;br/&gt;we&amp;#39;re&lt;br/&gt;looking to replace M1 with the entire package including P1, P2, and P3. We&lt;br/&gt;must&lt;br/&gt;consider the case where one of the parents is already in the mempool (in&lt;br/&gt;this&lt;br/&gt;case, P2), which means we must allow P3 to have new unconfirmed inputs.&lt;br/&gt;However,&lt;br/&gt;M2 lowers the ancestor score of P3 to 4.3sat/vB, so we should not replace M1&lt;br/&gt;with this package.&lt;br/&gt;&lt;br/&gt;Thus, the package RBF rule regarding new unconfirmed inputs is less strict&lt;br/&gt;than&lt;br/&gt;BIP125#2. However, we still achieve the same goal of requiring the&lt;br/&gt;replacement&lt;br/&gt;transactions to have a ancestor score at least as high as the original&lt;br/&gt;ones. As&lt;br/&gt;a result, the entire package is required to be a higher feerate mining&lt;br/&gt;candidate&lt;br/&gt;than each of the replaced transactions.&lt;br/&gt;&lt;br/&gt;Another note: the [comment][13] above the BIP125#2 code in the original RBF&lt;br/&gt;implementation suggests that the rule was intended to be temporary.&lt;br/&gt;&lt;br/&gt;##### Absolute Fee (Rule #3)&lt;br/&gt;&lt;br/&gt;The package must increase the absolute fee of the mempool, i.e. the total&lt;br/&gt;fees&lt;br/&gt;of the package must be higher than the absolute fees of the mempool&lt;br/&gt;transactions&lt;br/&gt;it replaces. Combined with the CPFP rule above, this differs from BIP125&lt;br/&gt;Rule #3&lt;br/&gt;- an individual transaction in the package may have lower fees than the&lt;br/&gt;  transaction(s) it is replacing. In fact, it may have 0 fees, and the child&lt;br/&gt;pays for RBF.&lt;br/&gt;&lt;br/&gt;##### Feerate (Rule #4)&lt;br/&gt;&lt;br/&gt;The package must pay for its own bandwidth; the package feerate must be&lt;br/&gt;higher&lt;br/&gt;than the replaced transactions by at least minimum relay feerate&lt;br/&gt;(`incrementalRelayFee`). Combined with the CPFP rule above, this differs&lt;br/&gt;from&lt;br/&gt;BIP125 Rule #4 - an individual transaction in the package can have a lower&lt;br/&gt;feerate than the transaction(s) it is replacing. In fact, it may have 0&lt;br/&gt;fees,&lt;br/&gt;and the child pays for RBF.&lt;br/&gt;&lt;br/&gt;##### Total Number of Replaced Transactions (Rule #5)&lt;br/&gt;&lt;br/&gt;The package cannot replace more than 100 mempool transactions. This is&lt;br/&gt;identical&lt;br/&gt;to BIP125 Rule #5.&lt;br/&gt;&lt;br/&gt;### Expected FAQs&lt;br/&gt;&lt;br/&gt;1. Is it possible for only some of the package to make it into the mempool?&lt;br/&gt;&lt;br/&gt;   Yes, it is. However, since we evict transactions from the mempool by&lt;br/&gt;descendant score and the package child is supposed to be sponsoring the&lt;br/&gt;fees of&lt;br/&gt;its parents, the most common scenario would be all-or-nothing. This is&lt;br/&gt;incentive-compatible. In fact, to be conservative, package validation should&lt;br/&gt;begin by trying to submit all of the transactions individually, and only&lt;br/&gt;use the&lt;br/&gt;package mempool acceptance logic if the parents fail due to low feerate.&lt;br/&gt;&lt;br/&gt;2. Should we allow packages to contain already-confirmed transactions?&lt;br/&gt;&lt;br/&gt;    No, for practical reasons. In mempool validation, we actually aren&amp;#39;t&lt;br/&gt;able to&lt;br/&gt;tell with 100% confidence if we are looking at a transaction that has&lt;br/&gt;already&lt;br/&gt;confirmed, because we look up inputs using a UTXO set. If we have historical&lt;br/&gt;block data, it&amp;#39;s possible to look for it, but this is inefficient, not&lt;br/&gt;always&lt;br/&gt;possible for pruning nodes, and unnecessary because we&amp;#39;re not going to do&lt;br/&gt;anything with the transaction anyway. As such, we already have the&lt;br/&gt;expectation&lt;br/&gt;that transaction relay is somewhat &amp;#34;stateful&amp;#34; i.e. nobody should be relaying&lt;br/&gt;transactions that have already been confirmed. Similarly, we shouldn&amp;#39;t be&lt;br/&gt;relaying packages that contain already-confirmed transactions.&lt;br/&gt;&lt;br/&gt;[1]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22290&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22290&lt;/a&gt;&lt;br/&gt;[2]:&lt;br/&gt;&lt;a href=&#34;https://github.com/bitcoin/bips/blob/1f0b563738199ca60d32b4ba779797fc97d040fe/bip-0141.mediawiki#transaction-size-calculations&#34;&gt;https://github.com/bitcoin/bips/blob/1f0b563738199ca60d32b4ba779797fc97d040fe/bip-0141.mediawiki#transaction-size-calculations&lt;/a&gt;&lt;br/&gt;[3]:&lt;br/&gt;&lt;a href=&#34;https://github.com/bitcoin/bitcoin/blob/94f83534e4b771944af7d9ed0f40746f392eb75e/src/policy/policy.cpp#L282&#34;&gt;https://github.com/bitcoin/bitcoin/blob/94f83534e4b771944af7d9ed0f40746f392eb75e/src/policy/policy.cpp#L282&lt;/a&gt;&lt;br/&gt;[4]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/16400&#34;&gt;https://github.com/bitcoin/bitcoin/pull/16400&lt;/a&gt;&lt;br/&gt;[5]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/21062&#34;&gt;https://github.com/bitcoin/bitcoin/pull/21062&lt;/a&gt;&lt;br/&gt;[6]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22675&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22675&lt;/a&gt;&lt;br/&gt;[7]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/22796&#34;&gt;https://github.com/bitcoin/bitcoin/pull/22796&lt;/a&gt;&lt;br/&gt;[8]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/20833&#34;&gt;https://github.com/bitcoin/bitcoin/pull/20833&lt;/a&gt;&lt;br/&gt;[9]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/21800&#34;&gt;https://github.com/bitcoin/bitcoin/pull/21800&lt;/a&gt;&lt;br/&gt;[10]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/16401&#34;&gt;https://github.com/bitcoin/bitcoin/pull/16401&lt;/a&gt;&lt;br/&gt;[11]: &lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/19621&#34;&gt;https://github.com/bitcoin/bitcoin/pull/19621&lt;/a&gt;&lt;br/&gt;[12]: &lt;a href=&#34;https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki&#34;&gt;https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki&lt;/a&gt;&lt;br/&gt;[13]:&lt;br/&gt;&lt;a href=&#34;https://github.com/bitcoin/bitcoin/pull/6871/files#diff-34d21af3c614ea3cee120df276c9c4ae95053830d7f1d3deaf009a4625409ad2R1101-R1104&#34;&gt;https://github.com/bitcoin/bitcoin/pull/6871/files#diff-34d21af3c614ea3cee120df276c9c4ae95053830d7f1d3deaf009a4625409ad2R1101-R1104&lt;/a&gt;&lt;br/&gt;[14]:&lt;br/&gt; &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133567078-075a971c-0619-4339-9168-b41fd2b90c28.png&#34;&gt; &lt;br/&gt;[15]:&lt;br/&gt; &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/132856734-fc17da75-f875-44bb-b954-cb7a1725cc0d.png&#34;&gt; &lt;br/&gt;[16]:&lt;br/&gt; &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133567347-a3e2e4a8-ae9c-49f8-abb9-81e8e0aba224.png&#34;&gt; &lt;br/&gt;[17]:&lt;br/&gt; &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133567370-21566d0e-36c8-4831-b1a8-706634540af3.png&#34;&gt; &lt;br/&gt;[18]:&lt;br/&gt; &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133567444-bfff1142-439f-4547-800a-2ba2b0242bcb.png&#34;&gt; &lt;br/&gt;[19]:&lt;br/&gt; &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/133456219-0bb447cb-dcb4-4a31-b9c1-7d86205b68bc.png&#34;&gt; &lt;br/&gt;[20]:&lt;br/&gt; &lt;img src=&#34;https://user-images.githubusercontent.com/25183001/132857787-7b7c6f56-af96-44c8-8d78-983719888c19.png&#34;&gt; &lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20210916/d71208a2/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20210916/d71208a2/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-08T00:59:15&#43;02:00</updated>
  </entry>

</feed>