summaryrefslogtreecommitdiff
path: root/58/c0c9c68b4053b3f95d291d9763360497f89ce2
blob: 1b44955bfde68c2c29ce4f3742ecbd2f2687d176 (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
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 <kgreenek@gmail.com>) id 1WDTNI-0008NM-Kn
	for bitcoin-development@lists.sourceforge.net;
	Wed, 12 Feb 2014 06:32:48 +0000
Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of gmail.com
	designates 209.85.160.178 as permitted sender)
	client-ip=209.85.160.178; envelope-from=kgreenek@gmail.com;
	helo=mail-yk0-f178.google.com; 
Received: from mail-yk0-f178.google.com ([209.85.160.178])
	by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128)
	(Exim 4.76) id 1WDTND-0008Cn-T6
	for bitcoin-development@lists.sourceforge.net;
	Wed, 12 Feb 2014 06:32:48 +0000
Received: by mail-yk0-f178.google.com with SMTP id 79so14130988ykr.9
	for <bitcoin-development@lists.sourceforge.net>;
	Tue, 11 Feb 2014 22:32:38 -0800 (PST)
X-Received: by 10.236.114.71 with SMTP id b47mr27197462yhh.42.1392186758464;
	Tue, 11 Feb 2014 22:32:38 -0800 (PST)
MIME-Version: 1.0
Received: by 10.170.94.66 with HTTP; Tue, 11 Feb 2014 22:32:18 -0800 (PST)
In-Reply-To: <EAEC76DA-A490-4A61-BFB7-611D4ADF1680@kill-bill.org>
References: <E1FDB3F2-25ED-4B99-979E-12CE943CBD66@kill-bill.org>
	<CANEZrP10z6_UAHD97mj22kVEGyXgHPQ2PdP_8RxHT5Py+xRP_A@mail.gmail.com>
	<D6BCC0C4-EF22-4DE8-868E-825D19C387E3@kill-bill.org>
	<CANEZrP0FzTGmp1zbaW1VHJLk5117ZnTSehfF4uMX=+UFS+R_Dw@mail.gmail.com>
	<0CC0BE1D-1DAA-4994-B034-EB7712F845CF@kill-bill.org>
	<DBA255DB-4839-4C3A-BA62-BD3926995C12@kill-bill.org>
	<CAEY8wq6F33814d2+97AqDoAicvh=0PigHZ03wHadMq6JqtQMLg@mail.gmail.com>
	<EAEC76DA-A490-4A61-BFB7-611D4ADF1680@kill-bill.org>
From: Kevin Greene <kgreenek@gmail.com>
Date: Tue, 11 Feb 2014 22:32:18 -0800
Message-ID: <CAEY8wq5=pAMTqDPM8yeCF+Z2=1GWmD0UDQdgacN1o3jAUh_BYA@mail.gmail.com>
To: Stephane Brossier <stephane@kill-bill.org>
Content-Type: multipart/alternative; boundary=20cf301af7fd330baf04f22fbd37
X-Spam-Score: -0.6 (/)
X-Spam-Report: Spam Filtering performed by mx.sourceforge.net.
	See http://spamassassin.org/tag/ for more details.
	-1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for
	sender-domain
	0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
	(kgreenek[at]gmail.com)
	-0.0 SPF_PASS               SPF: sender matches SPF record
	1.0 HTML_MESSAGE           BODY: HTML included in message
	-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
	author's domain
	0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
	not necessarily valid
	-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
X-Headers-End: 1WDTND-0008Cn-T6
X-Mailman-Approved-At: Wed, 12 Feb 2014 16:36:19 +0000
Cc: Pierre-Alexandre Meyer <pierre@kill-bill.org>,
	Bitcoin Dev <bitcoin-development@lists.sourceforge.net>
Subject: Re: [Bitcoin-development] Extension for BIP-0070 to support
	recurring payments
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: Wed, 12 Feb 2014 06:32:48 -0000

--20cf301af7fd330baf04f22fbd37
Content-Type: text/plain; charset=ISO-8859-1

Thanks for humoring my questions!

>I think reporting such errors to the wallet would make complete sense.
However i am not clear why we would a separate url for that?

Hmm, thinking about this more, adding a simple status_code in
PaymentRequest would be a much easier way to achieve this. However,
continuing to think about this even more, maybe the simple memo field along
with an empty set of outputs is enough already.

In bitcoinj, right now the code will throw a
PaymentRequestException.InvalidOutputs exception if the set of outputs is
empty with a message of "No Outputs". There isn't a good way to tell the
difference between a payment request that had no outputs and a payment
request that had some invalid output(s).

*Question to everyone:*
How does bitcoin-qt handle a PaymentRequest with no outputs?



On Tue, Feb 11, 2014 at 10:01 AM, Stephane Brossier
<stephane@kill-bill.org>wrote:

