summaryrefslogtreecommitdiff
path: root/57/fa1d1ff67332d73e848da15f8d729b3ae317ab
blob: 0fa208bbee01c18bd26b96ce2e06ce1b3cedd545 (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
Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193]
	helo=mx.sourceforge.net)
	by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
	(envelope-from <tomh@thinlink.com>) id 1Z4jNx-00053B-SB
	for bitcoin-development@lists.sourceforge.net;
	Tue, 16 Jun 2015 05:26:09 +0000
X-ACL-Warn: 
Received: from mail-pd0-f177.google.com ([209.85.192.177])
	by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128)
	(Exim 4.76) id 1Z4jNu-0007bY-U0
	for bitcoin-development@lists.sourceforge.net;
	Tue, 16 Jun 2015 05:26:09 +0000
Received: by pdjm12 with SMTP id m12so6103146pdj.3
	for <bitcoin-development@lists.sourceforge.net>;
	Mon, 15 Jun 2015 22:26:01 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to
	:subject:references:in-reply-to:content-type;
	bh=uY4pcVGugpj3Q/gPsTiE/gAUYJomYadcZq/6Wi2dQ3w=;
	b=OmZ/wCVls+bGcSUEWmlS6+4bVjYZ95G4mp+M22Q6WhKcqIEzy5LjoYYRrAPmzs3WwQ
	LP8V9rkbeGG2FunForlTZW1T0LxjOkEE1NtBiay6TfbMLJeH2tCGwcl6R0paTiJxW5x4
	SdHYlIUCIdg/YgO5zeOn6MYls0oqemGVwyAAGeqbxa5GqUNj4a6AUzym2raauhQZBnDI
	scIw7RvCCohpa6NGYoY+Y8Ih+GZC+7i2cXzT1pHTZ5UzS/MN954WrCbvttYQcxiiIfpm
	7e8Lc6tZo2qm4dikepwFCQFX2bgF4P2xvS5ezMCupSuZB+bv19GXfkTOa8t5NCc9r8o5
	oHfw==
X-Gm-Message-State: ALoCoQlApd1ULzmhv9W7aGQEshPez8BjyKRlh6YQCcrUWBUfGn6rDtEMVXt/ohnvxQAQ9GhiyGlN
X-Received: by 10.70.90.103 with SMTP id bv7mr55840746pdb.160.1434432361174;
	Mon, 15 Jun 2015 22:26:01 -0700 (PDT)
Received: from [192.168.1.89] (99-8-65-117.lightspeed.davlca.sbcglobal.net.
	[99.8.65.117]) by mx.google.com with ESMTPSA id
	ld1sm13949460pbc.26.2015.06.15.22.25.58
	(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Mon, 15 Jun 2015 22:25:59 -0700 (PDT)
Message-ID: <557FB36B.1030902@thinlink.com>
Date: Mon, 15 Jun 2015 22:26:03 -0700
From: Tom Harding <tomh@thinlink.com>
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64;
	rv:31.0) Gecko/20100101 Thunderbird/31.7.0
MIME-Version: 1.0
To: bitcoin-development@lists.sourceforge.net, 
	Pieter Wuille <pieter.wuille@gmail.com>
References: <CAPswA9w5Sgg6AV=9Pqx5sqbkdrwv9LmwoxmMu7xZsQSNXtmZnQ@mail.gmail.com>	<CAPg+sBjtovFpLoibpVGLsNJXexBcoiYzjrvctraXntCUZBJsGg@mail.gmail.com>	<CAPswA9zhB4GV=JJ28RRLFNrkVwExUv36zujmuAjwPd6rG6rvzQ@mail.gmail.com>	<CALJP9GCBJiofY7k2RJ460CuLuWQunHcx7EcLi1-d07v76Y-E2g@mail.gmail.com>	<CAPswA9wqdbU0z8ydBt+9M0iQX0VSi1ce=dg3fR2_2bx3-vEqzA@mail.gmail.com>	<CAPswA9z_xKY6v9=Ejh=01mZN0QCVo1e0RY1FTzXzS39i3tjgAw@mail.gmail.com>	<CAPswA9xk5QYAXxQ6ES3cnNPeB1FTiiSJgLahLEkSk4CLpoM_QQ@mail.gmail.com>	<CAPg+sBiWykR6RaHhbyYQbL=A5t1TmHgEmS_sC7jj9d3SUTMO9g@mail.gmail.com>	<CAPswA9zycU0pwZKaHU9J3Tvg=ovLJ8TZ9OH6ebTPONaRaiOE8g@mail.gmail.com>
	<CAPg+sBhuth22+vAHyS2iwpze8X=-b2wJQ5s1z2FhZ1jsLXobgQ@mail.gmail.com>
In-Reply-To: <CAPg+sBhuth22+vAHyS2iwpze8X=-b2wJQ5s1z2FhZ1jsLXobgQ@mail.gmail.com>
Content-Type: multipart/alternative;
	boundary="------------030802010103000105080504"
X-Spam-Score: 1.0 (+)
X-Spam-Report: Spam Filtering performed by mx.sourceforge.net.
	See http://spamassassin.org/tag/ for more details.
	1.0 HTML_MESSAGE           BODY: HTML included in message
	0.0 T_FILL_THIS_FORM_SHORT Fill in a short form with personal
	information
X-Headers-End: 1Z4jNu-0007bY-U0
Subject: Re: [Bitcoin-development] BIP for Proof of Payment
X-BeenThere: bitcoin-development@lists.sourceforge.net
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <bitcoin-development.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development>
List-Post: <mailto:bitcoin-development@lists.sourceforge.net>
List-Help: <mailto:bitcoin-development-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=subscribe>
X-List-Received-Date: Tue, 16 Jun 2015 05:26:09 -0000

This is a multi-part message in MIME format.
--------------030802010103000105080504
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable


Shared wallets were discussed earlier as a feature.  If you pay a for
dry cleaning with a shared wallet, a different 1-of-N signer can pick up
the clothes with no physical transfer of a claim check, by proving the
money that paid for the cleaning was his.

Many kinds of vouchers can be eliminated, because the money itself can
be vouched for, wirelessly, with ECDSA security.  A PoP would be much
more difficult to forge as a valet claim check, to steal a car.

Something like your coffee gift example was also mentioned.  The buyer
could export the private keys to your (the beneficiary's) wallet after
the purchase, by using an 'export gift claim check' function on the
spent transaction.  Then you pick up the coffee (car, concert seats...)
just as if you had paid.

Kalle goes to some trouble to describe how merchants need to ensure that
they only accept a PoP provided as a response to their challenge.

Coinjoin or simulfunding transactions wouldn't be PoP-able (nor should
they be) since no one signer has all the private keys.



