From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6E073C002D for ; Fri, 17 Jun 2022 01:34:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 31A20417E0 for ; Fri, 17 Jun 2022 01:34:33 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 31A20417E0 Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=gfBlm0M0 X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: 0.101 X-Spam-Level: X-Spam-Status: No, score=0.101 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, MANY_SPAN_IN_TEXT=2.199, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=no autolearn_force=no Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7BpZWpta2rhU for ; Fri, 17 Jun 2022 01:34:30 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0D42D417D7 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by smtp4.osuosl.org (Postfix) with ESMTPS id 0D42D417D7 for ; Fri, 17 Jun 2022 01:34:29 +0000 (UTC) Received: by mail-il1-x12b.google.com with SMTP id a15so2074661ilq.12 for ; Thu, 16 Jun 2022 18:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bIVFYwTWQeFy1BBnCMEZDheS/lU/V0zvGxWyY5EO07o=; b=gfBlm0M0gdRwsk9KpfMfLkwiD5YPplj9mmjgkLUTdCEEh7W56nnJ8cAYb5ZyKIszOA IiMAU5d/hWzPhkfV3lKhMsJjAT50+5kOFtJ4EfYNkw5/tXehgkvrEAWDkiLdSx6ZP4Po 9fjaG5EDQsuKUxjf/vvNXPgnL5XHyDQqPQSnR10Rm2wVvFhSjX3tWAoD53/AE3fstsTh /Ls8vIVuf6nh9h3WV2vYbbRrcN2OaJ1MrzadjYcTu52x+wUTWLZHyNEokuo/rstEL6XW 4Rd0kJqjSfVlkWZSsggY/gIJItZfx8dqKe/tIM11JvJMZtz534kqIUKfQdwU6GnjgsKi bdXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bIVFYwTWQeFy1BBnCMEZDheS/lU/V0zvGxWyY5EO07o=; b=I4pQNfHtv82N6aDqQZVIaL10YfPs3P39HPG1A4QnEmWo8W8CYXA4hv4ALEd3iJzORV oAVIDVblZsEfPjeh423+Ex8n7ac0qcvcp3oP8Mps6+Gyo2R9pkDVZTNxnviiOyLP/mU1 K9oFqYgdSXw6FqamwZAFT41BDrqrfgU40xosQyvJ4bSPpQQTlA1dUEuYF2IPKk/G5tGp brbRVhbhGQcZoM8+QWWGJ+ia5GupQt0wvl+2D40V0lt3KkTNund+3z2cTqC9i4ic2wEc vLF38DDevwVLYSvrtE0GxDKBO1ZVdYC1VOc44FCBXbHsfllAoTjKnnGyTRpl4XaQYs/E 3UIw== X-Gm-Message-State: AJIora8hsZmNnbNYHlWzVbTnorcT6pxf22eCo3DFXuudx7xu90lxc2eL g5CCtf1fRbkQueaCcZAR6ohOHp1F34dNqPBACGF2S3LAYHs= X-Google-Smtp-Source: AGRyM1tWQ2hEo1av/hdkL45rZPVSBeC2N90iqEkZL3O67CfGnv/Rik+b0mSMDHtGpWAFRh3Xh5usqaJUPgOookOAO00= X-Received: by 2002:a05:6e02:1645:b0:2d6:5dd3:e627 with SMTP id v5-20020a056e02164500b002d65dd3e627mr4381715ilu.268.1655429668535; Thu, 16 Jun 2022 18:34:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Antoine Riard Date: Fri, 17 Jun 2022 02:34:17 +0100 Message-ID: To: alicexbt Content-Type: multipart/alternative; boundary="00000000000058024005e19ac1cf" X-Mailman-Approved-At: Fri, 17 Jun 2022 09:02:02 +0000 Cc: Bitcoin Protocol Discussion Subject: Re: [bitcoin-dev] Playing with full-rbf peers for fun and L2s security X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2022 01:34:33 -0000 --00000000000058024005e19ac1cf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi alicexbt, Thanks for taking time to review the pull request, > 1)If something relies on a policy which can be changed without breaking consensus rules, how is it secure in any case with or without full rbf? Your Lightning node software relies on far more software and hardware components than the transaction-relay p2p network. One could list the operating system on which is running your Lightning process or the compiler toolchain turning out your Lightning source code in a binary artifact. Some weird kernel's memory mapping change could allow access to your channel funding keys, _without_ breaking the Bitcoin consensus rules [0]. Moreover, your Lightning node is also relying on the existence of a global Internet allowing your HTLC transaction to flow from your physical host to the crowd of transactions confirming in the blockchain. Due to this "protocol assumption" your channel balance would be vulnerable to any change in your ISP routing policy, e.g refusing to accept your IPV4 traffic by a sudden desiderata to impose an IPV6 supremacy. Still _without_ breaking the Bitcoin consensus rules. Of course, the odds of your ISP operator adopting this behavior are really low, mostly because your operator has to bind to social and economic constraints to stay in business. And I believe this imperative to stay in business is certainly not absent in the incentives of the Bitcoin node operators. You're free to run any policy on your node, especially one hardening the safety of your operations beyond the default one. However, if you start to a transaction-relay non-compatible with miner incentives, you won't have an efficient view of the blockspace demand, and from then won't be able to offer compelling feerates to execute your business transactions to satisfy your client needs. Or you won't consolidate your wallet UTXOs at times of low-demand. Indeed, a sane visibility of the mempools might not be critical now for you= r Bitcoin operations, but this is not likely to become true with miner's coinbase reward lowering with time and the system security relying on a fruitful fee market. So assuming there is a significant number of economically rational entities running p2p nodes, I think it's a reasonable assumption for Lightning developers that a policy maximizing miner's income and economic nodes operations will be widely run on the p2p network, and therefore lay its security model on that. When there is a gap between the economically optimal policy (full-rbf) and the effectively deployed one (optin), and this gap constitut= es a flaw for exploitation, I believe it's better to fix it. If you have a different mode of thinking w.r.t how we should design protocol in a trust-minimized, open, adversarial environment such as Bitcoin, I'm curious to listen to it. > If I write a python script that expects user to enter char 'a' or 'b' but user can enter 'c' and there is no code to handle exceptions or other chars, will it be secure? Of course not. If you deliver any critical software, you should attach a solid manual explaining all the corner cases and rough edges. Even better would be to enshrine the manual directly in your software API to minimize the footgunish behaviors. E.g, with any ECC library, forbidding to reuse nonces. If your user still ignores or misread the manual and provides an insecure input, there is not that much you can do. By analogy, I believe that's the same with Lightning. One recommendation of the deployment manual would be to be always connected to a full-rbf transaction-relay topology. Defaulting to this rule and your node exposes far more surface of attacks. Assuming the manual has been well-written (big assumption!), I don't think the system designer would be to blame. That said, one issue to confess with current Lightning is our lack of understanding of what should be figured out in the LN user manual for safe operations. I would say that's an active area of research [1] [2] [3] > 2)full-rbf is not default in the 2 open pull requests, so this experiment still relies on users changing RBF policies manually. If majority of nodes use default opt-in policy, how would this affect vulnerable projects? If we define the goal as ensuring there is a significant number of transaction-relay routes between the L2s nodes requiring full-rbf and the set of miners supporting this policy, and the set of miners is populated enough, there is no need to convince the majority of nodes operators to switch to full-rbf. Beyond landing the 'full-rbf' pull request, in pursuit of a partial full-rbf deployment, I'm thinking of reaching out to Lightning vendors to recommend running LN nodes operators run their full-node with the setting enabled. And also to few mining pool operators to advocate the potential increase in their income. Given there are like 17000 public LN nodes, if half of them adopt full-rbf it should give already a good number of full-rbf transaction-relay routes across the p2p network graph. When we're there, we can measure and think more about how to tune the full-rbf sub-topology. > 2-3% transactions are replaced with opt-in RBF, if someone did not replace earlier why would they do it with full RBF? Because it's breaking the reliability and security of their use-cases. Use-cases which didn't exist a few years ago. The mempool DoS vector is described here [4]. To the best of my understanding, it might affect a bunch of use-cases, such as dual-funded channels, on-chain DLCs, p2p coinjoins, batched submarine swaps out. With the attack described, the honest set of users might not have visibility of the network mempools that there is a malicious, low-cost, opt-out double-spend preventing the propagation of their multi-party transaction. With the existence of a full-rbf transaction-relay topology, the multi-party transaction is able to replace the optout. None of those use-cases were deployed a few years ago, and the understanding of the interactions with the mempool policy is still nascent among their operators. However, if we assume that layering is a way to grow= the Bitcoin ecosystem, as I do, it is reasonable to expect they will constitute a notable share of the Bitcoin transaction traffic during the next decade. > I am not opposed to full-rbf; rather, I am opposed to the notion that full-rbf will solve all problems I wished we had a magic Silver Bullet (tm) solving all the Bitcoin problems... I'm only advocating a partial full-rbf deployment to solve a real precise security issue affecting multi-party funded transactions. That said, full-rbf is far from solving the known set of problems affecting the L2s due to interactions with network mempools. E,g, see package relay motivation [5] > I would suggest users to try Bitcoin Knots instead which already has an option to disable all RBF policies if required, opt-in and full RBF policy. Selecting a full-node to underpin any serious Bitcoin infrastructure or secure a significant stack of coins should be submitted to a fully-fledged decision-making process. Many factors are likely to matter such as the level of activity of the contributor community, the chain of trust w.r.t dependencies, the security incident track records, the quality of the documentation, the exhaustivity and robustness of the set of features, ... This process might take tens of hours, to be duplicated by the number of node operators who would have to do the full-node vending switch. If you consider the cognitive cost at the level of the Bitcoin ecosystem, it's far less costly to implement and review a few lines of codes in Bitcoin Core. > Developers should provide basic RBF policy options rather than attempting to define what constitutes a good policy and removing the ability to disable something when necessary. Of course, this statement assumes there is a clear line between the developers and the users. Developers are also Bitcoin users, and they're modifying the software to suit their use-case needs. And that's exactly the purpose of the 'full-rbf' PR I'm proposing, aiming to propose a "good" policy for a Lightning node, without actually seeking to change the default. If they're parties interested in implementing more RBF policy options in Bitcoin Core, I think they're free to propose such changes and invest the engineering effort to do so. If you're interested in advancing the state of policy options in Bitcoin Core, there are a lot of interesting resources available and communities to encourage you in the learning process to contribute to the codebase [6]. Antoine [0] https://dirtycow.ninja [1] https://github.com/t-bast/lightning-docs/blob/master/pinning-attacks.md [2] https://arxiv.org/pdf/2006.01418.pdf [3] https://arxiv.org/pdf/2006.08513.pdf [4] https://lists.linuxfoundation.org/pipermail/lightning-dev/2021-May/003033.h= tml [5] https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-May/020493.htm= l [6] https://www.summerofbitcoin.org Le jeu. 16 juin 2022 =C3=A0 00:15, alicexbt a =C3= =A9crit : > Hi Antoine, > > > Thanks for opening the pull request to add support for full-rbf in Bitcoi= n > Core. I have a disagreements with the approach and questions. > > Recent discussions among LN devs have brought back on the surface concern= s > about the security of multi-party funded transactions (coinjoins, > dual-funded LN channels, on-chain DLCs, ...). It turns out there is a > low-fruit, naive DoS vector playable against the funding flow of any such > construction due to the lack of existent full-rbf transaction-relay > topology on today's p2p network [0] [1]. > > > 1)If something relies on a policy which can be changed without breaking > consensus rules, how is it secure in any case with or without full rbf? I= f > I write a python script that expects user to enter char 'a' or 'b' but us= er > can enter 'c' and there is no code to handle exceptions or other chars, > will it be secure? > > 2)full-rbf is not default in the 2 open pull requests, so this experiment > still relies on users changing RBF policies manually. If majority of node= s > use default opt-in policy, how would this affect vulnerable projects? > > If you're a mining operator looking to increase your income, you might be > interested to experiment with full-rbf as a policy. > > > Miners can only increase their income if users replace transactions. 2-3% > transactions are replaced with opt-in RBF, if someone did not replace > earlier why would they do it now even with full RBF? Or even if we add so= me > users in it who could not signal for some reasons, do you think it would = be > anything above 5%? > > If you're a Bitcoin user or business and you don't like full-rbf, please > express an opinion on how it might affect your software/operations. I'm > always interested to learn more about mempool and transaction-relay > interactions with upper-layers and applications and to listen to feedback > in those areas, and I guess a lot of other Bitcoin researchers/devs too. = I > know there have been a lot of concerns about full-rbf in the past, howeve= r > I believe the Bitcoin ecosystem has matured a lot since then. > > > I am not opposed to full-rbf; rather, I am opposed to the notion that > full-rbf will solve all problems and the lack of basic options in Bitcoin > Core to employ/disable different RBF policies. There is also a speculatio= n > about making full RBF default in an year which isn't relevant to discuss = at > this point without trying different RBF policies. > > I would suggest users to try Bitcoin Knots instead which already has an > option to disable all RBF policies if required, opt-in and full RBF polic= y. > This can also be done using GUI if not familiar with config option > mempoolreplacement=E2=80=8B. > > The rationale in PR #16171 was insufficient to justify removing it in the > first place, had 2 NACKs and was reopened to merge it. Why bother with a > few lines of code that may allow someone disable it if required in local > mempool since it's only useful when a big percentage of miners utilize it > and essentially underused according to the PR author? Developers should > provide basic RBF policy options rather than attempting to define what > constitutes a good policy and removing the ability to disable something > when necessary. > > > /dev/fd0 > > Sent with Proton Mail secure email. > > ------- Original Message ------- > On Tuesday, June 14th, 2022 at 5:55 AM, Antoine Riard via bitcoin-dev < > bitcoin-dev@lists.linuxfoundation.org> wrote: > > Hi list, > > Recent discussions among LN devs have brought back on the surface concern= s > about the security of multi-party funded transactions (coinjoins, > dual-funded LN channels, on-chain DLCs, ...). It turns out there is a > low-fruit, naive DoS vector playable against the funding flow of any such > construction due to the lack of existent full-rbf transaction-relay > topology on today's p2p network [0] [1]. While it does not consist in a > direct loss of funds, if exploited well I think it's annoying enough to > inflict significant timevalue loss or fee-bumping waste > to the future providers or distributed swarm of users doing multi-party > funded transactions. Of course, it can be fixed one layer above by > introducing either fidelity bonds or a reliable centralized coordinator, > though at the price of an overhead per-participant ressources cost and lo= ss > in system openness [1]. > > For that reason, I believe it would be beneficial to the flourishing of > multi-party funded transactions to fix the Dos vector by seeing a subset = of > the network running full-rbf and enabling propagation of honest multi-par= ty > transactions to the interested miners, replacing potential non-signaling > double-spend from a malicious counterparty. Moving towards that direction= , > I've submitted a small patch against Bitcoin Core enabling it to turn on > full-rbf as a policy, still under review [3]. The default setting stays > **false**, i.e keeping opt-in RBF as a default replacement policy. I've > started to run the patch on a public node at 146.190.224.15. > > If you're a node operator curious to play with full-rbf, feel free to > connect to this node or spawn up a toy, public node yourself. There is a > ##uafrbf libera chat if you would like information on the settings or > looking for full-rbf friends (though that step could be automated in the > future by setting up a dedicated network bit and reserving a few outbound > slots for them). > > If you're a mining operator looking to increase your income, you might be > interested to experiment with full-rbf as a policy. Indeed, in the future= I > believe the multi-party transactions issuers who need full-rbf to secure > their funding flow should connect by default to full-rbf peers. One can > conjecture that their transactions are likely to be more compelling in > their feerate as their liquidity needs are higher than the simple > transaction. For today, I think we have really few standards and bitcoin > softwares relying on multi-party funded transactions [4]. > > If you're a Bitcoin user or business and you don't like full-rbf, please > express an opinion on how it might affect your software/operations. I'm > always interested to learn more about mempool and transaction-relay > interactions with upper-layers and applications and to listen to feedback > in those areas, and I guess a lot of other Bitcoin researchers/devs too. = I > know there have been a lot of concerns about full-rbf in the past, howeve= r > I believe the Bitcoin ecosystem has matured a lot since then. > > Any mistakes or missing context is my own. > > Cheers, > Antoine > > [0] For more info about replace-by-fee, see > https://bitcoinops.org/en/topics/replace-by-fee/ > > [1] For more details about the DoS vector, see > https://lists.linuxfoundation.org/pipermail/lightning-dev/2021-May/003033= .html > > [2] E.g I think it does not affect the Lightning Pool service, as there i= s > a preliminary step where the participant funds are locked first in a 2-of= -2 > with the coordinator before being committed in the multi-party batch > transaction. > > [3] https://github.com/bitcoin/bitcoin/pull/25353 > > [4] E.g DLCs : > https://github.com/discreetlogcontracts/dlcspecs/blob/master/Transactions= .md > ; Lightning dual-funded channel : > https://github.com/lightning/bolts/pull/851 > > > --00000000000058024005e19ac1cf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi alicexbt,


