summaryrefslogtreecommitdiff
path: root/79/4b683d4811a6fa6d335f21b7c8f535a95bf814
blob: 7eaa0b234699d19d4dc780f81fe155cc019df582 (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
Return-Path: <lucasontivero@gmail.com>
Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])
 by lists.linuxfoundation.org (Postfix) with ESMTP id D4509C002A
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Tue, 23 May 2023 12:17:45 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by smtp1.osuosl.org (Postfix) with ESMTP id B6ED483CBB
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Tue, 23 May 2023 12:17:43 +0000 (UTC)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org B6ED483CBB
Authentication-Results: smtp1.osuosl.org;
 dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com
 header.a=rsa-sha256 header.s=20221208 header.b=Ja/ohoOJ
X-Virus-Scanned: amavisd-new at osuosl.org
X-Spam-Flag: NO
X-Spam-Score: -0.099
X-Spam-Level: 
X-Spam-Status: No, score=-0.099 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, PDS_OTHER_BAD_TLD=1.999,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
 autolearn=no autolearn_force=no
Received: from smtp1.osuosl.org ([127.0.0.1])
 by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id dV7EowMA_NNU
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Tue, 23 May 2023 12:17:40 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.8.0
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 9E77883C99
Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com
 [IPv6:2607:f8b0:4864:20::f2b])
 by smtp1.osuosl.org (Postfix) with ESMTPS id 9E77883C99
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Tue, 23 May 2023 12:17:36 +0000 (UTC)
Received: by mail-qv1-xf2b.google.com with SMTP id
 6a1803df08f44-623f24b7ec9so32963836d6.3
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Tue, 23 May 2023 05:17:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1684844254; x=1687436254;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=lptscLZCpLJjkJwtmC6g7VyNqITSKtrCiYCrw0KGH0I=;
 b=Ja/ohoOJKCNaVR0IUaLyaLanbR2uB5IYhK8C/c4bdbuBJwqtnnXJ4RvLfb0Qx7JkEH
 y+v55V9H+6hXhcTf8EDltsrPAIIOzUsDAxlXkL/3A9EUt/ZfJpsFvaKGJKwnoeX9nhkZ
 TOIuZq6if7TvhmJcroUvO/vvViH24GYEoMXDELZk/B1XTZfCe52jKejDs2AzXPomKUHl
 HPKZB9PGW1vIbihS+AUXHv4Bgw4fZJzSZL5miqo8fYwdpT9hcV8OyWhsk/yrB4C8Yu/a
 2e+y/R5QrAaLhgZRaDfxA/l+oqSS/nesObnRlR/uU6esYWwO+bS0gMIecm4Y/ywKJ+Gx
 U8cg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1684844254; x=1687436254;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=lptscLZCpLJjkJwtmC6g7VyNqITSKtrCiYCrw0KGH0I=;
 b=a0QUJcstrsghd958/I/9J/IPNR0vRNCKz26GmMBXZoZXRL2M4JW1NlFnQIb8/lc/+A
 fF8J/TgXU36HEgUAfdygGcWGCekMttVrYyyEGgbJr4dZmivAAw9sg8R1dxod2RBiW1Lt
 uD21QPI+NdgWH7jILv/u8OjLbDyGK6rqyGETFbpEf6soR0lVDbs87YKEQeSoRRXsH70l
 KKkIN/V8m/Nz1fU89G00EtpFzMz5ZQnVDjuqEsxLnyoNcQzaB+bwxg89WzK6wnw+Mim/
 9B7ZUnvihV12z9IDaVmIb7HCXod61ma33ksURDOJNr9zbR4/jiIE0nM7sMH5iwC/Hd41
 OuGg==
X-Gm-Message-State: AC+VfDwY9vPjzAK/3tn4wxzXb/2Qdh0LEgwBwi3kVwh7yGQXd8x62FCB
 ptNGQKKFfH+7Pnpb1Ztox9XeygJ/NiVLDBQT0DTMHsO1ulc=
X-Google-Smtp-Source: ACHHUZ6QLw9FIYXRP4J+6RJZKdZQFHxD9M7mDPVrT8TIQImUyB59oOJwnLmzH+Fpod+UbSw3qZ8ZFiyc3ZeghlEKJQQ=
X-Received: by 2002:a05:6214:20a5:b0:621:6bcb:e49 with SMTP id
 5-20020a05621420a500b006216bcb0e49mr21636901qvd.0.1684844254411; Tue, 23 May
 2023 05:17:34 -0700 (PDT)
MIME-Version: 1.0
References: <EWAXAmgFlZ8XQJOYO8VTH7Zj0tTAftwy-ylaGvf3Giealz1FFb97CbcxjP0q-Zu85XoAzOG0ivdYIKa_kG77ooHqBvCP7YOZOkb6yHmX75s=@protonmail.com>
 <SJ1P223MB0531D7D62140F0516A25897AA1439@SJ1P223MB0531.NAMP223.PROD.OUTLOOK.COM>
