1
0
Fork 0
mirror of https://github.com/bitcoin/bips.git synced 2025-03-04 03:03:53 +01:00

BIP 21: Allow empty addresses and query parameters

Empty addresses should be valid for compatibility with  BIP 72.

Empty query parameters should also be valid, since they are harmless,
and clients already accept them.

With these changes, bitcoin:?& would be a valid (but useless) URI.
This commit is contained in:
William Swanson 2014-03-10 18:10:27 -07:00
parent 6f15f98b12
commit 116129c687

View file

@ -37,14 +37,14 @@ Elements of the query component may contain characters outside the valid range.
(See also [[#Simpler syntax|a simpler representation of syntax]]) (See also [[#Simpler syntax|a simpler representation of syntax]])
bitcoinurn = "bitcoin:" bitcoinaddress [ "?" bitcoinparams ] bitcoinurn = "bitcoin:" bitcoinaddress [ "?" bitcoinparams ]
bitcoinaddress = base58 *base58 bitcoinaddress = *base58
bitcoinparams = bitcoinparam [ "&" bitcoinparams ] bitcoinparams = bitcoinparam [ "&" bitcoinparams ]
bitcoinparam = amountparam | labelparam | messageparam | otherparam | reqparam bitcoinparam = [ amountparam / labelparam / messageparam / otherparam / reqparam ]
amountparam = "amount=" *digit [ "." *digit ] amountparam = "amount=" *digit [ "." *digit ]
labelparam = "label=" *qchar labelparam = "label=" *qchar
messageparam = "message=" *qchar messageparam = "message=" *qchar
otherparam = qchar *qchar "=" *qchar otherparam = qchar *qchar [ "=" *qchar ]
reqparam = "req-" 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. Here, "qchar" corresponds to valid characters of an RFC 3986 URI query component, excluding the "=" and "&" characters, which this BIP takes as separators.