Thanks for taking time to review the pull request,


> 1)If something relies on a policy which can be = changed without breaking consensus rules, how is it secure in any case with= or without full rbf?=C2=A0


Your Lightning node software relies on far more soft= ware and hardware components than the transaction-relay p2p network.=C2=A0<= /font>One could list th= e operating system on which is running your Lightning process or the compil= er toolchain turning out=C2=A0your Lightning source code in a binary artifact. Some weird kernel&#= 39;s memory mapping change could allow access to=C2=A0your channel funding keys, _without_ breakin= g the Bitcoin consensus rules [0]. Moreover, your Lightning node is also=C2= =A0relying on the exist= ence of a global Internet allowing your HTLC transaction to flow from your = physical host=C2=A0to t= he crowd of transactions confirming in the blockchain. Due to this "pr= otocol assumption" your channel balance=C2=A0would be vulnerable to any change in your ISP ro= uting policy, e.g refusing to accept your IPV4 traffic by a sudden=C2=A0desiderata to impose an IP= V6 supremacy. Still _without_ breaking the Bitcoin consensus rules. Of cour= se, the odds of=C2=A0yo= ur ISP operator adopting this behavior are really low, mostly because your = operator has to bind to social and=C2=A0economic constraints to stay in business.


And I believe this imperative to stay in business is= certainly not absent in the incentives of the Bitcoin node=C2=A0operators. You're free= to run any policy on your node, especially one hardening the safety of you= r operations=C2=A0beyond the default one. However, if you start to a transaction-re= lay non-compatible with miner incentives, you=C2=A0won't have an efficient view of the blocksp= ace demand, and from then won't be able to offer compelling feerates=C2= =A0to execute your busi= ness transactions to satisfy your client needs. Or you won't consolidat= e your=C2=A0wallet UTXO= s at times of low-deman= d. Indeed, a sane visibility of the mempools might not be critical now for= =C2=A0your Bitcoin oper= ations, but this is not likely to become true with miner's coinbase rew= ard lowering with time=C2=A0and the system security relying on a fruitful fee market.