> Hi Kevin,
>
> On Feb 11, 2014, at 2:00 AM, Kevin Greene <kgreenek@gmail.com> wrote:
>
> Figured I would have a crack at reviewing this since Mike is out for a
> bit. It was great running into you guys at the bitcoin fair in SF! Small
> world :)
>
>
> Indeed! It was great meeting you! It's always nice to meet people in
> person...
>
> I like how simple this is. You just give it an url to fetch the next
> payment request and a date to fetch it.
>
> What should happen if the client tries to fetch the PaymentRequest early
> or late?
>
>
> If the client tries to fetch too early, then  the merchant will return a
> PaymentRequest with no output (there is nothing to pay yet). If it fetches
> too late, this is merchant specific. It could be that the service got
> discontinued -- extreme case -- or that there are now multiple
> PaymentRequest pending or that the merchant decided to aggregate those into
> one. In that scenario, it could lead to a case where the amount to pay goes
> beyond the contract and the wallet would refuse to make the recurring
> payment.
>
> Does it become valid after some date and stay valid for some length of
> time?
>
>
> The protocol we sketched does not include (yet) an expiration date. At
> this point the contract is fairly minimal, and we could envision adding
> more parameters such as expiration date. So at this point the behavior
> would be dictated by the merchant.
>
> Also, what should happen if the client tries to consume the same
> PaymentRequest twice (or multiple times) during the same period?
>
>
> The merchant initiates the PaymentRequest and is in charge to make sure
> they match the invoices that the client should pay. On the client side, the
> wallet is responsible to verify that the contract is respected, so if a
> merchant were to issue multiple times the same PaymentRequest, the wallet
> would detect it goes beyond the bonds defined in the contract and would
> refuse to make the additional Payments.
>
> I do not think daily/weekly/monthly is flexible enough. What do you think
> about having a concrete start time and end time when the next
> PaymentRequest will be valid?
>
>
> I agree that daily/weekly/monthly may not be flexible enough. However
> specifying a fixed date may be very tricky because in some cases a monthly
> subscription may start on a 31st of a month, and depending on the month,
> the due date will vary -- could be 30th, 28th, 29th, ... Also note that the
> frequency (daily/weekly/monthly) is not used as a polling interval, but is
> only used to verify the contract is respected.
>
> There are multiple viable options to specify that contract and ideally we
> could/should support multiple schemes; different merchants could use
> different schemes, and the client would decide wether or not he is ready to
> accept the terms that will later be enforced by the wallet. But of course
> all this flexibility goes against simplicity and so this is tradeoff...
>
>
> This also prevents the wallet from having to remember when it last sent a
> payment and getting skewed over time.
>
>
> Today, our current prototype is polling every day -- which is the lowest
> granularity we introduced -- and so there is no risk of getting skewed.
>
>
> When a wallet hits the polling_url to download the next PaymentRequest, it
> seems we need a way to communicate an error code to the wallet, for example
> if the server canceled the contract without the wallet knowing. Perhaps a
> separate polling_status_url, with a corresponding ACK message to indicate
> if the PaymentRequest is available. What do you think of that idea?
>
>
> I think reporting such errors to the wallet would make complete sense.
> However i am not clear why we would a separate url for that?
>
>  One high-level comment -- the wallet in this design doesn't have any way
> of knowing when the payments are supposed to end. I feel this is important
> to show to the user before they start their wallet polling infinitely.
>
>
> Subscriptions are non ending by definition, but at any time the client
> (through the wallet) or the merchant can decide to terminate the
> subscriptions -- we did not yet implement cancellation in that prototype
> but we are planning to add it later this week. Think of your Netflix
> subscriptions, this is never ending (evergreen) until you decide to
> terminate it or Netflix does it (abuse, bills not paid,...)
>
> Thanks for taking a look!
>
>
> On Sat, Feb 8, 2014 at 6:48 PM, Stephane Brossier <stephane@kill-bill.org>wrote:
>
>> Mike, Gavin,
>>
>>
>> We started to work on the merchant side to test the integration of our
>> prototype for the recurring payments. We modified the 'Payment Request
>> Generator' from Gavin to include a new check box 'set recurring'. We forked
>> the code and checked in our modification here:
>> https://github.com/killbill/paymentrequest/commit/e530f6ec528266aacfd076d7c3154ad39267c3f3
>>
>> We also found a few issues with the code diff that we sent yesterday for
>> bitcoinj and checked in the bug fixes  in our fork-- so the diff sent
>> yesterday is slightly outdated.
>>
>> So at this point we have a working prototype for bitcoinj and we are
>> waiting for your feedbacks. We also started to look at integrating the
>> protocol in Kill Bill to check that what is proposed supports indeed the
>> business cases of a full recurring billing platform.
>>
>> Hope to hear from you guys soon!
>>
>>
>> On Feb 7, 2014, at 6:57 PM, Stephane Brossier <stephane@kill-bill.org>
>> wrote:
>>
>> Mike and all,
>>
>> Pierre and I just committed a prototype implementation of the recurring
>> payment protocol using bitcoinj. You can find the diff on our fork:
>>
>> https://github.com/killbill/bitcoinj/commit/40c657c4191498f12539c60316116aa68af368a7
>>
>> We did not write the server (merchant side), but wanted to have some
>> feedback before going deeper (merchant implementation and tests). We did
>> our best to build it on top of the existing BIP-0070 protocol-- only a few
>> additions in the messages, but no new calls and no new uri scheme. We
>> created a new package 'recurring' where most of the new code lives.
>>
>> At a high level:
>>
>> 1. Creation of the subscription:
>>
>> The initial handshake for creating the subscription is exactly similar to
>> the one for the payment protocol (PaymentRequest is used to provide the
>> contract)
>>
>> 2. Wallet can decide to poll the merchants for its active subscriptions.
>>
>> Here the flow is exactly similar to the payment protocol but the wallet
>> receives a callback to verify the payment matches the contract and should
>> go through.
>>
>> Please give us some feedback whenever you have the chance. In the
>> meantime we will start implementing the merchant side and test the code.
>>
>> Cheers!
>>
>>
>>
>> On Jan 31, 2014, at 10:13 AM, Mike Hearn <mike@plan99.net> wrote:
>>
>> That looks OK at a very high level. Things you probably want to think
>> about:
>>
>>    - How to trigger it off the existing payment protocol (no new top
>>    level messages or mime types or uri extensions please)
>>    - Data structures to define the payment schedule
>>    - Do you allow pre-submission of time locked transactions or not?
>>
>> I think as you prototype these things will become clearer.  You could try
>> prototyping either in Bitcoin Core (C++) or bitcoinj (java, look at the
>> PaymentSession class).
>>
>>
>>
>> On Wed, Jan 29, 2014 at 3:47 AM, Stephane Brossier <
>> stephane@kill-bill.org> wrote:
>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *From what I have seen so far, there seems to be an agreement that this
>>> is a nice feature to add. We are pretty new to that community and so we
>>> don't know exactly what the process is, and in particular how we reach
>>> consensus via email. I am certainly open to follow 'the way' if there is
>>> one, but one solution would be to follow Mike's suggestion on providing a
>>> (prototype) implementation first and then defining/refining the BIP. Odinn
>>> also suggested a possible retribution for our time through crowd-sourcing
>>> which I am interested to pursue if that makes sense. We have quite some
>>> experience on the subscription side of things and while we are growing our
>>> knowledge on the Bitcoin technology (and ecosystem at large) we would
>>> benefit from: * some feedbacks on the high level proposal * additional
>>> requirements we might have missed So, below is a high level description of
>>> what we have in mind. If this sounds reasonable, we could start working on
>>> an implementation. I. Abstract --------------- This describes a protocol to
>>> enable recurring payments in bitcoins and can be seen as an extension of
>>> BIP-0070. The main goal here is to have the customer subscribe to a service
>>> of some kind (that is, agreeing on the terms of that subscription
>>> contract), and then have the wallet make recurring payments without any
>>> intervention from the customer as long as the payments match what the
>>> customer agreed on paying. An example of such service would be an online
>>> streaming website, to which a user pays a fixed recurring monthly fee to
>>> access videos (a.k.a. resources). Note that there is also usage based
>>> billing: for example, the user may need to purchase additional access for
>>> premium videos (overage charges). This type of billing is more complicated
>>> and there are many variations to it used in the industry (pre-paid, ...). For
>>> the sake of discussion, we'll focus on fixed recurring payments only, but
>>> we will keep usage in mind to make sure the protocol will be able to
>>> support it as well. II. Motivation ------------------ Subscription based
>>> services have been growing in the past few years and so the intent it to
>>> make it possible for customers to pay in bitcoins. Bitcoin's push model
>>> presents new advantages for the customer compared to traditional payment
>>> methods: the user has control over the subscription (for example, there is
>>> no need to call the merchant to explicitly cancel the credit card
>>> payments). It also opens the door to subscription management tools in
>>> wallets (e.g. Hive apps), which would give user an overview of what they
>>> are paying each month. III. Flow of
>>> Operations----------------------------------------*
>>>
>>>
>>>
>>>
>>> * Creation of the subscription: - - - - - - - - - - - - - - - - - - - -
>>> - - 1. The customer clicks 'subscribe' -> A message is sent to the
>>> merchant. 2. The merchant sends back a message to the wallet with the
>>> details of the subscription such as the amount to be paid. In reality,
>>> there will be more information but for the purpose of the prototype
>>> implementation this is sufficient. 3. The wallet prompts the customer for
>>> authorization. 4. The customer authorizes (or denies) it. 5. The wallet
>>> sends the confirmation to the merchant. 6. The merchant confirms the
>>> subscription was created. Ongoing payments: *
>>>
>>> *- - - - - - - - - - - - - - - - *
>>>
>>>
>>>
>>>
>>>
>>>
>>> * From that time on and since Bitcoin is a 'push' model, the wallet is
>>> responsible to poll the merchant for due payments associated with that
>>> subscription. Note that the merchant could specify hints to the wallet on
>>> when to poll (specific dates) or not during the registration of the
>>> subscription. Note that we can't simply have the wallet push X bitcoins
>>> every month: the user account on the merchant side may have gotten credits,
>>> invoice adjustments, etc. since the last invoice, so the amount to pay for
>>> a given billing period may be lower than the regular amount. It could even
>>> be zero if the user decides to make a one-time payment to the merchant
>>> directly using a different wallet. Hence, the wallet needs to get the
>>> latest invoice balance to make sure how much it should pay. This also opens
>>> the door for the support of overage charges. Quick note on the
>>> implementation on the merchant side: an entitlement system is a piece of
>>> logic on the merchant side which grants the user access to certain
>>> resources depending on the account status (unpaid invoices, etc.). This
>>> goes often hand in hand with a dunning system, which progressively
>>> restricts access as the user's account is more and more overdue. Since
>>> wallets can be offline for an extended period of time, payments may be
>>> missed and lead to an overdue state (e.g. extra fees, service degraded). It
>>> is the responsibility of the customer to ensure the wallet is up often
>>> enough for payments to happen. In that recurring phase where the wallet
>>> polls the merchant, the wallet is responsible to check that payments match
>>> the subscription contract; that is, the amount, frequency of payments, ...
>>> match what the customer agreed on. If so, the payment is made without
>>> asking for explicit approval from customer, and the flow is similar to
>>> BIP-0070: The message is sent to the merchant, and in parallel, a
>>> transaction is sent to the btcnet. The merchant sends an ACK to the wallet
>>> and of course checks the states of the transactions on the btcnet to mark
>>> that payment as successful. Subscription change (optional): *
>>>
>>> *- - - - - - - - - - - - - - - - - - - - - - - - *
>>>
>>>
>>> * Optionally we could implement a change in the ongoing subscription to
>>> address the upgrade/downgrade scenarios. Of course, we could also simply
>>> support a cancellation followed by a creation of a new subscription, but
>>> having that as a one atomic message is probably better. The steps are very
>>> similar to the initial registration. 1. The customer clicks 'upgrade',
>>> 'downgrade', ... -> A msg is sent to the merchant. 2. The merchant sends back
>>> a msg to the wallet with the detail of the NEW subscription. 3. The wallet
>>> prompts the customer for authorization. 4. The customer authorizes (or
>>> denies) it. 5. The wallet sends the confirmation to the merchant. 6. The
>>> merchant confirms the change in the subscription. Cancellation of the
>>> subscription: *
>>>
>>> *- - - - - - - - - - - - - - - - - - - - - - - - - *
>>>
>>>
>>>
>>> * The cancellation is initiated from the customer: 1. The customer
>>> clicks 'cancel' -> The wallet is informed that it  should not accept any
>>> new payment associated to that subscription. 2. The wallet sends a message
>>> to the merchant to inform about the cancellation. 3. The merchant confirms
>>> the subscription was cancelled. *
>>>
>>
>>
>>
>>
>
>

