Skip to content

Commit 3527ddd

Browse files
committed
One more attempt at PoP spec, this time with examples
1 parent 37404d4 commit 3527ddd

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

bip-XXXX.mediawiki

+30-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ I.e. amount=50.00 or amount=50 is treated as 50 BTC, and amount=50,000.00 is inv
8383

8484
The URI MAY include a "pop" (or "req-pop") parameter who's value can be used to build a URI which the wallet application can, after payment completes, "open" to provide proof the payment was completed or other information about the payment.
8585

86-
The value of a "pop" (or "req-pop") parameter shall be a percent-encoded (per RFC 3986 section 2.1) URI prefix. The wallet application, if it supports providing payment information SHOULD percent-decode the provided URI once then append the Payment Information to the resulting URI and open it with the default system handler for the given URI.
86+
The value of a "pop" (or "req-pop") parameter shall be a percent-encoded (per RFC 3986 section 2.1) URI prefix. The wallet application, if it supports providing payment information SHOULD percent-decode the provided URI once, append the query parameter key from which the payment instructions used were read, append a single =, and finally append the Payment Information to the resulting URI and open it with the default system handler for the URI. For payment instructions read from the body of the URI, "onchain" SHALL be used in place of the key.
8787

8888
A wallet MUST validate that the provided URI's scheme is not (case-insensitive) "http", "https", "file", "javascript", "mailto" or any other scheme which will open in a web browser prior to opening it.
8989

@@ -134,6 +134,8 @@ Please see the ABNF grammar above for the normative syntax.
134134
135135
=== Examples ===
136136

137+
==== URIs ====
138+
137139
Just the address:
138140
bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W
139141

@@ -171,3 +173,30 @@ Some future version that has variables which are (currently) not understood but
171173
bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?somethingyoudontunderstand=50&somethingelseyoudontget=999
172174

173175
Characters must be URI encoded properly.
176+
177+
==== Proof of Payment ====
178+
179+
If the original URI is
180+
bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?pop=initiatingapp%3a
181+
the wallet should perform the payment information callback by opening
182+
initiatingapp:onchain=$HEX_ENCODED_TRANSACTION
183+
184+
If the original URI is
185+
bitcoin:?lightning=lnbc420bogusinvoice&pop=callbackuri%3abody%3fpop=
186+
the wallet should perform the proof-of-payment callback by opening
187+
callbackuri:body?pop=lightning=$HEX_ENCODED_PAYMENT_PREIMAGE
188+
189+
If the original URI is
190+
bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?lightning=lnbc420bogusinvoice&pop=app%3a%3f
191+
and the wallet pays on-chain, it should perform the payment information callback by opening
192+
app:?onchain=$HEX_ENCODED_TRANSACTION
193+
but if the app pays using lightning, it should perform the proof-of-payment callback by opening
194+
app:?lightning=$HEX_ENCODED_PAYMENT_PREIMAGE
195+
196+
If the original URI is
197+
bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?pop=https%3aiwantyouripaddress.com
198+
the wallet should make a payment as it normally would but MUST NOT interact with iwantyouripaddress.com
199+
200+
If the original URI is
201+
bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?req-pop=https%3aevilwebsite.com
202+
the wallet MUST NOT make a payment

0 commit comments

Comments
 (0)