summaryrefslogtreecommitdiff
path: root/38/e3551f6bddff92f30c9c20a1f0928faae9778e
blob: 4239c5713176f379cc19c4e0ff7d241603796a11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193]
	helo=mx.sourceforge.net)
	by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
	(envelope-from <voisine@gmail.com>) id 1YxJoK-0002h9-PM
	for bitcoin-development@lists.sourceforge.net;
	Tue, 26 May 2015 18:42:44 +0000
Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of gmail.com
	designates 209.85.220.177 as permitted sender)
	client-ip=209.85.220.177; envelope-from=voisine@gmail.com;
	helo=mail-qk0-f177.google.com; 
Received: from mail-qk0-f177.google.com ([209.85.220.177])
	by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128)
	(Exim 4.76) id 1YxJoJ-0000Kp-8T
	for bitcoin-development@lists.sourceforge.net;
	Tue, 26 May 2015 18:42:44 +0000
Received: by qkgx75 with SMTP id x75so97015119qkg.1
	for <bitcoin-development@lists.sourceforge.net>;
	Tue, 26 May 2015 11:42:37 -0700 (PDT)
MIME-Version: 1.0
X-Received: by 10.55.17.103 with SMTP id b100mr56989902qkh.71.1432665757770;
	Tue, 26 May 2015 11:42:37 -0700 (PDT)
Received: by 10.140.91.37 with HTTP; Tue, 26 May 2015 11:42:37 -0700 (PDT)
In-Reply-To: <CAJN5wHV=bVgM16PPQqsOd1Qu+pALeAPmGz4-6xEV1qG6Fo+ToA@mail.gmail.com>
References: <CANe1mWzBy8-C+CWfwaOLxJ2wokjy8ytQUh2TkRY_Ummn1BpPzw@mail.gmail.com>
	<CANEZrP0DL8yA=neK0DTq0npEqc0q+RvTQD57OndNVg0vi2=yMg@mail.gmail.com>
	<20150525212638.GB12430@savin.petertodd.org>
	<CANEZrP1k-rUBSj2GMKqOEZsOuHp=axKUSxShOiN01DorzkFODQ@mail.gmail.com>
	<20150526001034.GF21367@savin.petertodd.org>
	<CAJN5wHV=bVgM16PPQqsOd1Qu+pALeAPmGz4-6xEV1qG6Fo+ToA@mail.gmail.com>
Date: Tue, 26 May 2015 11:42:37 -0700
Message-ID: <CACq0ZD7pu0q1P9cMWK-F1s_CHTWuHhawjwiJ_rQT7isYqQ4OFw@mail.gmail.com>
From: Aaron Voisine <voisine@gmail.com>
To: Danny Thorpe <danny.thorpe@gmail.com>
Content-Type: multipart/alternative; boundary=001a1146918a92e6c30517007dff
X-Spam-Score: -0.6 (/)
X-Spam-Report: Spam Filtering performed by mx.sourceforge.net.
	See http://spamassassin.org/tag/ for more details.
	-1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for
	sender-domain
	0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
	(voisine[at]gmail.com)
	-0.0 SPF_PASS               SPF: sender matches SPF record
	1.0 HTML_MESSAGE           BODY: HTML included in message
	-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
	author's domain
	0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
	not necessarily valid
	-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
X-Headers-End: 1YxJoJ-0000Kp-8T
Cc: Bitcoin Dev <bitcoin-development@lists.sourceforge.net>
Subject: Re: [Bitcoin-development] Cost savings by using replace-by-fee,
	30-90%
X-BeenThere: bitcoin-development@lists.sourceforge.net
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <bitcoin-development.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development>
List-Post: <mailto:bitcoin-development@lists.sourceforge.net>
List-Help: <mailto:bitcoin-development-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=subscribe>
X-List-Received-Date: Tue, 26 May 2015 18:42:44 -0000

--001a1146918a92e6c30517007dff
Content-Type: text/plain; charset=UTF-8

See the "first-seen-safe replace-by-fee" thread


Aaron Voisine
co-founder and CEO
breadwallet.com

