summaryrefslogtreecommitdiff
path: root/a4/0ac228b228249f6d77a609e28e5ea06276ad5d
blob: 60460ee8d833c2db1df0c0466cfb5cc669f96369 (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
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
Return-Path: <keatonatron@gmail.com>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 800BB1A24
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Sun, 27 Jan 2019 19:42:21 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com
	[209.85.128.49])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A6C425D3
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Sun, 27 Jan 2019 19:42:17 +0000 (UTC)
Received: by mail-wm1-f49.google.com with SMTP id p6so11571171wmc.1
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Sun, 27 Jan 2019 11:42:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:references:in-reply-to:from:date:message-id:subject:to; 
	bh=azJeI+cHfWn5jSio2XGrw/mCjhJsK52gY3ks3TxInYk=;
	b=FG2OeAtsn9zQFUqFm/6EMMKLJ/mk6kWM6jJPIEB8VwUEpi/WLSht2uiZQmcgC8j9TH
	TKhVURF9ssdXW4RFkFJKPYaKAAkyB+a0DzqTX1P/JwV7unRBu23IC6IoQgeS1MMK7vLJ
	513TCYdJZ9RhO6EUtXEKqi9HL69/hRQgI7th2K1qujYnDJTuab+5eT5bhQWYAYPUFv+8
	GlKeC9VVkOfqz9MaBTWSDs+5af0Efo+bYeHIsLE13HVg6l/bhP5vkkFKHrR+4mC3T0H8
	3/8H33Gmyq5t6HsPOSzn4R0FBHZVMiIDPo8RMxvhfjbG2RnxaWvvy0TYkb1Vyd9T6W4r
	PvTQ==
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;
	bh=azJeI+cHfWn5jSio2XGrw/mCjhJsK52gY3ks3TxInYk=;
	b=i7DDlq7n0ze/0xzo7TUgPgRRe5ba5+WSXj88HJwpBOuAu9JnEoHTM9G7gGw7QZflon
	IFIYY+IyBbtkACpgQ9LexnnazgP6L73ufp1L5jjbfRwkKliJuqc0CJzifznIGWzCa62s
	VZJGEM9fpQfI3708P/NzScOMoW3tVjw8NfKwV/FN4JP8LSI1tAKp6SXbag3awQBNXmzK
	uLyl+Gwj8+r1Cj4ttuveJrjeKgDWAK1c6abFR9ieefNcDU8HchwOe4IhT+ZhAPrtm2vx
	NCxQTnoa0hMy3uqI0QnoSG+jZomZGTJUmx+03Svxo85LCBOeS1RR8M8Q9mLEU+W/tp13
	NvbA==
X-Gm-Message-State: AJcUukf0y5JJ9Gvv5uhqRpCLIrd9fuzQO86eJAqXtDYCm+9c40o1foLE
	zFXdEHKpyvRXE2ie0ruQFuZi/X79Yjyc67LY426jYg==
X-Google-Smtp-Source: ALg8bN6fhgzBV6OEkFbI7ZjZXKPd32ncxi98Y74XrdKywU9gp5lM2ddPPyuzpInYwX5HviHqun+M4kliUfxoUxu+gv4=
X-Received: by 2002:a1c:bbd6:: with SMTP id l205mr13528345wmf.97.1548618135604;
	Sun, 27 Jan 2019 11:42:15 -0800 (PST)
MIME-Version: 1.0
References: <TtjH2zicjKr8PBVCMOvA7ryt2z_XXvtrpC4y1wuWSxexNwMdbPGE7vPmu6UnzmfYqYBMxZ8NNoz4VUnODdIcjR4j-E1sYz_FA6ZZMjKHtuM=@protonmail.com>
	<e15c5dd7-6fe1-b253-e129-aeae6493acd1@gmail.com>
	<-yZhdFkKfKAEz1_4GKKSpTxjvR8EDSsH_5-TTh_4X5qwa79igXKR14rh6JASrald-F97o1htWY_kcBQ7IVr7ZH9zOQlOEwzhkWDjTq0d7F4=@protonmail.com>
	<2cd4fe6d-c0ca-5ae7-4107-38e1609743a8@gmail.com>
In-Reply-To: <2cd4fe6d-c0ca-5ae7-4107-38e1609743a8@gmail.com>
From: James MacWhyte <keatonatron@gmail.com>
Date: Sun, 27 Jan 2019 11:42:03 -0800
Message-ID: <CAH+Axy7SJhTskrTX_i+Nc+HMtcNXhOFuGi11X=EjFEfBW=H06A@mail.gmail.com>
To: Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Content-Type: multipart/alternative; boundary="000000000000dd9274058075c13c"
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, HTML_MESSAGE,
	RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
X-Mailman-Approved-At: Sun, 27 Jan 2019 22:06:37 +0000
Subject: Re: [bitcoin-dev] bustapay BIP :: a practical sender/receiver
 coinjoin protocol
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>,
	<mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>,
	<mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Sun, 27 Jan 2019 19:42:21 -0000

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

Why does the template transaction need to be signed in step one and passed
back and forth so many times? What is wrong with:

1. Sender creates unsigned tx with their relevant inputs and outputs. This
tx is passed to receiver.

2. Receiver adds their relevant inputs and outputs and signs their portion
before returning the tx to sender.

3. Sender confirms their inputs and outputs have not been modified, and
signs the remainder of the tx before broadcasting it (or sending it to the
recipient if you want to follow the payment protocol spec).

James

On Sun, Jan 27, 2019, 08:45 Adam Gibson via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org wrote:

