summaryrefslogtreecommitdiff
path: root/bip-0021.mediawiki
diff options
context:
space:
mode:
Diffstat (limited to 'bip-0021.mediawiki')
-rw-r--r--bip-0021.mediawiki26
1 files changed, 18 insertions, 8 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 ===