--20cf301af7fd330baf04f22fbd37
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"color:rgb(51,102,102=
)">Thanks for humoring my questions!</div><div class=3D"gmail_default" styl=
e=3D"color:rgb(51,102,102)"><span style=3D"color:rgb(34,34,34);font-family:=
arial,sans-serif;font-size:13px"><br>

</span></div><div class=3D"gmail_default" style=3D"color:rgb(51,102,102)"><=
span style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13=
px">&gt;I think reporting such errors to the wallet would make complete sen=
se. However i am not clear why we would a separate url for that?</span><br>

</div><div class=3D"gmail_default" style=3D"color:rgb(51,102,102)"><br></di=
v><div class=3D"gmail_default" style=3D"color:rgb(51,102,102)">Hmm, thinkin=
g about this more, adding a simple status_code in PaymentRequest would be a=
 much easier way to achieve this. However, continuing to think about this e=
ven more, maybe the simple memo field along with an empty set of outputs is=
 enough already.</div>

<div class=3D"gmail_default" style=3D"color:rgb(51,102,102)"><br></div><div=
 class=3D"gmail_default" style=3D"color:rgb(51,102,102)">In bitcoinj, right=
 now the code will throw a PaymentRequestException.InvalidOutputs exception=
 if the set of outputs is empty with a message of &quot;No Outputs&quot;. T=