So assuming there is a significant number of economi= cally rational entities running p2p nodes, I think it's a=C2=A0<= /span>reasonable assumption fo= r Lightning developers that a policy maximizing miner's income and econ= omic nodes=C2=A0operati= ons will be widely run on the p2p network, and therefore lay its security m= odel on that. When there is a=C2=A0gap between the economically optimal policy (full-rbf) and the = effectively deployed one (optin), and this gap=C2=A0constitutes a flaw for exploitation, I believe= it's better to fix it.


If you have a different mode of thinking w.r.t how w= e should design protocol in a trust-minimized, open,=C2=A0adversarial=C2=A0<= /span>environment such as Bitc= oin, I'm curious to listen to it.


> If I write a python script that expects user to= enter char 'a' or 'b' but user can enter 'c' and t= here is no code to handle exceptions or other chars, will it be secure?


Of course not. If you deliver any critical software,= you should attach a solid manual explaining all the=C2=A0corner cases and rough edges. Eve= n better would be to enshrine the manual directly in your software API=C2= =A0to minimize the foot= gunish behaviors. E.g, with any ECC library, forbidding to reuse nonces. If= your=C2=A0user still i= gnores or misread the manual and provides an insecure input, there is not that much you can do.


By analogy, I believe that's the same with Light= ning. One recommendation of the deployment manual would=C2=A0= be to be always connected to a= full-rbf transaction-relay topology. Defaulting to this rule and your node= =C2=A0exposes far more = surface of attacks. Assuming the manual has been well-written (big assumpti= on!), I don't think= the system designer would be to blame.


