<oembed><type>rich</type><version>1.0</version><author_name>npub1vjzmc45k8dgujppapp2ue20h3l9apnsntgv4c0ukncvv549q64gsz4x8dd</author_name><author_url>https://nostr.ae/npub1vjzmc45k8dgujppapp2ue20h3l9apnsntgv4c0ukncvv549q64gsz4x8dd</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2022-10-17&#xA;📝 Original message:Hi John,&#xA;&#xA;I hear your worry about RBF issuing concerns for 0conf acceptance&#xA;merchants. I don&#39;t think it has been denied in the first communication of&#xA;this opt-in rbf proposal back in June. Merchants/0confs builders have been&#xA;invited to bring voices to the surface at that time [0]. So this new&#xA;full-RBF proposal has at least tried to bind to best communication&#xA;standards towards the community at large. If you think about more community&#xA;venues (Reddit, podcast, newsletter, ...) that developers may weigh in when&#xA;proposing Core policy changes, we can improve for next time.&#xA;&#xA;About the kernel of the concern I understand, I think the whole discussion&#xA;would benefit from clarifications in precising zero-conf security bounds.&#xA;Relying only on first-seen and lack of RBF as a solo ground to estimate the&#xA;safety of an incoming transaction isn&#39;t that robust in a distributed system&#xA;like the p2p network. However, building management risks framework on top,&#xA;as additional security layers sound a far more compelling approach from a&#xA;developer perspective. A year ago, when I initially proposed full-rbf, I&#xA;noted a few ideas that could be implemented such as double-spend monitoring&#xA;or staked reputation to enhance zero-conf security [1]. For sure, there is&#xA;a wide solution space to explore and build on to improve the 0conf flows,&#xA;and it would marginally benefit LN, as we have now zero-conf channels [2].&#xA;&#xA;That said, saying RBF causes more problems than it resolves sounds hard to&#xA;hold as a line from my perspective. As LN security relies on a reactive&#xA;model, where time-sensitive transactions must be included before a given&#xA;height to ensure funds safety, the ability to replace-by-fee previous bids&#xA;and have them propagating well on the network is fundamental. While I think&#xA;this is correct to say that today 0conf might be still a more significant&#xA;economic traffic than Lightning, the bitcoin user of tomorrow is likely to&#xA;expect both 0conf and Lightning, without caring that much about the&#xA;quibbles of the security mechanisms backing them.&#xA;&#xA;Overall, RBF is far from being a &#34;black-and-white&#34; thing, dependending of&#xA;the perspective you&#39;re coming from, and thanks to everyone for patience in&#xA;this discussion.&#xA;&#xA;Best,&#xA;Antoine&#xA;&#xA;[0]&#xA;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-June/020557.html&#xA;[1]&#xA;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-June/019074.html&#xA;[2] https://github.com/lightning/bolts/pull/910&#xA;&#xA;Le ven. 7 oct. 2022 à 12:43, Dario Sneidermanis via bitcoin-dev &lt;&#xA;bitcoin-dev at lists.linuxfoundation.org&gt; a écrit :&#xA;&#xA;&gt; Hello list,&#xA;&gt;&#xA;&gt; I&#39;m Dario, from Muun wallet, a mobile non-custodial bitcoin wallet. For&#xA;&gt; the past&#xA;&gt; few days we&#39;ve been reviewing the latest bitcoin core release candidate,&#xA;&gt; and we&#xA;&gt; found some troubling facts related to the opt-in full-RBF deployment.&#xA;&gt;&#xA;&gt; We first learned about the opt-in full-RBF proposal last June when it was&#xA;&gt; announced on the mailing list. Closing the gap between the protocol&#39;s relay&#xA;&gt; policies and the miner incentives is inevitable, so it was a welcomed&#xA;&gt; addition.&#xA;&gt; Furthermore, allowing transaction replacements that remove the opt-in RBF&#xA;&gt; flag&#xA;&gt; was deeply problematic.&#xA;&gt;&#xA;&gt; At the time, we understood we had at least a year from the initial opt-in&#xA;&gt; deployment until opt-out was deployed, giving us enough time to adapt Muun&#xA;&gt; to&#xA;&gt; the new policies. However, when reviewing the 24.0 release candidate just&#xA;&gt; a few&#xA;&gt; days ago, we realized that zero-conf apps (like Muun) must *immediately&#xA;&gt; turn&#xA;&gt; off* their zero-conf features.&#xA;&gt;&#xA;&gt; I understand this wasn&#39;t the intention when designing the opt-in deployment&#xA;&gt; mechanism. Given this new information, do you see a path where we can&#xA;&gt; delay the&#xA;&gt; opt-in deployment and find a safer way to deploy full-RBF?&#xA;&gt;&#xA;&gt; It&#39;d be great for this deployment to be a success so that we can continue&#xA;&gt; fixing&#xA;&gt; the remaining relay policy problems, such as package relay and the RBF&#xA;&gt; rules.&#xA;&gt; Maybe we could go straight to an opt-out deployment locked by code at a&#xA;&gt; certain&#xA;&gt; height in the future to give time to everyone and, at the same time, avoid&#xA;&gt; a&#xA;&gt; huge mempool divergence event?&#xA;&gt;&#xA;&gt; Below is our analysis of how zero-conf apps break with opt-in full-RBF. I&#xA;&gt; hope&#xA;&gt; it helps.&#xA;&gt;&#xA;&gt; Cheers,&#xA;&gt; Dario&#xA;&gt;&#xA;&gt;&#xA;&gt; # How do zero-conf apps work&#xA;&gt;&#xA;&gt; While the workings and trade-offs of zero-conf applications might be known&#xA;&gt; by&#xA;&gt; many in this list, it&#39;s useful to define precisely how they work to&#xA;&gt; understand&#xA;&gt; how they break.&#xA;&gt;&#xA;&gt; We call zero-conf applications to entities that accept on-chain payments&#xA;&gt; from&#xA;&gt; *untrusted parties* and will sometimes deliver the paid-for product or&#xA;&gt; service&#xA;&gt; without waiting for the transaction to be included in a block.&#xA;&gt;&#xA;&gt; Some examples of zero-conf apps:&#xA;&gt;&#xA;&gt; - Muun&#39;s submarine swaps for outgoing lightning payments&#xA;&gt; - Bitrefill&#39;s on-chain payments for gift cards and phone top-ups&#xA;&gt; - Many bitcoin ATMs&#39; on-chain deposits for selling bitcoin for cash (at&#xA;&gt; least&#xA;&gt;   the two biggest bitcoin ATM manufacturers support this: Genesis Coin and&#xA;&gt;   General Byte)&#xA;&gt;&#xA;&gt; All of these applications are receiving incoming on-chain transactions for&#xA;&gt; which&#xA;&gt; they don&#39;t control the inputs, and performing a risk analysis to decide&#xA;&gt; whether&#xA;&gt; they are ok with accepting the payment without confirmation.&#xA;&gt;&#xA;&gt; In practice, this works because once the bitcoin P2P network has fully&#xA;&gt; propagated a non-RBF transaction, you need the collaboration of a miner to&#xA;&gt; replace it, which isn&#39;t easy to get today. Even though many of the biggest&#xA;&gt; miners offer off-band transaction broadcasting services, they currently&#xA;&gt; won&#39;t&#xA;&gt; process conflicting transactions.&#xA;&gt;&#xA;&gt; Roughly, the risk analysis goes like this:&#xA;&gt;&#xA;&gt; 1. if an incoming transaction is RBF (direct or inherited)&#xA;&gt;    --&gt; too risky, wait for 1 conf (or more) since it can be replaced at&#xA;&gt; any time&#xA;&gt; 2. if the payment is for an amount greater than X&#xA;&gt;    --&gt; too risky, wait for 1 conf (or more), since the amount is worthy of&#xA;&gt; a&#xA;&gt;        sophisticated attacker&#xA;&gt; 3. wait for full(ish) propagation of the incoming transaction&#xA;&gt; 4. if there&#39;s no double-spend attempt&#xA;&gt;    --&gt; accept 0-conf&#xA;&gt;&#xA;&gt; As with any other risk analysis, there&#39;s always a false-negative detection&#xA;&gt; rate,&#xA;&gt; leading to an expected loss, which the zero-conf app should be willing to&#xA;&gt; bear.&#xA;&gt; Notice that the expected loss is tunable via the amount X in the above&#xA;&gt; analysis.&#xA;&gt;&#xA;&gt;&#xA;&gt; # Why are zero-conf apps not protected with an opt-in deployment&#xA;&gt;&#xA;&gt; Full-RBF adoption works on three different layers:&#xA;&gt;&#xA;&gt; - The transaction application layer&#xA;&gt; - The transaction relaying layer&#xA;&gt; - The transaction mining layer&#xA;&gt;&#xA;&gt; If an application wants to replace with full-RBF an *outgoing*&#xA;&gt; transaction, it&#xA;&gt; will need:&#xA;&gt;&#xA;&gt; - An upgraded node that opted into full-RBF, from which it can broadcast&#xA;&gt; the&#xA;&gt;   replacement transaction&#xA;&gt; - A connected component of upgraded nodes that opted into full-RBF, that&#xA;&gt; can&#xA;&gt;   relay the replacement transaction&#xA;&gt; - A miner in that connected component with an upgraded node that opted into&#xA;&gt;   full-RBF, that can mine the replacement transaction&#xA;&gt;&#xA;&gt; However, an application cannot control whether a replacement to an&#xA;&gt; *incoming*&#xA;&gt; transaction is relayed via full-RBF. As soon as a single application can&#xA;&gt; generate replacements easily via full-RBF, all other applications have to&#xA;&gt; assume&#xA;&gt; that any incoming transaction from an untrusted party might be replaced via&#xA;&gt; full-RBF. That is, for the application layer this is a forced upgrade.&#xA;&gt;&#xA;&gt; As soon as an unsophisticated attacker can use opt-in full-RBF, the risk&#xA;&gt; analysis performed by zero-conf applications stops working because the&#xA;&gt; transactions to analyze are all incoming transactions from untrusted&#xA;&gt; parties.&#xA;&gt; Since some wallets already implement cancel functionality for opt-in RBF&#xA;&gt; transactions, enabling the same functionality for every transaction&#xA;&gt; wouldn&#39;t&#xA;&gt; require much work, making canceling any unconfirmed transaction a one-click&#xA;&gt; experience. After this, the security model of zero-conf applications goes&#xA;&gt; from&#xA;&gt; &#34;susceptible to attacks from miners&#34; to &#34;anyone can perform an attack,&#xA;&gt; with an&#xA;&gt; easy-to-use interface&#34;.&#xA;&gt;&#xA;&gt; That is, the opt-in deployment of full-RBF doesn&#39;t protect zero-conf&#xA;&gt; applications from having to turn off their zero-conf features very soon&#xA;&gt; after&#xA;&gt; the initial deployment. All mitigations are mostly ineffective against&#xA;&gt; untrusted parties.&#xA;&gt;&#xA;&gt;&#xA;&gt; # Other things we have to fix&#xA;&gt;&#xA;&gt; While it&#39;s clear how full-RBF breaks zero-conf applications, other more&#xA;&gt; subtle&#xA;&gt; things break in *many* wallets (Muun included). If given the opportunity,&#xA;&gt; we&#xA;&gt; would like to fix them before deployment. One could argue that these things&#xA;&gt; were already broken, but they get considerably worse as the network adopts&#xA;&gt; full-RBF (even with an opt-in deployment), so we should fix them.&#xA;&gt;&#xA;&gt; ## Mental model for unconfirmed incoming transactions&#xA;&gt;&#xA;&gt; Many wallets with support for on-chain payments (Muun included) show&#xA;&gt; incoming&#xA;&gt; external transactions in some way to their users before they confirm. This&#xA;&gt; is a&#xA;&gt; common practice because not showing them leads users to worry that their&#xA;&gt; money&#xA;&gt; disappeared (exchanges doing this is the #1 issue we have to deal with in&#xA;&gt; our&#xA;&gt; customer support channels).&#xA;&gt;&#xA;&gt; With full-RBF, wallets should make it extremely clear to users that&#xA;&gt; unconfirmed&#xA;&gt; funds are not theirs (yet). Otherwise, protocol-unaware users that are&#xA;&gt; transacting on-chain with untrusted parties can be easily scammed if they&#xA;&gt; don&#39;t&#xA;&gt; know they have to wait for a confirmation. Eg. in Argentina, it&#39;s pretty&#xA;&gt; common&#xA;&gt; to meet someone in person to buy bitcoin P2P for cash, even for newcomers.&#xA;&gt;&#xA;&gt; ## Block explorers as payment receipts&#xA;&gt;&#xA;&gt; Most wallets with support for on-chain payments (Muun included) use the&#xA;&gt; transaction view of a block explorer as a shareable payment receipt. The&#xA;&gt; sender&#xA;&gt; of an on-chain transaction usually shares this link with the receiver to&#xA;&gt; let&#xA;&gt; them know they made a payment. Protocol-unaware receivers sometimes take&#xA;&gt; this&#xA;&gt; link as proof of payment.&#xA;&gt;&#xA;&gt; Most explorers currently don&#39;t track payment replacements and, more&#xA;&gt; importantly,&#xA;&gt; don&#39;t warn users that unconfirmed funds are not theirs (yet). With&#xA;&gt; full-RBF,&#xA;&gt; wallets should either stop relying on explorers for this functionality or&#xA;&gt; wait&#xA;&gt; for them to support it explicitly.&#xA;&gt;&#xA;&gt;&#xA;&gt; # Impact at Muun&#xA;&gt;&#xA;&gt; Work to transition Muun from using zero-conf submarine swaps to using&#xA;&gt; payment&#xA;&gt; channels is ongoing, but we are still several months away from being&#xA;&gt; production&#xA;&gt; ready. This means we would have to turn off outgoing lightning payments for&#xA;&gt; +100k monthly active users, which is a good chunk of all users making&#xA;&gt; non-custodial lightning payments today.&#xA;&gt;&#xA;&gt; Furthermore, the more subtle fixes imply non-trivial amounts of product&#xA;&gt; work&#xA;&gt; that we cannot reasonably deploy before they start affecting users.&#xA;&gt;&#xA;&gt; While I cannot talk for other applications, there are many impacted in one&#xA;&gt; way&#xA;&gt; or another, and none of the ones I checked with were aware of this change,&#xA;&gt; or&#xA;&gt; its implications.&#xA;&gt; _______________________________________________&#xA;&gt; bitcoin-dev mailing list&#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20221017/28add9f9/attachment.html&gt;</html></oembed>