summaryrefslogtreecommitdiff
path: root/9c/479e8d762d8298794ac1c18c3c5ab9f0461635
blob: cfc9f4dca3bbe89e814b4ce4a74e46aeb900ff0f (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
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
Return-Path: <antoine.riard@gmail.com>
Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])
 by lists.linuxfoundation.org (Postfix) with ESMTP id 4D494C0032
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 11 Sep 2023 06:02:30 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by smtp3.osuosl.org (Postfix) with ESMTP id 174D460B97
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 11 Sep 2023 06:02:30 +0000 (UTC)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 174D460B97
Authentication-Results: smtp3.osuosl.org;
 dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com
 header.a=rsa-sha256 header.s=20221208 header.b=i6tg83fL
X-Virus-Scanned: amavisd-new at osuosl.org
X-Spam-Flag: NO
X-Spam-Score: -1.088
X-Spam-Level: 
X-Spam-Status: No, score=-1.088 tagged_above=-999 required=5
 tests=[BAYES_00=-1.9, BITCOIN_OBFU_SUBJ=1, 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, RCVD_IN_DNSWL_NONE=-0.0001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_LOAN=0.01]
 autolearn=no autolearn_force=no
Received: from smtp3.osuosl.org ([127.0.0.1])
 by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id fRfAvjoNt7bU
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 11 Sep 2023 06:02:27 +0000 (UTC)
Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com
 [IPv6:2607:f8b0:4864:20::12f])
 by smtp3.osuosl.org (Postfix) with ESMTPS id EFB77607A4
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 11 Sep 2023 06:02:26 +0000 (UTC)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org EFB77607A4
Received: by mail-il1-x12f.google.com with SMTP id
 e9e14a558f8ab-34f68376b57so4486925ab.0
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sun, 10 Sep 2023 23:02:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1694412146; x=1695016946;
 darn=lists.linuxfoundation.org; 
 h=to:subject:message-id:date:from:in-reply-to:references:mime-version
 :from:to:cc:subject:date:message-id:reply-to;
 bh=JNdQbwE33i/FWK5Klsjg2I93FeKP8AYVfnVkQeDg24M=;
 b=i6tg83fLGw6J3Sc5VlD/0JjWyRHk3J5P5ZoO+Kf3CnqyBYWHdHkXwCH6nIROqQ6nHV
 wzUE/0Ru7RkNSdZNELX1tJEve8+yY+YSw6IgCgj5R/XZAvgeXUikhHVD+k7EhgrEziLd
 0gcUArcl+FsociBa6bNiQBZeDVGYnT+9e87/g9iYD04FM+c+EIBOsBkVcK9pLiuX/rud
 ywgcp7F8xYrvyXEZIu4muRgQOFeSxv67jSOlTHKCbc2wS036TbUQZQ93QWG76Lv//hu6
 MscCdKlUN6TlsnqjpcOZOB2VbKCp0Pv2rT2Pe253scB5RuUxhT7tEdn8lkK3ThJ6GXFl
 czUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1694412146; x=1695016946;
 h=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=JNdQbwE33i/FWK5Klsjg2I93FeKP8AYVfnVkQeDg24M=;
 b=tVoun18gCclwlfaWRbKKDvdIY6bEV/UDy9xgX5mFv0wboJIk5bEx7TC2nGvpVEWZ0w
 PRzFObN+FZgJwmTCad2qH0gSnHGBYUVW+OyVPcttZ8HeXeo755EvSmRtw+Of+JWZuI82
 zoL1F6jM7Hc6WiZgONeys9ZqhBxsBGafk5Lu5rhMtF9oZXNnCq6kfxy+DO9uwmil/CfT
 F7QZqE7exEArOLTWK6uMwjGH7p0eWPvlBxVVeS7r6yi+5y8wd7z2TIOrxsqICTVrEHoj
 LrMCWO42QnHjwLjCu3+Md7RNXZ/hWRlSOROZbCYfJh3U0TM2UG+YrKh/X4cUxzxNda89
 tZ3Q==
X-Gm-Message-State: AOJu0YzqK4E7xc6fZW4eskeRRh8H1U3/ckr1Jk29pd3PWNcPQQkV6LTq
 8sBDhk1Ya8lfJQ+rj1v6GeYnt2N878gqgPGuAIBhUD9fkMmVmgmm
X-Google-Smtp-Source: AGHT+IGYnRBgH/ok6fv6bjtPPLgtPiFWeXpeAawT6u45CIwDXOrUoYhHCddCJsIqIjE3szthmG5YMT/5/XpUUcjYlH4=
X-Received: by 2002:a92:d6d0:0:b0:34f:663d:b9fe with SMTP id
 z16-20020a92d6d0000000b0034f663db9femr5554884ilp.19.1694412145751; Sun, 10
 Sep 2023 23:02:25 -0700 (PDT)
MIME-Version: 1.0
References: <3G-PTmIOM96I32Sh_uJQqQlv8pf81bEbIvH9GNphyj0429Pan9dQEOez69bgrDzJunXaC9d2O5HWPmBQfQojo67mKQd7TOAljBFL3pI2Dbo=@protonmail.com>
In-Reply-To: <3G-PTmIOM96I32Sh_uJQqQlv8pf81bEbIvH9GNphyj0429Pan9dQEOez69bgrDzJunXaC9d2O5HWPmBQfQojo67mKQd7TOAljBFL3pI2Dbo=@protonmail.com>
From: Antoine Riard <antoine.riard@gmail.com>
Date: Mon, 11 Sep 2023 07:02:13 +0100
Message-ID: <CALZpt+ECDxM5mD3e0UjsS+r+E+xYLim-yUYoJ_P9Vpjk32_pPA@mail.gmail.com>
To: ZmnSCPxj <ZmnSCPxj@protonmail.com>, 
 Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Content-Type: multipart/alternative; boundary="0000000000000cfbca06050f1220"
X-Mailman-Approved-At: Mon, 11 Sep 2023 08:17:04 +0000
Subject: Re: [bitcoin-dev] Actuarial System To Reduce Interactivity In
 N-of-N (N > 2) Multiparticipant Offchain Mechanisms
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: Mon, 11 Sep 2023 06:02:30 -0000

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

Hi Zeeman


> What we can do is to add the actuary to the contract that
> controls the funds, but with the condition that the
> actuary signature has a specific `R`.

> As we know, `R` reuse --- creating a new signature for a
> different message but the same `R` --- will leak the
> private key.

> The actuary can be forced to put up an onchain bond.
> The bond can be spent using the private key of the actuary.
> If the actuary signs a transaction once, with a fixed `R`,
> then its private key is still safe.

> However, if the actuary signs one transaction that spends
> some transaction output, and then signs a different
> transaction that spends the same transaction output, both
> signatures need to use the same fixed `R`.
> Because of the `R` reuse, this lets anyone who expected
> one transaction to be confirmed, but finds that the other
> one was confirmed, to derive the secret key of the
> actuary from the two signatures, and then slash the bond
> of the actuary.

From my understanding, if an off-chain state N1 with a negotiated group of
40 is halted in the middle of the actuary's R reveals due to the 40th
participant non-interactivity, there is no guarantee than a new off-chain
state N1' with a new negotiated group of 39 (from which evicted 40th's
output is absent) do not re-use R reveals on N1. So for the actuary bond
security,  I think the R reveal should only happen once all the group
participants have revealed their own signature. It sounds like some loose
interactivity is still assumed, i.e all the non-actuary participants must
be online at the same time, and lack of contribution is to blame as you
have a "flat" off-chain construction (i.e no layering of the promised
off-chain outputs in subgroups to lower novation interactivity).