That said, one issue to confess with current Lightni= ng is our lack of understanding of what should be figured out in=C2=A0the LN user manual fo= r safe operations. I would say that's an active area of research [1] [2= ] [3]


> 2)full-rbf is not default in the 2 open pull re= quests, so this experiment still relies on users changing RBF policies manu= ally. If majority of nodes use default opt-in policy, how would this affect= vulnerable projects?


If we define the goal as ensuring there is a signifi= cant number of transaction-relay routes=C2=A0between the L2s nodes requiring full-rbf and t= he set of miners supporting this policy, and=C2=A0the set of miners is populated enough, there is = no need to convince the majority of nodes=C2=A0operators to switch to full-rbf.


Beyond landing the 'full-rbf' pull request, = in pursuit of a partial full-rbf deployment,=C2=A0I'm thinking of reaching out to Light= ning vendors to recommend running LN nodes operators=C2=A0run their full-node with = the setting enabled. And also to few mining pool operators to=C2=A0<= span style=3D"font-family:arial,sans-serif">advocate the potential increase= in their income.


Given there are like 17000 public LN nodes, if half = of them adopt full-rbf it should give=C2=A0already a good number of full-rbf transaction-re= lay routes across the p2p network graph.=C2=A0When we're there, we can measure and think more = about how to tune the full-rbf sub-topology.


