summaryrefslogtreecommitdiff
path: root/7f/011ba73e992f2a14a8d687ac96c83063c1c1b3
blob: 2627b43687c67720d5a960b3aacadcd67b61d0de (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
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
Return-Path: <antoine.riard@gmail.com>
Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133])
 by lists.linuxfoundation.org (Postfix) with ESMTP id E7A8AC002D
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sun,  6 Nov 2022 23:22:23 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by smtp2.osuosl.org (Postfix) with ESMTP id BC01A40166
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sun,  6 Nov 2022 23:22:23 +0000 (UTC)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org BC01A40166
Authentication-Results: smtp2.osuosl.org;
 dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com
 header.a=rsa-sha256 header.s=20210112 header.b=QBHQcN2i
X-Virus-Scanned: amavisd-new at osuosl.org
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level: 
X-Spam-Status: No, score=-2.097 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, LOTS_OF_MONEY=0.001, RCVD_IN_DNSWL_NONE=-0.0001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from smtp2.osuosl.org ([127.0.0.1])
 by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id UuT3aCJSLUue
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sun,  6 Nov 2022 23:22:21 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.8.0
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 6032E400C4
Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com
 [IPv6:2607:f8b0:4864:20::d33])
 by smtp2.osuosl.org (Postfix) with ESMTPS id 6032E400C4
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sun,  6 Nov 2022 23:22:21 +0000 (UTC)
Received: by mail-io1-xd33.google.com with SMTP id p184so7630794iof.11
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sun, 06 Nov 2022 15:22:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=VN6Cy1gWlO/NSngoOIwb1zcMLA6kZwl9BhbUO+BBnS4=;
 b=QBHQcN2iBcCY7+VpLeQpprCKVr2GT4V9wXX3yF3n7dxIhzgY1uf/iqaFKoJQ9BX7G6
 eeqZfHpcKcir0HGbVU7fKN9cEXjpDYeEdvbVPpKO80FOqvPCBDubQaehwOz/OP0Aca0b
 2MDy9jEDy8rRcZEVEy+phDqELGOaWQm3wwS9wehBOOmehR1OoKruBYqIAeT7gZRmGRtu
 UPDtX5ZBPGNGhLaOab/qs3IEw3tOhNPoEzeTShNnMItKGEzn5aAck80/vlXW5yu5nVuh
 bvP75HcB1TnipnRIX2kOSjFdgldq4dxvYYfI0qSjQnK6Zn7bixiRzKv0zwFElyEWwIMG
 XU+g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 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=VN6Cy1gWlO/NSngoOIwb1zcMLA6kZwl9BhbUO+BBnS4=;
 b=VZz2JwXGfZrrydlLWSGbAY5ZI9ECjcEduor6PTe85Ya6/+WVtCYY3rj3vdAFn/TPvM
 DWLH8O9W/bOKcUaeuBg2uvJi4x7PX1F9Rmm8yKGh7Wm4Dw+ycSCp56sM/FRcIgJH0afu
 d7zqRCYijhNPaNW04qzbGJYgcnAW8Gc+F4LVG1aUs9703cBX3+KB3ut/3Kao+KbzQ8bj
 VbEbRwDhv3Q+XaBkGiMEPZdgG/bo5MM8gxFunqBBNsxeLHySWTanqwoWUXHKyUeIQ/Wz
 2OdM3/kZ8gCoVno8XcznTE72syU8cD0rCfqRKk441thlwbYUgt7pg3xDZkerQc1tTs5+
 0+Bw==
X-Gm-Message-State: ACrzQf3ssubUofBfQB89vAdyhCN1gYu9dPrPMDvl4D2q0C5zn7cK+3tq
 LmhzDqwVipiI4/4Q4WmsDg9Gy0HlRdYcLJeN7eRmWYzRjD0y2w0H
X-Google-Smtp-Source: AMsMyM7nTFENpTP/7jmgwVKhEyRzPPJQT00QxIsKusrd7TVmXaSFQ2T/DseOAV7Y0qWwoasTfL7ZSzLgOdfcrL26xbY=
X-Received: by 2002:a05:6638:3f10:b0:375:71c7:c296 with SMTP id
 ck16-20020a0566383f1000b0037571c7c296mr17945552jab.155.1667776940289; Sun, 06
 Nov 2022 15:22:20 -0800 (PST)
