summaryrefslogtreecommitdiff
path: root/81/df2c7339d87eb1e4618459438e192fddce6019
blob: f8350ac8569e381f2dbb7e88712c317c863fc18b (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
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
Return-Path: <nadav@suredbits.com>
Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])
 by lists.linuxfoundation.org (Postfix) with ESMTP id 246B3C0051
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 20 Aug 2020 15:29:13 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by silver.osuosl.org (Postfix) with ESMTP id F2F9E20460
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 20 Aug 2020 15:29:12 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
Received: from silver.osuosl.org ([127.0.0.1])
 by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id TMcka9vXKZLF
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 20 Aug 2020 15:29:10 +0000 (UTC)
X-Greylist: from auto-whitelisted by SQLgrey-1.7.6
Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com
 [209.85.128.45])
 by silver.osuosl.org (Postfix) with ESMTPS id A80582045E
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 20 Aug 2020 15:29:09 +0000 (UTC)
Received: by mail-wm1-f45.google.com with SMTP id k8so1965378wma.2
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Thu, 20 Aug 2020 08:29:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=suredbits-com.20150623.gappssmtp.com; s=20150623;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=qqHJmu3jBEet2GsB3QS2HCIX7TCnxGo7e6iSYynGR/M=;
 b=R5H0W7zYNtwVhaZJaroJ7MveRYEtcy+yWTAMUKn4bK+bAMvL9570wCHlMZwskVZo8g
 fokdXM7Rb3PXUFbwZHvZnOHT557cSWqTZz5d//AmpqDUfD9qtFaCjspUG9wbcSSOmD6G
 OmgBPQM/70toX9dCzN+4bhnoa3uu9RcfGExz3oOQ/Vu9Sw9/djUjjH/a7xupij/T9z3I
 ZqGlhB5w2ZL4vf8HtGxTG72Sb1j5zhVk7ym6YH5b/zp9p7AmbIEsTu9iGQNcm1IjAYvQ
 ryKAhKOPctusY4R2Eo8BzT+3YEBxEXrOzAF/rA6VZLsmdL0zHORxMryzHOvbHIaZPjWw
 XNrw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=qqHJmu3jBEet2GsB3QS2HCIX7TCnxGo7e6iSYynGR/M=;
 b=scdsu7GUHRgYCepVSw/uN6j4PgDcGwdGUFiSlEWcUJx7a9Wl1lkCj25x39tR/rT7Bv
 V6NceV2HDAmLxKPAsiolWZRXKVa0MXJaPMdbF+nWpTnTdrZhYcI2ibkq2y1T7N1EpZ/9
 HAbaP/ur756e/KFX4PkuJUbS4Fd1mACBXKLSdqaSl/AzD7rvXfbcrswjOlQwJgQtxQ5r
 nHkMsJaIOnXqDiSWA4eKw4gmYn1X6uPPd3eN+C+1NxQXjE2IyYyagpTARzU04ndxHuXS
 0ZGoxF2DPtshIpRyOzdj2FSfr1Z63XkPixSYHgGblE2hDHbKiV34bWfwScDsPVInDHqz
 ZWqA==
X-Gm-Message-State: AOAM532mCZDQKzZmSoTfFWetcCcruvMZWLKZ0kbKenL93ryR2uuXMrFe
 d2ODMI1EuQ+L7oNpouITVFWCXfuopeeuNJ42KlIwCg==
X-Google-Smtp-Source: ABdhPJwzTViTCwdi/sLn7udf+Acd+UT1i4VuiAJU+CrhOSfsm8j7xpc3cEccPdWxormOiqtfdprYMDtSFYDFQPUB4OM=
X-Received: by 2002:a7b:c257:: with SMTP id b23mr3880579wmj.164.1597937347963; 
 Thu, 20 Aug 2020 08:29:07 -0700 (PDT)
MIME-Version: 1.0
References: <813e51a1-4252-08c0-d42d-5cef32f684bc@riseup.net>
 <xhRsCejqgUjoLy5hPMHgFcZdiqJsO7TfS0azWhis9-tvSgXodoKe7gN5IXyiVIVqUWSm7FoY-aBUaJCCDgixdWUN4n8EzhQlSNshsQeIFsw=@protonmail.com>
In-Reply-To: <xhRsCejqgUjoLy5hPMHgFcZdiqJsO7TfS0azWhis9-tvSgXodoKe7gN5IXyiVIVqUWSm7FoY-aBUaJCCDgixdWUN4n8EzhQlSNshsQeIFsw=@protonmail.com>
From: Nadav Kohen <nadav@suredbits.com>
Date: Thu, 20 Aug 2020 10:28:56 -0500
Message-ID: <CALGTLwPOhHwXULLOhpEzbKxb0V-kjZWLRdnZ90T9RWxFSwuu4w@mail.gmail.com>
To: ZmnSCPxj <ZmnSCPxj@protonmail.com>, 
 Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Content-Type: multipart/alternative; boundary="000000000000ffc30f05ad50c7b6"
X-Mailman-Approved-At: Thu, 20 Aug 2020 15:37:18 +0000
Subject: Re: [bitcoin-dev] Detailed protocol design for routed
 multi-transaction CoinSwap
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: Thu, 20 Aug 2020 15:29:13 -0000

--000000000000ffc30f05ad50c7b6
Content-Type: text/plain; charset="UTF-8"

Hey Chris and all,

Looking good :) I have one major concern though

>    q = EC privkey generated by maker
>    Q = q.G = EC pubkey published by maker
>
>    p = nonce generated by taker
>    P = p.G = nonce point calculated by taker
>
>    R = Q + P = pubkey used in bitcoin transaction
>      = (q + p).G