On 6/15/2015 3:00 AM, Pieter Wuille wrote:
>
> I did misunderstand that. That changes things significantly.
>
> However, having paid is not the same as having had access to the input
> coins. What about shared wallets or coinjoin?
>
> Also, if I understand correctly, there is no commitment to anything
> you're trying to say about the sender? So once I obtain a
> proof-of-payment from you about something you paid, I can go claim
> that it's mine?
>
> Why does anyone care who paid? This is like walking into a coffeshop,
> noticing I don't have money with me, let me friend pay for me, and
> then have the shop insist that I can't drink it because I'm not the buy=
er.
>
> Track payments, don't try to assign identities to payers.
>
> On Jun 15, 2015 11:35 AM, "Kalle Rosenbaum" <kalle@rosenbaum.se
> <mailto:kalle@rosenbaum.se>> wrote:
>
>     Hi Pieter!
>
>     It is intended to be a proof that you *have paid* for something. No=
t
>     that you have the intent to pay for something. You cannot use PoP
>     without a transaction to prove.
>
>     So, yes, it's just a proof of access to certain coins that you no
>     longer have.
>
>     Maybe I don't understand you correctly?
>
>     /Kalle
>
>     2015-06-15 11:27 GMT+02:00 Pieter Wuille <pieter.wuille@gmail.com
>     <mailto:pieter.wuille@gmail.com>>:
>     > Now that you have removed the outputs, I don't think it's even a
>     intent of
>     > payment, but just a proof of access to certain coins.
>     >
>     > On Jun 15, 2015 11:24 AM, "Kalle Rosenbaum" <kalle@rosenbaum.se
>     <mailto:kalle@rosenbaum.se>> wrote:
>     >>
>     >> Hi all!
>     >>
>     >> I have made the discussed changes and updated my implementation
>     >> (https://github.com/kallerosenbaum/poppoc) accordingly. These
>     are the
>     >> changes:
>     >>
>     >> * There is now only one output, the "pop output", of value 0.
>     >> * The sequence number of all inputs of the PoP must be set to 0.=
 I
>     >> chose to set it to 0 for all inputs for simplicity.
>     >> * The lock_time of the PoP must be set to 499999999 (max block
>     height lock
>     >> time).
>     >>
>     >> The comments so far has been mainly positive or neutral. Are
>     there any
>     >> major objections against any of the two proposals? If not, I
>     will ask
>     >> Gregory Maxwell to assign them BIP numbers.
>     >>
>     >> The two BIP proposals can be found at
>     >>
>     https://github.com/kallerosenbaum/poppoc/wiki/Proof-of-Payment-BIP =
and
>     >>
>     https://github.com/kallerosenbaum/poppoc/wiki/btcpop-scheme-BIP.
>     The source
>     >> for the Proof of Payment BIP proposal is also in-lined below.
>     >>
>     >> A number of alternative names have been proposed:
>     >>
>     >> * Proof of Potential
>     >> * Proof of Control
>     >> * Proof of Signature
>     >> * Signatory Proof
>     >> * Popo: Proof of payment origin
>     >> * Pots: Proof of transaction signer
>     >> * proof of transaction intent
>     >> * Declaration of intent
>     >> * Asset-access-and-action-affirmation, AAaAA, or A5
>     >> * VeriBit
>     >> * CertiBTC
>     >> * VBit
>     >> * PayID
>     >>
>     >> Given this list, I still think "Proof of Payment" is the most
>     descriptive
>     >> to non-technical people.
>     >>
>     >> Regards,
>     >> Kalle
>     >>
>     >>
>     >> #################################################
>     >> <pre>
>     >>   BIP: <BIP number>
>     >>   Title: Proof of Payment
>     >>   Author: Kalle Rosenbaum <kalle@rosenbaum.se
>     <mailto:kalle@rosenbaum.se>>
>     >>   Status: Draft
>     >>   Type: Standards Track
>     >>   Created: <date created on, in ISO 8601 (yyyy-mm-dd) format>
>     >> </pre>
>     >>
>     >> =3D=3D Abstract =3D=3D
>     >>
>     >> This BIP describes how a wallet can prove to a server that it
>     has the
>     >> ability to sign a certain transaction.
>     >>
>     >> =3D=3D Motivation =3D=3D
>     >>
>     >> There are several scenarios in which it would be useful to
>     prove that you
>     >> have paid for something. For example:
>     >>
>     >> * A pre-paid hotel room where your PoP functions as a key to
>     the door.
>     >> * An online video rental service where you pay for a video and
>     watch it on
>     >> any device.
>     >> * An ad-sign where you pay in advance for e.g. 2 weeks
>     exclusivity. During
>     >> this period you can upload new content to the sign whenever you
>     like using
>     >> PoP.
>     >> * Log in to a pay site using a PoP.
>     >> * A parking lot you pay for monthly and the car authenticates
>     itself using
>     >> PoP.
>     >> * A lottery where all participants pay to the same address, and
>     the winner
>     >> is selected among the transactions to that address. You
>     exchange the prize
>     >> for a PoP for the winning transaction.
>     >>
>     >> With Proof of Payment, these use cases can be achieved without a=
ny
>     >> personal information (user name, password, e-mail address, etc)
>     being
>     >> involved.
>     >>
>     >> =3D=3D Rationale =3D=3D
>     >>
>     >> Desirable properties:
>     >>
>     >> # A PoP should be generated on demand.
>     >> # It should only be usable once to avoid issues due to theft.
>     >> # It should be able to create a PoP for any payment, regardless
>     of script
>     >> type (P2SH, P2PKH, etc.).
>     >> # It should prove that you have enough credentials to unlock
>     all the
>     >> inputs of the proven transaction.
>     >> # It should be easy to implement by wallets and servers to ease
>     adoption.
>     >>
>     >> Current methods of proving a payment:
>     >>
>     >> * In BIP0070, the PaymentRequest together with the transactions
>     fulfilling
>     >> the request makes some sort of proof. However, it does not meet
>     1, 2 or 4
>     >> and it obviously only meets 3 if the payment is made through
>     BIP0070. Also,
>     >> there's no standard way to request/provide the proof. If
>     standardized it
>     >> would probably meet 5.
>     >> * Signing messages, chosen by the server, with the private keys
>     used to
>     >> sign the transaction. This could meet 1 and 2 but probably not
>     3. This is
>     >> not standardized either. 4 Could be met if designed so.
>     >>
>     >> If an input script type is P2SH, any satisfying script should
>     do, just as
>     >> if it was a payment. For M-of-N multisig scripts, that would
>     mean that any
>     >> set of M keys should be sufficient, not neccesarily the same
>     set of M keys
>     >> that signed the transaction. This is important because strictly
>     demanding
>     >> the same set of M keys would defeat the purpose of a multisig
>     address.
>     >>
>     >> =3D=3D Specification =3D=3D
>     >>
>     >> =3D=3D=3D Data structure =3D=3D=3D
>     >>
>     >> A proof of payment for a transaction T, here called PoP(T), is
>     used to
>     >> prove that one has ownership of the credentials needed to
>     unlock all the
>     >> inputs of T. It has the exact same structure as a bitcoin
>     transaction with
>     >> the same inputs as T and in the same order as in T, but with
>     each sequence
>     >> number set to 0. There is exactly one output, here called the
>     pop output,
>     >> with value 0. The pop output must have the following format:
>     >>
>     >>  OP_RETURN <version> <txid> <nonce>
>     >>
>     >> {|
>     >> ! Field        !! Size [B] !! Description
>     >> |-
>     >> | &lt;version> || 2        || Version, little endian, currently
>     0x01 0x00
>     >> |-
>     >> | &lt;txid>    || 32       || The transaction to prove
>     >> |-
>     >> | &lt;nonce>   || 6        || Random data
>     >> |}
>     >>
>     >> The lock_time of the PoP must be set to 499999999 to prevent
>     the PoP from
>     >> being included in a block, should it appear on the bitcoin p2p
>     network. This
>     >> is also the reason for setting the sequence numbers to 0, since
>     sequence
>     >> number of ffffffff would make lock_time ineffective. This
>     specification
>     >> demands that all input sequence numbers are 0, not just one of
>     them, which
>     >> would be sufficient to make lock_time effective. This is for
>     simplicity
>     >> reasons.
>     >>
>     >> An illustration of the PoP data structure and its original
>     payment is
>     >> shown below.
>     >>
>     >> <pre>
>     >>   T
>     >>  +------------------------------------------------+
>     >>  |inputs                | outputs                 |
>     >>  |       Value,Sequence | Value,Script            |
>     >>  +------------------------------------------------+
>     >>  |input0 1,ffffffff     | 0,pay to A              |
>     >>  |input1 3,ffffffff     | 2,OP_RETURN <some data> |
>     >>  |input2 4,ffffffff     | 1,pay to B              |
>     >>  |                      | 4,pay to C              |
>     >>  +------------------------------------------------+
>     >>
>     >>   PoP(T)
>     >>  +-------------------------------------------------------------+=

>     >>  | inputs               | outputs                              |=

>     >>  |       Value,Sequence | Value,Script                         |=

>     >>  +-------------------------------------------------------------+=

>     >>  |input0 1,00000000     | 0,OP_RETURN <version> <txid> <nonce> |=

>     >>  |input1 3,00000000     |                                      |=

>     >>  |input2 4,00000000     |                                      |=

>     >>  +-------------------------------------------------------------+=

>     >>  | lock_time=3D499999999                                        =
 |
>     >>  +-------------------------------------------------------------+=

>     >> </pre>
>     >>
>     >> The PoP is signed using the same signing process that is used
>     for bitcoin
>     >> transactions.
>     >>
>     >> The purpose of the nonce is to make it harder to use a stolen
>     PoP; Once
>     >> the PoP has reached the server, that PoP is useless since the
>     server will
>     >> generate a new nonce for every PoP request.
>     >>
>     >> =3D=3D=3D Process =3D=3D=3D
>     >>
>     >> # A proof of payment request is sent from the server to the
>     wallet. The
>     >> PoP request contains:
>     >> ## a random nonce
>     >> ## a destination where to send the PoP, for example a https URL
>     >> ## data hinting the wallet which transaction to create a proof
>     for. For
>     >> example:
>     >> ##* txid, if known by the server
>     >> ##* PaymentRequest.PaymentDetails.merchant_data (in case of a
>     BIP0070
>     >> payment)
>     >> ##* amount, label, message or other information from a BIP0021 U=
RI
>     >> # The wallet identifies a transaction T, if possible. Otherwise
>     it asks
>     >> the user to select among the ones that match the hints in 1.iii.=