> 2-3% transactions are replaced with opt-in RBF,= if someone did not replace earlier why would they do it with full RBF?


Because it's breaking the reliability and securi= ty of their use-cases. Use-cases which didn't exist=C2=A0= a few years ago. The mempool D= oS vector is described here [4]. To the best of my understanding, it might= =C2=A0affect a bunch of= use-cases, such as dual-funded channels, on-chain DLCs, p2p coinjoi= ns, batched submarine=C2=A0swaps out. With the attack= described, the honest set of users might not have visibility of the networ= k=C2=A0mempools that th= ere is a malicious, low-cost, opt-out double-spend preventing the propagati= on of their multi-party=C2=A0transaction. With the existence of a full-rbf transaction-relay topol= ogy, the multi-party transaction=C2=A0is able to replace the optout.


None of those use-cases were deployed a few years ag= o, and the understanding of the interactions with the=C2=A0mempool policy is still nascent = among their operators. However, if we assume that layering is a way to grow= =C2=A0the Bitcoin ecosy= stem, as I do, it is reasonable to expect they will constitute a notable sh= are of the=C2=A0Bitcoin= transaction traffic during the next decade.


> I am not opposed to full-rbf; rather, I am oppo= sed to the notion that full-rbf will solve all problems


I wished we had a magic Silver Bullet (tm) solving a= ll the Bitcoin problems...