here isn&#39;t a good way to tell the difference between a payment request =
that had no outputs and a payment request that had some invalid output(s).<=
/div>

<div class=3D"gmail_default" style=3D"color:rgb(51,102,102)"><br></div><div=
 class=3D"gmail_default" style=3D"color:rgb(51,102,102)"><b>Question to eve=
ryone:</b></div><div class=3D"gmail_default" style=3D"color:rgb(51,102,102)=
">How does bitcoin-qt handle a PaymentRequest with no outputs?</div>

<div class=3D"gmail_default" style=3D"color:rgb(51,102,102)"><br></div></di=
v><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Tue, Feb=
 11, 2014 at 10:01 AM, Stephane Brossier <span dir=3D"ltr">&lt;<a href=3D"m=
ailto:stephane@kill-bill.org" target=3D"_blank">stephane@kill-bill.org</a>&=
gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-word">Hi Kevin=
,<div><br><div><div class=3D""><div>On Feb 11, 2014, at 2:00 AM, Kevin Gree=
ne &lt;<a href=3D"mailto:kgreenek@gmail.com" target=3D"_blank">kgreenek@gma=
il.com</a>&gt; wrote:</div>

<br><blockquote type=3D"cite"><div dir=3D"ltr"><div class=3D"gmail_default"=
 style=3D"color:rgb(51,102,102)">Figured I would have a crack at reviewing =
this since Mike is out for a bit. It was great running into you guys at the=
 bitcoin fair in SF! Small world :)</div>

</div></blockquote><div><br></div></div><div>Indeed! It was great meeting y=
ou! It&#39;s always nice to meet people in person...</div></div><div><div c=
lass=3D""><br><blockquote type=3D"cite"><div dir=3D"ltr">

<div class=3D"gmail_default" style=3D"color:rgb(51,102,102)">I like how sim=
ple this is. You just give it an url to fetch the next payment request and =
a date to fetch it.</div>

<div class=3D"gmail_default" style=3D"color:rgb(51,102,102)"><br></div><div=
 class=3D"gmail_default" style=3D"color:rgb(51,102,102)">What should happen=
 if the client tries to fetch the PaymentRequest early or late?</div></div>=
</blockquote>

<div><br></div></div><div>If the client tries to fetch too early, then &nbs=
p;the merchant will return a PaymentRequest with no output (there is nothin=
g to pay yet). If it fetches too late, this is merchant specific. It could =
be that the service got discontinued -- extreme case -- or that there are n=
ow multiple PaymentRequest pending or that the merchant decided to aggregat=
e those into one. In that scenario, it could lead to a case where the amoun=
t to pay goes beyond the contract and the wallet would refuse to make the r=
ecurring payment.</div>

<div class=3D""><br><blockquote type=3D"cite"><div dir=3D"ltr"><div class=
=3D"gmail_default" style=3D"color:rgb(51,102,102)"> Does it become valid af=
ter some date and stay valid for some length of time? </div></div></blockqu=
ote><div>

<br></div></div><div>The protocol we sketched does not include (yet) an exp=
iration date. At this point the contract is fairly minimal, and we could en=
vision adding more parameters such as expiration date. So at this point the=
 behavior would be dictated by the merchant.</div>

<div class=3D""><div><br></div><blockquote type=3D"cite"><div dir=3D"ltr"><=
div class=3D"gmail_default" style=3D"color:rgb(51,102,102)">Also, what shou=
ld happen if the client tries to consume the same PaymentRequest twice (or =
multiple times) during the same period?</div>

</div></blockquote><div><br></div></div>The merchant initiates the PaymentR=
equest and is in charge to make sure they match the invoices that the clien=
t should pay. On the client side, the wallet is responsible to verify that =
the contract is respected, so if a merchant were to issue multiple times th=
e same PaymentRequest, the wallet would detect it goes beyond the bonds def=
ined in the contract and would refuse to make the additional Payments.</div=
>

<div><div class=3D""><br><blockquote type=3D"cite"><div dir=3D"ltr"><div cl=
ass=3D"gmail_default" style=3D"color:rgb(51,102,102)">I do not think daily/=
weekly/monthly is flexible enough. What do you think about having a concret=
e start time and end time when the next PaymentRequest will be valid?</div>