>     >> # The wallet creates an unsigned PoP (UPoP) for T, and asks the
>     user to
>     >> sign it.
>     >> # The user confirms
>     >> # The UPoP(T) is signed by the wallet, creating PoP(T).
>     >> # The PoP is sent to the destination in 1.ii.
>     >> # The server receiving the PoP validates it and responds with
>     =93valid=94 or
>     >> =93invalid=94.
>     >> # The wallet displays the response in some way to the user.
>     >>
>     >> '''Remarks:'''
>     >>
>     >> * The method of transferring the PoP request at step 1 is not
>     specified
>     >> here. Instead that is specified in separate specifications. See
>     [btcpop
>     >> scheme BIP](btcpop scheme BIP).
>     >> * The nonce must be randomly generated by the server for every
>     new PoP
>     >> request.
>     >>
>     >> =3D=3D=3D Validating a PoP =3D=3D=3D
>     >>
>     >> The server needs to validate the PoP and reply with "valid" or
>     "invalid".
>     >> That process is outlined below. If any step fails, the
>     validation is aborted
>     >> and "invalid" is returned:
>     >>
>     >> # Check the format of the PoP. It must pass normal transaction
>     checks,
>     >> except that the inputs may already be spent.
>     >> # Check that lock_time is 499999999.
>     >> # Check that there is exactly one output. This output must have
>     value 0
>     >> and conform to the OP_RETURN output format outlined above.
>     >> # Check that the nonce is the same as the one requested.
>     >> # Check that the inputs of the PoP are exactly the same as in
>     transaction
>     >> T, except that the sequence numbers must all be 0. The ordering
>     of the
>     >> inputs must also be the same as in T.
>     >> # Run the scripts of all the inputs. All scipts must return true=
=2E
>     >> # Check that the txid in the PoP output is the transaction you
>     actually
>     >> want proof for. If you don=92t know exactly what transaction you=

>     want proof
>     >> for, check that the transaction actually pays for the
>     product/service you
>     >> deliver.
>     >> # Return "valid".
>     >>
>     >> =3D=3D Security considerations =3D=3D
>     >>
>     >> * Someone can intercept the PoP-request and change any
>     parameter in it.
>     >> These can be mitigated by using secure connections. For example:=