MIME-Version: 1.0
References: <Y2HpaWnAC5dIGkx+@erisian.com.au>
In-Reply-To: <Y2HpaWnAC5dIGkx+@erisian.com.au>
From: Antoine Riard <antoine.riard@gmail.com>
Date: Sun, 6 Nov 2022 18:22:08 -0500
Message-ID: <CALZpt+G7SCTtsHUjdxdYYxFoQW4k7_BEbygVx2ksgZpTQZBUTw@mail.gmail.com>
To: Anthony Towns <aj@erisian.com.au>, 
 Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Content-Type: multipart/alternative; boundary="0000000000001735ba05ecd5949c"
X-Mailman-Approved-At: Sun, 06 Nov 2022 23:42:31 +0000
Cc: John Carvalho <john@synonym.to>
Subject: Re: [bitcoin-dev] Preventing/detecting pinning of jointly funded txs
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: Sun, 06 Nov 2022 23:22:24 -0000

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

Hi AJ,

Adding a few more thoughts here on what coinjoins/splicing/dual-funded
folks can do to solve this DoS isse in an opt-in RBF world only.

I'm converging that deploying a distributed monitoring of the network
mempools in the same fashion as zeroconf people is one solution, as you can
detect a conflicting spend of your multi-party transaction. Let's say you
have a web of well-connected full-nodes, each reporting all their incoming
mempool transactions to some reconciliation layer.

This "mempools watchdog" infrastructure isn't exempt from mempools
partitioning attacks by an adversary, where the goal is to control your
local node mempool view. A partitioning trick is somehow as simple as
policy changes across versions (e.g allowing Taproot Segwit v0.1 spends) or
two same-feerate transactions. The partitioning attack can target at least
two meaningful subsets. Either the miner mempools only, by conflicting all
the reachable nodes in as many subsets with a "tainted" transaction (e.g
set a special nSequence value for each), and looking on corresponding
issued block. Or targeting the "watchdog" mempools only, where the
adversary observation mechanism is the multi-party blame assignment round
itself. There is an open question on how many "divide-and-conquer" rounds
from an adversary viewpoint you need to efficiently identify all the
complete set of "mempools watchdog". If the transaction-relay topology is
highly dynamic thanks to outbound transaction-relay peers rotation, the
hardness bar is increased.

Though ultimately, the rough mental model I'm thinking on, this is a
"cat-and-mouse" game between the victims and the attacker, where the latter
try to find the blind spots of the former. I would say there is a strong
advantage to the attacker, in mapping the mempools can be batched against
multiple sets of victims. While the victims have no entry barriers to
deploy "mempools watchdog" there is a scarce resource in contest, namely
the inbound connection slots (at least the miners ones).

Victims could batch their defense costs, in outsourcing the monitoring to
dedicated entities (akin to LN watchtower). However, there is a belief in
lack of a compensation mechanism, you will have only a low number of public
ones (see number of BIP157 signaling nodes, or even Electrum ones).
Outsource mempools monitoring will hit the same issue of bounded public
resources, and as such be a "single-point-of-censorship" vector. Reminder,
we would like LN mobile clients from low-budget users to access those fancy
joint funding protocols (or at least I).

So as a first partial conclusion, not only the security efficiency but also
the economic scalability of such defensive "mempools watchdog"
infrastructure remains an open question to me.

Assuming we can solve them, there is still the issue of assigning blame
reliably among a set of trust-minimized joint funding protocol
participating UTXOs. Indeed, you're running quickly into issues like *two*
double-spend from two sybilling participants, aiming to halt the assignment
process. There is likely a need to introduce some "UTXO-satoshi-weight"
vote to efficiently converge towards assignment. At the very least it would
require the attacker to control more than 51% of the contributed UTXO to
manipulate the outcome of the blame assignment process. Assuming an
economically honest majority, you still have the timevalue cost inflicted
for each round of blame assignment. Assuming 255 inputs (current LN's
interactive construction protocol limit) and a transaction propagation
delay of 2min (30s ?) on the p2p network, an attacker controlling all the
inputs minus 1 might be able to DoS for ~50 blocks (do we have other
factors to think of in the design of the blame assignment process ?). In a
future where the timevalue of circulating coins is priced in (IMO when we
have competitive LN routing markets), this is probably a significant damage=
.