</div></blockquote><div><br></div></div>I agree that daily/weekly/monthly m=
ay not be flexible enough. However specifying a fixed date may be very tric=
ky because in some cases a monthly subscription may start on a 31st of a mo=
nth, and depending on the month, the due date will vary -- could be 30th, 2=
8th, 29th, ... Also note that the frequency (daily/weekly/monthly) is not u=
sed as a polling interval, but is only used to verify the contract is respe=
cted.&nbsp;</div>

<div><br></div><div>There are multiple viable options to specify that contr=
act and ideally we could/should support multiple schemes; different merchan=
ts could use different schemes, and the client would decide wether or not h=
e is ready to accept the terms that will later be enforced by the wallet. B=
ut of course all this flexibility goes against simplicity and so this is tr=
adeoff...</div>

<div><br></div><div><br></div><div><div class=3D""><blockquote type=3D"cite=
"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"color:rgb(51,102,1=
02)"> This also prevents the wallet from having to remember when it last se=
nt a payment and getting skewed over time.</div>

</div></blockquote><div><br></div></div><div>Today, our current prototype i=
s polling every day -- which is the lowest granularity we introduced -- and=
 so there is no risk of getting skewed.</div><div class=3D""><div><br></div=
>

<br><blockquote type=3D"cite"><div dir=3D"ltr"><div class=3D"gmail_default"=
 style=3D"color:rgb(51,102,102)">When a wallet hits the polling_url to down=
load the next PaymentRequest, it seems we need a way to communicate an erro=
r code to the wallet, for example if the server canceled the contract witho=
ut the wallet knowing. Perhaps a separate polling_status_url, with a corres=
ponding ACK message to indicate if the PaymentRequest is available. What do=
 you think of that idea?</div>

</div></blockquote><div><br></div></div>I think reporting such errors to th=
e wallet would make complete sense. However i am not clear why we would a s=
eparate url for that?</div><div><div class=3D""><br><blockquote type=3D"cit=
e">

<div dir=3D"ltr">

<div class=3D"gmail_default" style=3D"color:rgb(51,102,102)">One high-level=
 comment -- the wallet in this design doesn&#39;t have any way of knowing w=
hen the payments are supposed to end. I feel this is important to show to t=
he user before they start their wallet polling infinitely.</div>

</div></blockquote><div><br></div></div>Subscriptions are non ending by def=
inition, but at any time the client (through the wallet) or the merchant ca=
n decide to terminate the subscriptions -- we did not yet implement cancell=
ation in that prototype but we are planning to add it later this week. Thin=
k of your Netflix subscriptions, this is never ending (evergreen) until you=
 decide to terminate it or Netflix does it (abuse, bills not paid,...)</div=
>

<div><br></div><div>Thanks for taking a look!</div><div><div class=3D"h5"><=
div><br><blockquote type=3D"cite"><div class=3D"gmail_extra"><br><div class=
=3D"gmail_quote">On Sat, Feb 8, 2014 at 6:48 PM, Stephane Brossier <span di=
r=3D"ltr">&lt;<a href=3D"mailto:stephane@kill-bill.org" target=3D"_blank">s=
tephane@kill-bill.org</a>&gt;</span> wrote:<br>



<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-word"><div>Mik=
e, Gavin,</div><div><br></div><div><br></div><div>We started to work on the=
 merchant side to test the integration of our prototype for the recurring p=
ayments. We modified the &#39;Payment Request Generator&#39; from Gavin to =
include a new check box &#39;set recurring&#39;. We forked the code and che=
cked in our modification here:&nbsp;<a href=3D"https://github.com/killbill/=
paymentrequest/commit/e530f6ec528266aacfd076d7c3154ad39267c3f3" target=3D"_=
blank">https://github.com/killbill/paymentrequest/commit/e530f6ec528266aacf=
d076d7c3154ad39267c3f3</a></div>



<div><br></div><div>We also found a few issues with the code diff that we s=
ent yesterday for bitcoinj and checked in the bug fixes &nbsp;in our fork--=
 so the diff sent yesterday is slightly outdated.</div><div><br></div><div>


So at this point we have a working prototype for bitcoinj and we are waitin=
g for your feedbacks. We also started to look at integrating the protocol i=
n Kill Bill to check that what is proposed supports indeed the business cas=
es of a full recurring billing platform.</div>



<div><br></div><div>Hope to hear from you guys soon!</div><div><div><div><b=
r></div><br><div><div>On Feb 7, 2014, at 6:57 PM, Stephane Brossier &lt;<a =
href=3D"mailto:stephane@kill-bill.org" target=3D"_blank">stephane@kill-bill=
.org</a>&gt; wrote:</div>



<br><blockquote type=3D"cite"><div style=3D"word-wrap:break-word">Mike and =
all,<div><br></div><div>Pierre and I just committed a prototype implementat=
ion of the recurring payment protocol using bitcoinj. You can find the diff=
 on our fork:&nbsp;</div>



<div><a href=3D"https://github.com/killbill/bitcoinj/commit/40c657c4191498f=
12539c60316116aa68af368a7" target=3D"_blank">https://github.com/killbill/bi=
tcoinj/commit/40c657c4191498f12539c60316116aa68af368a7</a></div><div><br></=
div>



<div>We did not write the server (merchant side), but wanted to have some f=
eedback before going deeper (merchant implementation and tests). We did our=
 best to build it on top of the existing BIP-0070 protocol-- only a few add=
itions in the messages, but no new calls and no new uri scheme. We created =
a new package &#39;recurring&#39; where most of the new code lives.</div>



<div><br></div><div>At a high level:</div><div><br></div><div>1. Creation o=
f the subscription:</div><div><br></div><div>The initial handshake for crea=
ting the subscription is exactly similar to the one for the payment protoco=
l (PaymentRequest is used to provide the contract)</div>