>
>
> On 27. 01. 19 8:36, rhavar@protonmail.com wrote:
> > Thanks Adam,
> >
> > I have fixed the mistakes you have pointed out:
> https://github.com/bitcoin/bips/pull/754
> >
> > Thanks for the detailed look!
> >
> >> but its virtue of steganographic hiding means only minimal uptake
> >> is still enormously interesting and worth pursuing; that's my current
> feeling.
> >
> > I very much agree =3D) I really think anything that (silently) breaks t=
he
> assumption of common ownership of transaction inputs offers outsized
> benefits for the whole ecosystem.
> >
> > One other idea I have  is (way) better support for moving utxo's betwee=
n
> wallets. The least controversial use case is moving funds between wallets
> you own. Like I might want to move *specific* utxo's from/to my joinmarke=
t
> wallet, but not create a (privacy losing / expensive) transaction. Both
> core and joinmarket fail at this at a practical point of view.
>
> (tangential, but yes coin control in JM is an obviously necessary
> feature and will be done, I just don't have time).
>
> >
> > Like imho it'd be pretty cool having a standardized format for
> (txid:vout:privatekey) with wallets showing it as "External UTXO" and
> preferentially spending it (and wallet not automatically importing any
> other utxo from that address).
> >
> > Taken a bit further (this is the part which everyone hates) you could
> send someone money (or withdraw it from a service) by giving a person. It=
's
> not generally useful (for obvious reasons), but there's a lot of cases I
> think it's super cool.
>
> Is there a missing word. "by giving a person.."? Not actually sure what
> you're getting at here but I suspect it's again tangential to this BIP
> discussion.
>
> >
> > ---
> >
> > Getting back on topic, without trying to do a point-by-point reply, I
> agree with pretty much everything you said but I am reluctant to make any
> changes.
> >
> > I don't meant to be obtuse or anything, but I strongly believe the
> limiting factor to adoption to all these protocols is actually just getti=
ng
> people to implement it. I made multiple implementations of bustapay from
> both the sending/receiving end, so I could try develop the easiest to
> implement system that is still practical.
>
> You know, there's considerable evidence to the contrary, I'd argue: this
> idea *has* been implemented already three times: by yourself, by myself
> and by Samourai. And in fully incompatible ways :) So I think the
> limiting factor is in fact creating a standard that a reasonable number
> of people could agree with (and I like operational definitions, so
> subjective as it is, I like the goal of "good/clear enough that it could
> be incorporated into something like BtcPayServer")
>
> >
> > For instance I like PSBT and it's nice in theory. I actually had an
> original implementation using it, which is how I found some bugs in the
> core and golang version of PSBT). But in practice it's hugely overkill an=
d
> significantly increases the implementation complexity complexity and is
> poorly supported. Switching to just a raw transaction actually made
> everything easier. (And that's not to criticise PSBT, I would definitely
> want to use it in other contexts).
>
> But this relates back to my first "generic" point that you haven't
> addressed here - protocol versioning and the possibility of more than
> one option. Perhaps more realistic (debatable): have the current version
> be non-PSBT but with a plan to have a version bump with PSBT in future.
> Stuff like that. It seems crazy to actually long term reject it.
>
> >
> > Anyway, a big motivation for me even writing it as a BIP was to
> formalize my little anti-DOS trick of privately creating a "template
> transaction" which can just be dumped on the network as punishment. So if
> nothing else, hopefully I'll have demonstrated it's a pretty practical wa=
y
> of doing things.
> >
>
> I don't want to be that guy, but this was a central part of the proposal
> that came of the meetup last summer and is in Haywood's blogpost. I mean
> if you came up it with separately, then cool :) But I was there, that
> was established immediately as the right way of doing this to avoid a
> trivial attack.
> What might have confused you is all that stuff about multiple candidates
> and even ZKP approaches - those were just extra ideas about making it
> really secure at large scale; but those ideas don't quite meet the goal
> (for various reasons); well, arguably. The basic anti-DOS of an initial
> non-coinjoin was sorta central.
> (Also I'm noting you didn't respond to my critique of your "always use
> the same contributions" defence; I mean, probably that's fine, it was
> only really saying it isn't perfect. Was just curious to hear
> your/others thoughts on it).
>
> > --
> >
> > Also your analysis on "Unnecessary Input Heuristic" is pretty cool, but
> I also don't like telling people to "avoid the UIH2" without providing th=
e
> actual algo they should use. But really I think it's better off in a sort
> of article "how to pick contributed inputs" or something, as while it's
> nice it's not a huge deal and there's a lot of debatable tradeoffs that
> can/should be used. For instance the implementation I wrote for
> bustabit.com currently just heavily biases tainted inputs (e.g. ones
> associated with address reuse).
> >
>
> Good point about algo.
> I wrote my best effort at a procedure here:
>
> https://gist.github.com/AdamISZ/4551b947789d3216bacfcb7af25e029e#gistcomm=
ent-2799709
>
> I asked for comments on it but got none back so far (gists are terrible
> for this unfortunately, perhaps I'll have more luck on the list).
>
> I would argue that this issue *should* be mentioned on the BIP. A *huge*
> part of what makes PayJoin/BustaPay of interest is the steganographic
> feature, if you don't pay attention to this then it doesn't look like a
> payment (caveat.-->).
> The counterargument is Laurent's statistics which I previously linked,
> suggesting that maybe 30% of txs violate this anyway, today. I'm not
> sure about that, will need more analysis; Core's SRD algo may be one
> reason, but anyway ... better to make things look like payments.
>
> It doesn't hurt to prompt an implementer to do this; whether it's
> feasible in that specific wallet situation or not is up to them; whether
> they want to go hog wild and control percentages of UIH1 and UIH2 and
> whatnot is there business, or they can totally ignore it - but without
> it being mentioned in the BIP, they may not even think of it.
>
> A last point, you also don't see value in being more explicit about
> simple things like transaction version and locktime? Even if you think
> these things should *not* be controlled, e.g. the protocol should allow
> either transaction version, then it'd be better to explicitly say so.
> >
> >
> > -Ryan
> >
> > =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Origina=
l Message =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90
> > On Friday, January 25, 2019 6:47 AM, Adam Gibson via bitcoin-dev <
> bitcoin-dev@lists.linuxfoundation.org> wrote:
> >
> >> Ryan and list,
> >> I want to add some commentary to this (BIP79) to see if we can get
> >> further in standardizing this idea.
> >>
> >> When I first mulled it over I thought it too impractical, but its virt=
ue
> >> of steganographic hiding means only minimal uptake is still enormously
> >> interesting and worth pursuing; that's my current feeling. I've offere=
d
> >> more detailed thoughts in my blog post[1] (def not required reading
> here).
> >>
> >> Both Joinmarket and Samourai have started implementing this kind of
> >> transaction. And while that's interesting experimentally, some kind of
> >> cross-wallet standard would be helpful, albeit there some differences
> >> between that and the merchant/centralized service use-case.
> >>
> >> We might imagine as a concrete goal for this BIP to create something
> >> that would be acceptable for inclusion into a project like BTCPayServe=
r,
> >> so that it could be used in a realistic use case by smaller bitcoin
> >> accepting merchants.
> >>
> >> Comments to the BIP[2] as follows, with generic comments first, and th=
en
> >> specific comments for existing points in the BIP:
> >>
> >> [1] https://joinmarket.me/blog/blog/payjoin
> >> [2] https://github.com/bitcoin/bips/blob/master/bip-0079.mediawiki
> >>
> >> Generic comments
> >>
> >>
> =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=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=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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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=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >>
> >> -   Protocol versioning. Since inevitably (even if only merchants), th=
is
> >>     must be implemented by multiple wallets to be useful, the
> communication
> >>     protocol will need versioning (for example i have in my
> >>     simple/experimental Joinmarket PayJoin that sender sends min and m=
ax
> >>     supported version and receiver responds with a chosen protocol
> version
> >>     so we can update). I do understand that as a client-server model c=
an
> >>     apply here, we can ditch a lot of the complexities around
> network/p2p
> >>     interaction, but this much at least seems necessary.
> >>
> >> -   Although it has its logic, I don't think "Bustapay" is a good name
> for
> >>     this protocol. I prefer "PayJoin" which is neutral sounding and
> >>     self-descriptive. Needless to say this is not a hill I intend to
> die on.
> >>
> >> -   PSBT/BIP174. I realise this has already been discussed, but this i=
s
> a
> >>     good example of what this standardisation was designed for, so I'd
> be
> >>     against not including it, even given the reality that, as you
> correctly
> >>     observe, it is not yet implemented in the majority of wallets and
> >>     libraries. One way round that is to make it optional (possibly
> combined
> >>     with above point about versioning). Note that for example you were
> >>     observing the necessity to check the sequence number was unchanged=
;
> that
> >>     would be encapsulated by checking equality of PSBT Input
> objects/fields.
> >>     While one can make such software architecture arguments, the reall=
y
> >>     fundamental point is the need for standards for x-wallet
> compatibility.
> >>
> >> -   Version, Locktime: Perhaps this is not needed; in a peer to peer
> >>     wallet scenario I think there might be logic in trying to get cove=
r
> >>     traffic of (Core, Electrum, others), say, by using
> >>     last-block-locktime-mostly, as they do. Version should be 2 and
> sequence
> >>     is a function of your suggestion to use BIP125. Worth noting that
> BIP125
> >>     is not currently widely used on the network, though (see
> >>     https://p2sh.info/dashboard/db/replace-by-fee?orgId=3D1). For this
> reason
> >>     it should perhaps be explicitly only optional.
> >>
> >> -   Avoidance of non-payment "Unnecessary Input Heuristic" (1, 2). For
> >>     reference, see the definition here
> >>
> https://gist.github.com/AdamISZ/4551b947789d3216bacfcb7af25e029e#gistcomm=
ent-2796539
> >>     and some data here
> >>
> https://gist.github.com/AdamISZ/4551b947789d3216bacfcb7af25e029e#gistcomm=
ent-2800791
> >>     (whole comment thread may be of interest) - note this UIH name is
> afaik
> >>     Chris Belcher's invention, it seems useful as a categorisation.
> >>     So, it seems that UIH2 is more important to avoid; while some more
> >>     sophisticated wallet coin selection algorithms may occasionally pi=
ck
> >>     an input set where one input is larger than any output, most won't=
,
> and
> >>     some in particular never will. So I think the text here should
> indicate
> >>     that *the receiver's contributed input(s) SHOULD be chosen to avoi=
d
> >>     triggering the UIH2 heuristic where possible, so that the final
> payjoin
> >>     transaction is maximally plausible as an ordinary payment" or
> similar.
> >>     UIH1 is a nice-to-have (meaning the plausibility extends to two
> >>     different (both wrong) payment amounts, but it may not be necessar=
y
> to
> >>     mention it in the BIP.
> >>
> >>     Specific comments
> >>     =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >>
> >>
> >>>> =3D=3D=3D=3DStep 4. Receiver validates, re-signs, and propagates on =
the
> >>
> >> bitcoin network=3D=3D=3D=3D
> >>
> >> I believe this should say "Sender" not Receiver. Also for the next
> >> sentence, s/receiver/sender/:
> >>
> >>>> The receiver MUST validate the ''partial transaction'' was changed
> >>
> >> correctly and non-maliciously (to allow using potentially untrusted
> >> communication channels), re-sign its original inputs and propagate the
> >> final transaction over the bitcoin network.
> >>
> >> Your very correct highlighting of the attack vector of "receiver gives
> >> sender other inputs belonging to sender to unwittingly sign (described
> >> below), should be highlighted here, perhaps with the phrase "re-sign i=
ts
> >> ORIGINAL inputs" (only!)".
> >>
> >>>> When the sender is creating a "template transaction" it is done
> >>
> >> almost identically to creating a normal send, with the exception that
> >> only segwit inputs may be used. The sender is also encouraged to use a
> >> slightly more aggressive feerate than usual as well as BIP125 (Opt-in
> >> Full Replace-by-Fee Signaling), but neither is strictly required.
> >>
> >> "slightly more aggressive feerate than usual" - this I understand is t=
o
> >> make up for receiver contributed utxo, OK.
> >>
> >> "only segwit inputs" - it certainly makes things simpler. One can work
> >> with non-segwit inputs but especially considering (as mentioned below)
> >> we really ought to "MUST" the part about matching input types, I tend =
to
> >> agree that non-segwit should be disallowed.
> >>
> >>>> The receiver must add at least one input to the transaction (the
> >>
> >> "contributed inputs"). If the receiver has no inputs, it should use a
> >> 500 internal server error, so the client can send the transaction as p=
er
> >> normal (or try again later).
> >>
> >> Would it not be much simpler for the server to return a different
> >> (non-error) response indicating that it will broadcast the template tx
> >> in this case?
> >>
> >>>> Its generally advised to only add a single contributed input, howeve=
r
> >>
> >> they are circumstances where adding more than a single input can be
> useful.
> >>
> >> I don't see a good reason to advise the use of only 1 input? (but this
> >> will also connect with the above generic comment about "UIH"). I guess
> >> it's because of your approach to fees. I'd prefer not to create a
> >> limitation here.
> >>
> >>>> To prevent an attack where a receiver is continually sent variations
> >>
> >> of the same transaction to enumerate the receivers utxo set, it is
> >> essential that the receiver always returns the same contributed inputs
> >> when it's seen the same inputs.
> >>
> >> This is an approach to avoiding this problem which has the virtue of
> >> simplicity, but it seems a little problematic. (1) You must keep a
> >> mapping of proposed payment utxos to one's proposed contributed input
> >> utxos, but (2) how should this be updated if you need to spend the
> >> contribution mentioned in (1)? Ironically use of payjoin exacerbates
> >> this issue, because it results in a smaller number of utxos being held
> >> by the receiver at any one time :) All this considered, I still see th=
e
> >> value in your approach, but it might end up with a re-attempted paymen=
t
> >> being rejected. Certainly the more complex suggested solutions coming
> >> out of the summer 2018 coinjoin workshop aren't as practical as this,
> >> and may be overkill for small merchants/receivers.
> >>
> >>>> It is strongly preferable that the receiver makes an effort to pick =
a
> >>
> >> contributed input of the same type as the other transaction inputs if
> >> possible.
> >>
> >> I have also thought about this and you could reasonably argue this
> >> should be a MUST section in the BIP, that is, if the receiver cannot u=
se
> >> inputs of the same type, he should fall back to the template
> >> transaction. A mixed-input payjoin/coinjoin is essentially
> >> near-perfectly identifiable as such (there is almost zero other usage =
of
> >> multi-type-input transactions), which is a very different thing than a
> >> non-identifiable payjoin transaction. That may or may not be OK to the
> >> sender. This is debatable though, for sure.
> >>
> >>>> After adding inputs to the transaction, the receiver generally will
> >>
> >> want to adjust the output that pays himself by increasing it by the su=
m
> >> of the contributed input amounts (minus any fees he wants to
> >> contribute). However the only strict requirement is that the receiver
> >> must never add or remove inputs, and must not ever decrease any
> >> output amount.
> >>
> >> "must never add or remove inputs" - did you mean "must never remove
> >> inputs"? he surely has to add one! Or, perhaps you mean he must not
> >> alter the list of inputs provided by the sender (in which case it shou=
ld
> >> be clarified).
> >>
> >> "must not decrease any output amount" - I initally disagreed with this
> >> but it is a better option than the one I currently chose in Joinmarket
> >> payjoin (sender pays all fee as long as receiver utxos are not too
> >> much). So this means that the receiver either consciously chooses to n=
ot
> >> increase the fee, meaning the fee rate may be a bit low (hence your
> >> earlier comment about being generous, got it), or contributes via the
> >> payout amount. I guess the latter might break merchant software
> >> expecting to have amount output fixed and fees determined by change.
> >>
> >> Regards,
> >> Adam Gibson/waxwing
> >>
> >> On 30. 08. 18 22:24, Ryan Havar via bitcoin-dev wrote:
> >>
> >>> I've just finished writing an implementing of this, and extremely hap=
py
> >>> with how it turned out. So I'd like to go and try go down the path of
> >>> more formally describing it and getting some comments and ultimately
> >>> encourage its wide-spread use.
> >>> =3D=3DAbstract=3D=3D
> >>> The way bitcoin transactions are overwhelming used is known to leak
> more
> >>> information than desirable. This has lead to fungibility concerns in
> bitcoin
> >>> and a raise of unreasonably effective blockchain analysis.
> >>> Bustapay proposes a simple, practical way to bust these assumptions t=
o
> >>> immediate
> >>> benefit of the sender and recievers. Furthermore it does so in such a
> >>> way that
> >>> helps recievers avoid utxo bloat, a constant problem for bitcoin
> merchants.
> >>> =3D=3DCopyright=3D=3D
> >>> This BIP is in the public domain.
> >>> =3D=3DMotivation=3D=3D
> >>> One of the most powerful heuristic's employed by those whose goal is =
to
> >>> undermine
> >>> bitcoin's fungiblity has been to assume all inputs of a transaction a=
re
> >>> signed by
> >>> a single party. In the few cases this assumption does not hold, it is
> >>> generally
> >>> readibly recognizable (e.g. traditional coinjoins have a very obvious
> >>> structure,
> >>> or multisig outputs are most frequently validated onchain).
> >>> Bustapay requires no changes to bitcoin and creates bitcoin
> transactions
> >>> that are
> >>> indistinguishable from normal ones.
> >>> It is worth noting that this specification has been intentionally kep=
t
> >>> as simple
> >>> as possible to encourage adoption. There are almost an endless amount
> of
> >>> extensions
> >>> possible but the harder the implementation of clients/server the less
> >>> likely it
> >>> will ever be done. Should bustapay enjoy widespread adoption, a "v2"
> >>> specification
> >>> will be created with desired extensions.
> >>> =3D=3DSpecification=3D=3D
> >>> A bustapay payment is made from a sender to a receiver.
> >>> Step 1. Sender creates a bitcoin transaction paying the receiver
> >>> This transaction must be fully valid, signed and all inputs must use
> >>> segwit. This transaction is known as the "template transaction". This
> >>> transaction must not be propagated on the bitcoin network.
> >>> Step 2. Sender gives the "template transaction" to the receiver
> >>> This would generally be done as an HTTP POST. The exact URL to submit
> it
> >>> to could be specified with a bip21 encoded address. Such as
> >>> bitcoin:2NABbUr9yeRCp1oUCtVmgJF8HGRCo3ifpTT?bustapay=3D
> https://bp.bustabit.com/submit
> >>> and the HTTP body should be the raw transaction hex encoded as text.
> >>> Step 3. Receiver processes the transaction and returns a partially
> >>> signed coinjoin
> >>> The receiver validates the transaction is valid, pays himself and is
> >>> eligible for propation. The receiver then adds one of his own inputs
> >>> (known as the "contributed input") and increase the output that pays
> >>> himself by the contributed input amount. Doing so will invalidate the
> >>> "template transaction"'s original input signatures, so the sender nee=
ds
> >>> to return this "partial transaction" back to the receiver to sign. Th=
is
> >>> is returned as a hex-encoded raw transaction a response to the origin=
al
> >>> HTTP POST request.
> >>> Step 4. Receiver validates, re-signs, and propagates on the bitcoin
> network
> >>> The receiver is responsible in making sure the "partial transaction"
> >>> returned by the sender was changed correctly (it should assume the
> >>> connection has been MITM'd and act accordingly), resign its original
> >>> inputs and propagates this transaction over the bitcoin network. The
> >>> client must be aware that the server can reorder inputs and outputs.
> >>> Step 5. Receiver observes the finalized transaction on the bitcoin
> network
> >>> Once the receiver has seen the finalized transactions on the network
> >>> (and has enough confirmations) it can process it like a normal paymen=
t
> >>> for the sent amount (as opposed to the amount that it looks like on t=
he
> >>> network). If the receiver does not see the finalized transaction afte=
r
> a
> >>> timeout will propagate the original "template transaction" to ensure
> the
> >>> payment happens and function a strong anti-DoS mechanism.
> >>> =3D=3D=3D Implementation Notes =3D=3D=3D
> >>> For anyone wanting to implement bustapay payments, here are some note=
s
> >>> for receivers:
> >>>
> >>> -   A transaction can easily be checked if it's suitable for the
> mempool
> >>>     with testmempoolaccept in bitcoin core 0.17
> >>>
> >>> -   Tracking transactions by txid is precarious. To keep your sanity
> make
> >>>     sure all inputs are segwit. But remember segwit does not prevent
> txid
> >>>     malleability unless you validate the transaction. So really make
> sure
> >>>     you're using testmempoolaccept at the very least
> >>>
> >>> -   Bustapay could be abused by a malicious party to query if you own=
 a
> >>>     deposit address or not. So never accept a bustapay transaction
> that pays
> >>>     an already used deposit address
> >>>
> >>> -   You will need to keep a mapping of which utxos people have showed
> you
> >>>     and which you revealed. So if you see them again, you can reveal
> the
> >>>     same one of your own
> >>>
> >>> -   Check if the transaction was already sorted according to BIP69, i=
f
> so
> >>>     ensure the result stays that way. Otherwise probably just shuffle
> the
> >>>     inputs/outpus
> >>>
> >>>
> >>> Notes for sending applications:
> >>>
> >>> -   The HTTP response must not be trusted. It should be fully validat=
ed
> >>>     that no unexpected changes have been made to the transaction.
> >>>
> >>> -   The sender should be aware the original "template transaction" ma=
y
> be
> >>>     propagated at any time, and in fact can intentionally be
> >>>       done so for the purpose of RBF as it should have a slightly
> higher fee
> >>>     rate.
> >>>
> >>>
> >>> =3D=3D Credits =3D=3D
> >>> The idea is obviously based upon Dr. Maxwell's seminal CoinJoin
> >>> proposal, and reduced scope inspired by a simplification of the "pay =
2
> >>> endpoint" (now offline) blog post by blockstream.
> >>> -Ryan
> >>>
> >>> bitcoin-dev mailing list
> >>> bitcoin-dev@lists.linuxfoundation.org
> >>> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
> >>
> >> bitcoin-dev mailing list
> >> bitcoin-dev@lists.linuxfoundation.org
> >> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
> >
> >
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>

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

<div dir=3D"auto"><div>Why does the template transaction need to be signed =
in step one and passed back and forth so many times? What is wrong with:<di=
v dir=3D"auto"><br></div><div dir=3D"auto">1. Sender creates unsigned tx wi=
th their relevant inputs and outputs. This tx is passed to receiver.</div><=
div dir=3D"auto"><br></div><div dir=3D"auto">2. Receiver adds their relevan=
t inputs and outputs and signs their portion before returning the tx to sen=
der.</div><div dir=3D"auto"><br></div><div dir=3D"auto">3. Sender confirms =
their inputs and outputs have not been modified, and signs the remainder of=
 the tx before broadcasting it (or sending it to the recipient if you want =
to follow the payment protocol spec).</div><div dir=3D"auto"><br></div>Jame=
s<br><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Sun, Jan 27, 2019, =
08:45 Adam Gibson via bitcoin-dev &lt;<a href=3D"mailto:bitcoin-dev@lists.l=
inuxfoundation.org" target=3D"_blank" rel=3D"noreferrer">bitcoin-dev@lists.=
linuxfoundation.org</a> wrote:<br></div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 27. 01. 19 8:36, <a href=3D"mailto:rhavar@protonmail.com" rel=3D"norefer=
rer noreferrer" target=3D"_blank">rhavar@protonmail.com</a> wrote:<br>
&gt; Thanks Adam,<br>
&gt; <br>
&gt; I have fixed the mistakes you have pointed out: <a href=3D"https://git=
hub.com/bitcoin/bips/pull/754" rel=3D"noreferrer noreferrer noreferrer" tar=
get=3D"_blank">https://github.com/bitcoin/bips/pull/754</a><br>
&gt; <br>
&gt; Thanks for the detailed look!<br>
&gt; <br>
&gt;&gt; but its virtue of steganographic hiding means only minimal uptake<=
br>
&gt;&gt; is still enormously interesting and worth pursuing; that&#39;s my =
current feeling.<br>
&gt; <br>
&gt; I very much agree =3D) I really think anything that (silently) breaks =
the assumption of common ownership of transaction inputs offers outsized be=
nefits for the whole ecosystem.<br>
&gt; <br>
&gt; One other idea I have=C2=A0 is (way) better support for moving utxo&#3=
9;s between wallets. The least controversial use case is moving funds betwe=
en wallets you own. Like I might want to move *specific* utxo&#39;s from/to=
 my joinmarket wallet, but not create a (privacy losing / expensive) transa=
ction. Both core and joinmarket fail at this at a practical point of view.<=
br>
<br>
(tangential, but yes coin control in JM is an obviously necessary<br>
feature and will be done, I just don&#39;t have time).<br>
<br>
&gt; <br>
&gt; Like imho it&#39;d be pretty cool having a standardized format for (tx=
id:vout:privatekey) with wallets showing it as &quot;External UTXO&quot; an=
d preferentially spending it (and wallet not automatically importing any ot=
her utxo from that address).<br>
&gt; <br>
&gt; Taken a bit further (this is the part which everyone hates) you could =
send someone money (or withdraw it from a service) by giving a person. It&#=
39;s not generally useful (for obvious reasons), but there&#39;s a lot of c=
ases I think it&#39;s super cool.<br>
<br>
Is there a missing word. &quot;by giving a person..&quot;? Not actually sur=
e what<br>
you&#39;re getting at here but I suspect it&#39;s again tangential to this =
BIP<br>
discussion.<br>
<br>
&gt; <br>
&gt; ---<br>
&gt; <br>
&gt; Getting back on topic, without trying to do a point-by-point reply, I =
agree with pretty much everything you said but I am reluctant to make any c=
hanges.<br>
&gt; <br>
&gt; I don&#39;t meant to be obtuse or anything, but I strongly believe the=
 limiting factor to adoption to all these protocols is actually just gettin=
g people to implement it. I made multiple implementations of bustapay from =
both the sending/receiving end, so I could try develop the easiest to imple=
ment system that is still practical.<br>
<br>
You know, there&#39;s considerable evidence to the contrary, I&#39;d argue:=
 this<br>
idea *has* been implemented already three times: by yourself, by myself<br>
and by Samourai. And in fully incompatible ways :) So I think the<br>
limiting factor is in fact creating a standard that a reasonable number<br>
of people could agree with (and I like operational definitions, so<br>
subjective as it is, I like the goal of &quot;good/clear enough that it cou=
ld<br>
be incorporated into something like BtcPayServer&quot;)<br>
<br>
&gt; <br>
&gt; For instance I like PSBT and it&#39;s nice in theory. I actually had a=
n original implementation using it, which is how I found some bugs in the c=
ore and golang version of PSBT). But in practice it&#39;s hugely overkill a=
nd significantly increases the implementation complexity complexity and is =
poorly supported. Switching to just a raw transaction actually made everyth=
ing easier. (And that&#39;s not to criticise PSBT, I would definitely want =
to use it in other contexts).<br>
<br>
But this relates back to my first &quot;generic&quot; point that you haven&=
#39;t<br>
addressed here - protocol versioning and the possibility of more than<br>
one option. Perhaps more realistic (debatable): have the current version<br=
>
be non-PSBT but with a plan to have a version bump with PSBT in future.<br>
Stuff like that. It seems crazy to actually long term reject it.<br>
<br>
&gt; <br>
&gt; Anyway, a big motivation for me even writing it as a BIP was to formal=
ize my little anti-DOS trick of privately creating a &quot;template transac=
tion&quot; which can just be dumped on the network as punishment. So if not=
hing else, hopefully I&#39;ll have demonstrated it&#39;s a pretty practical=
 way of doing things.<br>