More fundamentally, I think this actuarial system does not solve the
"multi-party off-chain state correction" problem as there is no guarantee
that the actuary does not slash the bond itself. And if the bond is guarded
by users' pubkeys, there is no guarantee that the user will cooperate after
the actuary equivocation is committed to sign a "fair" slashing transaction=
.

Best,
Antoine

Le sam. 9 sept. 2023 =C3=A0 02:28, ZmnSCPxj via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> a =C3=A9crit :

>  (N > 2) Multiparticipant Offchain Mechanisms
>
> Introduction
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> The blockchain layer of Bitcoin provides an excellent non-interactivity:
> users can go offline, then come online, synchronize, and broadcast
> transactions to the mempool.
> Always-online miners then get the transactions and add them to blocks,
> thereby confirming them.
>
> There are two important properties here:
>
> * Users do not need to be persistently online, only online when they
>   need to create and send a transaction.
> * Miners only dictate transaction ordering (i.e. which of two
>   conflicting transactions "comes first" and the second one is thus
>   invalid), and do ***not*** have custody of any user funds at all.
>
> Both properties are difficult to achieve for offchain mechanisms like
> 2-participant Lightning channels.
> But without these two properties, the requirement to be interative
> and thus always online creates additional friction in the use of the
> technology.
>
> When we move on from 2-participant offchain mechanisms ("channels")
> and towards N > 2, the interactivity problem is exacerbated.
> Generally, it is not possible to advance the state of an offchain
> mechanism that uses N-of-N signing without all users being online
> simultaneously.
>
> In this writeup, I present a new role that N-of-N offchain mechanisms
> can include.
> This role, the actuary role, is similar to the role of miners on the
> blockchain: they have high uptime (so users can connect to them to
> send a transaction "for confirmation") and they only decide
> transaction ordeering and do ***not*** have custody of the coins.
>
> Required Softforks
> ------------------
>
> To enable the actuary role I propose here, we need to have two
> softforks:
>
> * `SIGHASH_ANYPREVOUT`
> * `OP_CHECKSEPARATEDSIG`
>   - Instead of accepting `(R, s)` signature as a single stack item,
>     this accepts `s` and `R` as two separate stack items.
>
> I expect that neither is significantly controversial.
> Neither seems to modify miner incentives, and thus isolates the
> new role away from actual miners.
>
> I will describe later how both are used by the proposed mechanism.
>
> Actuaries In An N-of-N Offchain Mechanism
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> Mechanisms like Decker-Wattenhofer, Poon-Dryja, and
> Decker-Russell-Osuntokun ("eltoo") can have an N-of-N signatory
> set.
> I will not discuss them deeply, other than to note that
> Decker-Russell-Osuntokun requires `SIGHAH_ANYPREVOUT`, supports
> N > 2 (unlike Poon-Dryja), and does not require significant
> number of transactions with varaible relative locktimes in the
> unilateral close case (unlike Decker-Wattenhofer).
>
> Using an N-of-N signatory set provides te following important
> advantage:
>
> * It is a consensus, not a democracy: everyone needs to agree.
>   - Thus, even a majority cannot force you to move funds you
>     own against your will.
>     The other side of "not your keys, not your coins" is
>     "your keys, your coins": if your key is necessary
>     because you are one of the N signatories, then funds inside
>     the mechanism are *your coins* and thus ***not*** custodial.
>
> The drawback of N-of-N signatories is that **all** N participants
> need to come together to sign a new state of the mechanism.
> If one of the N participants is offline, this stalls the protocol.
>
> An Offchain "Mempool"
> ---------------------
>
> At any time, an offchain mechanism such as Decker-Russell-Osuntokun
> will have a "current state", the latest set of transaction outputs
> that, if you unilateral close at that point, will be instantiated
> onchain.
>
> Thus, we can consider that the state of the mechanism is a set of
> pairs of Bitcoin SCRIPT and number of satoshis.
>
> These are instantiated as *actual* transaction outputs on some
> transaction that can be pushed onchain in a unilateral close
> situation.
>
> Suppose there are N (N > 2) participants in an offchain mechanism.
>
> Now suppose that one of the participants owns some funds in a
> simple single-sig contract in the current state of the offchain
> mechanism.
> Suppose that participant ("A") wants to send money to another
> participant ("B").
> Then participant A can "just" create an ordinary Bitcoin
> transaction that spends the appropriate transaction output from
> the current state, and sends money to participant B.
>
>     current state               +--------+--------------+
>     ---------+-----------+      |        |      A2      | (change output)
>              |     A     | ---> |        +--------------+
>              +-----------+      |        |      B2      |
>              |     B     |      +--------+--------------+
>              +-----------+
>              |     C     |
>     ---------+-----------+
>
> Now, B can "accept" this transaction is real, but ***only*** if
> B trusts A to not double-spend.
> Participant A can still construct a different transaction that
> spends that output but does ***not*** give any funds to
> participant B.
>
> Thus, this transaction is "unconfirmed", or in other words,
> would be in a "mempool" waiting to be confirmed.
>
> How do we "confirm" this transaction?
>
> In order to confirm this transaction, we apply the transaction
> to the current state of the mechanism: it is an atomic operation
> that deletes transaction output A and insersts two transaction
> outputs A2 and B2.
> This results in a new state.
> Then, all the participants (A, B, and C) need to sign off on the
> new state and invalidate the current state, replacing the current
> state to the new state.
>
> By moving to the new state, we effectively "cut through" the
> transactions that were in the "mempool" of the offchain mechanism.
> The cut-through transactions can then be forgotten forever, and
> more importantly ***do not have to be published to anyone***.
> Even a third party trying to validate the state of the offchain
> mechanism does **not** need to know about such old transactions
> that were already cut through.
> This is an important scaling property.
>
> Now, as mentioned above, the problem is that the N participants
> need to be online in order to advance the state and perform the
> cut-through.
> If one of the participants is offline, then none of the "mempool"
> transactions can confirm.
>
> So the question I raise now is: can we create a new role, an
> actuary, that is able to "confirm" transactions (i.e. indicate
> that a transction output has been spent by a specific
> transaction, and thus a conflicting transaction is no longer
> valid), but is otherwise unable to spend the funds (i.e.
> non-custodial)?
>
> K-of-N Non-Solution
> -------------------
>
> A common proposal is to have a federation of k-of-n that is
> trusted by participants.
>
> That way, even if some of the signatories are offline, the
> mechanism is "robust" in the sense that the state can still
> advance, and in-"mempool" transactions get "confirmed".
>
> The problem with this is that this is blatantly custodial.
> ***Any*** k-of-n mechanism ***MUST*** be custodial, as you
> cannot be sure that the k participants are actually not
> owned by a single participant which can now spend all your
> precious precious funds.
>
> Thus, this writeup completely rejects any k-of-n solution
> for state updates.
> We require that:
>
> * State updates are always signed N-of-N by all involved
>   participants.
> * Somehow we want to have a smaller threshold to *commit*
>   to having individual transactions in the *next* state,
>   and to reject double-spends of inputs to transactions
>   that have been committed.
>
> Actuary Role
> ------------
>
> Let us now define what we want the actuary role to be able
> to do and **NOT** do:
>
> * The actuary is able to select exactly one transaction
>   that spends a transaction output, i.e. it enforces
>   against double-spend.
> * The actuary is **NOT** able to spend funds unilaterally
>   by itslf, or with cooperation with participants that
>   do not otherwise have signing authorization for a
>   transaction output.
> * The actuary is **NOT** able to hostage funds, i.e. if
>   it stops responding, any single one participant can
>   drop the mechanism onchain and get actury-confirmed
>   (i.e. before the actuary stops responding) transactions
>   confirmed onchain, and thus able to recover their
>   funds.
>
> ### Ensuring Single-Spend
>
> We can have the actuary indicate that it has selected a
> transaction by also requiring that the actuary sign that
> transaction.
>
> We thus want to prevent the actuary from signing for the
> same output, but a different transaction.
>
> What we can do is to add the actuary to the contract that
> controls the funds, but with the condition that the
> actuary signature has a specific `R`.
>
> As we know, `R` reuse --- creating a new signature for a
> different message but the same `R` --- will leak the
> private key.
>
> The actuary can be forced to put up an onchain bond.
> The bond can be spent using the private key of the actuary.
> If the actuary signs a transaction once, with a fixed `R`,
> then its private key is still safe.
>
> However, if the actuary signs one transaction that spends
> some transaction output, and then signs a different
> transaction that spends the same transaction output, both
> signatures need to use the same fixed `R`.
> Because of the `R` reuse, this lets anyone who expected
> one transaction to be confirmed, but finds that the other
> one was confirmed, to derive the secret key of the
> actuary from the two signatures, and then slash the bond
> of the actuary.
>
> Thus, we need an `OP_CHECKSEPARATEDSIG` opcode.
> This takes three stack items, instead of two: `s`,
> `R`, and the public key.
>
> Then, an actual transaction output can indicate a specific
> `R` in a SCRIPT that includes `OP_CHECKSEPARATEDSIG`.
> This forces a specific `R` to be used, and thus requires
> the actuary to only sign once.
> This then enforces single-spend.
>
> ### Ensuring Non-Custodial
>
> This is simple: By ensuring that the onchain funding
> transaction output, which backs the entire mechanism, is
> an N-of-N of all participants, we can ensure that the
> actuary cannot spend the funds.
>
> Thus, by using N-of-N of all participants, we have
> consensus, and thus it is unnecessary for any participant
> to trust anyone else: they do not need to trust the
> actuary, or a quorum of signatories.
>
> As noted, this has the drawback that all N participants
> now need to sign off on each updtae of the offchain
> mechanism.
>
> However, the actuary serves a role:
>
> * While a new state is not yet signed off on by all
>   participants, it can sign individual transactions to
>   "confirm" them, with the assurance that they cannot
>   assist a double-spend since if they assist a
>   double-spend they lose their bond.
> * Participants can go online and offline at any time,
>   and the actuary can solicit and store their signatures
>   for to-be-next state.
>   Once it has solicited a complete N-of-N set for the
>   to-be-next state, it can then declare a new state and
>   hand the complete signature set to participants the
>   next time they come online.
>
> These reduce the onlineness requirement on participants.
>
> ### Ensuring Non-hostage
>
> We want the following property:
> If the actuary stops responding, then the participants
> can decide to drop the mechanism onchain, and recover
> their funds despite the actuary disappearing.
>
> Thus, the actuary cannot hostage the funds by refusing
> to confirm transactions: if the actuary refuses to
> confirm transactions, the participants can drop the
> mechanism onchain and just use the blockchain layer.
> This would suck, but the actuary still cannot hostage
> the funds held by the participants: the participants
> have a way to escape the mechanism.
>
> Crucially, we want the property that if we have some
> transactions that spend outputs from the current
> state, that were previously signed off by the actuary
> (i.e. "confirmed"), then when we drop onchain, we can
> drop those transactions onchain as well, with the
> assurance that other participants cannot replace them
> with an alternate version.
>
> To implement this, the SCRIPT of all outputs hosted
> inside the offchain mechanism are "infected" with
> `(sign-only-once(M) || CSV) && C`, where
> `M` is the actuary pubkey, `sign-only-once(M)` means
> that we enforce `R` reuse so that the actuary cannot
> sign the same output with different transactions
> (and thus ensure single-spend), and `C` is the
> "base", uninfected contract.
>
> For example, a hashlocked timelocked contract from A
> to B would have a "base" contract of:
>
>     (B && preimage(hash)) || (A && CLTV)
>
> And would have an "infected" contract of:
>
>     (sign-only-once(M) && CSV) && ((B && preimage(hash)) || (A && CLTV))
>
> For Taproot tapleaves, all tapleaves need to be infected.
> In addition, the `sign-only-once(M)` needs to use the same
> `R` for all tapleaves as well, so that signing for one
> branch cannot be used for another branch.
> The pointlocked branch cannot be used, but given current
> plans for `SIGHASH_ANYPREVOUT`, you need to sign
> `SIGHASH_ANYPREVOUT` because the actual transaction that
> gets confirmed can have a different transaction ID due to
> the Decker-Russell-Osuntokun.
>
> If the actaury stops responding, participants can
> publish the most recent state, as well as transactions
> that were "confirmed" by the actuary.
> Crucially, the transactions confirmed by the actuary
> have a time advantage, because they are signed by the
> actuary and we have a logical OR with the CSV;
> unconfirmed transactions need to wait for the CSV
> relative timeout before they can be confirmed onchain.
> Thus, if before it disappeared, the actuary signed some
> transactions and thus "confirmed" them, the participants
> can also confirm them onchain, and it is significantly
> less likely that another version of those transactions
> can get confirmed onchain in that situation.
> Thus, participants can rely on the "confirmation" of
> the actuary.
>
> Worked Example
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> Let us copy the initial state above, where there are three
> participants, A B C.
> In the below, M is the actuary, and the "M" here includes a
> fixed `R` nonce, to ensure that M can only sign once, and if
> M signs multiple times, it risks losing its bonded coins.
>
>     current state
>     ---------+-------------+
>              |(M||CSV) && A|
>              +-------------+
>              |(M||CSV) && B|
>              +-------------+
>              |(M||CSV) && C|
>     ---------+-------------+
>
> In the above, the "base" contracts are simple single-signature
> `A` / `B` / `C` conracts.
>
> While we show only `M`, in fact each `M` requirement also
> enforces single-spend for `M`.
> Each output also has a different `R` that is issused by the
> actuary.
>
> (for example, each participant can give the base contract
> serialization to the actuary, who then HMACs it with its own
> private key to generate a `r` then does `R =3D r * G`, so that
> the actuary does not need to remember the exact `R` each time,
> only whether it signed for a particular contract-amount pair.)
>
> Suppose that A decides to send some money to B.
> It creates a transaction spending the `A` output and creates
> two new outputs:
>
>     current state                  +--------+----------------+
>     ---------+-------------+       |        | (M||CSV) && A2 |
>              |(M||CSV) && A| ----> |    A   +----------------+
>              +-------------+       |        | (M||CSV) && B2 |
>              |(M||CSV) && B|       +--------+----------------+
>              +-------------+
>              |(M||CSV) && C|
>     ---------+-------------+
>
> In the above the `A` in the input side of the new transaction
> indicates a signature from participant A, fulfilling the base
> contract `A`.
>
> As the transaction is only signed by `A`, it is not yet
> confirmed.
> If the mechanism is dropped onchain, the participants must
> wait for the CSV timeout before it can be confirmed onchain,
> which reflects the fact that the transaction, inside the
> offchain mechanism, was not yet confirmed at this point.
>
> Now, suppose that participant A wants B to be assured that
> A will not double-spend the transaction.
> Then A solicits a single-spend signature from the actuary,
> getting a signature M:
>
>     current state                  +--------+----------------+
>     ---------+-------------+       |        | (M||CSV) && A2 |
>              |(M||CSV) && A| ----> |  M,A   +----------------+
>              +-------------+       |        | (M||CSV) && B2 |
>              |(M||CSV) && B|       +--------+----------------+
>              +-------------+
>              |(M||CSV) && C|
>     ---------+-------------+
>
> The above is now a confirmed transaction.
>
> Suppose at this point the offchain mechanism is dropped
> onchain.
> In that case, it is now immediately possible to also confirm
> the above transaction.
>
> Suppose that A tries to double-spend the transaction by signing
> another transaction spending the `A` output, but giving all of
> it to a new output `A3`.
> Because of the single-spend signature requirement, the actuary
> cannot safely sign this alternative version without losing its
> bonded amount.
>
>     current state                  +--------+----------------+
>     ---------+-------------+       |        | (M||CSV) && A2 |
>              |(M||CSV) && A| -+--> |  M,A   +----------------+
>              +-------------+  |    |        | (M||CSV) && B2 |
>              |(M||CSV) && B|  |    +--------+----------------+
>              +-------------+  |
>              |(M||CSV) && C|  |    +--------+----------------+
>     ---------+-------------+  +--> |    A   | (M||CSV) && A3 |
>                                    +--------+----------------+
>
> The transaction that is signed by the actuary M is the one that
> can be confirmed onchain immediately as soon as the current
> state transaction is confirmed, because the signature allows
> skipping the CSV requirement.
> However, the transaction that is signed only by participant A,
> in an attempt to double-spend the transaction, will need to
> wait out the CSV delay.
> The actuary M will never sign this alternate transaction, as
> `R` reuse will cause it to lose control of its private key and
> allow slashing of its bond.
>
> So, let us suppose that the actuary M decides to "cut through"
> the trasnaction it signed.
> The actuary M proposes to each of the participants to update
> the state of the offchain mechanism.
>
>     current state                  +--------+----------------+
>     ---------+-------------+       |        | (M||CSV) && A2 |
>              |(M||CSV) && A| ----> |  M,A   +----------------+
>              +-------------+       |        | (M||CSV) && B2 |
>              |(M||CSV) && B|       +--------+----------------+
>              +-------------+
>              |(M||CSV) && C|
>     ---------+-------------+
>
>     next state
>     ---------+----------------+
>              | (M||CSV) && A2 |
>     ---------+----------------+
>              | (M||CSV) && B2 |
>     ---------+----------------+
>              | (M||CSV) && B  |
>     ---------+----------------+
>              | (M||CSV) && C  |
>     ---------+----------------+
>
> It is not necessary for all the participants to come online
> simultaneously just to sign the new state.
> THe actuary can keep track of this new state on behalf of
> the participants, as well as the total signatures of all the
> N participants.
>
> Each participant still must validate that the next state
> contains the outputs they expect.
> However, they do not need to validate ***all*** outputs.
> For instance, participant C knows that it did not spend
> any funds, and did not receive any funds; it only cares
> that the next state still contains the `C` contract it
> expects.
> Participant A needs to validate the A2 and B2 exist,
> while participant B needs to validate the B2 and B outputs.
>
> ***This is important as it reduces the bandwidth requirements
> on the participants.***
> It is not necessary for the participants to validate *all*
> transactions, only that the participants validate the
> existence of outputs it expects to have been confirmed by
> the actaury.
> This is an important scaling advantage over e.g. a sidechain,
> where sidechain participants really ought to validate *all*
> transactions in the sidechain, not just the set they care
> about.
>
> Unlike the sidechain case, every participant needs to sign
> off on each state update.
> This means that as long as each participant does minimal
> protection of themselves, they can simply rely on the other
> participants being selfishly checking for their own expected
> outputs.
>
> If the actuary tries to cheat and create a next state that
> is not valid, then at least one participant will simply
> refuse to sign the next state, and drop the current state
> (and any transactions based on the current state) onchain.
> Thus, the N-of-N signatory set becomes an important
> optimization!
>
> In the above example, the actuary actually faithfully
> set the correct next state.
> So eventually all the participants get to go online and
> provide their signature shares, so that the mechanism
> advances and the next state becomes the current state:
>
>     current state
>     ---------+----------------+
>              | (M||CSV) && A2 |
>     ---------+----------------+
>              | (M||CSV) && B2 |
>     ---------+----------------+
>              | (M||CSV) && B  |
>     ---------+----------------+
>              | (M||CSV) && C  |
>     ---------+----------------+
>
> Against Custodiality
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>
> I think that people who want to actually improve Bitcoin
> MUST first strive as much as possible to ***avoid***
> custodians.
>
> Custodiality is easy.
>
> Escaping custody once you are custodied is almost impossible.
>
> Thus, it is important to ***avoid*** a custodial solution
> in our designs for Bitcoin.
>
> For example, Drivechains effectively makes miners the
> custodians of sidechain coins.
>
> Yes, there are incentives for miner custodians to not steal
> the sidechain coins.
>
> But far better to be able to say "it is not even possible for
> the miner to steal the coins in this mechanism at all".
>
> Do not give roles more rights than the minimum they absolute
> need to do their work!
> This is basic cybersecurity.
>
> We MUST avoid giving miners more control over **any** blockchain
> coins than what they already have.
> Miners currently can censor, and it is difficult to remove that
> ability without removing the ability to decide whether to confirm
> some transaction or not, since it is not possible to prove that
> you do not know a transaction.
> But currently miners cannot outright steal any funds.
>
> Giving more rights allows hackers who manage to take on the
> miner role (e.g. because the miner has bad opsec, or the hacker
> is the dictatorial warlord of the local government and has shot
> the miner to death and taken over their mine) to attack the
> system.
> Then, any analysis that "but miner roles have an incentive to
> not attack sidechains!" would not apply, as the hacker got the
> miner role outside of the normal miner expected incentives;
> the hacker incentives may not match the incentives of a "real"
> miner.
>
> Better if miners cannot attack at all, so that hackers that
> invalidly gain their role cannot attack, either.
>
> Similarly, the actuary role is given only the ability to decide
> to confirm or not confirm transactions.
> In particular the actuary role in this scheme is ***NOT***
> given the ability to move funds without consent of the purported
> owners of the value.
>
> This requires consensus, i.e. N-of-N signatories.
> However, the actuary is also overloaded so that it is the only
> entity that needs to have high uptime.
> Participants can drop online and offline, and the actuary
> coordinates the creation of new states.
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>

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

