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
|
Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194]
helo=mx.sourceforge.net)
by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
(envelope-from <kalle@rosenbaum.se>) id 1Z1FIT-0003JU-0s
for bitcoin-development@lists.sourceforge.net;
Sat, 06 Jun 2015 14:42:05 +0000
X-ACL-Warn:
Received: from mail-qg0-f44.google.com ([209.85.192.44])
by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128)
(Exim 4.76) id 1Z1FIR-0001Cf-94
for bitcoin-development@lists.sourceforge.net;
Sat, 06 Jun 2015 14:42:05 +0000
Received: by qgg3 with SMTP id 3so14111800qgg.2
for <bitcoin-development@lists.sourceforge.net>;
Sat, 06 Jun 2015 07:41:57 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20130820;
h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc
:content-type;
bh=e6ivAiCW4AEp5TeDEU0rQKp/13CS0TvSWkp27OhSAlk=;
b=cIdQtFxzSDmNl2mAu22u2PdyfPYSDUBlJ6U/UcmN+XYowNTKB5i+dmYGqnCFx6ZW7K
5es6JE9jhixNGde5tcq79bAFplZPSW/QccKNxjIdiGXEk9wMgPVxI+SJmrmWjVDIoLiR
79nudX36cLZ5Sm4Jo/j0S0hDX6QCRcIhYhJ40y4cFB8pgO4nWnIaLtSOCwiaEvbHbhu4
gbfoKqQ9b3Xq3u782MhoicJXJNTz3GQ97Z0azFE5bpblJBUI8itvD/FA14I0SHoTTNZG
bOMPWf8zt/FIHqadzO22jKSRoLRt1fvRbvCxIJ+fT57uRQgZykruQbz4bgzL8G/Z4AFx
C/1w==
X-Gm-Message-State: ALoCoQlyr5U/wI3m8bxJeEwY+IHeN3IcEdyBcvOc1ZM1H1GgxSJRXTcZJZItMGiE0Dwjuz6fuThd
MIME-Version: 1.0
X-Received: by 10.55.16.74 with SMTP id a71mr2087578qkh.15.1433601338871; Sat,
06 Jun 2015 07:35:38 -0700 (PDT)
Received: by 10.96.145.9 with HTTP; Sat, 6 Jun 2015 07:35:38 -0700 (PDT)
Date: Sat, 6 Jun 2015 16:35:38 +0200
Message-ID: <CAPswA9yb4S8X-_g+7JwwTL5teJCUHhAhaeR=aKfxHGdq56C5Bw@mail.gmail.com>
From: Kalle Rosenbaum <kalle@rosenbaum.se>
To: Greg Maxwell <gmaxwell@gmail.com>
Content-Type: multipart/alternative; boundary=001a113744728dacb10517da5209
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 AWL AWL: Adjusted score from AWL reputation of From: address
X-Headers-End: 1Z1FIR-0001Cf-94
Cc: Bitcoin Dev <bitcoin-development@lists.sourceforge.net>
Subject: [Bitcoin-development] BIP for PoP URI scheme
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: Sat, 06 Jun 2015 14:42:05 -0000
--001a113744728dacb10517da5209
Content-Type: text/plain; charset=UTF-8
Hi
Following earlier posts on Proof of Payment I'm now proposing the following
BIP for a Proof of Payment URI scheme (To read it formatted instead, go to
https://github.com/kallerosenbaum/poppoc/wiki/btcpop-scheme-BIP).
Regards,
Kalle Rosenbaum
<pre>
BIP: <BIP number>
Title: Proof of Payment URI scheme
Author: Kalle Rosenbaum <kalle@rosenbaum.se>
Status: Draft
Type: Standards Track
Created: <date created on, in ISO 8601 (yyyy-mm-dd) format>
</pre>
== Abstract ==
This is a proposal for a URI scheme to be used in the Proof of Payment
process.
== Motivation ==
To make a Proof of Payment, the party that wants the proof needs to
transfer a Proof of Payment request to the wallet software of the
other party. To facilitate that transfer, a new URI scheme
representing the PoP request is proposed. This URI can then be encoded
in QR images or sent over NFC in order to transfer it to the wallet.
== Specification ==
The specification is the same as BIP0021, with the following
differences:
* The URI scheme is <tt>btcpop</tt> instead of <tt>bitcoin</tt>
* The path component, i.e. the address part, is always empty.
* A mandatory <tt>p</tt> parameter whose value contains the destination for
the PoP. This could for example be a <tt>https:</tt> URL or a <tt>mailto:</tt>
URI.
* A mandatory <tt>n</tt> parameter representing the nonce, base58 encoded.
* An optional <tt>txid</tt> parameter containing the Base58 encoded hash of
the transaction to prove.
Just as in BIP0021, elements of the query component may contain
characters outside the valid range. These must first be encoded
according to UTF-8, and then each octet of the corresponding UTF-8
sequence must be percent-encoded as described in RFC 3986.
All parameters except <tt>p</tt> and <tt>n</tt> are hints to the
wallet on which transaction to create a PoP for.
The extensibility of BIP0021 applies to this scheme as well. For
example, a <tt>date</tt> parameter or a <tt>toaddr</tt> parameter
might be useful. <tt>req-*</tt> parameters are also allowed and obey
the same rules as in BIP0021, clients not supporting a <tt>req-*</tt>
parameter must consider the URI invalid.
=== Keep URIs short ===
Implementations should keep the URIs as short as possible. This is
because it makes QR decoding more stable. A camera with a scratched
lens or low resolution may run into problems scanning huge QR
codes. This is why the <tt>txid</tt> parameter is encoded in Base58
instead of the classic hex encoded string. We get away with 44
characters instead of 64. Also, the <tt>nonce</tt> parameter is Base58
encoded for the same reason.
== Interpretation ==
=== Transaction hints ===
The wallet processing the URI must use the hints in the PoP request to
filter its transaction set. The <tt>label</tt>, <tt>amount</tt> and
<tt>message</tt> parameters must, if present in the URI, exactly match
the data associated with the original payment according to the
following table:
{|
| <tt>btcpop:</tt> URI parameter || <tt>bitcoin:</tt> URI parameter ||
BIP70 PaymentDetails data
|-
| <tt>label</tt> || <tt>label</tt> ||
<tt>merchant_data</tt>
|-
| <tt>amount</tt> || <tt>amount</tt> ||
<tt>sum of outputs.amount</tt>
|-
| <tt>message</tt> || <tt>message</tt> ||
<tt>memo</tt>
|}
The <tt>txid</tt> parameter value must match the transaction hash of
the payment.
After filtering, the resulting transaction set is displayed to the
user who selects one of them to prove. An implementation could also
automatically select a transaction in the filtered set, but
there must still be a way for the user to select freely among the
matching transactions. If the filtered set is empty, no transaction
fits the hints and a message about that is presented to the user. If
the filtered set contains exactly one transaction, which is
preferable, that transaction can be automatically selected.
As a fallback, there must also be a way for the user to select any
transaction from the wallet regardless of the transaction hints. This
can be useful if the metadata of the wallet is lost, possibly due to a
restore from backup.
=== PoP destination <tt>p</tt> ===
The <tt>p</tt> parameter value is the destination where to send the
PoP to. This destination is typically a <tt>https:</tt> URL or a
<tt>http:</tt> URL, but it could be any type of URI, for example
<tt>mailto:</tt>. To keep <tt>btcpop:</tt> URIs short, users should
not make their <tt>p</tt> parameter unneccesarily long.
==== <tt>http:</tt> and <tt>https:</tt> URLs ====
Wallet implementations must support the <tt>http:</tt> and
<tt>https:</tt> schemes in which case <tt>POST</tt> method must be
used. The content type of the POST request must be set to
Content-Type: application/bitcoin-pop
Content-Transfer-Encoding: binary
== Examples ==
Send PoP for a transaction with label "video 42923" to
<tt>https://www.example.com/pop/352</tt>, using nonce <tt>0x73 0xd5
0x1a 0xbb 0xd8 0x9c</tt>:
btcpop:?p=https://www.example.com/pop/352&n=zgWTm8yH&label=video 42923
Send PoP through mail using
<tt>mailto:pop@example.com?subject=pop444</tt>, amount is 13370000
satoshis, nonce is <tt>0x6f 0xe 0xfb 0x68 0x92 0xf9</tt>. Note that
the <tt>?</tt> before <tt>subject</tt> is OK according to RFC3986,
since the query part starts from the first <tt>?</tt>:
btcpop:?p=mailto:pop@example.com?subject%3Dpop444&n=xJdKmEbr&amount=0.1337
Send PoP for transaction with id
<tt>cca7507897abc89628f450e8b1e0c6fca4ec3f7b34cccf55f3f531c659ff4d79</tt>
to pizza place at <tt>http://pizza.example.com/pop/laszlo111</tt>
using nonce <tt>0xfc 0xcc 0x2c 0x35 0xf0 0xb8</tt>
btcpop:?p=
http://pizza.example.com/pop/laszlo111&n=3AtNpVrPh&txid=Emt9MPvt1joznqHy5eEHkNtcuQuYWXzYJBQZN6BJm6NL
== Reference implementation ==
[https://github.com/kallerosenbaum/poppoc poppoc on GitHub]
[https://github.com/kallerosenbaum/wallet Mycelium fork on GitHub]
== References ==
[https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki BIP21]: URI
Scheme
[[Proof of Payment BIP]]
[https://www.ietf.org/rfc/rfc3986.txt RFC3986]: Uniform Resource Identifier
(URI): Generic Syntax
--001a113744728dacb10517da5209
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi<br><br>Following earlier posts on Proof of Payment I=
9;m now proposing the following BIP for a Proof of Payment URI scheme (To r=
ead it formatted instead, go to <a href=3D"https://github.com/kallerosenbau=
m/poppoc/wiki/btcpop-scheme-BIP">https://github.com/kallerosenbaum/poppoc/w=
iki/btcpop-scheme-BIP</a>).<br><br>Regards,<br>Kalle Rosenbaum<br><br><p=
re><br>=C2=A0 BIP: <BIP number><br>=C2=A0 Title: Proof of Payment =
URI scheme<br>=C2=A0 Author: Kalle Rosenbaum <<a href=3D"mailto:kalle@ro=
senbaum.se">kalle@rosenbaum.se</a>><br>=C2=A0 Status: Draft<br>=C2=A0 Ty=
pe: Standards Track<br>=C2=A0 Created: <date created on, in ISO 8601 (yy=
yy-mm-dd) format><br></pre><br><br>=3D=3D Abstract =3D=3D<br><br>T=
his is a proposal for a URI scheme to be used in the Proof of Payment<br>pr=
ocess.<br><br>=3D=3D Motivation =3D=3D<br><br>To make a Proof of Payment, t=
he party that wants the proof needs to<br>transfer a Proof of Payment reque=
st to the wallet software of the<br>other party. To facilitate that transfe=
r, a new URI scheme<br>representing the PoP request is proposed. This URI c=
an then be encoded<br>in QR images or sent over NFC in order to transfer it=
to the wallet.<br><br>=3D=3D Specification =3D=3D<br><br>The specification=
is the same as BIP0021, with the following<br>differences:<br><br>* The UR=
I scheme is <tt>btcpop</tt> instead of <tt>bitcoin</tt=
><br>* The path component, i.e. the address part, is always empty.<br>* =
A mandatory <tt>p</tt> parameter whose value contains the desti=
nation for the PoP. This could for example be a <tt>https:</tt>=
URL or a <tt>mailto:</tt> URI.<br>* A mandatory <tt>n<=
;/tt> parameter representing the nonce, base58 encoded.<br>* An optional=
<tt>txid</tt> parameter containing the Base58 encoded hash of =
the transaction to prove.<br><br>Just as in BIP0021, elements of the query =
component may contain<br>characters outside the valid range. These must fir=
st be encoded<br>according to UTF-8, and then each octet of the correspondi=
ng UTF-8<br>sequence must be percent-encoded as described in RFC 3986.<br><=
br>All parameters except <tt>p</tt> and <tt>n</tt> =
are hints to the<br>wallet on which transaction to create a PoP for.<br><br=
>The extensibility of BIP0021 applies to this scheme as well. For<br>exampl=
e, a <tt>date</tt> parameter or a <tt>toaddr</tt> p=
arameter<br>might be useful. <tt>req-*</tt> parameters are also=
allowed and obey<br>the same rules as in BIP0021, clients not supporting a=
<tt>req-*</tt><br>parameter must consider the URI invalid.<br>=
<br>=3D=3D=3D Keep URIs short =3D=3D=3D<br><br>Implementations should keep =
the URIs as short as possible. This is<br>because it makes QR decoding more=
stable. A camera with a scratched<br>lens or low resolution may run into p=
roblems scanning huge QR<br>codes. This is why the <tt>txid</tt>=
; parameter is encoded in Base58<br>instead of the classic hex encoded stri=
ng. We get away with 44<br>characters instead of 64. Also, the <tt>no=
nce</tt> parameter is Base58<br>encoded for the same reason.<br><br>=
=3D=3D Interpretation =3D=3D<br><br>=3D=3D=3D Transaction hints =3D=3D=3D<b=
r><br>The wallet processing the URI must use the hints in the PoP request t=
o<br>filter its transaction set. The <tt>label</tt>, <tt>=
amount</tt> and<br><tt>message</tt> parameters must, if p=
resent in the URI, exactly match<br>the data associated with the original p=
ayment according to the<br>following table:<br><br>{|<br>| <tt>btcpop=
:</tt> URI parameter || <tt>bitcoin:</tt> URI parameter |=
| BIP70 PaymentDetails data<br>|-<br>| <tt>label</tt> =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 || <tt>label</tt&=
gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|| <tt=
>merchant_data</tt><br>|-<br>| <tt>amount</tt> =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|| <tt>amount</tt&=
gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 || <tt>su=
m of outputs.amount</tt><br>|-<br>| <tt>message</tt> =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 || <tt>message</tt&g=
t; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|| <tt>memo=
</tt><br>|}<br><br>The <tt>txid</tt> parameter value must=
match the transaction hash of<br>the payment.<br><br>After filtering, the =
resulting transaction set is displayed to the<br>user who selects one of th=
em to prove. An implementation could also<br>automatically select a transac=
tion in the filtered set, but<br>there must still be a way for the user to =
select freely among the<br>matching transactions. If the filtered set is em=
pty, no transaction<br>fits the hints and a message about that is presented=
to the user. If<br>the filtered set contains exactly one transaction, whic=
h is<br>preferable, that transaction can be automatically selected.<br><br>=
As a fallback, there must also be a way for the user to select any<br>trans=
action from the wallet regardless of the transaction hints. This<br>can be =
useful if the metadata of the wallet is lost, possibly due to a<br>restore =
from backup.<br><br>=3D=3D=3D PoP destination <tt>p</tt> =3D=3D=
=3D<br><br>The <tt>p</tt> parameter value is the destination wh=
ere to send the<br>PoP to. This destination is typically a <tt>https:=
</tt> URL or a<br><tt>http:</tt> URL, but it could be any=
type of URI, for example<br><tt>mailto:</tt>. To keep <tt&g=
t;btcpop:</tt> URIs short, users should<br>not make their <tt>p=
</tt> parameter unneccesarily long.<br><br>=3D=3D=3D=3D <tt>htt=
p:</tt> and <tt>https:</tt> URLs =3D=3D=3D=3D<br><br>Wall=
et implementations must support the <tt>http:</tt> and<br><t=
t>https:</tt> schemes in which case <tt>POST</tt> meth=
od must be<br>used. The content type of the POST request must be set to<br>=
<br>=C2=A0Content-Type: application/bitcoin-pop<br>=C2=A0Content-Transfer-E=
ncoding: binary<br><br>=3D=3D Examples =3D=3D<br><br>Send PoP for a transac=
tion with label "video 42923" to<br><tt><a href=3D"https://=
www.example.com/pop/352">https://www.example.com/pop/352</a></tt>, us=
ing nonce <tt>0x73 0xd5<br>0x1a 0xbb 0xd8 0x9c</tt>:<br><br>=C2=
=A0btcpop:?p=3D<a href=3D"https://www.example.com/pop/352&n=3DzgWTm8yH&=
amp;label=3Dvideo">https://www.example.com/pop/352&n=3DzgWTm8yH&lab=
el=3Dvideo</a> 42923<br><br>Send PoP through mail using<br><tt>mailto=
:<a href=3D"mailto:pop@example.com">pop@example.com</a>?subject=3Dpop444<=
;/tt>, amount is 13370000<br>satoshis, nonce is <tt>0x6f 0xe 0xfb =
0x68 0x92 0xf9</tt>. Note that<br>the <tt>?</tt> before &=
lt;tt>subject</tt> is OK according to RFC3986,<br>since the query =
part starts from the first <tt>?</tt>:<br><br>=C2=A0btcpop:?p=
=3Dmailto:<a href=3D"mailto:pop@example.com">pop@example.com</a>?subject%3D=
pop444&n=3DxJdKmEbr&amount=3D0.1337<br><br>Send PoP for transaction=
with id<br><tt>cca7507897abc89628f450e8b1e0c6fca4ec3f7b34cccf55f3f53=
1c659ff4d79</tt><br>to pizza place at <tt><a href=3D"http://piz=
za.example.com/pop/laszlo111">http://pizza.example.com/pop/laszlo111</a><=
;/tt><br>using nonce <tt>0xfc 0xcc 0x2c 0x35 0xf0 0xb8</tt><=
br><br>=C2=A0btcpop:?p=3D<a href=3D"http://pizza.example.com/pop/laszlo111&=
amp;n=3D3AtNpVrPh&txid=3DEmt9MPvt1joznqHy5eEHkNtcuQuYWXzYJBQZN6BJm6NL">=
http://pizza.example.com/pop/laszlo111&n=3D3AtNpVrPh&txid=3DEmt9MPv=
t1joznqHy5eEHkNtcuQuYWXzYJBQZN6BJm6NL</a><br><br>=3D=3D Reference implement=
ation =3D=3D<br><br>[<a href=3D"https://github.com/kallerosenbaum/poppoc">h=
ttps://github.com/kallerosenbaum/poppoc</a> poppoc on GitHub]<br><br>[<a hr=
ef=3D"https://github.com/kallerosenbaum/wallet">https://github.com/kalleros=
enbaum/wallet</a> Mycelium fork on GitHub]<br><br>=3D=3D References =3D=3D<=
br><br>[<a href=3D"https://github.com/bitcoin/bips/blob/master/bip-0021.med=
iawiki">https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki</a> =
BIP21]: URI Scheme<br><br>[[Proof of Payment BIP]]<br><br>[<a href=3D"https=
://www.ietf.org/rfc/rfc3986.txt">https://www.ietf.org/rfc/rfc3986.txt</a> R=
FC3986]: Uniform Resource Identifier (URI): Generic Syntax<br><br></div>
--001a113744728dacb10517da5209--
|