I'm only advocating a partial full-rbf deploymen= t to solve a real precise security issue affecting=C2=A0multi-party funded transactions. Th= at said, full-rbf is far from solving the known set of problems=C2=A0affecting the L2s due to inte= ractions with network mempools. E,g, see package relay motivation [5]


> I would suggest users to try Bitcoin Knots inst= ead which already has an option to disable all RBF policies if required, op= t-in and full RBF policy.


Selecting a full-node to underpin any serious Bitcoi= n infrastructure or secure a significant stack of coins=C2=A0= should be submitted to a fully= -fledged decision-making process. Many factors are likely to matter<= span style=3D"font-family:arial,sans-serif"> such as=C2=A0the level of activity of the contributor= community, the chain of trust w.r.t dependencies, the security incident t<= /span>rack records, the qualit= y of the documentation, the exhaustivity and robustness of the set of featu= res, ...


This process might take tens of hours, to be duplica= ted by the number of node operators who would have to=C2=A0do the full-node vending switch.= If you consider the cognitive cost at the level of the Bitcoin=C2=A0ecosystem, it's far less = costly to implement and review a few lines of codes in Bitcoin Core.


> Developers should provide basic RBF policy opti= ons rather than attempting to define what constitutes a good policy and rem= oving the ability to disable something when necessary.