<div dir=3D"ltr">Hi Zeeman<div><br></div><div><br></div><div>&gt; What we c=
an do is to add the actuary to the contract that<br>&gt; controls the funds=
, but with the condition that the<br>&gt; actuary signature has a specific =
`R`.<br><br>&gt; As we know, `R` reuse --- creating a new signature for a<b=
r>&gt; different message but the same `R` --- will leak the<br>&gt; private=
 key.<br><br>&gt; The actuary can be forced to put up an onchain bond.<br>&=
gt; The bond can be spent using the private key of the actuary.<br>&gt; If =
the actuary signs a transaction once, with a fixed `R`,<br>&gt; then its pr=
ivate key is still safe.<br></div><div><br></div><div>&gt; However, if the =
actuary signs one transaction that spends<br>&gt; some transaction output, =
and then signs a different<br>&gt; transaction that spends the same transac=
tion output, both<br>&gt; signatures need to use the same fixed `R`.<br>&gt=
; Because of the `R` reuse, this lets anyone who expected<br>&gt; one trans=
action to be confirmed, but finds that the other<br>&gt; one was confirmed,=
 to derive the secret key of the<br>&gt; actuary from the two signatures, a=
nd then slash the bond<br>&gt; of the actuary.<br></div><div><br></div><div=
From my understanding, if an off-chain state N1 with a negotiated group of=
 40 is halted in the middle of the actuary&#39;s R reveals due to the 40th =
