<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <updated>2023-06-07T02:01:10Z</updated>
  <generator>https://yabu.me</generator>

  <title>Nostr notes by Gloria Zhao [ARCHIVE]</title>
  <author>
    <name>Gloria Zhao [ARCHIVE]</name>
  </author>
  <link rel="self" type="application/atom+xml" href="https://yabu.me/npub14ca6vjq25eaema6zxke2g8hjc6ztkf5ej698f5fhyg98zqq85zsqu0m739.rss" />
  <link href="https://yabu.me/npub14ca6vjq25eaema6zxke2g8hjc6ztkf5ej698f5fhyg98zqq85zsqu0m739" />
  <id>https://yabu.me/npub14ca6vjq25eaema6zxke2g8hjc6ztkf5ej698f5fhyg98zqq85zsqu0m739</id>
  <icon></icon>
  <logo></logo>




  <entry>
    <id>https://yabu.me/nevent1qqsq0hn67rakm9vpthjxlr4x09jfqfvv9z933fu8rfesrenusfs3lrqzyzhrhfjgp2n8h80hgg6m9fq77trgfwexnxtg5ax3xu3q5ugqq7s2q2x2w0l</id>
    
      <title type="html">📅 Original date posted:2021-12-07 📝 Original message:Hi ...</title>
    
    <link rel="alternate" href="https://yabu.me/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-07T23:00:54Z</updated>
  </entry>

</feed>