In-Reply-To: <SJ1P223MB0531D7D62140F0516A25897AA1439@SJ1P223MB0531.NAMP223.PROD.OUTLOOK.COM>
From: Lucas Ontivero <lucasontivero@gmail.com>
Date: Tue, 23 May 2023 09:17:23 -0300
Message-ID: <CALHvQn29S2T=ehqGD1vCJQQuC0aD6rjUUPsb+n80EBPgc_G4JA@mail.gmail.com>
To: Ben Carman <benthecarman@live.com>, 
 Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Content-Type: multipart/alternative; boundary="0000000000004941f105fc5b5f10"
X-Mailman-Approved-At: Tue, 23 May 2023 13:04:22 +0000
Subject: Re: [bitcoin-dev] Coinjoin with less steps using ALL|ANYONECANPAY
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Tue, 23 May 2023 12:17:45 -0000

--0000000000004941f105fc5b5f10
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi all,

In some coinjoin implementations inputs are registered first because in
that way, if the user fails or refuses to sign the transaction the input is
banned and denial of service is made a bit more expensive, in the sense
that an attacker needs more and more utxos to keep the attack going.

Your proposal can work if you find an alternative mechanism for mitigating
the DoS attacks or when DoS attacks are not a problem (I can imagine there
are scenarios where it is not really important).

Best

- Lucas


On Mon, May 22, 2023 at 7:53=E2=80=AFPM Ben Carman via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> wrote:

> The problem with using ALL|ANYONECANPAY is that you cannot verify
> beforehand that the other inputs are the inputs you want added to the
> transaction.
>
> Some examples of bad things that could happen:
>
>
>    - Coordinator adds its own inputs, you still get your outputs but
>    effectively paid fees for no privacy gain
>    - The inputs added could be paying at a lower fee rate than expected,
>    causing the tx to take longer than what you paid for
>    - Different input types or amount are added so you no longer have the
>    same uniformity across the inputs
>    - (if you care) An input from a sanctioned address is added, causing
>    you to get "tainted" coins.
>
> This is the code in ln-vortex that verifies the psbt on the client side i=
f
> you are curious
>
>
> https://github.com/ln-vortex/ln-vortex/blob/master/client/src/main/scala/=
com/lnvortex/client/VortexClient.scala#L616
>
>
> Best,
>
> benthecarman
>
> ------------------------------
> *From:* bitcoin-dev <bitcoin-dev-bounces@lists.linuxfoundation.org> on
> behalf of alicexbt via bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org=
>
> *Sent:* Monday, May 22, 2023 7:51 AM
> *To:* Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
> *Subject:* [bitcoin-dev] Coinjoin with less steps using ALL|ANYONECANPAY
>
> Hi Bitcoin Developers,
>
> I recently experimented with different sighash flags, PSBTs and realized
> ALL|ANYONECANPAY could be used to reduce some steps in coinjoin.
>
> Steps:
>
> - Register outputs.
> - One user creates a signed PSBT with 1 input, all registered outputs and
> ALL|ANYONECANPAY sighash flag. Other participants keep adding their input=
s
> to PSBT.
> - Finalize and broadcast the transaction.
>
> Proof of Concept (Aice and Bob): https://gitlab.com/-/snippets/2542297
>
> Tx:
> https://mempool.space/testnet/tx/c6dd626591dca7e25bbd516f01b23171eb0f2b62=
3471fcf8e073c87c1179c492
>
> I plan to use this in joinstr if there are no major drawbacks and it can
> even be implemented by other coinjoin implementations.
>
> /dev/fd0
> floppy disk guy
>
> Sent with Proton Mail secure email.
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>

--0000000000004941f105fc5b5f10
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi all,<br><br></div><div>In some coinjoin implementa=
tions inputs are registered first because in that way, if the user fails or=
 refuses to sign the transaction the input is banned and denial of service =
is made a bit more expensive, in the sense that an attacker needs more and =
more utxos to keep the attack going. <br></div><div><br></div><div>Your pro=
posal can work if you find an alternative mechanism for mitigating the DoS =
attacks or when DoS attacks are not a problem (I can imagine there are scen=
arios where it is not really important).<br><br></div><div>Best<br><br></di=
v><div>- Lucas<font style=3D"font-size:11pt;color:rgb(0,0,0)" face=3D"Calib=
ri, sans-serif"><br></font></div><div><br></div></div><br><div class=3D"gma=
il_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, May 22, 2023 at 7:5=
3=E2=80=AFPM Ben Carman via bitcoin-dev &lt;<a href=3D"mailto:bitcoin-dev@l=
ists.linuxfoundation.org">bitcoin-dev@lists.linuxfoundation.org</a>&gt; wro=
te:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px =
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=
=3D"msg3570622886445785554">