On the other hand, you have a full-rbf world, where instead to deploy or
gain access to "mempools watchdog" and proceed to a timevalue-expensive
blame assignment protocol, any participant should be able to fee-bump the
joint transaction (assuming multiple pre-signed feerate version of the
transactions, or ephemeral, nversion=3D3 and package-relay to do unilateral
CPFP). Ideally, this would be a reduction to a "flood-and-loot" attack, i.e
the attacker is constrained to buy the blockspace. A situation with a lot
of visibility for the joint funding protocol victims, I think.

Side-note: this alternative resolution process of relying on full-rbf,
still assumes solving RBF pinning rule 3, I think a fact I underscored in
my original full-rbf proposal of last year [0]. All that said, I think it's
good to think more of the end-of-pipeline economic trade-offs of the two
main directions to solve this DoS affecting joint funding protocol.
Transaction signature withhold DoS should be defended on a different layer,
and I think there are far more easy to deal with in  a set of participant
with at least stable temporary pseudonyms ("all participants should produce
a signature before X, laziness due to buggy Internet connection is treated
the same as a DoS" ?).

Best,
Antoine

[0] "Of course, even assuming full-rbf, propagation of the multi-party
funded
transactions can still be interfered with by an attacker, simply
broadcasting a double-spend with a feerate equivalent to the honest
transaction. However, it tightens the attack scenario to a scorched earth
approach, where the attacker has to commit equivalent fee-bumping reserve
to maintain the pinning and might lose the "competing" fees to miners."

https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-June/019074.ht=
ml

Le mar. 1 nov. 2022 =C3=A0 23:52, Anthony Towns via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> a =C3=A9crit :

> On Fri, Oct 28, 2022 at 03:21:53AM +1000, Anthony Towns via bitcoin-dev
> wrote:
> > What should folks wanting to do coinjoins/dualfunding/dlcs/etc do to
> > solve that problem if they have only opt-in RBF available?
>
> ref:
> https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-October/0211=
24.html
>
> So, having a go at answering my own question.
>
> I think ultimately the scenario here is:
>
>  * you have a joint funding protocol, where everyone says "here's
>    an unspent utxo that will be my contribution", collaborates on signing
>    a transaction spending all those utxos, and then broadcasts it
>
>  * everyone jointly agrees to pay some amount in fees for that
>    transaction, targeting confirmation within N blocks
>
>  * the goal is to have the transaction confirm, obviously; but it's also
>    acceptable to discover a conflicting transaction, as that will
>    demonstrate that a particular participant has been dishonest (their
>    utxo was not "unspent"), allowing the overall protocol to make progres=
s
>
> The question then is how much effort do you have to go to to make such a
> protocol work?
>
> As an extreme example, you could always have each participant maintain
> a dedicated amount of hashpower: eg, if each participant individually
> controls 0.5% of hashpower, then having two honest participants would
> give you a 75% chance of confirmation within 137 blocks (roughly a day),
> even if your transaction failed to relay at all, and the only way to
> prevent confirmation is for a conflicting transaction to be confirmed
> earlier. Of course, needing to have 0.5% of hashpower would mean fewer
> than 200 people globally could participate in such a protocol, and
> requires something like $10M in capital investment just for ASICs in
> order to participate.
>
> I think the next step from that pretty much requires introducing the
> assumption that the vast majority of the bitcoin p2p network (both nodes
> and hashrate) will accept your transaction, at least in a world where all
> your collaborators are honest and don't create conflicting transactions.
> You can limit that assumption a little bit, but without most p2p peers
> being willing to relay your tx, you start having privacy issues; and
> without most miners being willing to mine your tx, you start getting
> problems with predicting fees. And in any event, I don't think anyone's
> trying to make weird transactions here, just get their otherwise normal
> transactions to actually confirm.
>
> I think the same approach used to detect double spend races by people
> accepting zeroconf would work here too. That is setup a couple of
> anonymous bitcoin nodes, let them sit for a couple of weeks so their
> mempools are realistic, then when you broadcast a jointly funded
> transaction, query their mempools: if your new tx made it there, it
> likely made it to mining pools too, and you're fine; if it didn't, then
> the transaction that's blocking it almost certainly did, so you can find
> out what that is and can go from there.
>
> (If you don't see either your tx, or a conflicting one, then it likely
> means the nodes that broadcasted your tx are being sybil attacked, either
> because their peers are directly controlled by an attacker, or they've
> been identified by an attacker and attacked in some other way; presumably
> you could pick a couple of node that have been confirmed by both your
> anonymous nodes' as valid and reachable, and connect to them to break
> out of the sybil attack; if that doesn't work either, you probably need
> to change ISPs or put your active node via a (different) VPN provider...)
>
> Your capital expenses are much lower that way: perhaps on the order of
> $20/month to run a couple of nodes on AWS or linode or similar.
>
> But, you might say, what if I don't even want to run multiple bitcoin
> nodes 24/7 indefinitely? Can we outsource that, like we outsource mining
> by paying tx fees?
>
> That seems harder, particularly if you want to avoid whoever you're
> outsourcing too from associating you with the jointly funded transaction
> you're interested in.
>
> If you're *not* worried about that association, it's probably easy:
> just find some public explorers, and see if they list any conflicts in
> their mempool, or use the "broadcast tx" feature and see if it gives an
> error identifying the conflicting transaction.
>
> I think it's probably hard to make that behaviour a normal part of p2p tx
> relay though: if someone's trying to relay tx T but you reject it
> because of a conflicting tx C; then it's easy to tell the node that
> first relayed T to you about C -- but how does that information get back
> to the original broadcaster?
>
> One way would be to broadcast "C" back to whoever announced T to you,
> and let C propogate all the way back to whoever originally proposed T --
> but that only works if everyone's running a mempool policy where there's
> a total ordering for tx replacement, ie for any conflicting txs, either
> T replaces C or C replaces T, and that's not something we have now or
> would have even with full RBF, and seems pretty hard to actually achieve.
> (And if it was achieved, you could just keep replacing T with a more
> attractive T' so that it did eventually replace C)
>
> Another way might be to have the original broadcaster retry the broadcast=
:
> connect to new peers, reannounce T, and see what happens.  Then eventuall=
y
> they'll connect to a peer that has C in their mempool, and just needs a
> "reject" message of some kind that can identify C.  But in that case,
> the peer that's going to send the reject message needs to be able to
> efficiently associate T back to C, even though it doesn't have T in
> the mempool -- it won't want to redownload T each time, because that's
> a waste of bandwidth, and it can't re-validate T to find the conflict
> fresh without having a copy of T.
>
> Using BIP 37 mempool filters or something might be an approach if there
> are plenty of nodes around that _are_ willing to dedicate extra resources
> to helping people find potentially conflicting txs.  Unfortunately that
> probably is pretty bad for privacy: if your adversary is blocking your
> coinjoin T with a pinned tx C, then the fact that you've asked for a
> filter that happens to match C is probably a good indication that you're
> involved in the coinjoin T; and there's a decent chance that the only
> people will to dedicate the extra resources to offer those services to
> the public will be people who want to invade your privacy...
>
> A problem with mempool filters (or telling other nodes what's in your
> mempool in general) is that that can provide a way for attackers to
> identify who your peers are: if you create a bunch of conflicting txs,
> and give a different one to many nodes other than you, then see which
> tx you end up with, that identifies which peers are close to you, and
> that information could be used to attack those peers, which in turn may
> allow more effective sybil attacks against you.
>
> So I think my best answer is:
>
>  - if you really want to do things with untrusted peers in bitcoin,
>    investing in hashpower maybe isn't that unreasonable a thing to
>    do. $10M in capital giving you the ability to usually make progress
>    within a day even if everyone else dislikes you? surprisingly
>    reasonable, especially if more progress is made on stratumv2...
>
>  - if you don't care about privacy (eg, you're funding a lightning
>    channel that's going to be gossiped anyway), just query an explorer
>    (or some other centralised service) to find out the conflicting tx
>    and go from there.
>
>  - if you do care about privacy, run a few "anonymous" bitcoind nodes
>    that don't announce transactions, and see what their mempool
>    contains.
>
>  - we can probably make it easier to run anonymous bitcoind nodes
>    by making transaction broadcasts more private (tor/i2p? dandelion? hav=
e
>    lightning nodes send channel open/close txs to another lightning
>    node to announce to bitcoin p2p?) -- for cases where you're already
>    running a bitcoin node 24/7 (or trusting someone else that does), I
>    think that gives you a pretty good method of either being confident
>    your tx made it to a decent percentage of hashrate, or spotting a
>    conflicting tx to be able to assign blame
>
> Anyone got any improvements on the above?
>
> Cheers,
> aj
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>

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

<div dir=3D"ltr">Hi AJ,<br><br>Adding a few more thoughts here on what coin=
joins/splicing/dual-funded folks can do to solve this DoS isse in an opt-in=
 RBF world only.<br><br>I&#39;m converging that deploying a distributed mon=
itoring of the network mempools in the same fashion as zeroconf people is o=
ne solution, as you can detect a conflicting spend of your multi-party tran=
saction. Let&#39;s say you have a web of well-connected full-nodes, each re=
porting all their incoming mempool transactions to some reconciliation laye=
r.<br><br>This &quot;mempools watchdog&quot; infrastructure isn&#39;t exemp=
t from mempools partitioning attacks by an adversary, where the goal is to =
control your local node mempool view. A partitioning trick is somehow as si=
mple as policy changes across versions (e.g allowing Taproot Segwit v0.1 sp=
ends) or two same-feerate transactions. The partitioning attack can target =
at least two meaningful subsets. Either the miner mempools only, by conflic=
ting all the reachable nodes in as many subsets with a &quot;tainted&quot; =
transaction (e.g set a special nSequence value for each), and looking on co=
rresponding issued block. Or targeting the &quot;watchdog&quot; mempools on=
ly, where the adversary observation mechanism is the multi-party blame assi=
gnment round itself. There is an open question on how many &quot;divide-and=
-conquer&quot; rounds from an adversary viewpoint you need to efficiently i=
dentify all the complete set of &quot;mempools watchdog&quot;. If the trans=
action-relay topology is highly dynamic thanks to outbound transaction-rela=
y peers rotation, the hardness bar is increased.<br><br>Though ultimately, =
the rough mental model I&#39;m thinking on, this is a &quot;cat-and-mouse&q=
uot; game between the victims and the attacker, where the latter try to fin=
d the blind spots of the former. I would say there is a strong advantage to=
 the attacker, in mapping the mempools can be batched against multiple sets=
 of victims. While the victims have no entry barriers to deploy &quot;mempo=
ols watchdog&quot; there is a scarce resource in contest, namely the inboun=
d connection slots (at least the miners ones).<br><br>Victims could batch t=
heir defense costs, in outsourcing the monitoring to dedicated entities (ak=
in to LN watchtower). However, there is a belief in lack of a compensation =
mechanism, you will have only a low number of public ones (see number of BI=
P157 signaling nodes, or even Electrum ones). Outsource mempools monitoring=
 will hit the same issue of bounded public resources, and as such be a &quo=
t;single-point-of-censorship&quot; vector. Reminder, we would like LN mobil=
e clients from low-budget users to access those fancy joint funding protoco=
ls (or at least I).<br><br>So as a first partial conclusion, not only the s=
ecurity efficiency but also the economic scalability of such defensive &quo=
t;mempools watchdog&quot; infrastructure remains an open question to me.<br=
><br>Assuming we can solve them, there is still the issue of assigning blam=
e reliably among a set of trust-minimized joint funding protocol participat=
ing UTXOs. Indeed, you&#39;re running quickly into issues like *two* double=
-spend from two sybilling participants, aiming to halt the assignment proce=
ss. There is likely a need to introduce some &quot;UTXO-satoshi-weight&quot=
; vote to efficiently converge towards assignment. At the very least it wou=
ld require the attacker to control more than 51% of the contributed UTXO to=
 manipulate the outcome of the blame assignment process. Assuming an econom=
ically honest majority, you still have the timevalue cost inflicted for eac=
h round of blame assignment. Assuming 255 inputs (current LN&#39;s interact=
ive construction protocol limit) and a transaction propagation delay of 2mi=
n (30s ?) on the p2p network, an attacker controlling all the inputs minus =
1 might be able to DoS for ~50 blocks (do we have other factors to think of=
 in the design of the blame assignment process ?). In a future where the ti=
mevalue of circulating coins is priced in (IMO when we have competitive LN =
routing markets), this is probably a significant damage.<br><br>On the othe=
r hand, you have a full-rbf world, where instead to deploy or gain access t=
o &quot;mempools watchdog&quot; and proceed to a timevalue-expensive blame =
assignment protocol, any participant should be able to fee-bump the joint t=
ransaction (assuming multiple pre-signed feerate version of the transaction=
s, or ephemeral, nversion=3D3 and package-relay to do unilateral CPFP). Ide=
ally, this would be a reduction to a &quot;flood-and-loot&quot; attack, i.e=
 the attacker is constrained to buy the blockspace. A situation with a lot =
of visibility for the joint funding protocol victims, I think.<br><br>Side-=
note: this alternative resolution process of relying on full-rbf, still ass=
umes solving RBF pinning rule 3, I think a fact I underscored in my origina=
l full-rbf proposal of last year [0]. All that said, I think it&#39;s good =
to think more of the end-of-pipeline economic trade-offs of the two main di=
rections to solve this DoS affecting joint funding protocol. Transaction si=
gnature withhold DoS should be defended on a different layer, and I think t=
here are far more easy to deal with in=C2=A0 a set of participant with at l=
east stable temporary pseudonyms (&quot;all participants should produce a s=
ignature before X, laziness due to buggy Internet connection is treated the=
 same as a DoS&quot; ?).<br><br>Best,<br>Antoine<br><br>[0] &quot;Of course=
, even assuming full-rbf, propagation of the multi-party funded<br>transact=
ions can still be interfered with by an attacker, simply<br>broadcasting a =
double-spend with a feerate equivalent to the honest<br>transaction. Howeve=
r, it tightens the attack scenario to a scorched earth<br>approach, where t=
he attacker has to commit equivalent fee-bumping reserve<br>to maintain the=
 pinning and might lose the &quot;competing&quot; fees to miners.&quot;<br>=
<br><a href=3D"https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021=
-June/019074.html">https://lists.linuxfoundation.org/pipermail/bitcoin-dev/=
2021-June/019074.html</a><br></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">Le=C2=A0mar. 1 nov. 2022 =C3=A0=C2=A023:52, A=
nthony Towns via bitcoin-dev &lt;<a href=3D"mailto:bitcoin-dev@lists.linuxf=
oundation.org">bitcoin-dev@lists.linuxfoundation.org</a>&gt; a =C3=A9crit=
=C2=A0:<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">On Fri, =
Oct 28, 2022 at 03:21:53AM +1000, Anthony Towns via bitcoin-dev wrote:<br>
&gt; What should folks wanting to do coinjoins/dualfunding/dlcs/etc do to<b=
r>
&gt; solve that problem if they have only opt-in RBF available?<br>
<br>
ref: <a href=3D"https://lists.linuxfoundation.org/pipermail/bitcoin-dev/202=
2-October/021124.html" rel=3D"noreferrer" target=3D"_blank">https://lists.l=
inuxfoundation.org/pipermail/bitcoin-dev/2022-October/021124.html</a><br>
<br>
So, having a go at answering my own question.<br>
<br>
I think ultimately the scenario here is:<br>
<br>
=C2=A0* you have a joint funding protocol, where everyone says &quot;here&#=
39;s<br>
=C2=A0 =C2=A0an unspent utxo that will be my contribution&quot;, collaborat=
es on signing<br>
=C2=A0 =C2=A0a transaction spending all those utxos, and then broadcasts it=
<br>
<br>
=C2=A0* everyone jointly agrees to pay some amount in fees for that<br>
=C2=A0 =C2=A0transaction, targeting confirmation within N blocks<br>
<br>
=C2=A0* the goal is to have the transaction confirm, obviously; but it&#39;=
s also<br>
=C2=A0 =C2=A0acceptable to discover a conflicting transaction, as that will=
<br>
=C2=A0 =C2=A0demonstrate that a particular participant has been dishonest (=
their<br>
=C2=A0 =C2=A0utxo was not &quot;unspent&quot;), allowing the overall protoc=
ol to make progress<br>
<br>
The question then is how much effort do you have to go to to make such a<br=
>
protocol work?<br>
<br>
As an extreme example, you could always have each participant maintain<br>
a dedicated amount of hashpower: eg, if each participant individually<br>
controls 0.5% of hashpower, then having two honest participants would<br>
give you a 75% chance of confirmation within 137 blocks (roughly a day),<br=
>
even if your transaction failed to relay at all, and the only way to<br>
prevent confirmation is for a conflicting transaction to be confirmed<br>
earlier. Of course, needing to have 0.5% of hashpower would mean fewer<br>
than 200 people globally could participate in such a protocol, and<br>
requires something like $10M in capital investment just for ASICs in<br>
order to participate.<br>
<br>
I think the next step from that pretty much requires introducing the<br>
assumption that the vast majority of the bitcoin p2p network (both nodes<br=
>
and hashrate) will accept your transaction, at least in a world where all<b=
r>
your collaborators are honest and don&#39;t create conflicting transactions=
.<br>
You can limit that assumption a little bit, but without most p2p peers<br>
being willing to relay your tx, you start having privacy issues; and<br>
without most miners being willing to mine your tx, you start getting<br>
problems with predicting fees. And in any event, I don&#39;t think anyone&#=
39;s<br>
trying to make weird transactions here, just get their otherwise normal<br>
transactions to actually confirm.<br>
<br>
I think the same approach used to detect double spend races by people<br>
accepting zeroconf would work here too. That is setup a couple of<br>
anonymous bitcoin nodes, let them sit for a couple of weeks so their<br>
mempools are realistic, then when you broadcast a jointly funded<br>
transaction, query their mempools: if your new tx made it there, it<br>
likely made it to mining pools too, and you&#39;re fine; if it didn&#39;t, =
then<br>
the transaction that&#39;s blocking it almost certainly did, so you can fin=
d<br>
out what that is and can go from there.<br>
<br>
(If you don&#39;t see either your tx, or a conflicting one, then it likely<=
br>
means the nodes that broadcasted your tx are being sybil attacked, either<b=
r>
because their peers are directly controlled by an attacker, or they&#39;ve<=
br>
been identified by an attacker and attacked in some other way; presumably<b=
r>
you could pick a couple of node that have been confirmed by both your<br>
anonymous nodes&#39; as valid and reachable, and connect to them to break<b=
r>
out of the sybil attack; if that doesn&#39;t work either, you probably need=
<br>
to change ISPs or put your active node via a (different) VPN provider...)<b=
r>
<br>
Your capital expenses are much lower that way: perhaps on the order of<br>
$20/month to run a couple of nodes on AWS or linode or similar.<br>
<br>
But, you might say, what if I don&#39;t even want to run multiple bitcoin<b=
r>
nodes 24/7 indefinitely? Can we outsource that, like we outsource mining<br=
>
by paying tx fees?<br>
<br>
That seems harder, particularly if you want to avoid whoever you&#39;re<br>
outsourcing too from associating you with the jointly funded transaction<br=
>
you&#39;re interested in.<br>
<br>
If you&#39;re *not* worried about that association, it&#39;s probably easy:=
<br>
just find some public explorers, and see if they list any conflicts in<br>
their mempool, or use the &quot;broadcast tx&quot; feature and see if it gi=
ves an<br>
error identifying the conflicting transaction.<br>
<br>
I think it&#39;s probably hard to make that behaviour a normal part of p2p =
tx<br>
relay though: if someone&#39;s trying to relay tx T but you reject it<br>
because of a conflicting tx C; then it&#39;s easy to tell the node that<br>
first relayed T to you about C -- but how does that information get back<br=
>
to the original broadcaster?<br>
<br>
One way would be to broadcast &quot;C&quot; back to whoever announced T to =
you,<br>
and let C propogate all the way back to whoever originally proposed T --<br=
>
but that only works if everyone&#39;s running a mempool policy where there&=
#39;s<br>
a total ordering for tx replacement, ie for any conflicting txs, either<br>
T replaces C or C replaces T, and that&#39;s not something we have now or<b=
r>
would have even with full RBF, and seems pretty hard to actually achieve.<b=
r>
(And if it was achieved, you could just keep replacing T with a more<br>
attractive T&#39; so that it did eventually replace C)<br>
<br>
Another way might be to have the original broadcaster retry the broadcast:<=
br>
connect to new peers, reannounce T, and see what happens.=C2=A0 Then eventu=
ally<br>
they&#39;ll connect to a peer that has C in their mempool, and just needs a=
<br>
&quot;reject&quot; message of some kind that can identify C.=C2=A0 But in t=
hat case,<br>
the peer that&#39;s going to send the reject message needs to be able to<br=
>
efficiently associate T back to C, even though it doesn&#39;t have T in<br>
the mempool -- it won&#39;t want to redownload T each time, because that&#3=
9;s<br>
a waste of bandwidth, and it can&#39;t re-validate T to find the conflict<b=
r>
fresh without having a copy of T.<br>
<br>
Using BIP 37 mempool filters or something might be an approach if there<br>
are plenty of nodes around that _are_ willing to dedicate extra resources<b=
r>
to helping people find potentially conflicting txs.=C2=A0 Unfortunately tha=
t<br>
probably is pretty bad for privacy: if your adversary is blocking your<br>
coinjoin T with a pinned tx C, then the fact that you&#39;ve asked for a<br=
>
filter that happens to match C is probably a good indication that you&#39;r=
e<br>
involved in the coinjoin T; and there&#39;s a decent chance that the only<b=
r>
people will to dedicate the extra resources to offer those services to<br>
the public will be people who want to invade your privacy...<br>
<br>
A problem with mempool filters (or telling other nodes what&#39;s in your<b=
r>
mempool in general) is that that can provide a way for attackers to<br>
identify who your peers are: if you create a bunch of conflicting txs,<br>
and give a different one to many nodes other than you, then see which<br>
tx you end up with, that identifies which peers are close to you, and<br>
that information could be used to attack those peers, which in turn may<br>
allow more effective sybil attacks against you.<br>
<br>
So I think my best answer is:<br>
<br>
=C2=A0- if you really want to do things with untrusted peers in bitcoin,<br=
>
=C2=A0 =C2=A0investing in hashpower maybe isn&#39;t that unreasonable a thi=
ng to<br>
=C2=A0 =C2=A0do. $10M in capital giving you the ability to usually make pro=
gress<br>
=C2=A0 =C2=A0within a day even if everyone else dislikes you? surprisingly<=
br>
=C2=A0 =C2=A0reasonable, especially if more progress is made on stratumv2..=
.<br>
<br>
=C2=A0- if you don&#39;t care about privacy (eg, you&#39;re funding a light=
ning<br>
=C2=A0 =C2=A0channel that&#39;s going to be gossiped anyway), just query an=
 explorer<br>
=C2=A0 =C2=A0(or some other centralised service) to find out the conflictin=
g tx<br>
=C2=A0 =C2=A0and go from there.<br>
<br>
=C2=A0- if you do care about privacy, run a few &quot;anonymous&quot; bitco=
ind nodes<br>
=C2=A0 =C2=A0that don&#39;t announce transactions, and see what their mempo=
ol<br>
=C2=A0 =C2=A0contains.<br>
<br>
=C2=A0- we can probably make it easier to run anonymous bitcoind nodes<br>
=C2=A0 =C2=A0by making transaction broadcasts more private (tor/i2p? dandel=
ion? have<br>
=C2=A0 =C2=A0lightning nodes send channel open/close txs to another lightni=
ng<br>
=C2=A0 =C2=A0node to announce to bitcoin p2p?) -- for cases where you&#39;r=
e already<br>
=C2=A0 =C2=A0running a bitcoin node 24/7 (or trusting someone else that doe=
s), I<br>
=C2=A0 =C2=A0think that gives you a pretty good method of either being conf=
ident<br>
=C2=A0 =C2=A0your tx made it to a decent percentage of hashrate, or spottin=
g a<br>
=C2=A0 =C2=A0conflicting tx to be able to assign blame<br>
<br>
Anyone got any improvements on the above?<br>
<br>
Cheers,<br>
aj<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" =
rel=3D"noreferrer" target=3D"_blank">https://lists.linuxfoundation.org/mail=
man/listinfo/bitcoin-dev</a><br>
</blockquote></div>

--0000000000001735ba05ecd5949c--