<div><br></div><div>2. Wallet can decide to poll the merchants for its acti=
ve subscriptions.</div><div><br></div><div>Here the flow is exactly similar=
 to the payment protocol but the wallet receives a callback to verify the p=
ayment matches the contract and should go through.</div>



<div><br></div><div>Please give us some feedback whenever you have the chan=
ce. In the meantime we will start implementing the merchant side and test t=
he code.</div><div><br></div><div>Cheers!</div><div><br></div><div><br>



</div><div><br><div><div>On Jan 31, 2014, at 10:13 AM, Mike Hearn &lt;<a hr=
ef=3D"mailto:mike@plan99.net" target=3D"_blank">mike@plan99.net</a>&gt; wro=
te:</div><br><blockquote type=3D"cite"><div dir=3D"ltr">That looks OK at a =
very high level. Things you probably want to think about:<div>



<ul><li>How to trigger it off the existing payment protocol (no new top lev=
el messages or mime types or uri extensions please)</li>
<li>Data structures to define the payment schedule</li><li>Do you allow pre=
-submission of time locked transactions or not?</li></ul><div>I think as yo=
u prototype these things will become clearer. &nbsp;You could try prototypi=
ng either in Bitcoin Core (C++) or bitcoinj (java, look at the PaymentSessi=
on class).</div>




</div><div><br></div></div><div class=3D"gmail_extra"><br><br><div class=3D=
"gmail_quote">On Wed, Jan 29, 2014 at 3:47 AM, Stephane Brossier <span dir=
=3D"ltr">&lt;<a href=3D"mailto:stephane@kill-bill.org" target=3D"_blank">st=
ephane@kill-bill.org</a>&gt;</span> wrote:<br>




<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-word"><b><div =
style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"=
font-size:15px;font-family:Arial;font-weight:normal;vertical-align:baseline=
;white-space:pre-wrap">From what I have seen so far, there seems to be an a=
greement that this is a nice feature to add. </span><b><div style=3D"line-h=
eight:1.15;margin-top:0pt;margin-bottom:0pt;display:inline!important">




<span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical=
-align:baseline;white-space:pre-wrap">We are pretty new to that community a=
nd so we don&#39;t know exactly what the process is, and in particular how =
we reach consensus via email. I am certainly open to follow &#39;the way&#3=
9; if there is one, but one solution would be to follow Mike&#39;s suggesti=
on on providing a (prototype) implementation first and then defining/refini=
ng the BIP. Odinn also suggested a possible retribution for our time throug=
h crowd-sourcing which I am interested to pursue if that makes sense.</span=
></div>




</b></div><br><span style=3D"font-size:15px;font-family:Arial;font-weight:n=
ormal;vertical-align:baseline;white-space:pre-wrap"></span><br><span style=
=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical-align:base=
line;white-space:pre-wrap"></span><div style=3D"line-height:1.15;margin-top=
:0pt;margin-bottom:0pt">




<span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical=
-align:baseline;white-space:pre-wrap">We have quite some experience on the =
subscription side of things and while we are growing our knowledge on the B=
itcoin technology (and ecosystem at large) we would benefit from:</span></d=
iv>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical-align:bas=
eline;white-space:pre-wrap">* some feedbacks on the high level proposal</sp=
an></div>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical-align:bas=
eline;white-space:pre-wrap">* additional requirements we might have missed<=
/span></div>




<br><span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vert=
ical-align:baseline;white-space:pre-wrap"></span><div style=3D"line-height:=
1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-f=
amily:Arial;font-weight:normal;vertical-align:baseline;white-space:pre-wrap=
">So, below is a high level description of what we have in mind. If this so=
unds reasonable, we could start working on an implementation.</span></div>




<br><span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vert=
ical-align:baseline;white-space:pre-wrap"></span><br><span style=3D"font-si=
ze:15px;font-family:Arial;font-weight:normal;vertical-align:baseline;white-=
space:pre-wrap"></span><p dir=3D"ltr" style=3D"line-height:1.15;margin-top:=
0pt;margin-bottom:0pt">




<span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical=
-align:baseline;white-space:pre-wrap"> </span></p><div style=3D"line-height=
:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-=
family:Arial;vertical-align:baseline;white-space:pre-wrap">I. Abstract</spa=
n></div>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;vertical-align:baseline;white-space:p=
re-wrap">---------------</span></div><br><span style=3D"font-size:15px;font=
-family:Arial;vertical-align:baseline;white-space:pre-wrap"></span><div sty=
le=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt">




<span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical=
-align:baseline;white-space:pre-wrap">This describes a protocol to enable r=
ecurring payments in bitcoins and can be seen as an extension of BIP-0070. =
The main goal here is to have the customer subscribe to a service of some k=
ind (that is, agreeing on the terms of that subscription contract), and the=
n have the wallet make recurring payments without any intervention from the=
 customer as long as the payments match what the customer agreed on paying.=
</span></div>




<br><span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vert=
ical-align:baseline;white-space:pre-wrap"></span><div style=3D"line-height:=
1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-f=
amily:Arial;font-weight:normal;vertical-align:baseline;white-space:pre-wrap=
">An example of such service would be an online streaming website, to which=
 a user pays a fixed recurring monthly fee to access videos (a.k.a. resourc=
es). Note that there is also usage based billing: for example, the user may=
 need to purchase additional access for premium videos (overage charges). T=
his type of billing is more complicated and there are many variations to it=
 used in the industry (pre-paid, &hellip;). For the sake of discussion, we&=
rsquo;ll focus on fixed recurring payments only, but we will keep usage in =
mind to make sure the protocol will be able to support it as well.</span></=
div>




<div><b><br></b></div><br><span style=3D"font-size:15px;font-family:Arial;f=
ont-weight:normal;vertical-align:baseline;white-space:pre-wrap"></span><div=
 style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D=