>     >> ** Pop destination - Stealing your PoP.
>     >> ** label - Trick you to sign an unintended pop or set a label
>     that your
>     >> wallet doesn't have any record for, resulting in a broken
>     service. Always
>     >> check the PoP before signing.
>     >> ** nonce - Your pop will not validate on server.
>     >> * Someone can steal a PoP, for example by tampering with the
>     PoP request,
>     >> and try to use the service hoping to get a matching nonce.
>     Probability per
>     >> try: 1/(2^48). The server should have a mechanism for detecting
>     a brute
>     >> force attack of this kind, or at least slow down the process by
>     delaying the
>     >> PoP request by some 100 ms or so.
>     >> * Even if a wallet has no funds it might still be valuable as a
>     generator
>     >> for PoPs. This makes it important to keep the security of the
>     wallet after
>     >> it has been emptied.
>     >> * Transaction malleability may cause the server to have another
>     >> transaction id for a payment than the client's wallet. In that
>     case the
>     >> wallet will not be able to prove the transaction to the server.
>     Wallets
>     >> should not rely on the transaction id of the outgoing
>     transaction. Instead
>     >> it should listen for the transaction on the network and put
>     that in its list
>     >> of transactions.
>     >>
>     >> =3D=3D Reference implementation =3D=3D
>     >>
>     >> [https://github.com/kallerosenbaum/poppoc poppoc on GitHub]
>     >>
>     >> [https://github.com/kallerosenbaum/wallet Mycelium fork on GitHu=
b]
>     >>
>     >> =3D=3D References =3D=3D
>     >>
>     >> [https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki
>     BIP0021]:
>     >> URI Scheme
>     >>
>     >> [https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki
>     BIP0070]:
>     >> Payment Protocol
>     >>
>     >> [[btcpop scheme BIP]]
>     >>
>     >> #########################################################
>     >>
>     >> 2015-06-06 23:25 GMT+02:00 Kalle Rosenbaum <kalle@rosenbaum.se
>     <mailto:kalle@rosenbaum.se>>:
>     >> > Thank you all for the feedback.
>     >> >
>     >> > I will change the data structure as follows:
>     >> >
>     >> > * There will be only one output, the "pop output", and no
>     outputs from
>     >> > T will be copied to the PoP.
>     >> > * The pop output will have value 0.
>     >> > * The sequence number of all inputs of the PoP will be set to
>     0. I
>     >> > chose to set it to 0 for all inputs for simplicity.
>     >> > * The lock_time of the PoP is always set to 499999999.
>     >> >
>     >> > Any comments on this?
>     >> >
>     >> > /Kalle
>     >> >
>     >> > 2015-06-06 19:00 GMT+02:00 Kalle Rosenbaum
>     <kalle@rosenbaum.se <mailto:kalle@rosenbaum.se>>:
>     >> >> 2015-06-06 18:10 GMT+02:00 Tom Harding <tomh@thinlink.com
>     <mailto:tomh@thinlink.com>>:
>     >> >>> On Jun 6, 2015 8:05 AM, "Kalle Rosenbaum"
>     <kalle@rosenbaum.se <mailto:kalle@rosenbaum.se>> wrote:
>     >> >>>
>     >> >>>> I'm open to changes here.
>     >> >>>
>     >> >>> I suggest:
>     >> >>>
>     >> >>> - Don't include any real outputs.   They are redundant
>     because the
>     >> >>> txid is
>     >> >>> already referenced.
>     >> >>
>     >> >> with the nLocktime solution, the copied outputs are not neede=
d.
>     >> >>
>     >> >>>
>     >> >>> - Start the proof script, which should be invalid, with a ma=
gic
>     >> >>> constant and
>     >> >>> include space for future expansion.  This makes PoP's easy
>     to identify
>     >> >>> and
>     >> >>> extend.
>     >> >>
>     >> >> I did remore the constant (a "PoP" literal ascii encoded stri=
ng)
>     >> >> because it didn't add much. The recipient will expect a pop,
>     so it
>     >> >> will simply treat it as one. I did add a 2 byte version
>     field to make
>     >> >> it extendable.
>     >> >>
>     >> >>>
>     >> >>> - "Proof of Potential"
>     >> >>
>     >> >> Noted :-)
>     >> >>
>     >> >> Thank you
>     >> >> /Kalle
>     >>
>     >>
>     >>
>     -------------------------------------------------------------------=
-----------
>     >>
>     >> _______________________________________________
>     >> Bitcoin-development mailing list
>     >> Bitcoin-development@lists.sourceforge.net
>     <mailto:Bitcoin-development@lists.sourceforge.net>
>     >> https://lists.sourceforge.net/lists/listinfo/bitcoin-development=

>     >>
>     >
>
>
>
> -----------------------------------------------------------------------=
-------
>
>
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development