participant non-interactivity, there is no guarantee than a new off-chain s=
tate N1&#39; with a new negotiated group of 39 (from which evicted 40th&#39=
;s output is absent) do not re-use R reveals on N1. So for the actuary bond=
 security, =C2=A0I think the R reveal should only happen once all the group=
 participants have revealed their own signature. It sounds like some loose =
interactivity is still assumed,=C2=A0i.e all the non-actuary participants m=
ust be online at the same time, and lack of contribution is to blame as you=
 have a &quot;flat&quot; off-chain construction (i.e no layering of the pro=
mised off-chain outputs in subgroups to lower novation interactivity).<br><=
/div><div><br></div><div>More fundamentally, I think this actuarial system =
does not solve the &quot;multi-party off-chain state correction&quot; probl=
em as there is no guarantee that the actuary does not slash the bond itself=
. And if the bond is guarded by users&#39; pubkeys, there is no guarantee t=
hat the user will cooperate after the actuary equivocation is committed to =
sign a &quot;fair&quot; slashing transaction.</div><div><br></div><div>Best=
,</div><div>Antoine</div></div><br><div class=3D"gmail_quote"><div dir=3D"l=
tr" class=3D"gmail_attr">Le=C2=A0sam. 9 sept. 2023 =C3=A0=C2=A002:28, ZmnSC=
Pxj via bitcoin-dev &lt;<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation=
.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;b=
order-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,=
204);padding-left:1ex">=C2=A0(N &gt; 2) Multiparticipant Offchain Mechanism=
s<br>
<br>
Introduction <br>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>
<br>
The blockchain layer of Bitcoin provides an excellent non-interactivity:<br=
>
users can go offline, then come online, synchronize, and broadcast<br>
transactions to the mempool.<br>
Always-online miners then get the transactions and add them to blocks,<br>
thereby confirming them. <br>
<br>
There are two important properties here: <br>
<br>
* Users do not need to be persistently online, only online when they<br>
=C2=A0 need to create and send a transaction.<br>
* Miners only dictate transaction ordering (i.e. which of two<br>
=C2=A0 conflicting transactions &quot;comes first&quot; and the second one =
is thus<br>
=C2=A0 invalid), and do ***not*** have custody of any user funds at all.<br=
>
<br>
Both properties are difficult to achieve for offchain mechanisms like<br>
2-participant Lightning channels.<br>
But without these two properties, the requirement to be interative<br>
and thus always online creates additional friction in the use of the<br>
technology.=C2=A0 <br>
<br>
When we move on from 2-participant offchain mechanisms (&quot;channels&quot=
;)<br>
and towards N &gt; 2, the interactivity problem is exacerbated.<br>
Generally, it is not possible to advance the state of an offchain<br>
mechanism that uses N-of-N signing without all users being online<br>
simultaneously.<br>
<br>
In this writeup, I present a new role that N-of-N offchain mechanisms<br>
can include.<br>
This role, the actuary role, is similar to the role of miners on the<br>
blockchain: they have high uptime (so users can connect to them to<br>
send a transaction &quot;for confirmation&quot;) and they only decide<br>
transaction ordeering and do ***not*** have custody of the coins.<br>
<br>
Required Softforks<br>
------------------<br>
<br>
To enable the actuary role I propose here, we need to have two<br>
softforks:<br>
<br>
* `SIGHASH_ANYPREVOUT`<br>
* `OP_CHECKSEPARATEDSIG`<br>
=C2=A0 - Instead of accepting `(R, s)` signature as a single stack item,<br=
>
=C2=A0 =C2=A0 this accepts `s` and `R` as two separate stack items.<br>
<br>
I expect that neither is significantly controversial.<br>
Neither seems to modify miner incentives, and thus isolates the<br>
new role away from actual miners.<br>
<br>
I will describe later how both are used by the proposed mechanism.<br>
<br>
Actuaries In An N-of-N Offchain Mechanism<br>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>
<br>
Mechanisms like Decker-Wattenhofer, Poon-Dryja, and<br>
Decker-Russell-Osuntokun (&quot;eltoo&quot;) can have an N-of-N signatory<b=
r>
set.<br>
I will not discuss them deeply, other than to note that<br>
Decker-Russell-Osuntokun requires `SIGHAH_ANYPREVOUT`, supports<br>
N &gt; 2 (unlike Poon-Dryja), and does not require significant<br>
number of transactions with varaible relative locktimes in the<br>
unilateral close case (unlike Decker-Wattenhofer).<br>
<br>
Using an N-of-N signatory set provides te following important<br>
advantage:<br>
<br>
* It is a consensus, not a democracy: everyone needs to agree.<br>
=C2=A0 - Thus, even a majority cannot force you to move funds you<br>
=C2=A0 =C2=A0 own against your will.<br>
=C2=A0 =C2=A0 The other side of &quot;not your keys, not your coins&quot; i=
s<br>
=C2=A0 =C2=A0 &quot;your keys, your coins&quot;: if your key is necessary<b=
r>
=C2=A0 =C2=A0 because you are one of the N signatories, then funds inside<b=
r>
=C2=A0 =C2=A0 the mechanism are *your coins* and thus ***not*** custodial.<=
br>
<br>
The drawback of N-of-N signatories is that **all** N participants<br>
need to come together to sign a new state of the mechanism.<br>
If one of the N participants is offline, this stalls the protocol.<br>
<br>
An Offchain &quot;Mempool&quot;<br>
---------------------<br>
<br>
At any time, an offchain mechanism such as Decker-Russell-Osuntokun<br>
will have a &quot;current state&quot;, the latest set of transaction output=
s<br>
that, if you unilateral close at that point, will be instantiated<br>
onchain.<br>
<br>
Thus, we can consider that the state of the mechanism is a set of<br>
pairs of Bitcoin SCRIPT and number of satoshis.<br>
<br>
These are instantiated as *actual* transaction outputs on some<br>
transaction that can be pushed onchain in a unilateral close<br>
situation.<br>
<br>
Suppose there are N (N &gt; 2) participants in an offchain mechanism.<br>
<br>
Now suppose that one of the participants owns some funds in a<br>
simple single-sig contract in the current state of the offchain<br>
mechanism.<br>
Suppose that participant (&quot;A&quot;) wants to send money to another<br>
participant (&quot;B&quot;).<br>
Then participant A can &quot;just&quot; create an ordinary Bitcoin<br>
transaction that spends the appropriate transaction output from<br>
the current state, and sends money to participant B.<br>
<br>
=C2=A0 =C2=A0 current state=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0+--------+--------------+<br>
=C2=A0 =C2=A0 ---------+-----------+=C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 A2=C2=A0 =C2=A0 =C2=A0 | (change output)<b=
r>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0A=C2=
=A0 =C2=A0 =C2=A0| ---&gt; |=C2=A0 =C2=A0 =C2=A0 =C2=A0 +--------------+<br=
>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+-----------+=C2=A0 =C2=A0 =
=C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 B2=C2=A0 =C2=A0 =
=C2=A0 |<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0B=C2=
=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 +--------+--------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+-----------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0C=C2=
=A0 =C2=A0 =C2=A0|<br>
=C2=A0 =C2=A0 ---------+-----------+<br>
<br>
Now, B can &quot;accept&quot; this transaction is real, but ***only*** if<b=
r>
B trusts A to not double-spend.<br>
Participant A can still construct a different transaction that<br>
spends that output but does ***not*** give any funds to<br>
participant B.<br>
<br>
Thus, this transaction is &quot;unconfirmed&quot;, or in other words,<br>
would be in a &quot;mempool&quot; waiting to be confirmed.<br>
<br>
How do we &quot;confirm&quot; this transaction?<br>
<br>
In order to confirm this transaction, we apply the transaction<br>
to the current state of the mechanism: it is an atomic operation<br>
that deletes transaction output A and insersts two transaction<br>
outputs A2 and B2.<br>
This results in a new state.<br>
Then, all the participants (A, B, and C) need to sign off on the<br>
new state and invalidate the current state, replacing the current<br>
state to the new state.<br>
<br>
By moving to the new state, we effectively &quot;cut through&quot; the<br>
transactions that were in the &quot;mempool&quot; of the offchain mechanism=
.<br>
The cut-through transactions can then be forgotten forever, and<br>
more importantly ***do not have to be published to anyone***.<br>
Even a third party trying to validate the state of the offchain<br>
mechanism does **not** need to know about such old transactions<br>
that were already cut through.<br>
This is an important scaling property.<br>
<br>
Now, as mentioned above, the problem is that the N participants<br>
need to be online in order to advance the state and perform the<br>
cut-through.<br>
If one of the participants is offline, then none of the &quot;mempool&quot;=
<br>
transactions can confirm.<br>
<br>
So the question I raise now is: can we create a new role, an<br>
actuary, that is able to &quot;confirm&quot; transactions (i.e. indicate<br=
>
that a transction output has been spent by a specific<br>
transaction, and thus a conflicting transaction is no longer<br>
valid), but is otherwise unable to spend the funds (i.e.<br>
non-custodial)?<br>
<br>
K-of-N Non-Solution<br>
-------------------<br>
<br>
A common proposal is to have a federation of k-of-n that is<br>
trusted by participants.<br>
<br>
That way, even if some of the signatories are offline, the<br>
mechanism is &quot;robust&quot; in the sense that the state can still<br>
advance, and in-&quot;mempool&quot; transactions get &quot;confirmed&quot;.=
<br>
<br>
The problem with this is that this is blatantly custodial.<br>
***Any*** k-of-n mechanism ***MUST*** be custodial, as you<br>
cannot be sure that the k participants are actually not<br>
owned by a single participant which can now spend all your<br>
precious precious funds.<br>
<br>
Thus, this writeup completely rejects any k-of-n solution<br>
for state updates.<br>
We require that:<br>
<br>
* State updates are always signed N-of-N by all involved<br>
=C2=A0 participants.<br>
* Somehow we want to have a smaller threshold to *commit*<br>
=C2=A0 to having individual transactions in the *next* state,<br>
=C2=A0 and to reject double-spends of inputs to transactions<br>
=C2=A0 that have been committed.<br>
<br>
Actuary Role<br>
------------<br>
<br>
Let us now define what we want the actuary role to be able<br>
to do and **NOT** do:<br>
<br>
* The actuary is able to select exactly one transaction<br>
=C2=A0 that spends a transaction output, i.e. it enforces<br>
=C2=A0 against double-spend.<br>
* The actuary is **NOT** able to spend funds unilaterally<br>
=C2=A0 by itslf, or with cooperation with participants that<br>
=C2=A0 do not otherwise have signing authorization for a<br>
=C2=A0 transaction output.<br>
* The actuary is **NOT** able to hostage funds, i.e. if<br>
=C2=A0 it stops responding, any single one participant can<br>
=C2=A0 drop the mechanism onchain and get actury-confirmed<br>
=C2=A0 (i.e. before the actuary stops responding) transactions<br>
=C2=A0 confirmed onchain, and thus able to recover their<br>
=C2=A0 funds.<br>
<br>
### Ensuring Single-Spend<br>
<br>
We can have the actuary indicate that it has selected a<br>
transaction by also requiring that the actuary sign that<br>
transaction.<br>
<br>
We thus want to prevent the actuary from signing for the<br>
same output, but a different transaction.<br>
<br>
What we can do is to add the actuary to the contract that<br>
controls the funds, but with the condition that the<br>
actuary signature has a specific `R`.<br>
<br>
As we know, `R` reuse --- creating a new signature for a<br>
different message but the same `R` --- will leak the<br>
private key.<br>
<br>
The actuary can be forced to put up an onchain bond.<br>
The bond can be spent using the private key of the actuary.<br>
If the actuary signs a transaction once, with a fixed `R`,<br>
then its private key is still safe.<br>
<br>
However, if the actuary signs one transaction that spends<br>
some transaction output, and then signs a different<br>
transaction that spends the same transaction output, both<br>
signatures need to use the same fixed `R`.<br>
Because of the `R` reuse, this lets anyone who expected<br>
one transaction to be confirmed, but finds that the other<br>
one was confirmed, to derive the secret key of the<br>
actuary from the two signatures, and then slash the bond<br>
of the actuary.<br>
<br>
Thus, we need an `OP_CHECKSEPARATEDSIG` opcode.<br>
This takes three stack items, instead of two: `s`,<br>
`R`, and the public key.<br>
<br>
Then, an actual transaction output can indicate a specific<br>
`R` in a SCRIPT that includes `OP_CHECKSEPARATEDSIG`.<br>
This forces a specific `R` to be used, and thus requires<br>
the actuary to only sign once.<br>
This then enforces single-spend.<br>
<br>
### Ensuring Non-Custodial<br>
<br>
This is simple: By ensuring that the onchain funding<br>
transaction output, which backs the entire mechanism, is<br>
an N-of-N of all participants, we can ensure that the<br>
actuary cannot spend the funds.<br>
<br>
Thus, by using N-of-N of all participants, we have<br>
consensus, and thus it is unnecessary for any participant<br>
to trust anyone else: they do not need to trust the<br>
actuary, or a quorum of signatories.<br>
<br>
As noted, this has the drawback that all N participants<br>
now need to sign off on each updtae of the offchain<br>
mechanism.<br>
<br>
However, the actuary serves a role:<br>
<br>
* While a new state is not yet signed off on by all<br>
=C2=A0 participants, it can sign individual transactions to<br>
=C2=A0 &quot;confirm&quot; them, with the assurance that they cannot<br>
=C2=A0 assist a double-spend since if they assist a<br>
=C2=A0 double-spend they lose their bond.<br>
* Participants can go online and offline at any time,<br>
=C2=A0 and the actuary can solicit and store their signatures<br>
=C2=A0 for to-be-next state.<br>
=C2=A0 Once it has solicited a complete N-of-N set for the<br>
=C2=A0 to-be-next state, it can then declare a new state and<br>
=C2=A0 hand the complete signature set to participants the<br>
=C2=A0 next time they come online.<br>
<br>
These reduce the onlineness requirement on participants.<br>
<br>
### Ensuring Non-hostage<br>
<br>
We want the following property:<br>
If the actuary stops responding, then the participants<br>
can decide to drop the mechanism onchain, and recover<br>
their funds despite the actuary disappearing.<br>
<br>
Thus, the actuary cannot hostage the funds by refusing<br>
to confirm transactions: if the actuary refuses to<br>
confirm transactions, the participants can drop the<br>
mechanism onchain and just use the blockchain layer.<br>
This would suck, but the actuary still cannot hostage<br>
the funds held by the participants: the participants<br>
have a way to escape the mechanism.<br>
<br>
Crucially, we want the property that if we have some<br>
transactions that spend outputs from the current<br>
state, that were previously signed off by the actuary<br>
(i.e. &quot;confirmed&quot;), then when we drop onchain, we can<br>
drop those transactions onchain as well, with the<br>
assurance that other participants cannot replace them<br>
with an alternate version.<br>
<br>
To implement this, the SCRIPT of all outputs hosted<br>
inside the offchain mechanism are &quot;infected&quot; with<br>
`(sign-only-once(M) || CSV) &amp;&amp; C`, where<br>
`M` is the actuary pubkey, `sign-only-once(M)` means<br>
that we enforce `R` reuse so that the actuary cannot<br>
sign the same output with different transactions<br>
(and thus ensure single-spend), and `C` is the<br>
&quot;base&quot;, uninfected contract.<br>
<br>
For example, a hashlocked timelocked contract from A<br>
to B would have a &quot;base&quot; contract of:<br>
<br>
=C2=A0 =C2=A0 (B &amp;&amp; preimage(hash)) || (A &amp;&amp; CLTV)<br>
<br>
And would have an &quot;infected&quot; contract of:<br>
<br>
=C2=A0 =C2=A0 (sign-only-once(M) &amp;&amp; CSV) &amp;&amp; ((B &amp;&amp; =
preimage(hash)) || (A &amp;&amp; CLTV))<br>
<br>
For Taproot tapleaves, all tapleaves need to be infected.<br>
In addition, the `sign-only-once(M)` needs to use the same<br>
`R` for all tapleaves as well, so that signing for one<br>
branch cannot be used for another branch.<br>
The pointlocked branch cannot be used, but given current<br>
plans for `SIGHASH_ANYPREVOUT`, you need to sign<br>
`SIGHASH_ANYPREVOUT` because the actual transaction that<br>
gets confirmed can have a different transaction ID due to<br>
the Decker-Russell-Osuntokun.<br>
<br>
If the actaury stops responding, participants can<br>
publish the most recent state, as well as transactions<br>
that were &quot;confirmed&quot; by the actuary.<br>
Crucially, the transactions confirmed by the actuary<br>
have a time advantage, because they are signed by the<br>
actuary and we have a logical OR with the CSV;<br>
unconfirmed transactions need to wait for the CSV<br>
relative timeout before they can be confirmed onchain.<br>
Thus, if before it disappeared, the actuary signed some<br>
transactions and thus &quot;confirmed&quot; them, the participants<br>
can also confirm them onchain, and it is significantly<br>
less likely that another version of those transactions<br>
can get confirmed onchain in that situation.<br>
Thus, participants can rely on the &quot;confirmation&quot; of<br>
the actuary.<br>
<br>
Worked Example<br>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>
<br>
Let us copy the initial state above, where there are three<br>
participants, A B C.<br>
In the below, M is the actuary, and the &quot;M&quot; here includes a<br>
fixed `R` nonce, to ensure that M can only sign once, and if<br>
M signs multiple times, it risks losing its bonded coins.<br>
<br>
=C2=A0 =C2=A0 current state<br>
=C2=A0 =C2=A0 ---------+-------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|(M||CSV) &amp;&amp; A|<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+-------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|(M||CSV) &amp;&amp; B|<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+-------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|(M||CSV) &amp;&amp; C|<br>
=C2=A0 =C2=A0 ---------+-------------+<br>
<br>
In the above, the &quot;base&quot; contracts are simple single-signature<br=
>
`A` / `B` / `C` conracts.<br>
<br>
While we show only `M`, in fact each `M` requirement also<br>
enforces single-spend for `M`.<br>
Each output also has a different `R` that is issused by the<br>
actuary.<br>
<br>
(for example, each participant can give the base contract<br>
serialization to the actuary, who then HMACs it with its own<br>
private key to generate a `r` then does `R =3D r * G`, so that<br>
the actuary does not need to remember the exact `R` each time,<br>
only whether it signed for a particular contract-amount pair.)<br>
<br>
Suppose that A decides to send some money to B.<br>
It creates a transaction spending the `A` output and creates<br>
two new outputs:<br>
<br>
=C2=A0 =C2=A0 current state=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 +--------+----------------+<br>
=C2=A0 =C2=A0 ---------+-------------+=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 | (M||CSV) &amp;&amp; A2 |<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|(M||CSV) &amp;&amp; A| ---=
-&gt; |=C2=A0 =C2=A0 A=C2=A0 =C2=A0+----------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+-------------+=C2=A0 =C2=
=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 | (M||CSV) &amp;&amp; B2 |<br=
>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|(M||CSV) &amp;&amp; B|=C2=
=A0 =C2=A0 =C2=A0 =C2=A0+--------+----------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+-------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|(M||CSV) &amp;&amp; C|<br>
=C2=A0 =C2=A0 ---------+-------------+<br>
<br>
In the above the `A` in the input side of the new transaction<br>
indicates a signature from participant A, fulfilling the base<br>
contract `A`.<br>
<br>
As the transaction is only signed by `A`, it is not yet<br>
confirmed.<br>
If the mechanism is dropped onchain, the participants must<br>
wait for the CSV timeout before it can be confirmed onchain,<br>
which reflects the fact that the transaction, inside the<br>
offchain mechanism, was not yet confirmed at this point.<br>
<br>
Now, suppose that participant A wants B to be assured that<br>
A will not double-spend the transaction.<br>
Then A solicits a single-spend signature from the actuary,<br>
getting a signature M:<br>
<br>
=C2=A0 =C2=A0 current state=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 +--------+----------------+<br>
=C2=A0 =C2=A0 ---------+-------------+=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 | (M||CSV) &amp;&amp; A2 |<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|(M||CSV) &amp;&amp; A| ---=
-&gt; |=C2=A0 M,A=C2=A0 =C2=A0+----------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+-------------+=C2=A0 =C2=
=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 | (M||CSV) &amp;&amp; B2 |<br=
>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|(M||CSV) &amp;&amp; B|=C2=
=A0 =C2=A0 =C2=A0 =C2=A0+--------+----------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+-------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|(M||CSV) &amp;&amp; C|<br>
=C2=A0 =C2=A0 ---------+-------------+<br>
<br>
The above is now a confirmed transaction.<br>
<br>
Suppose at this point the offchain mechanism is dropped<br>
onchain.<br>
In that case, it is now immediately possible to also confirm<br>
the above transaction.<br>
<br>
Suppose that A tries to double-spend the transaction by signing<br>
another transaction spending the `A` output, but giving all of<br>
it to a new output `A3`.<br>
Because of the single-spend signature requirement, the actuary<br>
cannot safely sign this alternative version without losing its<br>
bonded amount.<br>
<br>
=C2=A0 =C2=A0 current state=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 +--------+----------------+<br>
=C2=A0 =C2=A0 ---------+-------------+=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 | (M||CSV) &amp;&amp; A2 |<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|(M||CSV) &amp;&amp; A| -+-=
-&gt; |=C2=A0 M,A=C2=A0 =C2=A0+----------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+-------------+=C2=A0 |=C2=
=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 | (M||CSV) &amp;&amp; B2 |<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|(M||CSV) &amp;&amp; B|=C2=
=A0 |=C2=A0 =C2=A0 +--------+----------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+-------------+=C2=A0 |<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|(M||CSV) &amp;&amp; C|=C2=
=A0 |=C2=A0 =C2=A0 +--------+----------------+<br>
=C2=A0 =C2=A0 ---------+-------------+=C2=A0 +--&gt; |=C2=A0 =C2=A0 A=C2=A0=
 =C2=A0| (M||CSV) &amp;&amp; A3 |<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+--------+-------------=