"font-size:15px;font-family:Arial;vertical-align:baseline;white-space:pre-w=
rap">II. Motivation</span></div>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;vertical-align:baseline;white-space:p=
re-wrap">------------------</span></div><br><span style=3D"font-size:15px;f=
ont-family:Arial;vertical-align:baseline;white-space:pre-wrap"></span><div =
style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt">




<span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical=
-align:baseline;white-space:pre-wrap">Subscription based services have been=
 growing in the past few years and so the intent it to make it possible for=
 customers to pay in bitcoins. </span></div>




<br><span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vert=
ical-align:baseline;white-space:pre-wrap"></span><div style=3D"line-height:=
1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-f=
amily:Arial;font-weight:normal;vertical-align:baseline;white-space:pre-wrap=
">Bitcoin&rsquo;s push model presents new advantages for the customer compa=
red to traditional payment methods: the user has control over the subscript=
ion (for example, there is no need to call the merchant to explicitly cance=
l the credit card payments). It also opens the door to subscription managem=
ent tools in wallets (e.g. Hive apps), which would give user an overview of=
 what they are paying each month.</span></div>




<br><span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vert=
ical-align:baseline;white-space:pre-wrap"></span><br><span style=3D"font-si=
ze:15px;font-family:Arial;font-weight:normal;vertical-align:baseline;white-=
space:pre-wrap"></span><div style=3D"line-height:1.15;margin-top:0pt;margin=
-bottom:0pt">




<span style=3D"font-size:15px;font-family:Arial;vertical-align:baseline;whi=
te-space:pre-wrap">III. Flow of Operations</span></div>--------------------=
--------------------</b><div><b><br><span style=3D"font-size:15px;font-fami=
ly:Arial;vertical-align:baseline;white-space:pre-wrap"></span><br>




<span style=3D"font-size:15px;font-family:Arial;vertical-align:baseline;whi=
te-space:pre-wrap"></span><div style=3D"line-height:1.15;margin-top:0pt;mar=
gin-bottom:0pt"><span style=3D"font-size:15px;font-family:Arial;vertical-al=
ign:baseline;white-space:pre-wrap">Creation of the subscription:</span></di=
v>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;vertical-align:baseline;white-space:p=
re-wrap">- - - - - - - - - - - - - - - - - - - - - - </span></div><br><span=
 style=3D"font-size:15px;font-family:Arial;vertical-align:baseline;white-sp=
ace:pre-wrap"></span><div style=3D"line-height:1.15;margin-top:0pt;margin-b=
ottom:0pt">




<span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical=
-align:baseline;white-space:pre-wrap">1. The customer clicks &#39;subscribe=
&#39; -&gt; A message is sent to the merchant.</span></div><div style=3D"li=
ne-height:1.15;margin-top:0pt;margin-bottom:0pt">




<span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical=
-align:baseline;white-space:pre-wrap">2. The merchant sends back a message =
to the wallet with the details of the subscription such as the amount to be=
 paid. In reality, there will be more information but for the purpose of th=
e prototype implementation this is sufficient.</span></div>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical-align:bas=
eline;white-space:pre-wrap">3. The wallet prompts the customer for authoriz=
ation.</span></div>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical-align:bas=
eline;white-space:pre-wrap">4. The customer authorizes (or denies) it.</spa=
n></div>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical-align:bas=
eline;white-space:pre-wrap">5. The wallet sends the confirmation to the mer=
chant.</span></div>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical-align:bas=
eline;white-space:pre-wrap">6. The merchant confirms the subscription was c=
reated.</span></div>




<br><span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vert=
ical-align:baseline;white-space:pre-wrap"></span><div style=3D"line-height:=
1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-f=
amily:Arial;vertical-align:baseline;white-space:pre-wrap">Ongoing payments:=
</span></div>




</b><div><b><div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt=
"><span style=3D"font-size:15px;font-family:Arial;vertical-align:baseline;w=
hite-space:pre-wrap">- - - - - - - - - - - - - - - -</span></div>
<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;vertical-align:baseline;white-space:p=
re-wrap"><br></span></div></b></div><b><span style=3D"font-size:15px;font-f=
amily:Arial;vertical-align:baseline;white-space:pre-wrap"></span><div style=
=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt">




<span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical=
-align:baseline;white-space:pre-wrap">From that time on and since Bitcoin i=
s a &#39;push&#39; model, the wallet is responsible to poll the merchant fo=
r due payments associated with that subscription. Note that the merchant co=
uld specify hints to the wallet on when to poll (specific dates) or not dur=
ing the registration of the subscription.</span></div>




<br><span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vert=
ical-align:baseline;white-space:pre-wrap"></span><div style=3D"line-height:=
1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-f=
amily:Arial;font-weight:normal;vertical-align:baseline;white-space:pre-wrap=
">Note that we can&#39;t simply have the wallet push X bitcoins every month=
: the user account on the merchant side may have gotten credits, invoice ad=
justments, etc. since the last invoice, so the amount to pay for a given bi=
lling period may be lower than the regular amount. It could even be zero if=
 the user decides to make a one-time payment to the merchant directly using=
 a different wallet. Hence, the wallet needs to get the latest invoice bala=
nce to make sure how much it should pay. This also opens the door for the s=
upport of overage charges.</span></div>




<br><span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vert=
ical-align:baseline;white-space:pre-wrap"></span><br><span style=3D"font-si=
ze:15px;font-family:Arial;font-weight:normal;vertical-align:baseline;white-=
space:pre-wrap"></span><div style=3D"line-height:1.15;margin-top:0pt;margin=
-bottom:0pt">




<span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical=
-align:baseline;white-space:pre-wrap">Quick note on the implementation on t=
he merchant side: an entitlement system is a piece of logic on the merchant=
 side which grants the user access to certain resources depending on the ac=
