Skip to content

Commit 62e166e

Browse files
committed
Add PoP callbacks
1 parent fff9ae9 commit 62e166e

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

bip-XXXX.mediawiki

+24-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This BIP proposes a URI scheme for describing Bitcoin payment receipt informatio
1717
==Motivation==
1818
The purpose of this URI scheme is to enable users to easily make payments by simply clicking links on webpages or scanning QR Codes.
1919

20-
This BIP is a modification of [[bip-0021.mediawiki|BIP 0021]] to add information about the modern usage of bitcoin: URIs as well as provide forward-looking guidance on how to incorporate new payment instructions. BIP 21 was based on BIP 20, which was, in turn based off an earlier document by Nils Schneider.
20+
This BIP is a modification of [[bip-0021.mediawiki|BIP 0021]] to add information about the modern usage of bitcoin: URIs as well as provide forward-looking guidance on how to incorporate new payment instructions. It further adds an optional extension to provide the payment initiator with proof of payment. BIP 21 was based on BIP 20, which was, in turn based off an earlier document by Nils Schneider.
2121

2222
==Specification==
2323

@@ -42,10 +42,11 @@ Elements of the query component may contain characters outside the valid range.
4242
bitcoinurn = "bitcoin:" [ bitcoinaddress ] [ "?" bitcoinparams ]
4343
bitcoinaddress = *base58 / *bech32 / *bech32m
4444
bitcoinparams = bitcoinparam [ "&" bitcoinparams ]
45-
bitcoinparam = [ amountparam / labelparam / messageparam / otherparam / reqparam ]
45+
bitcoinparam = [ amountparam / labelparam / messageparam / responseparam / otherparam / reqparam ]
4646
amountparam = "amount=" *digit [ "." *digit ]
4747
labelparam = "label=" *qchar
4848
messageparam = "message=" *qchar
49+
responseparam = [ "req-" ] "pop=" *qchar
4950
otherparam = qchar *qchar [ "=" *qchar ]
5051
reqparam = "req-" qchar *qchar [ "=" *qchar ]
5152
@@ -64,6 +65,7 @@ The following keys are defined generally and apply to any URI regardless of paym
6465
*label: Label for that address (e.g. name of receiver)
6566
*address: bitcoin address
6667
*message: message that describes the transaction to the user ([[#Examples|see examples below]])
68+
*pop: a URI which the Bitcoin Wallet may return to in order to provide the application which initiated the payment with proof that a payment was completed.
6769
6870
The following keys are currently defined for payment instructions of various forms:
6971

@@ -79,6 +81,20 @@ If an amount is provided, it MUST be specified in decimal BTC.
7981
All amounts MUST contain no commas and use a period (.) as the separating character to separate whole numbers and decimal fractions.
8082
I.e. amount=50.00 or amount=50 is treated as 50 BTC, and amount=50,000.00 is invalid.
8183

84+
=== Proof of Payment ===
85+
86+
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.
87+
88+
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 first percent-decode the provided URI once, append "&pop=" followed by the Payment Information to the resulting URI and open it with the default system handler for the given URI.
89+
90+
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.
91+
92+
If a wallet will not open the pop scheme (either because it does not support returning payment information for the selected payment method or because it uses a URI scheme which should not be opened) and the parameter was passed as a "req-pop" parameter, the wallet MUST NOT initiate payment.
93+
94+
For payments made using an on-chain transaction, the Payment Information shall be the full (including witness data) Bitcoin transaction as it was broadcasted to the Bitcoin network, encoded in hex.
95+
96+
Other payment schemes will define their own Payment Information format. This BIP may be updated from time to time with Payment Information formats for other payment schemes.
97+
8298
== Rationale ==
8399

84100
===Payment identifiers, not person identifiers===
@@ -97,6 +113,12 @@ Compared to BIP 21, this document describes standard query parameters containing
97113

98114
Any existing BIP 21 implementation should automatically be fully compliant with this BIP, as the changes only describe existing practice or impact future address format inclusion.
99115

116+
== Proof of Payment ==
117+
118+
On many mobile operating systems (especially, or any operating system more generally), applications may "open" a bitcoin: URI in order to initiate a payment with the user's default wallet application. These payment-initiating applications may wish to learn about the completed payment.
119+
120+
For payments completed on-chain, this is largely addressed by having the payment-initiating application monitor the blockchain for payment completion, however for other payment schemes (e.g. lightning), no such global ledger of transactions exists. In that case, proof of payment must be provided via some other mechanism.
121+
100122
== Appendix ==
101123

102124
=== Simpler syntax ===

0 commit comments

Comments
 (0)