<oembed><type>rich</type><version>1.0</version><title>James O&#39;Beirne [ARCHIVE] wrote</title><author_name>James O&#39;Beirne [ARCHIVE] (npub1dp…ymz3t)</author_name><author_url>https://yabu.me/npub1dpdfw74plzm03mzglkdegp3hqn6qs9yffqefa5kh98mru49nrg7szymz3t</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2022-02-10&#xA;📝 Original message:There&#39;s been much talk about fee-bumping lately, and for good reason -&#xA;dynamic fee management is going to be a central part of bitcoin use as&#xA;the mempool fills up (lord willing) and right now fee-bumping is&#xA;fraught with difficulty and pinning peril.&#xA;&#xA;Gloria&#39;s recent post on the topic[0] was very lucid and highlights a&#xA;lot of the current issues, as well as some proposals to improve the&#xA;situation.&#xA;&#xA;As others have noted, the post was great. But throughout the course&#xA;of reading it and the ensuing discussion, I became troubled by the&#xA;increasing complexity of both the status quo and some of the&#xA;proposed remedies.&#xA;&#xA;Layering on special cases, more carve-outs, and X and Y percentage&#xA;thresholds is going to make reasoning about the mempool harder than it&#xA;already is. Special consideration for &#34;what should be in the next&#xA;block&#34; and/or the caching of block templates seems like an imposing&#xA;dependency, dragging in a bunch of state and infrastructure to a&#xA;question that should be solely limited to mempool feerate aggregates&#xA;and the feerate of the particular txn package a wallet is concerned&#xA;with.&#xA;&#xA;This is bad enough for protocol designers and Core developers, but&#xA;making the situation any more intractable for &#34;end-users&#34; and wallet&#xA;developers feels wrong.&#xA;&#xA;I thought it might be useful to step back and reframe. Here are a few&#xA;aims that are motivated chiefly by the quality of end-user experience,&#xA;constrained to obey incentive compatibility (i.e. miner reward, DoS&#xA;avoidance). Forgive the abstract dalliance for a moment; I&#39;ll talk&#xA;through concretes afterwards.&#xA;&#xA;&#xA;# Purely additive feerate bumps should never be impossible&#xA;&#xA;Any user should always be able to add to the incentive to mine any&#xA;transaction in a purely additive way. The countervailing force here&#xA;ends up being spam prevention (a la min-relay-fee) to prevent someone&#xA;from consuming bandwidth and mempool space with a long series of&#xA;infinitesimal fee-bumps.&#xA;&#xA;A fee bump, naturally, should be given the same per-byte consideration&#xA;as a normal Bitcoin transaction in terms of relay and block space,&#xA;although it would be nice to come up with a more succinct&#xA;representation. This leads to another design principle:&#xA;&#xA;&#xA;# The bandwidth and chain space consumed by a fee-bump should be minimal&#xA;&#xA;Instead of prompting a rebroadcast of the original transaction for&#xA;replacement, which contains a lot of data not new to the network, it&#xA;makes more sense to broadcast the &#34;diff&#34; which is the additive&#xA;contribution towards some txn&#39;s feerate.&#xA;&#xA;This dovetails with the idea that...&#xA;&#xA;&#xA;# Special transaction structure should not be required to bump fees&#xA;&#xA;In an ideal design, special structural foresight would not be needed&#xA;in order for a txn&#39;s feerate to be improved after broadcast.&#xA;&#xA;Anchor outputs specified solely for CPFP, which amount to many bytes of&#xA;wasted chainspace, are a hack. It&#39;s probably uncontroversial at this&#xA;point to say that even RBF itself is kind of a hack - a special&#xA;sequence number should not be necessary for post-broadcast contribution&#xA;toward feerate. Not to mention RBF&#39;s seemingly wasteful consumption of&#xA;bandwidth due to the rebroadcast of data the network has already seen.&#xA;&#xA;In a sane design, no structural foresight - and certainly no wasted&#xA;bytes in the form of unused anchor outputs - should be needed in order&#xA;to add to a miner&#39;s reward for confirming a given transaction.&#xA;&#xA;Planning for fee-bumps explicitly in transaction structure also often&#xA;winds up locking in which keys are required to bump fees, at odds&#xA;with the idea that...&#xA;&#xA;&#xA;# Feerate bumps should be able to come from anywhere&#xA;&#xA;One of the practical downsides of CPFP that I haven&#39;t seen discussed in&#xA;this conversation is that it requires the transaction to pre-specify the&#xA;keys needed to sign for fee bumps. This is problematic if you&#39;re, for&#xA;example, using a vault structure that makes use of pre-signed&#xA;transactions.&#xA;&#xA;What if the key you specified n the anchor outputs for a bunch of&#xA;pre-signed txns is compromised? What if you&#39;d like to be able to&#xA;dynamically select the wallet that bumps fees? CPFP does you no favors&#xA;here.&#xA;&#xA;There is of course a tension between allowing fee bumps to come from&#xA;anywhere and the threat of pinning-like attacks. So we should venture&#xA;to remove pinning as a possibility, in line with the first design&#xA;principle I discuss.&#xA;&#xA;&#xA;---&#xA;&#xA;Coming down to earth, the &#34;tabula rasa&#34; thought experiment above has led&#xA;me to favor an approach like the transaction sponsors design that Jeremy&#xA;proposed in a prior discussion back in 2020[1].&#xA;&#xA;Transaction sponsors allow feerates to be bumped after a transaction&#39;s&#xA;broadcast, regardless of the structure of the original transaction.&#xA;No rebroadcast (wasted bandwidth) is required for the original txn data.&#xA;No wasted chainspace on only-maybe-used prophylactic anchor outputs.&#xA;&#xA;The interface for end-users is very straightforward: if you want to bump&#xA;fees, specify a transaction that contributes incrementally to package&#xA;feerate for some txid. Simple.&#xA;&#xA;In the original discussion, there were a few main objections that I noted:&#xA;&#xA;1. In Jeremy&#39;s original proposal, only one sponsor txn per txid is&#xA;   allowed by policy. A malicious actor could execute a pinning-like&#xA;   attack by specifying an only-slightly-helpful feerate sponsor that&#xA;   then precludes other larger bumps.&#xA;&#xA;I think there are some ways around this shortcoming. For example: what&#xA;if, by policy, sponsor txns had additional constraints that&#xA;&#xA;  - each input must be signed {SIGHASH_SINGLE,SIGHASH_NONE}|ANYONECANPAY,&#xA;  - the txn must be specified RBFable,&#xA;  - a replacement for the sponsor txn must raise the sponsor feerate,&#xA;    including ancestors (maybe this is inherent in &#34;is RBFable,&#34; but&#xA;    I don&#39;t want to conflate absolute feerates into this).&#xA;&#xA;That way, there is still at most a single sponsor txn per txid in the&#xA;mempool, but anyone can &#34;mix in&#34; inputs which bump the effective&#xA;feerate of the sponsor.&#xA;&#xA;This may not be the exact solution we want, but I think it demonstrates&#xA;that the sponsors design has some flexibility and merits some thinking.&#xA;&#xA;The second objection about sponsors was&#xA;&#xA;2. (from Suhas) sponsors break the classic invariant: &#34;once a valid&#xA;   transaction is created, it should not become invalid later on unless&#xA;   the inputs are double-spent.&#34;&#xA;&#xA;This doesn&#39;t seem like a huge concern to me if you consider the txid&#xA;being sponsored as a sort of spiritual input to the sponsor. While the&#xA;theoretical objection against broadening where one has to look in a txn&#xA;to determine its dependencies is understandable, I don&#39;t see what the&#xA;practical cost here is.&#xA;&#xA;Reorg complexity seems comparable if not identical, especially if we&#xA;broaden sponsor rules to allow blocks to contain sponsor txns that are&#xA;both for txids in the same block _or_ already included in the chain.&#xA;&#xA;This theoretical concession seems preferable to heaping more rules onto&#xA;an already labyrinthine mempool policy that is difficult for both&#xA;implementers and users to reason about practically and conceptually.&#xA;&#xA;A third objection that wasn&#39;t posed, IIRC, but almost certainly would&#xA;be:&#xA;&#xA;3. Transaction sponsors requires a soft-fork.&#xA;&#xA;Soft-forks are no fun, but I&#39;ll tell you what also isn&#39;t fun: being on&#xA;the hook to model (and sometimes implement) a dizzying potpourri of&#xA;mempool policies and special-cases. Expecting wallet implementers to&#xA;abide by a maze of rules faithfully in order to ensure txn broadcast and&#xA;fee management invites bugs for perpetuity and network behavior that is&#xA;difficult to reason about a priori. Use of CPFP in the long-term also&#xA;risks needless chain waste.&#xA;&#xA;If a soft-fork is the cost of cleaning up this essential process,&#xA;consideration should be given to paying it as a one-time cost. This&#xA;topic merits a separate post, but consider that in the 5 years leading&#xA;up to the 2017 SegWit drama, we averaged about a soft-fork a year.&#xA;Uncontroversial, &#34;safe&#34; changes to the consensus protocol shouldn&#39;t be&#xA;out of the question when significant practical benefit is plain to see.&#xA;&#xA;---&#xA;&#xA;I hope this message has added some framing to the discussion on fees,&#xA;as well prompting other participants to go back and give the&#xA;transaction sponsor proposal a serious look. The sponsors interface is&#xA;about the simplest I can imagine for wallets, and it seems easy to&#xA;reason about for implementers on Core and elsewhere.&#xA;&#xA;I&#39;m not out to propose soft-forks lightly, but the current complexity&#xA;in fee management feels untenable, and as evidenced by all the&#xA;discussion lately, fees are an increasingly crucial part of the system.&#xA;&#xA;&#xA;&#xA;[0]:&#xA;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-January/019817.html&#xA;[1]:&#xA;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2020-September/018168.html&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220210/b6bf7054/attachment.html&gt;</html></oembed>