count status (unpaid invoices, etc.). This goes often hand in hand with a d=
unning system, which progressively restricts access as the user&#39;s accou=
nt is more and more overdue. Since wallets can be offline for an extended p=
eriod of time, payments may be missed and lead to an overdue state (e.g. ex=
tra fees, service degraded). It is the responsibility of the customer to en=
sure the wallet is up often enough for payments to happen.</span></div>




<br><span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vert=
ical-align:baseline;white-space:pre-wrap"></span><br><span style=3D"font-si=
ze:15px;font-family:Arial;font-weight:normal;vertical-align:baseline;white-=
space:pre-wrap"></span><div style=3D"line-height:1.15;margin-top:0pt;margin=
-bottom:0pt">




<span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical=
-align:baseline;white-space:pre-wrap">In that recurring phase where the wal=
let polls the merchant, the wallet is responsible to check that payments ma=
tch the subscription contract; that is, the amount, frequency of payments, =
&hellip; match what the customer agreed on. If so, the payment is made with=
out asking for explicit approval from customer, and the flow is similar to =
BIP-0070: The message is sent to the merchant, and in parallel, a transacti=
on is sent to the btcnet. The merchant sends an ACK to the wallet and of co=
urse checks the states of the transactions on the btcnet to mark that payme=
nt as successful.</span></div>




<br><span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vert=
ical-align:baseline;white-space:pre-wrap"></span><div style=3D"line-height:=
1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-f=
amily:Arial;vertical-align:baseline;white-space:pre-wrap">Subscription chan=
ge (optional):</span></div>




</b><b><div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><sp=
an style=3D"font-size:15px;font-family:Arial;vertical-align:baseline;white-=
space:pre-wrap">- - - - - - - - - - - - - - - - - - - - - - - - </span></di=
v>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;vertical-align:baseline;white-space:p=
re-wrap"><br></span></div></b><b><span style=3D"font-size:15px;font-family:=
Arial;vertical-align:baseline;white-space:pre-wrap"></span><div style=3D"li=
ne-height:1.15;margin-top:0pt;margin-bottom:0pt">




<span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical=
-align:baseline;white-space:pre-wrap">Optionally we could implement a chang=
e in the ongoing subscription to address the upgrade/downgrade scenarios. O=
f course, we could also simply support a cancellation followed by a creatio=
n of a new subscription, but having that as a one atomic message is probabl=
y better. The steps are very similar to the initial registration.</span></d=
iv>




<br><span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vert=
ical-align:baseline;white-space:pre-wrap"></span><div style=3D"line-height:=
1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-f=
amily:Arial;font-weight:normal;vertical-align:baseline;white-space:pre-wrap=
">1. The customer clicks &#39;upgrade&#39;, &#39;downgrade&#39;, &hellip; -=
&gt; A msg is sent to the merchant.</span></div>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical-align:bas=
eline;white-space:pre-wrap">2. The merchant sends back a msg to the wallet =
with the detail of the NEW subscription. </span></div>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical-align:bas=
eline;white-space:pre-wrap">3. The wallet prompts the customer for authoriz=
ation.</span></div>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical-align:bas=
eline;white-space:pre-wrap">4. The customer authorizes (or denies) it.</spa=
n></div>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical-align:bas=
eline;white-space:pre-wrap">5. The wallet sends the confirmation to the mer=
chant.</span></div>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical-align:bas=
eline;white-space:pre-wrap">6. The merchant confirms the change in the subs=
cription.</span></div>




<br><span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vert=
ical-align:baseline;white-space:pre-wrap"></span><div style=3D"line-height:=
1.15;margin-top:0pt;margin-bottom:0pt"><span style=3D"font-size:15px;font-f=
amily:Arial;vertical-align:baseline;white-space:pre-wrap">Cancellation of t=
he subscription:</span></div>




</b><b><div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><sp=
an style=3D"font-size:15px;font-family:Arial;vertical-align:baseline;white-=
space:pre-wrap">- - - - - - - - - - - - - - - - - - - - - - - - - </span></=
div>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;vertical-align:baseline;white-space:p=
re-wrap"><br></span></div></b><b><span style=3D"font-size:15px;font-family:=
Arial;vertical-align:baseline;white-space:pre-wrap"></span><div style=3D"li=
ne-height:1.15;margin-top:0pt;margin-bottom:0pt">




<span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical=
-align:baseline;white-space:pre-wrap">The cancellation is initiated from th=
e customer:</span></div><br><span style=3D"font-size:15px;font-family:Arial=
;font-weight:normal;vertical-align:baseline;white-space:pre-wrap"></span><d=
iv style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt">




<span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical=
-align:baseline;white-space:pre-wrap">1. The customer clicks &#39;cancel&#3=
9; -&gt; The wallet is informed that it &nbsp;should not accept any new pay=
ment associated to that subscription.</span></div>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical-align:bas=
eline;white-space:pre-wrap">2. The wallet sends a message to the merchant t=
o inform about the cancellation.</span></div>




<div style=3D"line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span styl=
e=3D"font-size:15px;font-family:Arial;font-weight:normal;vertical-align:bas=
eline;white-space:pre-wrap">3. The merchant confirms the subscription was c=
ancelled.</span></div>




<br><span style=3D"font-size:15px;font-family:Arial;font-weight:normal;vert=
ical-align:baseline;white-space:pre-wrap"></span><br><span style=3D"font-si=
ze:15px;font-family:Arial;font-weight:normal;vertical-align:baseline;white-=
space:pre-wrap"></span></b></div>




</div></blockquote></div><br></div>
</blockquote></div><br></div></div></blockquote></div><br></div></div></div=
></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></blockquote></div><br></div=
>

--20cf301af7fd330baf04f22fbd37--