If I'm understanding this correctly (which I'm not sure I ame), it seems
like the plan is to put R on-chain as the key to an output? As stated this
is completely insecure as Q is known in advance so the taker can always
choose a nonce p but then claim that their nonce point is p.G - Q so that
the key that goes on-chain is (p.G - Q + Q) = p.G allowing them to steal
the funds. If the plan is not to use full-fledged 2-ECDSA (which I think is
actually necessary as I still don't understand how the HTLC signatures are
generated) you have to, at the very least, force the taker to provide a
Zero Knowledge Proof of Knowledge (ZKPoK) of the discrete log to the point
they advertise as their nonce point to avoid this. Alternatively, I think
you can use the following key as is done in MuSig:

R = H(Q || P || Q)*Q + H(Q || P || P)*P

But I still don't see how signatures can be generated for HTLCs from this
key.

Of course all of this complexity more or less goes away once we have
Schnorr signatures and can use MuSig with adaptor signatures.

Best,
Nadav

On Thu, Aug 20, 2020 at 6:17 AM ZmnSCPxj via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> wrote:

> Good morning Chris,
>
> Great to see this!
>
> Mostly minor comments.
>
>
>
> >
> > == Direct connections to Alice ===
> >
> > Only Alice, the taker, knows the entire route, Bob and Charlie just know
> > their previous and next transactions. Bob and Charlie do not have direct
> > connections with each other, only with Alice.
> >
> > Diagram of Tor connections:
> >
> > Bob Charlie
> > | /
> > | /
> > | /
> > Alice
> >
> > When Bob and Charlie communicate, they are actually sending and
> > receiving messages via Alice who relays them to Charlie or Bob. This
> > helps hide whether the previous or next counterparty in a CoinSwap route
> > is a maker or taker.
> >
> > This doesn't have security issues even in the final steps where private
> > keys are handed over, because those private keys are always for 2-of-2
> > multisig and so on their own are never enough to steal money.
>
> This has a massive advantage over CoinJoin.
>
> In CoinJoin, since all participants sign a single transaction, every
> participant knows the total number of participants.
> Thus, in CoinJoin, it is fairly useless to have just one taker and one
> maker, the maker knows exactly which output belongs to the taker.
> Even if all communications were done via the single paying taker, the
> maker(s) are shown the final transaction and thus can easily know how many
> participants there are (by counting the number of equal-valued outputs).
>
> With CoinSwap, in principle no maker has to know how many other makers are
> in the swap.
>
> Thus it would still be useful to make a single-maker CoinSwap, as that
> would be difficult, for the maker, to diferentiate from a multi-maker
> CoinSwap.
>
> There are still a few potential leaks though:
>
> * If paying through a CoinSwap, the cheapest option for the taker would be
> to send out a single large UTXO (single-output txes) to the first maker,
> and then demand the final payment and any change as two separate swaps from
> the final maker.
>   * Intermediate makers are likely to not have exact amounts, thus is
> unlikely to create a single-output tx when forwarding.
>   * Thus, the first maker could identify the taker.
> * The makers can try timing the communications lag with the taker.
>   The general assumption would be that more makers == more delay in taker
> responses.
>
>
>
> >
> > === Miner fees ===
> >
> > Makers have no incentive to pay any miner fees. They only do
> > transactions which earn them an income and are willing to wait a very
> > long time for that to happen. By contrast takers want to create
> > transactions far more urgently. In JoinMarket we coded a protocol where
> > the maker could contribute to miner fees, but the market price offered
> > of that trended towards zero. So the reality is that takers will pay all
> > the miner fees. Also because makers don't know the taker's time
> > preference they don't know how much they should pay in miner fees.
> >
> > The taker will have to set limits on how large the maker's transactions
> > are, otherwise makers could abuse this by having the taker consolidate
> > maker's UTXOs for free.
>
> Why not have the taker pay for the *first* maker-spent UTXO and have
> additional maker-spent UTXOs paid for by the maker?
> i.e. the taker indicates "swap me 1 BTC in 3 bags of 0.3, 0.3, and 0.4
> BTC", and pays for one UTXO spent for each "bag" (thus pays for 3 UTXOs).
>
> Disagreements on feerate can be resolved by having the taker set the
> feerate, i.e. "the customer is always right".
> Thus if the maker *has to* spend two UTXOs to make up the 0.4 BTC bag, it
> pays for the mining fees for that extra UTXO.
> The maker can always reject the swap attempt if it *has to* spend multiple
> UTXOs and would lose money doing so if the taker demands a too-high feerate.
>
>
> > == Contract transaction definitions ==
> >
> > Contract transactions are those which may spend from the 2-of-2 multisig
> > outputs, they transfer the coins into a contract where the coins can be
> > spent either by waiting for a timeout or providing a hash preimage
> > value. Ideally contract transactions will never be broadcast but their
> > existence keeps all parties honest.
> >
> > M~ is miner fees, which we treat as a random variable, and ultimately
> > set by whichever pre-signed RBF tx get mined. When we talk about the
> > contract tx, we actually mean perhaps 20-30 transactions which only
> > differ by the miner fee and have RBF enabled, so they can be broadcasted
> > in sequence to get the contract transaction mined regardless of the
> > demand for block space.
>
> The highest-fee version could have, in addition, CPFP-anchor outputs, like
> those being proposed in Lightning, so even if onchain fees rise above the
> largest fee reservation, it is possible to add even more fees.
>
> Or not.
> Hmm.
>
>
> Another thought: later you describe that miner fees are paid by Alice by
> forwarding those fees as well, how does that work when there are multiple
> versions of the contract transaction?
>
> >
> > (Alice+timelock_A OR Bob+hash) = Is an output which can be spent
> > either with Alice's private key
> > after waiting for a relative
> > timelock_A, or by Bob's private key by
> > revealing a hash preimage value
>
> The rationale for relative timelocks is that it makes private key turnover
> slightly more useable by ensuring that, after private key turnover, it is
> possible to wait indefinitely to spend the UTXO it received.
> This is in contrast with absolute timelocks, where after private key
> turnover, it is required to spend received UTXO before the absolute timeout.
>
> The dangers are:
>
> * Until it receives the private key, if either of the incoming or outgoing
> contract transactions are confirmed, every swap participant (taker or
> maker) should also broadcast the other contract transaction, and resolve by
> onchain transactions (with loss of privacy).
> * After receiving the private key, if the incoming contract transaction is
> confirmed, it should spend the resulting contract output.
> * It is possible to steal from a participant if that participant goes
> offline longer than the timeout.
>   This may imply that there may have to be some minimum timeout that
> makers indicate in their advertisements.
>   * The taker can detect if the first maker is offline, then if it is
> offline, try a contract transaction broadcast, if it confirms, the taker
> can wait for the timeout; if it times out, the taker can clawback the
> transaction.
>     * This appears to be riskless for the taker.
>     * Against a similar attack, Lightning requires channel reserves, which
> means the first hop never gains control of the entire value, which is a
> basic requirement for private key turnover.
>   * On the other hand, the taker has the largest timeout before it can
> clawback the funds, so it would wait for a long time, and at any time in
> between the first maker can come online and spend using the hashlock branch.
>     * But the taker can just try on the hope it works; it has nothing to
> lose.
>   * This attack seems to be possible only for the taker to mount.
>     Other makers on the route cannot know who the other makers are,
> without cooperation of the taker, who is the only one who knows all the
> makers.
>     * On the other hand, the last maker in the route has an outgoing HTLC
> with the smallest timelock, so it is the least-risk and therefore a maker
> who notices its outgoing HTLC has a low timeout might want to just do this
> anyway even if it is unsure if the taker is offline.
>   * Participants might want to spend from the UTXO to a new address after
> private key turnover anyway.
>     Makers could spend using a low-fee RBF-enabled tx, and when another
> request comes in for another swap, try to build a new funding tx with a
> higher-fee bump.
>
>
> > A possible attack by a malicious Alice is that she chooses M1 to be very
> > low (e.g. 1 sat/vbyte) and sets M2 and M3 to be very high (e.g. 1000
> > sat/vb) and then intentionally aborts, forcing the makers to lose much
> > more money in miner fees than the attacker. The attack can be used to
> > waste away Bob's and Charlie's coins on miner fees at little cost to the
> > malicious taker Alice. So to defend against this attack Bob and Charlie
> > must refuse to sign a contract transaction if the corresponding funding
> > transaction pays miner fees greater than Alice's funding transaction.
>
> Sorry, I do not follow the logic for this...?
>
> > The timelocks are staggered so that if Alice uses the preimage to take
> > coins then the right people will also learn the preimage and have enough
> > time to be able to get their coins back too. Alice starts with knowledge
> > of the hash preimage so she must have a longest timelock.
>
> More precisely:
>
> * The HTLC outgoing from Alice has the longest timelock.
> * The HTLC incoming into Alice has the shortest timelock.
>
> For the makers, they only need to ensure that the incoming timelock is
> much larger than the outgoing timelock.
>
>
> >
> > == EC tweak to reduce one round trip ==
> >
> > When two parties are agreeing on a 2-of-2 multisig address, they need to
> > agree on their public keys. We can avoid one round trip by using the EC
> > tweak trick.
> >
> > When Alice, the taker, downloads the entire offer book for the liquidity
> > market, the offers will also contain a EC public key. Alice can tweak
> > this to generate a brand new public key for which the maker knows the
> > private key. This public key will be one of the keys in the 2-of-2
> > multisig. This feature removes one round trip from the protocol.
> >
> > q = EC privkey generated by maker
> > Q = q.G = EC pubkey published by maker
> >
> > p = nonce generated by taker
> > P = p.G = nonce point calculated by taker
> >
> > R = Q + P = pubkey used in bitcoin transaction
> > = (q + p).G
>
> Whoa whoa whoa whoa.
>
> All this time I was thinking you were going to use 2p-ECDSA for all
> 2-of-2s.
> In which case, the private key generated by the taker would be sufficient
> tweak to blind this.
>
> In 2p-ECDSA, for two participants M = m * G; T = t * G, the total key is m
> * t * G = m * T = t * M.
>
> Are you going to use `2 <T> <Q+P> 2 OP_CHECKMULTISIG` instead of 2p-ECDSA?
> Note that you cannot usefully hide among Lightning mutual closes, because
> of the reserve; Lightning mutual closes are very very likely to be spent in
> a 1-input (that spends from a 2-of-2 P2WSH), 2-output (that pays to two
> P2WPKHs) tx.
>
> >
> > == Protocol ==
>
> > ---8<------
>
> The protocol looks correct to me.
>
> LOL.
>
> Give me a little more time to check it in detail hahaha.
>
>
>
> >     ==== Retaliation as DOS-resistance ====
> >
> >     In some situations (e.g. step 8.) if one maker in the coinswap route
> is
> >     the victim of a DOS they will retaliate by DOSing the previous maker
> in
> >     the route. This may seem unnecessary and unfair (after all why waste
> >     even more time and block space) but is actually the best way to
> resist
> >     DOS because it produces a concrete cost every time a DOS happens.
>
> I agree.
>
> >
> >     == Analysis of deviations ==
> >
> >     This section discusses what happens if one party deviates from the
> >     protocol by doing something else, for example broadcasting a htlc
> >     contract tx when they shouldnt have.
> >
> >     The party name refers to what that party does, followed by other
> party's
> >     reactions to it.
> >     e.g. Party1: does a thing, Party2/Party3: does a thing in reaction
> >
> >     If multiple deviations are possible in a step then they are numbered
> >     e.g. A1 A2 A2 etc
> >
> >     0-2. Alice/Bob/Charlie: nothing else is possible except following the
> >     protocol or aborting
> >
> > 8.  Alice: broadcasts one or more of the A htlc txes. Bob/Charlie/Dennis:
> >     do nothing, they havent lost any time or money.
> >     4-6. Bob/Charlie: nothing else is possible except following the
> protocol
> >     or aborting.
> >
> > 9.  Bob: broadcasts one or more of the B htlc txes, Alice: broadcasts all
> >     her own A htlc txes and waits for the timeout to get her money back.
> >     Charlie: do nothing
> >
> > 10.  Charlie: nothing else is possible except following the protocol or
> >     aborting.
> >
> > 11.  Alice: broadcasts one or more of the A htlc txes. Bob: broadcasts
> all
> >     his own A htlc txes and waits for the timeout.
> >     A. same as 8.
> >     B. Charlie: broadcasts one or more of the C htlc txes, Alice/Bob:
> >     broadcasts all their own htlc txes and waits for the timeout to get
> >     their money back.
> >     C-E1. Alice: broadcasts all of C htlc txes and uses her knowledge of
> the
> >     preimage hash to take the money immediately. Charlie: broadcasts
> >     all of B htlc txes and reading the hash value from the blockchain,
> >     uses it to take the money from B htlc immediately. Bob: broadcasts
> >     all of A htlc txes, and reading hash from the blockchain, uses it
> >     to take the money from A htlc immediately.
> >     C-E2. Alice: broadcast her own A htlc txes, and after a timeout take
> the
> >     money. Bob: broadcast his own B htlc txes and after the timeout
> >     take their money. Charlie: broadcast his own C htlc txes and after
> >     the timeout take their money.
> >     F1. Bob: broadcast one or more of A htcl txes and use the hash
> preimage
> >     to get the money immediately. He already knows both privkeys of the
> >     multisig so this is pointless and just damages privacy and wastes
> >     miner fees. Alice: blacklist Bob's fidelity bond.
> >     F2. Bob: broadcast one or more of the C htlc txes. Charlie: use
> preimage
> >     to get his money immediately. Bob's actions were pointless. Alice:
> >     cant tell whether Bob or Charlie actually broadcasted, so blacklist
> >     both fidelity bonds.
> >     G1. Charlie: broadcast one or more of B htcl txes and use the hash
> >     preimage to get the money immediately. He already knows both
> >     privkeys of the multisig so this is pointless and just damages
> >     privacy and wastes miner fees. Alice: cant tell whether Bob or
> >     Charlie actually broadcasted, so blacklist both fidelity bonds.
> >     G2. Charlie: broadcast one or more of the A htlc txes. Alice:
> broadcast
> >     the remaining A htlc txes and use preimage to get her money
> >     immediately. Charlies's actions were pointless. Alice: blacklist
> >     Charlie's fidelity bond.
> >
> >     The multisig outputs of the funding transactions can stay unspent
> >     indefinitely. However the parties must always be watching the network
> >     and ready to respond with their own sweep using a preimage. This is
> >     because the other party still possesses a fully-signed contract tx.
> The
> >     parties respond in the same way as in steps C-E1, F2 and G2. Alice's
> >     reaction of blacklisting both fidelity bonds might not be the right
> way,
> >     because one maker could use it to get another one blacklisted (as
> well
> >     as themselves).
>
> Looks OK, though note that a participant might try to do so (as pointed
> out above) in the hope that the next participant is offline.
>
> Thank you very much for your writeup!
>
> Regards,
> ZmnSCPxj
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>

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