--------------030802010103000105080504
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    Shared wallets were discussed earlier as a feature.  If you pay a
    for dry cleaning with a shared wallet, a different 1-of-N signer can
    pick up the clothes with no physical transfer of a claim check, by
    proving the money that paid for the cleaning was his.<br>
    <br>
    Many kinds of vouchers can be eliminated, because the money itself
    can be vouched for, wirelessly, with ECDSA security.  A PoP would be
    much more difficult to forge as a valet claim check, to steal a car.<br>
    <br>
    Something like your coffee gift example was also mentioned.  The
    buyer could export the private keys to your (the beneficiary's)
    wallet after the purchase, by using an 'export gift claim check'
    function on the spent transaction.  Then you pick up the coffee
    (car, concert seats...) just as if you had paid.<br>
    <br>
    Kalle goes to some trouble to describe how merchants need to ensure
    that they only accept a PoP provided as a response to their
    challenge.<br>
    <br>
    Coinjoin or simulfunding transactions wouldn't be PoP-able (nor
    should they be) since no one signer has all the private keys.<br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 6/15/2015 3:00 AM, Pieter Wuille
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAPg+sBhuth22+vAHyS2iwpze8X=-b2wJQ5s1z2FhZ1jsLXobgQ@mail.gmail.com"
      type="cite">
      <p dir="ltr">I did misunderstand that. That changes things
        significantly.</p>
      <p dir="ltr">However, having paid is not the same as having had
        access to the input coins. What about shared wallets or
        coinjoin?</p>
      <p dir="ltr">Also, if I understand correctly, there is no
        commitment to anything you're trying to say about the sender? So
        once I obtain a proof-of-payment from you about something you
        paid, I can go claim that it's mine?</p>
      <p dir="ltr">Why does anyone care who paid? This is like walking
        into a coffeshop, noticing I don't have money with me, let me
        friend pay for me, and then have the shop insist that I can't
        drink it because I'm not the buyer.</p>
      <p dir="ltr">Track payments, don't try to assign identities to
        payers.</p>
      <div class="gmail_quote">On Jun 15, 2015 11:35 AM, "Kalle
        Rosenbaum" &lt;<a moz-do-not-send="true"
          href="mailto:kalle@rosenbaum.se">kalle@rosenbaum.se</a>&gt;
        wrote:<br type="attribution">
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Pieter!<br>
          <br>
          It is intended to be a proof that you *have paid* for
          something. Not<br>
          that you have the intent to pay for something. You cannot use
          PoP<br>
          without a transaction to prove.<br>
          <br>
          So, yes, it's just a proof of access to certain coins that you
          no longer have.<br>
          <br>
          Maybe I don't understand you correctly?<br>
          <br>
          /Kalle<br>
          <br>
          2015-06-15 11:27 GMT+02:00 Pieter Wuille &lt;<a
            moz-do-not-send="true" href="mailto:pieter.wuille@gmail.com">pieter.wuille@gmail.com</a>&gt;:<br>
          &gt; Now that you have removed the outputs, I don't think it's
          even a intent of<br>
          &gt; payment, but just a proof of access to certain coins.<br>
          &gt;<br>
          &gt; On Jun 15, 2015 11:24 AM, "Kalle Rosenbaum" &lt;<a
            moz-do-not-send="true" href="mailto:kalle@rosenbaum.se">kalle@rosenbaum.se</a>&gt;
          wrote:<br>
          &gt;&gt;<br>
          &gt;&gt; Hi all!<br>
          &gt;&gt;<br>
          &gt;&gt; I have made the discussed changes and updated my
          implementation<br>
          &gt;&gt; (<a moz-do-not-send="true"
            href="https://github.com/kallerosenbaum/poppoc"
            rel="noreferrer" target="_blank">https://github.com/kallerosenbaum/poppoc</a>)
          accordingly. These are the<br>
          &gt;&gt; changes:<br>
          &gt;&gt;<br>
          &gt;&gt; * There is now only one output, the "pop output", of
          value 0.<br>
          &gt;&gt; * The sequence number of all inputs of the PoP must
          be set to 0. I<br>
          &gt;&gt; chose to set it to 0 for all inputs for simplicity.<br>
          &gt;&gt; * The lock_time of the PoP must be set to 499999999
          (max block height lock<br>
          &gt;&gt; time).<br>
          &gt;&gt;<br>
          &gt;&gt; The comments so far has been mainly positive or
          neutral. Are there any<br>
          &gt;&gt; major objections against any of the two proposals? If
          not, I will ask<br>
          &gt;&gt; Gregory Maxwell to assign them BIP numbers.<br>
          &gt;&gt;<br>
          &gt;&gt; The two BIP proposals can be found at<br>
          &gt;&gt; <a moz-do-not-send="true"
href="https://github.com/kallerosenbaum/poppoc/wiki/Proof-of-Payment-BIP"
            rel="noreferrer" target="_blank">https://github.com/kallerosenbaum/poppoc/wiki/Proof-of-Payment-BIP</a>
          and<br>
          &gt;&gt; <a moz-do-not-send="true"
            href="https://github.com/kallerosenbaum/poppoc/wiki/btcpop-scheme-BIP"
            rel="noreferrer" target="_blank">https://github.com/kallerosenbaum/poppoc/wiki/btcpop-scheme-BIP</a>.
          The source<br>
          &gt;&gt; for the Proof of Payment BIP proposal is also
          in-lined below.<br>
          &gt;&gt;<br>
          &gt;&gt; A number of alternative names have been proposed:<br>
          &gt;&gt;<br>
          &gt;&gt; * Proof of Potential<br>
          &gt;&gt; * Proof of Control<br>
          &gt;&gt; * Proof of Signature<br>
          &gt;&gt; * Signatory Proof<br>
          &gt;&gt; * Popo: Proof of payment origin<br>
          &gt;&gt; * Pots: Proof of transaction signer<br>
          &gt;&gt; * proof of transaction intent<br>
          &gt;&gt; * Declaration of intent<br>
          &gt;&gt; * Asset-access-and-action-affirmation, AAaAA, or A5<br>
          &gt;&gt; * VeriBit<br>
          &gt;&gt; * CertiBTC<br>
          &gt;&gt; * VBit<br>
          &gt;&gt; * PayID<br>
          &gt;&gt;<br>
          &gt;&gt; Given this list, I still think "Proof of Payment" is
          the most descriptive<br>
          &gt;&gt; to non-technical people.<br>
          &gt;&gt;<br>
          &gt;&gt; Regards,<br>
          &gt;&gt; Kalle<br>
          &gt;&gt;<br>
          &gt;&gt;<br>
          &gt;&gt; #################################################<br>
          &gt;&gt; &lt;pre&gt;<br>
          &gt;&gt;   BIP: &lt;BIP number&gt;<br>
          &gt;&gt;   Title: Proof of Payment<br>
          &gt;&gt;   Author: Kalle Rosenbaum &lt;<a
            moz-do-not-send="true" href="mailto:kalle@rosenbaum.se">kalle@rosenbaum.se</a>&gt;<br>
          &gt;&gt;   Status: Draft<br>
          &gt;&gt;   Type: Standards Track<br>
          &gt;&gt;   Created: &lt;date created on, in ISO 8601
          (yyyy-mm-dd) format&gt;<br>
          &gt;&gt; &lt;/pre&gt;<br>
          &gt;&gt;<br>
          &gt;&gt; == Abstract ==<br>
          &gt;&gt;<br>
          &gt;&gt; This BIP describes how a wallet can prove to a server
          that it has the<br>
          &gt;&gt; ability to sign a certain transaction.<br>
          &gt;&gt;<br>
          &gt;&gt; == Motivation ==<br>
          &gt;&gt;<br>
          &gt;&gt; There are several scenarios in which it would be
          useful to prove that you<br>
          &gt;&gt; have paid for something. For example:<br>
          &gt;&gt;<br>
          &gt;&gt; * A pre-paid hotel room where your PoP functions as a
          key to the door.<br>
          &gt;&gt; * An online video rental service where you pay for a
          video and watch it on<br>
          &gt;&gt; any device.<br>
          &gt;&gt; * An ad-sign where you pay in advance for e.g. 2
          weeks exclusivity. During<br>
          &gt;&gt; this period you can upload new content to the sign
          whenever you like using<br>
          &gt;&gt; PoP.<br>
          &gt;&gt; * Log in to a pay site using a PoP.<br>
          &gt;&gt; * A parking lot you pay for monthly and the car
          authenticates itself using<br>
          &gt;&gt; PoP.<br>
          &gt;&gt; * A lottery where all participants pay to the same
          address, and the winner<br>
          &gt;&gt; is selected among the transactions to that address.
          You exchange the prize<br>
          &gt;&gt; for a PoP for the winning transaction.<br>
          &gt;&gt;<br>
          &gt;&gt; With Proof of Payment, these use cases can be
          achieved without any<br>
          &gt;&gt; personal information (user name, password, e-mail
          address, etc) being<br>
          &gt;&gt; involved.<br>
          &gt;&gt;<br>
          &gt;&gt; == Rationale ==<br>
          &gt;&gt;<br>
          &gt;&gt; Desirable properties:<br>
          &gt;&gt;<br>
          &gt;&gt; # A PoP should be generated on demand.<br>
          &gt;&gt; # It should only be usable once to avoid issues due
          to theft.<br>
          &gt;&gt; # It should be able to create a PoP for any payment,
          regardless of script<br>
          &gt;&gt; type (P2SH, P2PKH, etc.).<br>
          &gt;&gt; # It should prove that you have enough credentials to
          unlock all the<br>
          &gt;&gt; inputs of the proven transaction.<br>
          &gt;&gt; # It should be easy to implement by wallets and
          servers to ease adoption.<br>
          &gt;&gt;<br>
          &gt;&gt; Current methods of proving a payment:<br>
          &gt;&gt;<br>
          &gt;&gt; * In BIP0070, the PaymentRequest together with the
          transactions fulfilling<br>
          &gt;&gt; the request makes some sort of proof. However, it
          does not meet 1, 2 or 4<br>
          &gt;&gt; and it obviously only meets 3 if the payment is made
          through BIP0070. Also,<br>
          &gt;&gt; there's no standard way to request/provide the proof.
          If standardized it<br>
          &gt;&gt; would probably meet 5.<br>
          &gt;&gt; * Signing messages, chosen by the server, with the
          private keys used to<br>
          &gt;&gt; sign the transaction. This could meet 1 and 2 but
          probably not 3. This is<br>
          &gt;&gt; not standardized either. 4 Could be met if designed
          so.<br>
          &gt;&gt;<br>
          &gt;&gt; If an input script type is P2SH, any satisfying
          script should do, just as<br>
          &gt;&gt; if it was a payment. For M-of-N multisig scripts,
          that would mean that any<br>
          &gt;&gt; set of M keys should be sufficient, not neccesarily
          the same set of M keys<br>
          &gt;&gt; that signed the transaction. This is important
          because strictly demanding<br>
          &gt;&gt; the same set of M keys would defeat the purpose of a
          multisig address.<br>
          &gt;&gt;<br>
          &gt;&gt; == Specification ==<br>
          &gt;&gt;<br>
          &gt;&gt; === Data structure ===<br>
          &gt;&gt;<br>
          &gt;&gt; A proof of payment for a transaction T, here called
          PoP(T), is used to<br>
          &gt;&gt; prove that one has ownership of the credentials
          needed to unlock all the<br>
          &gt;&gt; inputs of T. It has the exact same structure as a
          bitcoin transaction with<br>
          &gt;&gt; the same inputs as T and in the same order as in T,
          but with each sequence<br>
          &gt;&gt; number set to 0. There is exactly one output, here
          called the pop output,<br>
          &gt;&gt; with value 0. The pop output must have the following
          format:<br>
          &gt;&gt;<br>
          &gt;&gt;  OP_RETURN &lt;version&gt; &lt;txid&gt; &lt;nonce&gt;<br>
          &gt;&gt;<br>
          &gt;&gt; {|<br>
          &gt;&gt; ! Field        !! Size [B] !! Description<br>
          &gt;&gt; |-<br>
          &gt;&gt; | &amp;lt;version&gt; || 2        || Version, little
          endian, currently 0x01 0x00<br>
          &gt;&gt; |-<br>
          &gt;&gt; | &amp;lt;txid&gt;    || 32       || The transaction
          to prove<br>
          &gt;&gt; |-<br>
          &gt;&gt; | &amp;lt;nonce&gt;   || 6        || Random data<br>
          &gt;&gt; |}<br>
          &gt;&gt;<br>
          &gt;&gt; The lock_time of the PoP must be set to 499999999 to
          prevent the PoP from<br>
          &gt;&gt; being included in a block, should it appear on the
          bitcoin p2p network. This<br>
          &gt;&gt; is also the reason for setting the sequence numbers
          to 0, since sequence<br>
          &gt;&gt; number of ffffffff would make lock_time ineffective.
          This specification<br>
          &gt;&gt; demands that all input sequence numbers are 0, not
          just one of them, which<br>
          &gt;&gt; would be sufficient to make lock_time effective. This
          is for simplicity<br>
          &gt;&gt; reasons.<br>
          &gt;&gt;<br>
          &gt;&gt; An illustration of the PoP data structure and its
          original payment is<br>
          &gt;&gt; shown below.<br>
          &gt;&gt;<br>
          &gt;&gt; &lt;pre&gt;<br>
          &gt;&gt;   T<br>
          &gt;&gt;  +------------------------------------------------+<br>
          &gt;&gt;  |inputs                | outputs                 |<br>
          &gt;&gt;  |       Value,Sequence | Value,Script            |<br>
          &gt;&gt;  +------------------------------------------------+<br>
          &gt;&gt;  |input0 1,ffffffff     | 0,pay to A              |<br>
          &gt;&gt;  |input1 3,ffffffff     | 2,OP_RETURN &lt;some
          data&gt; |<br>
          &gt;&gt;  |input2 4,ffffffff     | 1,pay to B              |<br>
          &gt;&gt;  |                      | 4,pay to C              |<br>
          &gt;&gt;  +------------------------------------------------+<br>
          &gt;&gt;<br>
          &gt;&gt;   PoP(T)<br>
          &gt;&gt; 
          +-------------------------------------------------------------+<br>
          &gt;&gt;  | inputs               | outputs                   
                    |<br>
          &gt;&gt;  |       Value,Sequence | Value,Script               
                   |<br>
          &gt;&gt; 
          +-------------------------------------------------------------+<br>
          &gt;&gt;  |input0 1,00000000     | 0,OP_RETURN &lt;version&gt;
          &lt;txid&gt; &lt;nonce&gt; |<br>
          &gt;&gt;  |input1 3,00000000     |                           
                    |<br>
          &gt;&gt;  |input2 4,00000000     |                           
                    |<br>
          &gt;&gt; 
          +-------------------------------------------------------------+<br>
          &gt;&gt;  | lock_time=499999999                               
                   |<br>
          &gt;&gt; 
          +-------------------------------------------------------------+<br>
          &gt;&gt; &lt;/pre&gt;<br>
          &gt;&gt;<br>
          &gt;&gt; The PoP is signed using the same signing process that
          is used for bitcoin<br>
          &gt;&gt; transactions.<br>
          &gt;&gt;<br>
          &gt;&gt; The purpose of the nonce is to make it harder to use
          a stolen PoP; Once<br>
          &gt;&gt; the PoP has reached the server, that PoP is useless
          since the server will<br>
          &gt;&gt; generate a new nonce for every PoP request.<br>
          &gt;&gt;<br>
          &gt;&gt; === Process ===<br>
          &gt;&gt;<br>
          &gt;&gt; # A proof of payment request is sent from the server
          to the wallet. The<br>
          &gt;&gt; PoP request contains:<br>
          &gt;&gt; ## a random nonce<br>
          &gt;&gt; ## a destination where to send the PoP, for example a
          https URL<br>
          &gt;&gt; ## data hinting the wallet which transaction to
          create a proof for. For<br>
          &gt;&gt; example:<br>
          &gt;&gt; ##* txid, if known by the server<br>
          &gt;&gt; ##* PaymentRequest.PaymentDetails.merchant_data (in
          case of a BIP0070<br>
          &gt;&gt; payment)<br>
          &gt;&gt; ##* amount, label, message or other information from
          a BIP0021 URI<br>
          &gt;&gt; # The wallet identifies a transaction T, if possible.
          Otherwise it asks<br>
          &gt;&gt; the user to select among the ones that match the
          hints in 1.iii.<br>
          &gt;&gt; # The wallet creates an unsigned PoP (UPoP) for T,
          and asks the user to<br>
          &gt;&gt; sign it.<br>
          &gt;&gt; # The user confirms<br>
          &gt;&gt; # The UPoP(T) is signed by the wallet, creating
          PoP(T).<br>
          &gt;&gt; # The PoP is sent to the destination in 1.ii.<br>
          &gt;&gt; # The server receiving the PoP validates it and
          responds with “valid” or<br>
          &gt;&gt; “invalid”.<br>
          &gt;&gt; # The wallet displays the response in some way to the
          user.<br>
          &gt;&gt;<br>
          &gt;&gt; '''Remarks:'''<br>
          &gt;&gt;<br>
          &gt;&gt; * The method of transferring the PoP request at step
          1 is not specified<br>
          &gt;&gt; here. Instead that is specified in separate
          specifications. See [btcpop<br>
          &gt;&gt; scheme BIP](btcpop scheme BIP).<br>
          &gt;&gt; * The nonce must be randomly generated by the server
          for every new PoP<br>
          &gt;&gt; request.<br>
          &gt;&gt;<br>
          &gt;&gt; === Validating a PoP ===<br>
          &gt;&gt;<br>
          &gt;&gt; The server needs to validate the PoP and reply with
          "valid" or "invalid".<br>
          &gt;&gt; That process is outlined below. If any step fails,
          the validation is aborted<br>
          &gt;&gt; and "invalid" is returned:<br>
          &gt;&gt;<br>
          &gt;&gt; # Check the format of the PoP. It must pass normal
          transaction checks,<br>
          &gt;&gt; except that the inputs may already be spent.<br>
          &gt;&gt; # Check that lock_time is 499999999.<br>
          &gt;&gt; # Check that there is exactly one output. This output
          must have value 0<br>
          &gt;&gt; and conform to the OP_RETURN output format outlined
          above.<br>
          &gt;&gt; # Check that the nonce is the same as the one
          requested.<br>
          &gt;&gt; # Check that the inputs of the PoP are exactly the
          same as in transaction<br>
          &gt;&gt; T, except that the sequence numbers must all be 0.
          The ordering of the<br>
          &gt;&gt; inputs must also be the same as in T.<br>
          &gt;&gt; # Run the scripts of all the inputs. All scipts must
          return true.<br>
          &gt;&gt; # Check that the txid in the PoP output is the
          transaction you actually<br>
          &gt;&gt; want proof for. If you don’t know exactly what
          transaction you want proof<br>
          &gt;&gt; for, check that the transaction actually pays for the
          product/service you<br>
          &gt;&gt; deliver.<br>
          &gt;&gt; # Return "valid".<br>
          &gt;&gt;<br>
          &gt;&gt; == Security considerations ==<br>
          &gt;&gt;<br>
          &gt;&gt; * Someone can intercept the PoP-request and change
          any parameter in it.<br>
          &gt;&gt; These can be mitigated by using secure connections.
          For example:<br>
          &gt;&gt; ** Pop destination - Stealing your PoP.<br>
          &gt;&gt; ** label - Trick you to sign an unintended pop or set
          a label that your<br>
          &gt;&gt; wallet doesn't have any record for, resulting in a
          broken service. Always<br>
          &gt;&gt; check the PoP before signing.<br>
          &gt;&gt; ** nonce - Your pop will not validate on server.<br>
          &gt;&gt; * Someone can steal a PoP, for example by tampering
          with the PoP request,<br>
          &gt;&gt; and try to use the service hoping to get a matching
          nonce. Probability per<br>
          &gt;&gt; try: 1/(2^48). The server should have a mechanism for
          detecting a brute<br>
          &gt;&gt; force attack of this kind, or at least slow down the
          process by delaying the<br>
          &gt;&gt; PoP request by some 100 ms or so.<br>
          &gt;&gt; * Even if a wallet has no funds it might still be
          valuable as a generator<br>
          &gt;&gt; for PoPs. This makes it important to keep the
          security of the wallet after<br>
          &gt;&gt; it has been emptied.<br>
          &gt;&gt; * Transaction malleability may cause the server to
          have another<br>
          &gt;&gt; transaction id for a payment than the client's
          wallet. In that case the<br>
          &gt;&gt; wallet will not be able to prove the transaction to
          the server. Wallets<br>
          &gt;&gt; should not rely on the transaction id of the outgoing
          transaction. Instead<br>
          &gt;&gt; it should listen for the transaction on the network
          and put that in its list<br>
          &gt;&gt; of transactions.<br>
          &gt;&gt;<br>
          &gt;&gt; == Reference implementation ==<br>
          &gt;&gt;<br>
          &gt;&gt; [<a moz-do-not-send="true"
            href="https://github.com/kallerosenbaum/poppoc"
            rel="noreferrer" target="_blank">https://github.com/kallerosenbaum/poppoc</a>
          poppoc on GitHub]<br>
          &gt;&gt;<br>
          &gt;&gt; [<a moz-do-not-send="true"
            href="https://github.com/kallerosenbaum/wallet"
            rel="noreferrer" target="_blank">https://github.com/kallerosenbaum/wallet</a>
          Mycelium fork on GitHub]<br>
          &gt;&gt;<br>
          &gt;&gt; == References ==<br>
          &gt;&gt;<br>
          &gt;&gt; [<a moz-do-not-send="true"
            href="https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki"
            rel="noreferrer" target="_blank">https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki</a>
          BIP0021]:<br>
          &gt;&gt; URI Scheme<br>
          &gt;&gt;<br>
          &gt;&gt; [<a moz-do-not-send="true"
            href="https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki"
            rel="noreferrer" target="_blank">https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki</a>
          BIP0070]:<br>
          &gt;&gt; Payment Protocol<br>
          &gt;&gt;<br>
          &gt;&gt; [[btcpop scheme BIP]]<br>
          &gt;&gt;<br>
          &gt;&gt;
          #########################################################<br>
          &gt;&gt;<br>
          &gt;&gt; 2015-06-06 23:25 GMT+02:00 Kalle Rosenbaum &lt;<a
            moz-do-not-send="true" href="mailto:kalle@rosenbaum.se">kalle@rosenbaum.se</a>&gt;:<br>
          &gt;&gt; &gt; Thank you all for the feedback.<br>
          &gt;&gt; &gt;<br>
          &gt;&gt; &gt; I will change the data structure as follows:<br>
          &gt;&gt; &gt;<br>
          &gt;&gt; &gt; * There will be only one output, the "pop
          output", and no outputs from<br>
          &gt;&gt; &gt; T will be copied to the PoP.<br>
          &gt;&gt; &gt; * The pop output will have value 0.<br>
          &gt;&gt; &gt; * The sequence number of all inputs of the PoP
          will be set to 0. I<br>
          &gt;&gt; &gt; chose to set it to 0 for all inputs for
          simplicity.<br>
          &gt;&gt; &gt; * The lock_time of the PoP is always set to
          499999999.<br>
          &gt;&gt; &gt;<br>
          &gt;&gt; &gt; Any comments on this?<br>
          &gt;&gt; &gt;<br>
          &gt;&gt; &gt; /Kalle<br>
          &gt;&gt; &gt;<br>
          &gt;&gt; &gt; 2015-06-06 19:00 GMT+02:00 Kalle Rosenbaum &lt;<a
            moz-do-not-send="true" href="mailto:kalle@rosenbaum.se">kalle@rosenbaum.se</a>&gt;:<br>
          &gt;&gt; &gt;&gt; 2015-06-06 18:10 GMT+02:00 Tom Harding &lt;<a
            moz-do-not-send="true" href="mailto:tomh@thinlink.com">tomh@thinlink.com</a>&gt;:<br>
          &gt;&gt; &gt;&gt;&gt; On Jun 6, 2015 8:05 AM, "Kalle
          Rosenbaum" &lt;<a moz-do-not-send="true"
            href="mailto:kalle@rosenbaum.se">kalle@rosenbaum.se</a>&gt;
          wrote:<br>
          &gt;&gt; &gt;&gt;&gt;<br>
          &gt;&gt; &gt;&gt;&gt;&gt; I'm open to changes here.<br>
          &gt;&gt; &gt;&gt;&gt;<br>
          &gt;&gt; &gt;&gt;&gt; I suggest:<br>
          &gt;&gt; &gt;&gt;&gt;<br>
          &gt;&gt; &gt;&gt;&gt; - Don't include any real outputs.   They
          are redundant because the<br>
          &gt;&gt; &gt;&gt;&gt; txid is<br>
          &gt;&gt; &gt;&gt;&gt; already referenced.<br>
          &gt;&gt; &gt;&gt;<br>
          &gt;&gt; &gt;&gt; with the nLocktime solution, the copied
          outputs are not needed.<br>
          &gt;&gt; &gt;&gt;<br>
          &gt;&gt; &gt;&gt;&gt;<br>
          &gt;&gt; &gt;&gt;&gt; - Start the proof script, which should
          be invalid, with a magic<br>
          &gt;&gt; &gt;&gt;&gt; constant and<br>
          &gt;&gt; &gt;&gt;&gt; include space for future expansion. 
          This makes PoP's easy to identify<br>
          &gt;&gt; &gt;&gt;&gt; and<br>
          &gt;&gt; &gt;&gt;&gt; extend.<br>
          &gt;&gt; &gt;&gt;<br>
          &gt;&gt; &gt;&gt; I did remore the constant (a "PoP" literal
          ascii encoded string)<br>
          &gt;&gt; &gt;&gt; because it didn't add much. The recipient
          will expect a pop, so it<br>
          &gt;&gt; &gt;&gt; will simply treat it as one. I did add a 2
          byte version field to make<br>
          &gt;&gt; &gt;&gt; it extendable.<br>
          &gt;&gt; &gt;&gt;<br>
          &gt;&gt; &gt;&gt;&gt;<br>
          &gt;&gt; &gt;&gt;&gt; - "Proof of Potential"<br>
          &gt;&gt; &gt;&gt;<br>
          &gt;&gt; &gt;&gt; Noted :-)<br>
          &gt;&gt; &gt;&gt;<br>
          &gt;&gt; &gt;&gt; Thank you<br>
          &gt;&gt; &gt;&gt; /Kalle<br>
          &gt;&gt;<br>
          &gt;&gt;<br>
          &gt;&gt;
------------------------------------------------------------------------------<br>
          &gt;&gt;<br>
          &gt;&gt; _______________________________________________<br>
          &gt;&gt; Bitcoin-development mailing list<br>
          &gt;&gt; <a moz-do-not-send="true"
            href="mailto:Bitcoin-development@lists.sourceforge.net">Bitcoin-development@lists.sourceforge.net</a><br>
          &gt;&gt; <a moz-do-not-send="true"
            href="https://lists.sourceforge.net/lists/listinfo/bitcoin-development"
            rel="noreferrer" target="_blank">https://lists.sourceforge.net/lists/listinfo/bitcoin-development</a><br>
          &gt;&gt;<br>
          &gt;<br>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">------------------------------------------------------------------------------
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Bitcoin-development mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Bitcoin-development@lists.sourceforge.net">Bitcoin-development@lists.sourceforge.net</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/bitcoin-development">https://lists.sourceforge.net/lists/listinfo/bitcoin-development</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>

--------------030802010103000105080504--