---+<br>
<br>
The transaction that is signed by the actuary M is the one that<br>
can be confirmed onchain immediately as soon as the current<br>
state transaction is confirmed, because the signature allows<br>
skipping the CSV requirement.<br>
However, the transaction that is signed only by participant A,<br>
in an attempt to double-spend the transaction, will need to<br>
wait out the CSV delay.<br>
The actuary M will never sign this alternate transaction, as<br>
`R` reuse will cause it to lose control of its private key and<br>
allow slashing of its bond.<br>
<br>
So, let us suppose that the actuary M decides to &quot;cut through&quot;<br=
>
the trasnaction it signed.<br>
The actuary M proposes to each of the participants to update<br>
the state of the offchain mechanism.<br>
<br>
=C2=A0 =C2=A0 current state=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 +--------+----------------+<br>
=C2=A0 =C2=A0 ---------+-------------+=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 | (M||CSV) &amp;&amp; A2 |<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|(M||CSV) &amp;&amp; A| ---=
-&gt; |=C2=A0 M,A=C2=A0 =C2=A0+----------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+-------------+=C2=A0 =C2=
=A0 =C2=A0 =C2=A0|=C2=A0 =C2=A0 =C2=A0 =C2=A0 | (M||CSV) &amp;&amp; B2 |<br=
>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|(M||CSV) &amp;&amp; B|=C2=
=A0 =C2=A0 =C2=A0 =C2=A0+--------+----------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+-------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|(M||CSV) &amp;&amp; C|<br>
=C2=A0 =C2=A0 ---------+-------------+<br>
<br>
=C2=A0 =C2=A0 next state<br>
=C2=A0 =C2=A0 ---------+----------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| (M||CSV) &amp;&amp; A2 |<=
br>
=C2=A0 =C2=A0 ---------+----------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| (M||CSV) &amp;&amp; B2 |<=
br>
=C2=A0 =C2=A0 ---------+----------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| (M||CSV) &amp;&amp; B=C2=
=A0 |<br>
=C2=A0 =C2=A0 ---------+----------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| (M||CSV) &amp;&amp; C=C2=
=A0 |<br>
=C2=A0 =C2=A0 ---------+----------------+<br>
<br>
It is not necessary for all the participants to come online<br>
simultaneously just to sign the new state.<br>
THe actuary can keep track of this new state on behalf of<br>
the participants, as well as the total signatures of all the<br>
N participants.<br>
<br>
Each participant still must validate that the next state<br>
contains the outputs they expect.<br>
However, they do not need to validate ***all*** outputs.<br>
For instance, participant C knows that it did not spend<br>
any funds, and did not receive any funds; it only cares<br>
that the next state still contains the `C` contract it<br>
expects.<br>
Participant A needs to validate the A2 and B2 exist,<br>
while participant B needs to validate the B2 and B outputs.<br>
<br>
***This is important as it reduces the bandwidth requirements<br>
on the participants.***<br>
It is not necessary for the participants to validate *all*<br>
transactions, only that the participants validate the<br>
existence of outputs it expects to have been confirmed by<br>
the actaury.<br>
This is an important scaling advantage over e.g. a sidechain,<br>
where sidechain participants really ought to validate *all*<br>
transactions in the sidechain, not just the set they care<br>
about.<br>
<br>
Unlike the sidechain case, every participant needs to sign<br>
off on each state update.<br>
This means that as long as each participant does minimal<br>
protection of themselves, they can simply rely on the other<br>
participants being selfishly checking for their own expected<br>
outputs.<br>
<br>
If the actuary tries to cheat and create a next state that<br>
is not valid, then at least one participant will simply<br>
refuse to sign the next state, and drop the current state<br>
(and any transactions based on the current state) onchain.<br>
Thus, the N-of-N signatory set becomes an important<br>
optimization!<br>
<br>
In the above example, the actuary actually faithfully<br>
set the correct next state.<br>
So eventually all the participants get to go online and<br>
provide their signature shares, so that the mechanism<br>
advances and the next state becomes the current state:<br>
<br>
=C2=A0 =C2=A0 current state<br>
=C2=A0 =C2=A0 ---------+----------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| (M||CSV) &amp;&amp; A2 |<=
br>
=C2=A0 =C2=A0 ---------+----------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| (M||CSV) &amp;&amp; B2 |<=
br>
=C2=A0 =C2=A0 ---------+----------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| (M||CSV) &amp;&amp; B=C2=
=A0 |<br>
=C2=A0 =C2=A0 ---------+----------------+<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| (M||CSV) &amp;&amp; C=C2=
=A0 |<br>
=C2=A0 =C2=A0 ---------+----------------+<br>
<br>
Against Custodiality<br>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>
<br>
I think that people who want to actually improve Bitcoin<br>
MUST first strive as much as possible to ***avoid***<br>
custodians.<br>
<br>
Custodiality is easy.<br>
<br>
Escaping custody once you are custodied is almost impossible.<br>
<br>
Thus, it is important to ***avoid*** a custodial solution<br>
in our designs for Bitcoin.<br>
<br>
For example, Drivechains effectively makes miners the<br>
custodians of sidechain coins.<br>
<br>
Yes, there are incentives for miner custodians to not steal<br>
the sidechain coins.<br>
<br>
But far better to be able to say &quot;it is not even possible for<br>
the miner to steal the coins in this mechanism at all&quot;.<br>
<br>
Do not give roles more rights than the minimum they absolute<br>
need to do their work!<br>
This is basic cybersecurity.<br>
<br>
We MUST avoid giving miners more control over **any** blockchain<br>
coins than what they already have.<br>
Miners currently can censor, and it is difficult to remove that<br>
ability without removing the ability to decide whether to confirm<br>
some transaction or not, since it is not possible to prove that<br>
you do not know a transaction.<br>
But currently miners cannot outright steal any funds.<br>
<br>
Giving more rights allows hackers who manage to take on the<br>
miner role (e.g. because the miner has bad opsec, or the hacker<br>
is the dictatorial warlord of the local government and has shot<br>
the miner to death and taken over their mine) to attack the<br>
system.<br>
Then, any analysis that &quot;but miner roles have an incentive to<br>
not attack sidechains!&quot; would not apply, as the hacker got the<br>
miner role outside of the normal miner expected incentives;<br>
the hacker incentives may not match the incentives of a &quot;real&quot;<br=
>
miner.<br>
<br>
Better if miners cannot attack at all, so that hackers that<br>
invalidly gain their role cannot attack, either.<br>
<br>
Similarly, the actuary role is given only the ability to decide<br>
to confirm or not confirm transactions.<br>
In particular the actuary role in this scheme is ***NOT***<br>
given the ability to move funds without consent of the purported<br>
owners of the value.<br>
<br>
This requires consensus, i.e. N-of-N signatories.<br>
However, the actuary is also overloaded so that it is the only<br>
entity that needs to have high uptime.<br>
Participants can drop online and offline, and the actuary<br>
coordinates the creation of new states.<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>

--0000000000000cfbca06050f1220--