<div dir=3D"ltr">Hey Chris and all,<div><br></div><div>Looking good :) I ha=
ve one major concern though<br><div><br></div><div>&gt;=C2=A0 =C2=A0 q =3D =
EC privkey generated by maker</div>&gt;=C2=A0 =C2=A0 Q =3D q.G =3D EC pubke=
y published by maker<br>&gt;<br>&gt;=C2=A0 =C2=A0 p =3D nonce generated by =
taker<br>&gt;=C2=A0 =C2=A0 P =3D p.G =3D nonce point calculated by taker<br=
>&gt;<br>&gt;=C2=A0 =C2=A0 R =3D Q + P =3D pubkey used in bitcoin transacti=
on<br>&gt;=C2=A0 =C2=A0 =C2=A0 =3D (q + p).G<div><br></div><div>If I&#39;m =
understanding this correctly (which I&#39;m not sure I ame), it seems like =
the plan is to put R on-chain as the key to an output? As stated this is co=
mpletely=C2=A0insecure as Q is known in advance so the taker can always cho=
ose a nonce p but then claim that their nonce point is p.G - Q so that the =
key that goes on-chain is (p.G - Q=C2=A0+ Q) =3D p.G allowing them to steal=
 the funds. If the plan is not to use full-fledged=C2=A02-ECDSA (which I th=
ink is actually necessary as I still don&#39;t understand how the HTLC sign=
atures are generated) you have to, at the very least, force the taker to pr=
ovide a Zero Knowledge Proof of Knowledge (ZKPoK) of the discrete log to th=
e point they advertise=C2=A0as their nonce point to avoid this. Alternative=
ly, I think you can use the following key as is done in MuSig:</div></div><=
div><br></div><div>R =3D H(Q || P || Q)*Q=C2=A0+ H(Q || P || P)*P</div><div=
><br></div><div>But I still don&#39;t see how signatures can be generated f=
or HTLCs from this key.</div><div><br></div><div>Of course all of this comp=
lexity more or less goes away once we have Schnorr signatures and can use M=
uSig with adaptor signatures.</div><div><br></div><div>Best,</div><div>Nada=
v</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail=
_attr">On Thu, Aug 20, 2020 at 6:17 AM ZmnSCPxj via bitcoin-dev &lt;<a href=
=3D"mailto:bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.linuxfo=
undation.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddin=
g-left:1ex">Good morning Chris,<br>
<br>
Great to see this!<br>
<br>
Mostly minor comments.<br>
<br>
<br>
<br>
&gt;<br>
&gt; =3D=3D Direct connections to Alice =3D=3D=3D<br>
&gt;<br>
&gt; Only Alice, the taker, knows the entire route, Bob and Charlie just kn=
ow<br>
&gt; their previous and next transactions. Bob and Charlie do not have dire=
ct<br>
&gt; connections with each other, only with Alice.<br>
&gt;<br>
&gt; Diagram of Tor connections:<br>
&gt;<br>
&gt; Bob Charlie<br>
&gt; | /<br>
&gt; | /<br>
&gt; | /<br>
&gt; Alice<br>
&gt;<br>
&gt; When Bob and Charlie communicate, they are actually sending and<br>
&gt; receiving messages via Alice who relays them to Charlie or Bob. This<b=
r>
&gt; helps hide whether the previous or next counterparty in a CoinSwap rou=
te<br>
&gt; is a maker or taker.<br>
&gt;<br>
&gt; This doesn&#39;t have security issues even in the final steps where pr=
ivate<br>
&gt; keys are handed over, because those private keys are always for 2-of-2=
<br>
&gt; multisig and so on their own are never enough to steal money.<br>
<br>
This has a massive advantage over CoinJoin.<br>
<br>
In CoinJoin, since all participants sign a single transaction, every partic=
ipant knows the total number of participants.<br>
Thus, in CoinJoin, it is fairly useless to have just one taker and one make=
r, the maker knows exactly which output belongs to the taker.<br>
Even if all communications were done via the single paying taker, the maker=
(s) are shown the final transaction and thus can easily know how many parti=
cipants there are (by counting the number of equal-valued outputs).<br>
<br>
With CoinSwap, in principle no maker has to know how many other makers are =
in the swap.<br>
<br>
Thus it would still be useful to make a single-maker CoinSwap, as that woul=
d be difficult, for the maker, to diferentiate from a multi-maker CoinSwap.=
<br>
<br>
There are still a few potential leaks though:<br>
<br>
* If paying through a CoinSwap, the cheapest option for the taker would be =
to send out a single large UTXO (single-output txes) to the first maker, an=
d then demand the final payment and any change as two separate swaps from t=
he final maker.<br>
=C2=A0 * Intermediate makers are likely to not have exact amounts, thus is =
unlikely to create a single-output tx when forwarding.<br>
=C2=A0 * Thus, the first maker could identify the taker.<br>
* The makers can try timing the communications lag with the taker.<br>
=C2=A0 The general assumption would be that more makers =3D=3D more delay i=
n taker responses.<br>
<br>
<br>
<br>
&gt;<br>
&gt; =3D=3D=3D Miner fees =3D=3D=3D<br>
&gt;<br>
&gt; Makers have no incentive to pay any miner fees. They only do<br>
&gt; transactions which earn them an income and are willing to wait a very<=
br>
&gt; long time for that to happen. By contrast takers want to create<br>
&gt; transactions far more urgently. In JoinMarket we coded a protocol wher=
e<br>
&gt; the maker could contribute to miner fees, but the market price offered=
<br>
&gt; of that trended towards zero. So the reality is that takers will pay a=
ll<br>
&gt; the miner fees. Also because makers don&#39;t know the taker&#39;s tim=
e<br>
&gt; preference they don&#39;t know how much they should pay in miner fees.=
<br>
&gt;<br>
&gt; The taker will have to set limits on how large the maker&#39;s transac=
tions<br>
&gt; are, otherwise makers could abuse this by having the taker consolidate=
<br>
&gt; maker&#39;s UTXOs for free.<br>
<br>
Why not have the taker pay for the *first* maker-spent UTXO and have additi=
onal maker-spent UTXOs paid for by the maker?<br>
i.e. the taker indicates &quot;swap me 1 BTC in 3 bags of 0.3, 0.3, and 0.4=
 BTC&quot;, and pays for one UTXO spent for each &quot;bag&quot; (thus pays=
 for 3 UTXOs).<br>
<br>
Disagreements on feerate can be resolved by having the taker set the feerat=
e, i.e. &quot;the customer is always right&quot;.<br>
Thus if the maker *has to* spend two UTXOs to make up the 0.4 BTC bag, it p=
ays for the mining fees for that extra UTXO.<br>
The maker can always reject the swap attempt if it *has to* spend multiple =
UTXOs and would lose money doing so if the taker demands a too-high feerate=
.<br>
<br>
<br>
&gt; =3D=3D Contract transaction definitions =3D=3D<br>
&gt;<br>
&gt; Contract transactions are those which may spend from the 2-of-2 multis=
ig<br>
&gt; outputs, they transfer the coins into a contract where the coins can b=
e<br>
&gt; spent either by waiting for a timeout or providing a hash preimage<br>
&gt; value. Ideally contract transactions will never be broadcast but their=
<br>
&gt; existence keeps all parties honest.<br>
&gt;<br>
&gt; M~ is miner fees, which we treat as a random variable, and ultimately<=
br>
&gt; set by whichever pre-signed RBF tx get mined. When we talk about the<b=
r>
&gt; contract tx, we actually mean perhaps 20-30 transactions which only<br=
>
&gt; differ by the miner fee and have RBF enabled, so they can be broadcast=
ed<br>
&gt; in sequence to get the contract transaction mined regardless of the<br=
>
&gt; demand for block space.<br>
<br>
The highest-fee version could have, in addition, CPFP-anchor outputs, like =
those being proposed in Lightning, so even if onchain fees rise above the l=
argest fee reservation, it is possible to add even more fees.<br>
<br>
Or not.<br>
Hmm.<br>
<br>
<br>
Another thought: later you describe that miner fees are paid by Alice by fo=
rwarding those fees as well, how does that work when there are multiple ver=
sions of the contract transaction?<br>
<br>
&gt;<br>
&gt; (Alice+timelock_A OR Bob+hash) =3D Is an output which can be spent<br>
&gt; either with Alice&#39;s private key<br>
&gt; after waiting for a relative<br>
&gt; timelock_A, or by Bob&#39;s private key by<br>
&gt; revealing a hash preimage value<br>
<br>
The rationale for relative timelocks is that it makes private key turnover =
slightly more useable by ensuring that, after private key turnover, it is p=
ossible to wait indefinitely to spend the UTXO it received.<br>
This is in contrast with absolute timelocks, where after private key turnov=
er, it is required to spend received UTXO before the absolute timeout.<br>
<br>
The dangers are:<br>
<br>
* Until it receives the private key, if either of the incoming or outgoing =
contract transactions are confirmed, every swap participant (taker or maker=
) should also broadcast the other contract transaction, and resolve by onch=
ain transactions (with loss of privacy).<br>
* After receiving the private key, if the incoming contract transaction is =
confirmed, it should spend the resulting contract output.<br>
* It is possible to steal from a participant if that participant goes offli=
ne longer than the timeout.<br>
=C2=A0 This may imply that there may have to be some minimum timeout that m=
akers indicate in their advertisements.<br>
=C2=A0 * The taker can detect if the first maker is offline, then if it is =
offline, try a contract transaction broadcast, if it confirms, the taker ca=
n wait for the timeout; if it times out, the taker can clawback the transac=
tion.<br>
=C2=A0 =C2=A0 * This appears to be riskless for the taker.<br>
=C2=A0 =C2=A0 * Against a similar attack, Lightning requires channel reserv=
es, which means the first hop never gains control of the entire value, whic=
h is a basic requirement for private key turnover.<br>
=C2=A0 * On the other hand, the taker has the largest timeout before it can=
 clawback the funds, so it would wait for a long time, and at any time in b=
etween the first maker can come online and spend using the hashlock branch.=
<br>
=C2=A0 =C2=A0 * But the taker can just try on the hope it works; it has not=
hing to lose.<br>
=C2=A0 * This attack seems to be possible only for the taker to mount.<br>
=C2=A0 =C2=A0 Other makers on the route cannot know who the other makers ar=
e, without cooperation of the taker, who is the only one who knows all the =
makers.<br>
=C2=A0 =C2=A0 * On the other hand, the last maker in the route has an outgo=
ing HTLC with the smallest timelock, so it is the least-risk and therefore =
a maker who notices its outgoing HTLC has a low timeout might want to just =
do this anyway even if it is unsure if the taker is offline.<br>
=C2=A0 * Participants might want to spend from the UTXO to a new address af=
ter private key turnover anyway.<br>
=C2=A0 =C2=A0 Makers could spend using a low-fee RBF-enabled tx, and when a=
nother request comes in for another swap, try to build a new funding tx wit=
h a higher-fee bump.<br>
<br>
<br>
&gt; A possible attack by a malicious Alice is that she chooses M1 to be ve=
ry<br>
&gt; low (e.g. 1 sat/vbyte) and sets M2 and M3 to be very high (e.g. 1000<b=
r>
&gt; sat/vb) and then intentionally aborts, forcing the makers to lose much=
<br>
&gt; more money in miner fees than the attacker. The attack can be used to<=
br>
&gt; waste away Bob&#39;s and Charlie&#39;s coins on miner fees at little c=
ost to the<br>
&gt; malicious taker Alice. So to defend against this attack Bob and Charli=
e<br>
&gt; must refuse to sign a contract transaction if the corresponding fundin=
g<br>
&gt; transaction pays miner fees greater than Alice&#39;s funding transacti=
on.<br>
<br>
Sorry, I do not follow the logic for this...?<br>
<br>
&gt; The timelocks are staggered so that if Alice uses the preimage to take=
<br>
&gt; coins then the right people will also learn the preimage and have enou=
gh<br>
&gt; time to be able to get their coins back too. Alice starts with knowled=
ge<br>
&gt; of the hash preimage so she must have a longest timelock.<br>
<br>
More precisely:<br>
<br>
* The HTLC outgoing from Alice has the longest timelock.<br>
* The HTLC incoming into Alice has the shortest timelock.<br>
<br>
For the makers, they only need to ensure that the incoming timelock is much=
 larger than the outgoing timelock.<br>
<br>
<br>
&gt;<br>
&gt; =3D=3D EC tweak to reduce one round trip =3D=3D<br>
&gt;<br>
&gt; When two parties are agreeing on a 2-of-2 multisig address, they need =
to<br>
&gt; agree on their public keys. We can avoid one round trip by using the E=
C<br>
&gt; tweak trick.<br>
&gt;<br>
&gt; When Alice, the taker, downloads the entire offer book for the liquidi=
ty<br>
&gt; market, the offers will also contain a EC public key. Alice can tweak<=
br>
&gt; this to generate a brand new public key for which the maker knows the<=
br>
&gt; private key. This public key will be one of the keys in the 2-of-2<br>
&gt; multisig. This feature removes one round trip from the protocol.<br>
&gt;<br>
&gt; q =3D EC privkey generated by maker<br>
&gt; Q =3D q.G =3D EC pubkey published by maker<br>
&gt;<br>
&gt; p =3D nonce generated by taker<br>
&gt; P =3D p.G =3D nonce point calculated by taker<br>
&gt;<br>
&gt; R =3D Q + P =3D pubkey used in bitcoin transaction<br>
&gt; =3D (q + p).G<br>
<br>
Whoa whoa whoa whoa.<br>
<br>
All this time I was thinking you were going to use 2p-ECDSA for all 2-of-2s=
.<br>
In which case, the private key generated by the taker would be sufficient t=
weak to blind this.<br>
<br>
In 2p-ECDSA, for two participants M =3D m * G; T =3D t * G, the total key i=
s m * t * G =3D m * T =3D t * M.<br>
<br>
Are you going to use `2 &lt;T&gt; &lt;Q+P&gt; 2 OP_CHECKMULTISIG` instead o=
f 2p-ECDSA?<br>
Note that you cannot usefully hide among Lightning mutual closes, because o=
f the reserve; Lightning mutual closes are very very likely to be spent in =
a 1-input (that spends from a 2-of-2 P2WSH), 2-output (that pays to two P2W=
PKHs) tx.<br>
<br>
&gt;<br>
&gt; =3D=3D Protocol =3D=3D<br>
<br>
&gt; ---8&lt;------<br>
<br>
The protocol looks correct to me.<br>
<br>
LOL.<br>
<br>
Give me a little more time to check it in detail hahaha.<br>
<br>
<br>
<br>
&gt;=C2=A0 =C2=A0 =C2=A0=3D=3D=3D=3D Retaliation as DOS-resistance =3D=3D=
=3D=3D<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0In some situations (e.g. step 8.) if one maker in t=
he coinswap route is<br>
&gt;=C2=A0 =C2=A0 =C2=A0the victim of a DOS they will retaliate by DOSing t=
he previous maker in<br>
&gt;=C2=A0 =C2=A0 =C2=A0the route. This may seem unnecessary and unfair (af=
ter all why waste<br>
&gt;=C2=A0 =C2=A0 =C2=A0even more time and block space) but is actually the=
 best way to resist<br>
&gt;=C2=A0 =C2=A0 =C2=A0DOS because it produces a concrete cost every time =
a DOS happens.<br>
<br>
I agree.<br>
<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0=3D=3D Analysis of deviations =3D=3D<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0This section discusses what happens if one party de=
viates from the<br>
&gt;=C2=A0 =C2=A0 =C2=A0protocol by doing something else, for example broad=
casting a htlc<br>
&gt;=C2=A0 =C2=A0 =C2=A0contract tx when they shouldnt have.<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0The party name refers to what that party does, foll=
owed by other party&#39;s<br>
&gt;=C2=A0 =C2=A0 =C2=A0reactions to it.<br>
&gt;=C2=A0 =C2=A0 =C2=A0e.g. Party1: does a thing, Party2/Party3: does a th=
ing in reaction<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0If multiple deviations are possible in a step then =
they are numbered<br>
&gt;=C2=A0 =C2=A0 =C2=A0e.g. A1 A2 A2 etc<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A00-2. Alice/Bob/Charlie: nothing else is possible ex=
cept following the<br>
&gt;=C2=A0 =C2=A0 =C2=A0protocol or aborting<br>
&gt;<br>
&gt; 8.=C2=A0 Alice: broadcasts one or more of the A htlc txes. Bob/Charlie=
/Dennis:<br>
&gt;=C2=A0 =C2=A0 =C2=A0do nothing, they havent lost any time or money.<br>
&gt;=C2=A0 =C2=A0 =C2=A04-6. Bob/Charlie: nothing else is possible except f=
ollowing the protocol<br>
&gt;=C2=A0 =C2=A0 =C2=A0or aborting.<br>
&gt;<br>
&gt; 9.=C2=A0 Bob: broadcasts one or more of the B htlc txes, Alice: broadc=
asts all<br>
&gt;=C2=A0 =C2=A0 =C2=A0her own A htlc txes and waits for the timeout to ge=
t her money back.<br>
&gt;=C2=A0 =C2=A0 =C2=A0Charlie: do nothing<br>
&gt;<br>
&gt; 10.=C2=A0 Charlie: nothing else is possible except following the proto=
col or<br>
&gt;=C2=A0 =C2=A0 =C2=A0aborting.<br>
&gt;<br>
&gt; 11.=C2=A0 Alice: broadcasts one or more of the A htlc txes. Bob: broad=
casts all<br>
&gt;=C2=A0 =C2=A0 =C2=A0his own A htlc txes and waits for the timeout.<br>
&gt;=C2=A0 =C2=A0 =C2=A0A. same as 8.<br>
&gt;=C2=A0 =C2=A0 =C2=A0B. Charlie: broadcasts one or more of the C htlc tx=
es, Alice/Bob:<br>
&gt;=C2=A0 =C2=A0 =C2=A0broadcasts all their own htlc txes and waits for th=
e timeout to get<br>
&gt;=C2=A0 =C2=A0 =C2=A0their money back.<br>
&gt;=C2=A0 =C2=A0 =C2=A0C-E1. Alice: broadcasts all of C htlc txes and uses=
 her knowledge of the<br>
&gt;=C2=A0 =C2=A0 =C2=A0preimage hash to take the money immediately. Charli=
e: broadcasts<br>
&gt;=C2=A0 =C2=A0 =C2=A0all of B htlc txes and reading the hash value from =
the blockchain,<br>
&gt;=C2=A0 =C2=A0 =C2=A0uses it to take the money from B htlc immediately. =
Bob: broadcasts<br>
&gt;=C2=A0 =C2=A0 =C2=A0all of A htlc txes, and reading hash from the block=
chain, uses it<br>
&gt;=C2=A0 =C2=A0 =C2=A0to take the money from A htlc immediately.<br>
&gt;=C2=A0 =C2=A0 =C2=A0C-E2. Alice: broadcast her own A htlc txes, and aft=
er a timeout take the<br>
&gt;=C2=A0 =C2=A0 =C2=A0money. Bob: broadcast his own B htlc txes and after=
 the timeout<br>
&gt;=C2=A0 =C2=A0 =C2=A0take their money. Charlie: broadcast his own C htlc=
 txes and after<br>
&gt;=C2=A0 =C2=A0 =C2=A0the timeout take their money.<br>
&gt;=C2=A0 =C2=A0 =C2=A0F1. Bob: broadcast one or more of A htcl txes and u=
se the hash preimage<br>
&gt;=C2=A0 =C2=A0 =C2=A0to get the money immediately. He already knows both=
 privkeys of the<br>
&gt;=C2=A0 =C2=A0 =C2=A0multisig so this is pointless and just damages priv=
acy and wastes<br>
&gt;=C2=A0 =C2=A0 =C2=A0miner fees. Alice: blacklist Bob&#39;s fidelity bon=
d.<br>
&gt;=C2=A0 =C2=A0 =C2=A0F2. Bob: broadcast one or more of the C htlc txes. =
Charlie: use preimage<br>
&gt;=C2=A0 =C2=A0 =C2=A0to get his money immediately. Bob&#39;s actions wer=
e pointless. Alice:<br>
&gt;=C2=A0 =C2=A0 =C2=A0cant tell whether Bob or Charlie actually broadcast=
ed, so blacklist<br>
&gt;=C2=A0 =C2=A0 =C2=A0both fidelity bonds.<br>
&gt;=C2=A0 =C2=A0 =C2=A0G1. Charlie: broadcast one or more of B htcl txes a=
nd use the hash<br>
&gt;=C2=A0 =C2=A0 =C2=A0preimage to get the money immediately. He already k=
nows both<br>
&gt;=C2=A0 =C2=A0 =C2=A0privkeys of the multisig so this is pointless and j=
ust damages<br>
&gt;=C2=A0 =C2=A0 =C2=A0privacy and wastes miner fees. Alice: cant tell whe=
ther Bob or<br>
&gt;=C2=A0 =C2=A0 =C2=A0Charlie actually broadcasted, so blacklist both fid=
elity bonds.<br>
&gt;=C2=A0 =C2=A0 =C2=A0G2. Charlie: broadcast one or more of the A htlc tx=
es. Alice: broadcast<br>
&gt;=C2=A0 =C2=A0 =C2=A0the remaining A htlc txes and use preimage to get h=
er money<br>
&gt;=C2=A0 =C2=A0 =C2=A0immediately. Charlies&#39;s actions were pointless.=
 Alice: blacklist<br>
&gt;=C2=A0 =C2=A0 =C2=A0Charlie&#39;s fidelity bond.<br>
&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0The multisig outputs of the funding transactions ca=
n stay unspent<br>
&gt;=C2=A0 =C2=A0 =C2=A0indefinitely. However the parties must always be wa=
tching the network<br>
&gt;=C2=A0 =C2=A0 =C2=A0and ready to respond with their own sweep using a p=
reimage. This is<br>
&gt;=C2=A0 =C2=A0 =C2=A0because the other party still possesses a fully-sig=
ned contract tx. The<br>
&gt;=C2=A0 =C2=A0 =C2=A0parties respond in the same way as in steps C-E1, F=
2 and G2. Alice&#39;s<br>
&gt;=C2=A0 =C2=A0 =C2=A0reaction of blacklisting both fidelity bonds might =
not be the right way,<br>
&gt;=C2=A0 =C2=A0 =C2=A0because one maker could use it to get another one b=
lacklisted (as well<br>
&gt;=C2=A0 =C2=A0 =C2=A0as themselves).<br>
<br>
Looks OK, though note that a participant might try to do so (as pointed out=
 above) in the hope that the next participant is offline.<br>
<br>
Thank you very much for your writeup!<br>
<br>
Regards,<br>
ZmnSCPxj<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>

--000000000000ffc30f05ad50c7b6--