summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-03-18 17:22:17 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2014-03-18 17:22:17 +0100
commita3fe3270ace5994865a7ac4cd01097747a20f9f6 (patch)
tree937164429a3e84aa7352aea08bc9717c4d880b21
parent0505c84b4836604b789bdb38647baa44f2c85d3c (diff)
parent116129c6878a14415afba89e90b8ddd3a12b477e (diff)
downloadbips-a3fe3270ace5994865a7ac4cd01097747a20f9f6.tar.xz
Merge pull request #30 from swansontec/master
Fix BIP 21 and BIP 72 ambiguities & mistakes
-rw-r--r--bip-0021.mediawiki26
-rw-r--r--bip-0072.mediawiki9
2 files changed, 23 insertions, 12 deletions
diff --git a/bip-0021.mediawiki b/bip-0021.mediawiki
index 8f2201b..e64a71e 100644
--- a/bip-0021.mediawiki
+++ b/bip-0021.mediawiki
@@ -26,19 +26,29 @@ They SHOULD require the user to manually approve each payment individually, thou
=== Operating system integration ===
Graphical bitcoin clients SHOULD register themselves as the handler for the "bitcoin:" URI scheme by default, if no other handler is already registered. If there is already a registered handler, they MAY prompt the user to change it once when they first run the client.
-=== BNF grammar ===
+=== General Format ===
+
+Bitcoin URIs follow the general format for URIs as set forth in RFC 3986. The path component consists of a bitcoin address, and the query component provides additional payment options.
+
+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.
+
+=== ABNF grammar ===
(See also [[#Simpler syntax|a simpler representation of syntax]])
bitcoinurn = "bitcoin:" bitcoinaddress [ "?" bitcoinparams ]
- bitcoinaddress = base58 *base58
- bitcoinparams = *bitcoinparam
- bitcoinparam = amountparam | labelparam | messageparam | otherparam | reqparam
+ bitcoinaddress = *base58
+ bitcoinparams = bitcoinparam [ "&" bitcoinparams ]
+ bitcoinparam = [ amountparam / labelparam / messageparam / otherparam / reqparam ]
amountparam = "amount=" *digit [ "." *digit ]
- labelparam = "label=" *pchar
- messageparam = "message=" *pchar
- otherparam = pchar *pchar "=" *pchar
- reqparam = "req-" pchar *pchar "=" *pchar
+ labelparam = "label=" *qchar
+ messageparam = "message=" *qchar
+ otherparam = qchar *qchar [ "=" *qchar ]
+ reqparam = "req-" qchar *qchar [ "=" *qchar ]
+
+Here, "qchar" corresponds to valid characters of an RFC 3986 URI query component, excluding the "=" and "&" characters, which this BIP takes as separators.
+
+The scheme component ("bitcoin:") is case-insensitive, and implementations must accept any combination of uppercase and lowercase letters. The rest of the URI is case-sensitive, including the query parameter keys.
=== Query Keys ===
diff --git a/bip-0072.mediawiki b/bip-0072.mediawiki
index 4edd749..246a40c 100644
--- a/bip-0072.mediawiki
+++ b/bip-0072.mediawiki
@@ -22,8 +22,9 @@ bitcoin wallets.
The bitcoin: URI scheme is extended with an additional, optional
"r" parameter, whose value is a URL from which a PaymentRequest
-message should be fetched (unsafe and reserved octets in the URL value
-must be encoded as described in RFC 1738).
+message should be fetched (characters not allowed within the scope
+of a query parameter must be percent-encoded as described in RFC 3986
+and bip-0021).
If the "r" parameter is provided and backwards compatibility
is not required, then the bitcoin address portion of the URI may be
@@ -52,9 +53,9 @@ r parameter and will initiate a payment to bitcoin address.
==Examples==
A backwards-compatible request:
<pre>
-bitcoin:mq7se9wy2egettFxPbmn99cK8v5AFq55Lx?amount=0.11&r=https%3A%2F%2Fmerchant.com%2Fpay.php%3Fh%3D2a8628fc2fbe
+bitcoin:mq7se9wy2egettFxPbmn99cK8v5AFq55Lx?amount=0.11&r=https://merchant.com/pay.php?h%3D2a8628fc2fbe
</pre>
Non-backwards-compatible equivalent:
<pre>
-bitcoin:?r=https%3A%2F%2Fmerchant.com%2Fpay.php%3Fh%3D2a8628fc2fbe
+bitcoin:?r=https://merchant.com/pay.php?h%3D2a8628fc2fbe
</pre>