On Tue, May 26, 2015 at 11:22 AM, Danny Thorpe <danny.thorpe@gmail.com>
wrote:

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

--001a1146918a92e6c30517007dff
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">See the &quot;first-seen-safe replace-by-fee&quot; thread<=
/div><div class=3D"gmail_extra"><br clear=3D"all"><div><div class=3D"gmail_=
signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div><br>Aaron Voisine</d=
iv><div>co-founder and CEO<br><a href=3D"http://breadwallet.com" target=3D"=
_blank">breadwallet.com</a></div></div></div></div></div></div>
<br><div class=3D"gmail_quote">On Tue, May 26, 2015 at 11:22 AM, Danny Thor=
pe <span dir=3D"ltr">&lt;<a href=3D"mailto:danny.thorpe@gmail.com" target=
=3D"_blank">danny.thorpe@gmail.com</a>&gt;</span> wrote:<br><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa=
dding-left:1ex"><div dir=3D"ltr">What prevents RBF from being used for frau=
dulent payment reversals? =C2=A0<div><br></div><div>Pay 1BTC to Alice for h=
ard goods, then after you receive the goods broadcast a double spend of tha=
t transaction to pay Alice nothing? Your only cost is the higher network fe=
e of the 2nd tx.</div><div><br></div><div>Thanks,</div><div>-Danny</div></d=
iv><div class=3D"gmail_extra"><br><div class=3D"gmail_quote"><div><div clas=
s=3D"h5">On Mon, May 25, 2015 at 5:10 PM, Peter Todd <span dir=3D"ltr">&lt;=
<a href=3D"mailto:pete@petertodd.org" target=3D"_blank">pete@petertodd.org<=
/a>&gt;</span> wrote:<br></div></div><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><d=
iv class=3D"h5">On Tue, May 26, 2015 at 12:03:09AM +0200, Mike Hearn wrote:=
<br>
&gt; CPFP also solves it just fine.<br>
<br>
CPFP is a significantly more expensive way of paying fees than RBF,<br>
particularly for the use-case of defragmenting outputs, with cost<br>
savings ranging from 30% to 90%<br>
<br>
<br>
Case 1: CPFP vs. RBF for increasing the fee on a single tx<br>
----------------------------------------------------------<br>
<br>
Creating an spending a P2PKH output uses 34 bytes of txout, and 148<br>
bytes of txin, 182 bytes total.<br>
<br>
Let&#39;s suppose I have a 1 BTC P2PKH output and I want to pay 0.1 BTC to<=
br>
Alice. This results in a 1in/2out transaction t1 that&#39;s 226 bytes in si=
ze.<br>
I forget to click on the &quot;priority fee&quot; option, so it goes out wi=
th the<br>
minimum fee of 2.26uBTC. Whoops! I use CPFP to spend that output,<br>
creating a new transaction t2 that&#39;s 192 bytes in size. I want to pay<b=
r>
1mBTC/KB for a fast confirmation, so I&#39;m now paying 418uBTC of<br>
transaction fees.<br>
<br>
On the other hand, had I use RBF, my wallet would have simply<br>
rebroadcast t1 with the change address decreased. The rules require you<br>
to pay 2.26uBTC for the bandwidth consumed broadcasting it, plus the new<br=
>
fee level, or 218uBTC of fees in total.<br>
<br>
Cost savings: 48%<br>
<br>
<br>
Case 2: Paying multiple recipients in succession<br>
------------------------------------------------<br>
<br>
Suppose that after I pay Alice, I also decide to pay Bob for his hard<br>
work demonstrating cryptographic protocols. I need to create a new<br>
transaction t2 spending t1&#39;s change address. Normally t2 would be<br>
another 226 bytes in size, resulting in 226uBTC additional fees.<br>
<br>
With RBF on the other hand I can simply double-spend t1 with a<br>
transaction paying both Alice and Bob. This new transaction is 260 bytes<br=
>
in size. I have to pay 2.6uBTC additional fees to pay for the bandwidth<br>
consumed broadcasting it, resulting in an additional 36uBTC of fees.<br>
<br>
Cost savings: 84%<br>
<br>
<br>
Case 3: Paying multiple recipients from a 2-of-3 multisig wallet<br>
----------------------------------------------------------------<br>
<br>
The above situation gets even worse with multisig. t1 in the multisig<br>
case is 367 bytes; t2 another 367 bytes, costing an additional 367uBTC<br>
in fees. With RBF we rewrite t1 with an additional output, resulting in<br>
a 399 byte transaction, with just 36uBTC in additional fees.<br>
<br>
Cost savings: 90%<br>
<br>
<br>
Case 4: Dust defragmentation<br>
----------------------------<br>
<br>
My wallet has a two transaction outputs that it wants to combine into<br>
one for the purpose of UTXO defragmentation. It broadcasts transaction<br>
t1 with two inputs and one output, size 340 bytes, paying zero fees.<br>
<br>
Prior to the transaction confirming I find I need to spend those funds<br>
for a priority transaction at the 1mBTC/KB fee level. This transaction,<br>
t2a, has one input and two outputs, 226 bytes in size. However it needs<br>
to pay fees for both transactions at once, resulting in a combined total<br=
>
fee of 556uBTC. If this situation happens frequently, defragmenting<br>
UTXOs is likely to cost more in additional fees than it saves.<br>
<br>
With RBF I&#39;d simply doublespend t1 with a 2-in-2-out transaction 374<br=
>
bytes in size, paying 374uBTC. Even better, if one of the two inputs is<br>
sufficiently large to cover my costs I can doublespend t1 with a<br>
1-in-2-out tx just 226 bytes in size, paying 226uBTC.<br>
<br>
Cost savings: 32% to 59%, or even infinite if defragmentation w/o RBF<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 costs you more than you sa=
ve<br>
<span><font color=3D"#888888"><br>
--<br>
&#39;peter&#39;[:-1]@<a href=3D"http://petertodd.org" target=3D"_blank">pet=
ertodd.org</a><br>
0000000000000000134ce6577d4122094479f548b997baf84367eaf0c190bc9f<br>
</font></span><br></div></div>---------------------------------------------=
---------------------------------<br>
One dashboard for servers and applications across Physical-Virtual-Cloud<br=
>
Widest out-of-the-box monitoring support with 50+ applications<br>
Performance metrics, stats and reports that give you Actionable Insights<br=
>
Deep dive visibility with transaction tracing using APM Insight.<br>
<a href=3D"http://ad.doubleclick.net/ddm/clk/290420510;117567292;y" target=
=3D"_blank">http://ad.doubleclick.net/ddm/clk/290420510;117567292;y</a><br>=
_______________________________________________<br>
Bitcoin-development mailing list<br>
<a href=3D"mailto:Bitcoin-development@lists.sourceforge.net" target=3D"_bla=
nk">Bitcoin-development@lists.sourceforge.net</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/bitcoin-development=
" target=3D"_blank">https://lists.sourceforge.net/lists/listinfo/bitcoin-de=
velopment</a><br>
<br></blockquote></div><br></div>
<br>-----------------------------------------------------------------------=
-------<br>
One dashboard for servers and applications across Physical-Virtual-Cloud<br=
>
Widest out-of-the-box monitoring support with 50+ applications<br>
Performance metrics, stats and reports that give you Actionable Insights<br=
>
Deep dive visibility with transaction tracing using APM Insight.<br>
<a href=3D"http://ad.doubleclick.net/ddm/clk/290420510;117567292;y" target=
=3D"_blank">http://ad.doubleclick.net/ddm/clk/290420510;117567292;y</a><br>=
_______________________________________________<br>
Bitcoin-development mailing list<br>
<a href=3D"mailto:Bitcoin-development@lists.sourceforge.net">Bitcoin-develo=
pment@lists.sourceforge.net</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/bitcoin-development=
" target=3D"_blank">https://lists.sourceforge.net/lists/listinfo/bitcoin-de=
velopment</a><br>
<br></blockquote></div><br></div>

--001a1146918a92e6c30517007dff--