<oembed><type>rich</type><version>1.0</version><author_name>npub1q5sgcakfxhw3ya93tvnpqeacvf32p6lw70hke53rkjnf9lhw9w8s43ps87</author_name><author_url>https://nostr.ae/npub1q5sgcakfxhw3ya93tvnpqeacvf32p6lw70hke53rkjnf9lhw9w8s43ps87</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2015-05-26&#xA;📝 Original message:What prevents RBF from being used for fraudulent payment reversals?&#xA;&#xA;Pay 1BTC to Alice for hard goods, then after you receive the goods&#xA;broadcast a double spend of that transaction to pay Alice nothing? Your&#xA;only cost is the higher network fee of the 2nd tx.&#xA;&#xA;Thanks,&#xA;-Danny&#xA;&#xA;On Mon, May 25, 2015 at 5:10 PM, Peter Todd &lt;pete at petertodd.org&gt; wrote:&#xA;&#xA;&gt; On Tue, May 26, 2015 at 12:03:09AM +0200, Mike Hearn wrote:&#xA;&gt; &gt; CPFP also solves it just fine.&#xA;&gt;&#xA;&gt; CPFP is a significantly more expensive way of paying fees than RBF,&#xA;&gt; particularly for the use-case of defragmenting outputs, with cost&#xA;&gt; savings ranging from 30% to 90%&#xA;&gt;&#xA;&gt;&#xA;&gt; Case 1: CPFP vs. RBF for increasing the fee on a single tx&#xA;&gt; ----------------------------------------------------------&#xA;&gt;&#xA;&gt; Creating an spending a P2PKH output uses 34 bytes of txout, and 148&#xA;&gt; bytes of txin, 182 bytes total.&#xA;&gt;&#xA;&gt; Let&#39;s suppose I have a 1 BTC P2PKH output and I want to pay 0.1 BTC to&#xA;&gt; Alice. This results in a 1in/2out transaction t1 that&#39;s 226 bytes in size.&#xA;&gt; I forget to click on the &#34;priority fee&#34; option, so it goes out with the&#xA;&gt; minimum fee of 2.26uBTC. Whoops! I use CPFP to spend that output,&#xA;&gt; creating a new transaction t2 that&#39;s 192 bytes in size. I want to pay&#xA;&gt; 1mBTC/KB for a fast confirmation, so I&#39;m now paying 418uBTC of&#xA;&gt; transaction fees.&#xA;&gt;&#xA;&gt; On the other hand, had I use RBF, my wallet would have simply&#xA;&gt; rebroadcast t1 with the change address decreased. The rules require you&#xA;&gt; to pay 2.26uBTC for the bandwidth consumed broadcasting it, plus the new&#xA;&gt; fee level, or 218uBTC of fees in total.&#xA;&gt;&#xA;&gt; Cost savings: 48%&#xA;&gt;&#xA;&gt;&#xA;&gt; Case 2: Paying multiple recipients in succession&#xA;&gt; ------------------------------------------------&#xA;&gt;&#xA;&gt; Suppose that after I pay Alice, I also decide to pay Bob for his hard&#xA;&gt; work demonstrating cryptographic protocols. I need to create a new&#xA;&gt; transaction t2 spending t1&#39;s change address. Normally t2 would be&#xA;&gt; another 226 bytes in size, resulting in 226uBTC additional fees.&#xA;&gt;&#xA;&gt; With RBF on the other hand I can simply double-spend t1 with a&#xA;&gt; transaction paying both Alice and Bob. This new transaction is 260 bytes&#xA;&gt; in size. I have to pay 2.6uBTC additional fees to pay for the bandwidth&#xA;&gt; consumed broadcasting it, resulting in an additional 36uBTC of fees.&#xA;&gt;&#xA;&gt; Cost savings: 84%&#xA;&gt;&#xA;&gt;&#xA;&gt; Case 3: Paying multiple recipients from a 2-of-3 multisig wallet&#xA;&gt; ----------------------------------------------------------------&#xA;&gt;&#xA;&gt; The above situation gets even worse with multisig. t1 in the multisig&#xA;&gt; case is 367 bytes; t2 another 367 bytes, costing an additional 367uBTC&#xA;&gt; in fees. With RBF we rewrite t1 with an additional output, resulting in&#xA;&gt; a 399 byte transaction, with just 36uBTC in additional fees.&#xA;&gt;&#xA;&gt; Cost savings: 90%&#xA;&gt;&#xA;&gt;&#xA;&gt; Case 4: Dust defragmentation&#xA;&gt; ----------------------------&#xA;&gt;&#xA;&gt; My wallet has a two transaction outputs that it wants to combine into&#xA;&gt; one for the purpose of UTXO defragmentation. It broadcasts transaction&#xA;&gt; t1 with two inputs and one output, size 340 bytes, paying zero fees.&#xA;&gt;&#xA;&gt; Prior to the transaction confirming I find I need to spend those funds&#xA;&gt; for a priority transaction at the 1mBTC/KB fee level. This transaction,&#xA;&gt; t2a, has one input and two outputs, 226 bytes in size. However it needs&#xA;&gt; to pay fees for both transactions at once, resulting in a combined total&#xA;&gt; fee of 556uBTC. If this situation happens frequently, defragmenting&#xA;&gt; UTXOs is likely to cost more in additional fees than it saves.&#xA;&gt;&#xA;&gt; With RBF I&#39;d simply doublespend t1 with a 2-in-2-out transaction 374&#xA;&gt; bytes in size, paying 374uBTC. Even better, if one of the two inputs is&#xA;&gt; sufficiently large to cover my costs I can doublespend t1 with a&#xA;&gt; 1-in-2-out tx just 226 bytes in size, paying 226uBTC.&#xA;&gt;&#xA;&gt; Cost savings: 32% to 59%, or even infinite if defragmentation w/o RBF&#xA;&gt;               costs you more than you save&#xA;&gt;&#xA;&gt; --&#xA;&gt; &#39;peter&#39;[:-1]@petertodd.org&#xA;&gt; 0000000000000000134ce6577d4122094479f548b997baf84367eaf0c190bc9f&#xA;&gt;&#xA;&gt;&#xA;&gt; ------------------------------------------------------------------------------&#xA;&gt; One dashboard for servers and applications across Physical-Virtual-Cloud&#xA;&gt; Widest out-of-the-box monitoring support with 50+ applications&#xA;&gt; Performance metrics, stats and reports that give you Actionable Insights&#xA;&gt; Deep dive visibility with transaction tracing using APM Insight.&#xA;&gt; http://ad.doubleclick.net/ddm/clk/290420510;117567292;y&#xA;&gt; _______________________________________________&#xA;&gt; Bitcoin-development mailing list&#xA;&gt; Bitcoin-development at lists.sourceforge.net&#xA;&gt; https://lists.sourceforge.net/lists/listinfo/bitcoin-development&#xA;&gt;&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20150526/4f1264c0/attachment.html&gt;</html></oembed>