<div dir=3D"ltr">
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
The problem with using ALL|ANYONECANPAY is that you cannot verify beforehan=
d that the other inputs are the inputs you want added to the transaction.</=
div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
Some examples of bad things that could happen:</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<ul>
<li style=3D"list-style-type:&quot;- &quot;"><span>Coordinator adds its own=
 inputs, you still get your outputs but effectively paid fees for no privac=
y gain</span></li><li style=3D"list-style-type:&quot;- &quot;"><span>The in=
puts added could be paying at a lower fee rate than expected, causing the t=
x to take longer than what you paid for</span></li><li style=3D"list-style-=
type:&quot;- &quot;"><span>Different input types or amount are added so you=
 no longer have the same uniformity across the inputs</span></li><li style=
=3D"list-style-type:&quot;- &quot;"><span>(if you care) An input from a san=
ctioned address is added, causing you to get &quot;tainted&quot; coins.<br>
</span></li></ul>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
This is the code in ln-vortex that verifies the psbt on the client side if =
you are curious<br>
<br>
<a href=3D"https://github.com/ln-vortex/ln-vortex/blob/master/client/src/ma=
in/scala/com/lnvortex/client/VortexClient.scala#L616" id=3D"m_3570622886445=
785554LPNoLPOWALinkPreview" target=3D"_blank">https://github.com/ln-vortex/=
ln-vortex/blob/master/client/src/main/scala/com/lnvortex/client/VortexClien=
t.scala#L616</a>
<div></div>
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
Best,</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<br>
</div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
benthecarman<br>
</div>
<div id=3D"m_3570622886445785554appendonsend"></div>
<div style=3D"font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color=
:rgb(0,0,0)">
<br>
</div>
<hr style=3D"display:inline-block;width:98%">
<div id=3D"m_3570622886445785554divRplyFwdMsg" dir=3D"ltr"><font style=3D"f=
ont-size:11pt;color:rgb(0,0,0)" face=3D"Calibri, sans-serif"><b>From:</b> b=
itcoin-dev &lt;<a href=3D"mailto:bitcoin-dev-bounces@lists.linuxfoundation.=
org" target=3D"_blank">bitcoin-dev-bounces@lists.linuxfoundation.org</a>&gt=
; on behalf of alicexbt via bitcoin-dev &lt;<a href=3D"mailto:bitcoin-dev@l=
ists.linuxfoundation.org" target=3D"_blank">bitcoin-dev@lists.linuxfoundati=
on.org</a>&gt;<br>
<b>Sent:</b> Monday, May 22, 2023 7:51 AM<br>
<b>To:</b> Bitcoin Protocol Discussion &lt;<a href=3D"mailto:bitcoin-dev@li=
sts.linuxfoundation.org" target=3D"_blank">bitcoin-dev@lists.linuxfoundatio=
n.org</a>&gt;<br>
<b>Subject:</b> [bitcoin-dev] Coinjoin with less steps using ALL|ANYONECANP=
AY</font>
<div>=C2=A0</div>
</div>
<div><font size=3D"2"><span style=3D"font-size:11pt">
<div>Hi Bitcoin Developers,<br>
<br>
I recently experimented with different sighash flags, PSBTs and realized AL=
L|ANYONECANPAY could be used to reduce some steps in coinjoin.<br>
<br>
Steps:<br>
<br>
- Register outputs.<br>
- One user creates a signed PSBT with 1 input, all registered outputs and A=
LL|ANYONECANPAY sighash flag. Other participants keep adding their inputs t=
o PSBT.<br>
- Finalize and broadcast the transaction.<br>
<br>
Proof of Concept (Aice and Bob):=C2=A0<a href=3D"https://gitlab.com/-/snipp=
ets/2542297" target=3D"_blank">https://gitlab.com/-/snippets/2542297</a><br=
>
<br>
Tx: <a href=3D"https://mempool.space/testnet/tx/c6dd626591dca7e25bbd516f01b=
23171eb0f2b623471fcf8e073c87c1179c492" target=3D"_blank">
https://mempool.space/testnet/tx/c6dd626591dca7e25bbd516f01b23171eb0f2b6234=
71fcf8e073c87c1179c492</a><br>
<br>
I plan to use this in joinstr if there are no major drawbacks and it can ev=
en be implemented by other coinjoin implementations.
<br>
<br>
/dev/fd0<br>
floppy disk guy<br>
<br>
Sent with Proton Mail secure email.<br>
_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" target=3D"_blank">=
bitcoin-dev@lists.linuxfoundation.org</a><br>
<a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" =
target=3D"_blank">https://lists.linuxfoundation.org/mailman/listinfo/bitcoi=
n-dev</a><br>
</div>
</span></font></div>
</div>

_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" target=3D"_blank">=
bitcoin-dev@lists.linuxfoundation.org</a><br>
<a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" =
rel=3D"noreferrer" target=3D"_blank">https://lists.linuxfoundation.org/mail=
man/listinfo/bitcoin-dev</a><br>
</div></blockquote></div>

--0000000000004941f105fc5b5f10--