Of course, this statement assumes there is a clear l= ine between the developers and the users. Developers=C2=A0are also Bitcoin users, and they&= #39;re modifying the software to suit their use-case needs. And that's = exactly=C2=A0the purpos= e of the 'full-rbf' PR I'm proposing, aiming to propose a "= ;good" policy for a Lightning node, without actually seeking to change= the default. If they're=C2=A0parties interested in implementing more RBF policy options in Bi= tcoin Core, I think they're free to propose such=C2=A0changes and invest the engineering effor= t to do so. If you're interested in advancing the state of=C2=A0= policy options in Bitcoin Core= , there are a lot of interesting resources available and communities to=C2=A0encourage you in the learning process to con= tribute to the codebase [6].


Antoine


[0] https://dirty= cow.ninja

[1] https://github.com/t-bast/lightning-doc= s/blob/master/pinning-attacks.md

[2] https://arxiv.org/pdf/2006.01418.pdf

[3] https://arxiv.org/pdf/2006.08513.pdf

[4] https://lists.linuxfoundation.or= g/pipermail/lightning-dev/2021-May/003033.html

[5] https://lists.linuxfoundation.org/= pipermail/bitcoin-dev/2022-May/020493.html

[6] http= s://www.summerofbitcoin.org



Le=C2=A0jeu. 16 juin 2022 =C3= =A0=C2=A000:15, alicexbt <ali= cexbt@protonmail.com> a =C3=A9crit=C2=A0:
=
Hi Anto= ine,


Thanks for opening the pull request to add support for full-rbf in= Bitcoin Core. I have a disagreements with the approach and questions.

Recent discussi= ons among LN devs have brought back on the surface concerns about the secur= ity of multi-party funded transactions (coinjoins, dual-funded LN channels,= on-chain DLCs, ...). It turns out there is a low-fruit, naive DoS vector p= layable against the funding flow of any such construction due to the lack o= f existent full-rbf transaction-relay topology on today's p2p network [= 0] [1].=C2=A0

1)If something relies on a= policy which can be changed without breaking consensus rules, how is it se= cure in any case with or without full rbf? If I write a python script that = expects user to enter char 'a' or 'b' but user can enter &#= 39;c' and there is no code to handle exceptions or other chars, will it= be secure?=C2=A0=C2=A0

2)full-rbf is not default in the 2 open pull reque= sts, so this experiment still relies on users changing RBF policies manuall= y. If majority of nodes use default opt-in policy, how would this affect vu= lnerable projects?

If you're a mining operator looking to increase your income, y= ou might be interested to experiment with full-rbf as a policy.
Miners can only increase their income if users replace transacti= ons. 2-3% transactions are replaced with opt-in RBF, if someone did not rep= lace earlier why would they do it now even with full RBF? Or even if we add= some users in it who could not signal for some reasons, do you think it wo= uld be anything above 5%?

If you're a Bitcoin user or business and you don't l= ike full-rbf, please express an opinion on how it might affect your softwar= e/operations. I'm always interested to learn more about mempool and tra= nsaction-relay interactions with upper-layers and applications and to liste= n to feedback in those areas, and I guess a lot of other Bitcoin researcher= s/devs too. I know there have been a lot of concerns about full-rbf in the = past, however I believe the Bitcoin ecosystem has matured a lot since then.=

I am not opposed to full-rbf; rather, I am opp= osed to the notion that full-rbf will solve all problems and the lack of ba= sic options in Bitcoin Core to employ/disable different RBF policies. There= is also a speculation about making full RBF default in an year which isn&#= 39;t relevant to discuss at this point without trying different RBF policie= s.

I would suggest users to try Bitcoin Knots instead which already= has an option to disable all RBF policies if required, opt-in and full RBF= policy. This can also be done using GUI if not familiar with config option= mempoolreplacement=E2=80=8B.