&gt; <br>
<br>
I don&#39;t want to be that guy, but this was a central part of the proposa=
l<br>
that came of the meetup last summer and is in Haywood&#39;s blogpost. I mea=
n<br>
if you came up it with separately, then cool :) But I was there, that<br>
was established immediately as the right way of doing this to avoid a<br>
trivial attack.<br>
What might have confused you is all that stuff about multiple candidates<br=
>
and even ZKP approaches - those were just extra ideas about making it<br>
really secure at large scale; but those ideas don&#39;t quite meet the goal=
<br>
(for various reasons); well, arguably. The basic anti-DOS of an initial<br>
non-coinjoin was sorta central.<br>
(Also I&#39;m noting you didn&#39;t respond to my critique of your &quot;al=
ways use<br>
the same contributions&quot; defence; I mean, probably that&#39;s fine, it =
was<br>
only really saying it isn&#39;t perfect. Was just curious to hear<br>
your/others thoughts on it).<br>
<br>
&gt; --<br>
&gt; <br>
&gt; Also your analysis on &quot;Unnecessary Input Heuristic&quot; is prett=
y cool, but I also don&#39;t like telling people to &quot;avoid the UIH2&qu=
ot; without providing the actual algo they should use. But really I think i=
t&#39;s better off in a sort of article &quot;how to pick contributed input=
s&quot; or something, as while it&#39;s nice it&#39;s not a huge deal and t=
here&#39;s a lot of debatable tradeoffs that can/should be used. For instan=
ce the implementation I wrote for <a href=3D"http://bustabit.com" rel=3D"no=
referrer noreferrer noreferrer" target=3D"_blank">bustabit.com</a> currentl=
y just heavily biases tainted inputs (e.g. ones associated with address reu=
se).<br>
&gt; <br>
<br>
Good point about algo.<br>
I wrote my best effort at a procedure here:<br>
<a href=3D"https://gist.github.com/AdamISZ/4551b947789d3216bacfcb7af25e029e=
#gistcomment-2799709" rel=3D"noreferrer noreferrer noreferrer" target=3D"_b=
lank">https://gist.github.com/AdamISZ/4551b947789d3216bacfcb7af25e029e#gist=
comment-2799709</a><br>
<br>
I asked for comments on it but got none back so far (gists are terrible<br>
for this unfortunately, perhaps I&#39;ll have more luck on the list).<br>
<br>
I would argue that this issue *should* be mentioned on the BIP. A *huge*<br=
>
part of what makes PayJoin/BustaPay of interest is the steganographic<br>
feature, if you don&#39;t pay attention to this then it doesn&#39;t look li=
ke a<br>
payment (caveat.--&gt;).<br>
The counterargument is Laurent&#39;s statistics which I previously linked,<=
br>
suggesting that maybe 30% of txs violate this anyway, today. I&#39;m not<br=
>
sure about that, will need more analysis; Core&#39;s SRD algo may be one<br=
>
reason, but anyway ... better to make things look like payments.<br>
<br>
It doesn&#39;t hurt to prompt an implementer to do this; whether it&#39;s<b=
r>
feasible in that specific wallet situation or not is up to them; whether<br=
>
they want to go hog wild and control percentages of UIH1 and UIH2 and<br>
whatnot is there business, or they can totally ignore it - but without<br>
it being mentioned in the BIP, they may not even think of it.<br>
<br>
A last point, you also don&#39;t see value in being more explicit about<br>
simple things like transaction version and locktime? Even if you think<br>
these things should *not* be controlled, e.g. the protocol should allow<br>
either transaction version, then it&#39;d be better to explicitly say so.<b=
r>
&gt; <br>
&gt; <br>
&gt; -Ryan<br>
&gt; <br>
&gt; =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Origin=
al Message =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90<=
br>
&gt; On Friday, January 25, 2019 6:47 AM, Adam Gibson via bitcoin-dev &lt;<=
a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" rel=3D"noreferrer n=
oreferrer" target=3D"_blank">bitcoin-dev@lists.linuxfoundation.org</a>&gt; =
wrote:<br>
&gt; <br>
&gt;&gt; Ryan and list,<br>
&gt;&gt; I want to add some commentary to this (BIP79) to see if we can get=
<br>
&gt;&gt; further in standardizing this idea.<br>
&gt;&gt;<br>
&gt;&gt; When I first mulled it over I thought it too impractical, but its =
virtue<br>
&gt;&gt; of steganographic hiding means only minimal uptake is still enormo=
usly<br>
&gt;&gt; interesting and worth pursuing; that&#39;s my current feeling. I&#=
39;ve offered<br>
&gt;&gt; more detailed thoughts in my blog post[1] (def not required readin=
g here).<br>
&gt;&gt;<br>
&gt;&gt; Both Joinmarket and Samourai have started implementing this kind o=
f<br>
&gt;&gt; transaction. And while that&#39;s interesting experimentally, some=
 kind of<br>
&gt;&gt; cross-wallet standard would be helpful, albeit there some differen=
ces<br>
&gt;&gt; between that and the merchant/centralized service use-case.<br>
&gt;&gt;<br>
&gt;&gt; We might imagine as a concrete goal for this BIP to create somethi=
ng<br>
&gt;&gt; that would be acceptable for inclusion into a project like BTCPayS=
erver,<br>
&gt;&gt; so that it could be used in a realistic use case by smaller bitcoi=
n<br>
&gt;&gt; accepting merchants.<br>
&gt;&gt;<br>
&gt;&gt; Comments to the BIP[2] as follows, with generic comments first, an=
d then<br>
&gt;&gt; specific comments for existing points in the BIP:<br>
&gt;&gt;<br>
&gt;&gt; [1] <a href=3D"https://joinmarket.me/blog/blog/payjoin" rel=3D"nor=
eferrer noreferrer noreferrer" target=3D"_blank">https://joinmarket.me/blog=
/blog/payjoin</a><br>
&gt;&gt; [2] <a href=3D"https://github.com/bitcoin/bips/blob/master/bip-007=
9.mediawiki" rel=3D"noreferrer noreferrer noreferrer" target=3D"_blank">htt=
ps://github.com/bitcoin/bips/blob/master/bip-0079.mediawiki</a><br>
&gt;&gt;<br>
&gt;&gt; Generic comments<br>
&gt;&gt;<br>
&gt;&gt; =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=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=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=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=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=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=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3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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=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=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=
=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=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=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>
&gt;&gt;<br>
&gt;&gt; -=C2=A0 =C2=A0Protocol versioning. Since inevitably (even if only =
merchants), this<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0must be implemented by multiple wallets to be u=
seful, the communication<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0protocol will need versioning (for example i ha=
ve in my<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0simple/experimental Joinmarket PayJoin that sen=
der sends min and max<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0supported version and receiver responds with a =
chosen protocol version<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0so we can update). I do understand that as a cl=
ient-server model can<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0apply here, we can ditch a lot of the complexit=
ies around network/p2p<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0interaction, but this much at least seems neces=
sary.<br>
&gt;&gt;<br>
&gt;&gt; -=C2=A0 =C2=A0Although it has its logic, I don&#39;t think &quot;B=
ustapay&quot; is a good name for<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0this protocol. I prefer &quot;PayJoin&quot; whi=
ch is neutral sounding and<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0self-descriptive. Needless to say this is not a=
 hill I intend to die on.<br>
&gt;&gt;<br>
&gt;&gt; -=C2=A0 =C2=A0PSBT/BIP174. I realise this has already been discuss=
ed, but this is a<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0good example of what this standardisation was d=
esigned for, so I&#39;d be<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0against not including it, even given the realit=
y that, as you correctly<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0observe, it is not yet implemented in the major=
ity of wallets and<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0libraries. One way round that is to make it opt=
ional (possibly combined<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0with above point about versioning). Note that f=
or example you were<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0observing the necessity to check the sequence n=
umber was unchanged; that<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0would be encapsulated by checking equality of P=
SBT Input objects/fields.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0While one can make such software architecture a=
rguments, the really<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0fundamental point is the need for standards for=
 x-wallet compatibility.<br>
&gt;&gt;<br>
&gt;&gt; -=C2=A0 =C2=A0Version, Locktime: Perhaps this is not needed; in a =
peer to peer<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0wallet scenario I think there might be logic in=
 trying to get cover<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0traffic of (Core, Electrum, others), say, by us=
ing<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0last-block-locktime-mostly, as they do. Version=
 should be 2 and sequence<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0is a function of your suggestion to use BIP125.=
 Worth noting that BIP125<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0is not currently widely used on the network, th=
ough (see<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0<a href=3D"https://p2sh.info/dashboard/db/repla=
ce-by-fee?orgId=3D1" rel=3D"noreferrer noreferrer noreferrer" target=3D"_bl=
ank">https://p2sh.info/dashboard/db/replace-by-fee?orgId=3D1</a>). For this=
 reason<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0it should perhaps be explicitly only optional.<=
br>
&gt;&gt;<br>
&gt;&gt; -=C2=A0 =C2=A0Avoidance of non-payment &quot;Unnecessary Input Heu=
ristic&quot; (1, 2). For<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0reference, see the definition here<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0<a href=3D"https://gist.github.com/AdamISZ/4551=
b947789d3216bacfcb7af25e029e#gistcomment-2796539" rel=3D"noreferrer norefer=
rer noreferrer" target=3D"_blank">https://gist.github.com/AdamISZ/4551b9477=
89d3216bacfcb7af25e029e#gistcomment-2796539</a><br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0and some data here<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0<a href=3D"https://gist.github.com/AdamISZ/4551=
b947789d3216bacfcb7af25e029e#gistcomment-2800791" rel=3D"noreferrer norefer=
rer noreferrer" target=3D"_blank">https://gist.github.com/AdamISZ/4551b9477=
89d3216bacfcb7af25e029e#gistcomment-2800791</a><br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0(whole comment thread may be of interest) - not=
e this UIH name is afaik<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0Chris Belcher&#39;s invention, it seems useful =
as a categorisation.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0So, it seems that UIH2 is more important to avo=
id; while some more<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0sophisticated wallet coin selection algorithms =
may occasionally pick<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0an input set where one input is larger than any=
 output, most won&#39;t, and<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0some in particular never will. So I think the t=
ext here should indicate<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0that *the receiver&#39;s contributed input(s) S=
HOULD be chosen to avoid<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0triggering the UIH2 heuristic where possible, s=
o that the final payjoin<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0transaction is maximally plausible as an ordina=
ry payment&quot; or similar.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0UIH1 is a nice-to-have (meaning the plausibilit=
y extends to two<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0different (both wrong) payment amounts, but it =
may not be necessary to<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0mention it in the BIP.<br>
&gt;&gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0Specific comments<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt; =3D=3D=3D=3DStep 4. Receiver validates, re-signs, and prop=
agates on the<br>
&gt;&gt;<br>
&gt;&gt; bitcoin network=3D=3D=3D=3D<br>
&gt;&gt;<br>
&gt;&gt; I believe this should say &quot;Sender&quot; not Receiver. Also fo=
r the next<br>
&gt;&gt; sentence, s/receiver/sender/:<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt; The receiver MUST validate the &#39;&#39;partial transacti=
on&#39;&#39; was changed<br>
&gt;&gt;<br>
&gt;&gt; correctly and non-maliciously (to allow using potentially untruste=
d<br>
&gt;&gt; communication channels), re-sign its original inputs and propagate=
 the<br>
&gt;&gt; final transaction over the bitcoin network.<br>
&gt;&gt;<br>
&gt;&gt; Your very correct highlighting of the attack vector of &quot;recei=
ver gives<br>
&gt;&gt; sender other inputs belonging to sender to unwittingly sign (descr=
ibed<br>
&gt;&gt; below), should be highlighted here, perhaps with the phrase &quot;=
re-sign its<br>
&gt;&gt; ORIGINAL inputs&quot; (only!)&quot;.<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt; When the sender is creating a &quot;template transaction&q=
uot; it is done<br>
&gt;&gt;<br>
&gt;&gt; almost identically to creating a normal send, with the exception t=
hat<br>
&gt;&gt; only segwit inputs may be used. The sender is also encouraged to u=
se a<br>
&gt;&gt; slightly more aggressive feerate than usual as well as BIP125 (Opt=
-in<br>
&gt;&gt; Full Replace-by-Fee Signaling), but neither is strictly required.<=
br>
&gt;&gt;<br>
&gt;&gt; &quot;slightly more aggressive feerate than usual&quot; - this I u=
nderstand is to<br>
&gt;&gt; make up for receiver contributed utxo, OK.<br>
&gt;&gt;<br>
&gt;&gt; &quot;only segwit inputs&quot; - it certainly makes things simpler=
. One can work<br>
&gt;&gt; with non-segwit inputs but especially considering (as mentioned be=
low)<br>
&gt;&gt; we really ought to &quot;MUST&quot; the part about matching input =
types, I tend to<br>
&gt;&gt; agree that non-segwit should be disallowed.<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt; The receiver must add at least one input to the transactio=
n (the<br>
&gt;&gt;<br>
&gt;&gt; &quot;contributed inputs&quot;). If the receiver has no inputs, it=
 should use a<br>
&gt;&gt; 500 internal server error, so the client can send the transaction =
as per<br>
&gt;&gt; normal (or try again later).<br>
&gt;&gt;<br>
&gt;&gt; Would it not be much simpler for the server to return a different<=
br>
&gt;&gt; (non-error) response indicating that it will broadcast the templat=
e tx<br>
&gt;&gt; in this case?<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt; Its generally advised to only add a single contributed inp=
ut, however<br>
&gt;&gt;<br>
&gt;&gt; they are circumstances where adding more than a single input can b=
e useful.<br>
&gt;&gt;<br>
&gt;&gt; I don&#39;t see a good reason to advise the use of only 1 input? (=
but this<br>
&gt;&gt; will also connect with the above generic comment about &quot;UIH&q=
uot;). I guess<br>
&gt;&gt; it&#39;s because of your approach to fees. I&#39;d prefer not to c=
reate a<br>
&gt;&gt; limitation here.<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt; To prevent an attack where a receiver is continually sent =
variations<br>
&gt;&gt;<br>
&gt;&gt; of the same transaction to enumerate the receivers utxo set, it is=
<br>
&gt;&gt; essential that the receiver always returns the same contributed in=
puts<br>
&gt;&gt; when it&#39;s seen the same inputs.<br>
&gt;&gt;<br>
&gt;&gt; This is an approach to avoiding this problem which has the virtue =
of<br>
&gt;&gt; simplicity, but it seems a little problematic. (1) You must keep a=
<br>
&gt;&gt; mapping of proposed payment utxos to one&#39;s proposed contribute=
d input<br>
&gt;&gt; utxos, but (2) how should this be updated if you need to spend the=
<br>
&gt;&gt; contribution mentioned in (1)? Ironically use of payjoin exacerbat=
es<br>
&gt;&gt; this issue, because it results in a smaller number of utxos being =
held<br>
&gt;&gt; by the receiver at any one time :) All this considered, I still se=
e the<br>
&gt;&gt; value in your approach, but it might end up with a re-attempted pa=
yment<br>
&gt;&gt; being rejected. Certainly the more complex suggested solutions com=
ing<br>
&gt;&gt; out of the summer 2018 coinjoin workshop aren&#39;t as practical a=
s this,<br>
&gt;&gt; and may be overkill for small merchants/receivers.<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt; It is strongly preferable that the receiver makes an effor=
t to pick a<br>
&gt;&gt;<br>
&gt;&gt; contributed input of the same type as the other transaction inputs=
 if<br>
&gt;&gt; possible.<br>
&gt;&gt;<br>
&gt;&gt; I have also thought about this and you could reasonably argue this=
<br>
&gt;&gt; should be a MUST section in the BIP, that is, if the receiver cann=
ot use<br>
&gt;&gt; inputs of the same type, he should fall back to the template<br>
&gt;&gt; transaction. A mixed-input payjoin/coinjoin is essentially<br>
&gt;&gt; near-perfectly identifiable as such (there is almost zero other us=
age of<br>
&gt;&gt; multi-type-input transactions), which is a very different thing th=
an a<br>
&gt;&gt; non-identifiable payjoin transaction. That may or may not be OK to=
 the<br>
&gt;&gt; sender. This is debatable though, for sure.<br>
&gt;&gt;<br>
&gt;&gt;&gt;&gt; After adding inputs to the transaction, the receiver gener=
ally will<br>
&gt;&gt;<br>
&gt;&gt; want to adjust the output that pays himself by increasing it by th=
e sum<br>
&gt;&gt; of the contributed input amounts (minus any fees he wants to<br>
&gt;&gt; contribute). However the only strict requirement is that the recei=
ver<br>
&gt;&gt; must never add or remove inputs, and must not ever decrease any<br=
>
&gt;&gt; output amount.<br>
&gt;&gt;<br>
&gt;&gt; &quot;must never add or remove inputs&quot; - did you mean &quot;m=
ust never remove<br>
&gt;&gt; inputs&quot;? he surely has to add one! Or, perhaps you mean he mu=
st not<br>
&gt;&gt; alter the list of inputs provided by the sender (in which case it =
should<br>
&gt;&gt; be clarified).<br>
&gt;&gt;<br>
&gt;&gt; &quot;must not decrease any output amount&quot; - I initally disag=
reed with this<br>
&gt;&gt; but it is a better option than the one I currently chose in Joinma=
rket<br>
&gt;&gt; payjoin (sender pays all fee as long as receiver utxos are not too=
<br>
&gt;&gt; much). So this means that the receiver either consciously chooses =
to not<br>
&gt;&gt; increase the fee, meaning the fee rate may be a bit low (hence you=
r<br>
&gt;&gt; earlier comment about being generous, got it), or contributes via =
the<br>
&gt;&gt; payout amount. I guess the latter might break merchant software<br=
>
&gt;&gt; expecting to have amount output fixed and fees determined by chang=
e.<br>
&gt;&gt;<br>
&gt;&gt; Regards,<br>
&gt;&gt; Adam Gibson/waxwing<br>
&gt;&gt;<br>
&gt;&gt; On 30. 08. 18 22:24, Ryan Havar via bitcoin-dev wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; I&#39;ve just finished writing an implementing of this, and ex=
tremely happy<br>
&gt;&gt;&gt; with how it turned out. So I&#39;d like to go and try go down =
the path of<br>
&gt;&gt;&gt; more formally describing it and getting some comments and ulti=
mately<br>
&gt;&gt;&gt; encourage its wide-spread use.<br>
&gt;&gt;&gt; =3D=3DAbstract=3D=3D<br>
&gt;&gt;&gt; The way bitcoin transactions are overwhelming used is known to=
 leak more<br>
&gt;&gt;&gt; information than desirable. This has lead to fungibility conce=
rns in bitcoin<br>
&gt;&gt;&gt; and a raise of unreasonably effective blockchain analysis.<br>
&gt;&gt;&gt; Bustapay proposes a simple, practical way to bust these assump=
tions to<br>
&gt;&gt;&gt; immediate<br>
&gt;&gt;&gt; benefit of the sender and recievers. Furthermore it does so in=
 such a<br>
&gt;&gt;&gt; way that<br>
&gt;&gt;&gt; helps recievers avoid utxo bloat, a constant problem for bitco=
in merchants.<br>
&gt;&gt;&gt; =3D=3DCopyright=3D=3D<br>
&gt;&gt;&gt; This BIP is in the public domain.<br>
&gt;&gt;&gt; =3D=3DMotivation=3D=3D<br>
&gt;&gt;&gt; One of the most powerful heuristic&#39;s employed by those who=
se goal is to<br>
&gt;&gt;&gt; undermine<br>
&gt;&gt;&gt; bitcoin&#39;s fungiblity has been to assume all inputs of a tr=
ansaction are<br>
&gt;&gt;&gt; signed by<br>
&gt;&gt;&gt; a single party. In the few cases this assumption does not hold=
, it is<br>
&gt;&gt;&gt; generally<br>
&gt;&gt;&gt; readibly recognizable (e.g. traditional coinjoins have a very =
obvious<br>
&gt;&gt;&gt; structure,<br>
&gt;&gt;&gt; or multisig outputs are most frequently validated onchain).<br=
>
&gt;&gt;&gt; Bustapay requires no changes to bitcoin and creates bitcoin tr=
ansactions<br>
&gt;&gt;&gt; that are<br>
&gt;&gt;&gt; indistinguishable from normal ones.<br>
&gt;&gt;&gt; It is worth noting that this specification has been intentiona=
lly kept<br>
&gt;&gt;&gt; as simple<br>
&gt;&gt;&gt; as possible to encourage adoption. There are almost an endless=
 amount of<br>
&gt;&gt;&gt; extensions<br>
&gt;&gt;&gt; possible but the harder the implementation of clients/server t=
he less<br>
&gt;&gt;&gt; likely it<br>
&gt;&gt;&gt; will ever be done. Should bustapay enjoy widespread adoption, =
a &quot;v2&quot;<br>
&gt;&gt;&gt; specification<br>
&gt;&gt;&gt; will be created with desired extensions.<br>
&gt;&gt;&gt; =3D=3DSpecification=3D=3D<br>
&gt;&gt;&gt; A bustapay payment is made from a sender to a receiver.<br>
&gt;&gt;&gt; Step 1. Sender creates a bitcoin transaction paying the receiv=
er<br>
&gt;&gt;&gt; This transaction must be fully valid, signed and all inputs mu=
st use<br>
&gt;&gt;&gt; segwit. This transaction is known as the &quot;template transa=
ction&quot;. This<br>
&gt;&gt;&gt; transaction must not be propagated on the bitcoin network.<br>
&gt;&gt;&gt; Step 2. Sender gives the &quot;template transaction&quot; to t=
he receiver<br>
&gt;&gt;&gt; This would generally be done as an HTTP POST. The exact URL to=
 submit it<br>
&gt;&gt;&gt; to could be specified with a bip21 encoded address. Such as<br=
>
&gt;&gt;&gt; bitcoin:2NABbUr9yeRCp1oUCtVmgJF8HGRCo3ifpTT?bustapay=3D<a href=
=3D"https://bp.bustabit.com/submit" rel=3D"noreferrer noreferrer noreferrer=
" target=3D"_blank">https://bp.bustabit.com/submit</a><br>
&gt;&gt;&gt; and the HTTP body should be the raw transaction hex encoded as=
 text.<br>
&gt;&gt;&gt; Step 3. Receiver processes the transaction and returns a parti=
ally<br>
&gt;&gt;&gt; signed coinjoin<br>
&gt;&gt;&gt; The receiver validates the transaction is valid, pays himself =
and is<br>
&gt;&gt;&gt; eligible for propation. The receiver then adds one of his own =
inputs<br>
&gt;&gt;&gt; (known as the &quot;contributed input&quot;) and increase the =
output that pays<br>
&gt;&gt;&gt; himself by the contributed input amount. Doing so will invalid=
ate the<br>
&gt;&gt;&gt; &quot;template transaction&quot;&#39;s original input signatur=
es, so the sender needs<br>
&gt;&gt;&gt; to return this &quot;partial transaction&quot; back to the rec=
eiver to sign. This<br>
&gt;&gt;&gt; is returned as a hex-encoded raw transaction a response to the=
 original<br>
&gt;&gt;&gt; HTTP POST request.<br>
&gt;&gt;&gt; Step 4. Receiver validates, re-signs, and propagates on the bi=
tcoin network<br>
&gt;&gt;&gt; The receiver is responsible in making sure the &quot;partial t=
ransaction&quot;<br>
&gt;&gt;&gt; returned by the sender was changed correctly (it should assume=
 the<br>
&gt;&gt;&gt; connection has been MITM&#39;d and act accordingly), resign it=
s original<br>
&gt;&gt;&gt; inputs and propagates this transaction over the bitcoin networ=
k. The<br>
&gt;&gt;&gt; client must be aware that the server can reorder inputs and ou=
tputs.<br>
&gt;&gt;&gt; Step 5. Receiver observes the finalized transaction on the bit=
coin network<br>
&gt;&gt;&gt; Once the receiver has seen the finalized transactions on the n=
etwork<br>
&gt;&gt;&gt; (and has enough confirmations) it can process it like a normal=
 payment<br>
&gt;&gt;&gt; for the sent amount (as opposed to the amount that it looks li=
ke on the<br>
&gt;&gt;&gt; network). If the receiver does not see the finalized transacti=
on after a<br>
&gt;&gt;&gt; timeout will propagate the original &quot;template transaction=
&quot; to ensure the<br>
&gt;&gt;&gt; payment happens and function a strong anti-DoS mechanism.<br>
&gt;&gt;&gt; =3D=3D=3D Implementation Notes =3D=3D=3D<br>
&gt;&gt;&gt; For anyone wanting to implement bustapay payments, here are so=
me notes<br>
&gt;&gt;&gt; for receivers:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; -=C2=A0 =C2=A0A transaction can easily be checked if it&#39;s =
suitable for the mempool<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0with testmempoolaccept in bitcoin core 0.17=
<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; -=C2=A0 =C2=A0Tracking transactions by txid is precarious. To =
keep your sanity make<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0sure all inputs are segwit. But remember se=
gwit does not prevent txid<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0malleability unless you validate the transa=
ction. So really make sure<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0you&#39;re using testmempoolaccept at the v=
ery least<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; -=C2=A0 =C2=A0Bustapay could be abused by a malicious party to=
 query if you own a<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0deposit address or not. So never accept a b=
ustapay transaction that pays<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0an already used deposit address<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; -=C2=A0 =C2=A0You will need to keep a mapping of which utxos p=
eople have showed you<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0and which you revealed. So if you see them =
again, you can reveal the<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0same one of your own<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; -=C2=A0 =C2=A0Check if the transaction was already sorted acco=
rding to BIP69, if so<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0ensure the result stays that way. Otherwise=
 probably just shuffle the<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0inputs/outpus<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Notes for sending applications:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; -=C2=A0 =C2=A0The HTTP response must not be trusted. It should=
 be fully validated<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0that no unexpected changes have been made t=
o the transaction.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; -=C2=A0 =C2=A0The sender should be aware the original &quot;te=
mplate transaction&quot; may be<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0propagated at any time, and in fact can int=
entionally be<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0 done so for the purpose of RBF as it=
 should have a slightly higher fee<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0rate.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; =3D=3D Credits =3D=3D<br>
&gt;&gt;&gt; The idea is obviously based upon Dr. Maxwell&#39;s seminal Coi=
nJoin<br>
&gt;&gt;&gt; proposal, and reduced scope inspired by a simplification of th=
e &quot;pay 2<br>
&gt;&gt;&gt; endpoint&quot; (now offline) blog post by blockstream.<br>
&gt;&gt;&gt; -Ryan<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; bitcoin-dev mailing list<br>
&gt;&gt;&gt; <a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" rel=
=3D"noreferrer noreferrer" target=3D"_blank">bitcoin-dev@lists.linuxfoundat=
ion.org</a><br>
&gt;&gt;&gt; <a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/=
bitcoin-dev" rel=3D"noreferrer noreferrer noreferrer" target=3D"_blank">htt=
ps://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br>
&gt;&gt;<br>
&gt;&gt; bitcoin-dev mailing list<br>
&gt;&gt; <a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" rel=3D"no=
referrer noreferrer" target=3D"_blank">bitcoin-dev@lists.linuxfoundation.or=
g</a><br>
&gt;&gt; <a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitc=
oin-dev" rel=3D"noreferrer noreferrer noreferrer" target=3D"_blank">https:/=
/lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br>
&gt; <br>
&gt; <br>
_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" rel=3D"noreferrer =
noreferrer" target=3D"_blank">bitcoin-dev@lists.linuxfoundation.org</a><br>
<a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" =
rel=3D"noreferrer noreferrer noreferrer" target=3D"_blank">https://lists.li=
nuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br>
</blockquote></div></div></div>

--000000000000dd9274058075c13c--