The rationale in PR #1617= 1 was insufficient to justify removing it in the first place, had 2 NACKs a= nd was reopened to merge it. Why bother with a few lines of code that may a= llow someone disable it if required in local mempool since it's only us= eful when a big percentage of miners utilize it and essentially underused a= ccording to the PR author? Developers should provide basic RBF policy optio= ns rather than attempting to define what constitutes a good policy and remo= ving the ability to disable something when necessary.


/dev/fd0

Sent with Proton Mail secure email.

------- Original Message -------
On Tuesday, June 14th, 2022 at 5:55 AM, Antoine Riard via bitcoin-d= ev <bitcoin-dev@lists.linuxfoundation.org> wrote:

Hi list,

Recent discussions among LN de= vs have brought back on the surface concerns about the security of multi-pa= rty funded transactions (coinjoins, dual-funded LN channels, on-chain DLCs,= ...). It turns out there is a low-fruit, naive DoS vector playable against= the funding flow of any such construction due to the lack of existent full= -rbf transaction-relay topology on today's p2p network [0] [1]. While i= t does not consist in a direct loss of funds, if exploited well I think it&= #39;s annoying enough to inflict significant timevalue loss or fee-bumping = waste
to the future providers or distributed swarm of users doing multi= -party funded transactions. Of course, it can be fixed one layer above by i= ntroducing either fidelity bonds or a reliable centralized coordinator, tho= ugh at the price of an overhead per-participant ressources cost and loss in= system openness [1].

For that reason, I believe it would be benefic= ial to the flourishing of multi-party funded transactions to fix the Dos ve= ctor by seeing a subset of the network running full-rbf and enabling propag= ation of honest multi-party transactions to the interested miners, replacin= g potential non-signaling double-spend from a malicious counterparty. Movin= g towards that direction, I've submitted a small patch against Bitcoin = Core enabling it to turn on full-rbf as a policy, still under review [3]. T= he default setting stays **false**, i.e keeping opt-in RBF as a default rep= lacement policy. I've started to run the patch on a public node at 146.= 190.224.15.

If you're a node operator curious to play with full-= rbf, feel free to connect to this node or spawn up a toy, public node yours= elf. There is a ##uafrbf libera chat if you would like information on the s= ettings or looking for full-rbf friends (though that step could be automate= d in the future by setting up a dedicated network bit and reserving a few o= utbound slots for them).

If you're a mining operator looking to = increase your income, you might be interested to experiment with full-rbf a= s a policy. Indeed, in the future I believe the multi-party transactions is= suers who need full-rbf to secure their funding flow should connect by defa= ult to full-rbf peers. One can conjecture that their transactions are likel= y to be more compelling in their feerate as their liquidity needs are highe= r than the simple transaction. For today, I think we have really few standa= rds and bitcoin softwares relying on multi-party funded transactions [4].
If you're a Bitcoin user or business and you don't like full-= rbf, please express an opinion on how it might affect your software/operati= ons. I'm always interested to learn more about mempool and transaction-= relay interactions with upper-layers and applications and to listen to feed= back in those areas, and I guess a lot of other Bitcoin researchers/devs to= o. I know there have been a lot of concerns about full-rbf in the past, how= ever I believe the Bitcoin ecosystem has matured a lot since then.

A= ny mistakes or missing context is my own.

Cheers,
Antoine

= [0] For more info about replace-by-fee, see https://bitcoinops.org/en/topics/replace-by-fee/

[1]= For more details about the DoS vector, see https://lists.linuxfoundation.org/p= ipermail/lightning-dev/2021-May/003033.html

[2] E.g I think it d= oes not affect the Lightning Pool service, as there is a preliminary step w= here the participant funds are locked first in a 2-of-2 with the coordinato= r before being committed in the multi-party batch transaction.

[3] <= a href=3D"https://github.com/bitcoin/bitcoin/pull/25353" rel=3D"noreferrer = nofollow noopener" target=3D"_blank">https://github.com/bitcoin/bitcoin/pul= l/25353

[4] E.g DLCs : https://github.com/discreetlogcontracts/dlcspec= s/blob/master/Transactions.md ; Lightning dual-funded channel : https://github.com/lightning/bolts/pull/851

--00000000000058024005e19ac1cf--