diff --git a/bip-0021.mediawiki b/bip-0021.mediawiki index 7c9c7f7032..84da3c2ee4 100644 --- a/bip-0021.mediawiki +++ b/bip-0021.mediawiki @@ -39,8 +39,8 @@ Elements of the query component may contain characters outside the valid range. (See also [[#Simpler syntax|a simpler representation of syntax]]) - bitcoinurn = "bitcoin:" [ bitcoinaddress ] [ "?" bitcoinparams ] - bitcoinaddress = *base58 + bitcoinurn = "bitcoin:" [ bitcoinaddress ] [ "?" bitcoinaddress ] [ "?" bitcoinparams ] + bitcoinaddress = *base58 / *bech32 / *bech32m bitcoinparams = bitcoinparam [ "&" bitcoinparams ] bitcoinparam = [ amountparam / labelparam / messageparam / otherparam / reqparam ] amountparam = "amount=" *digit [ "." *digit ] @@ -55,7 +55,13 @@ The scheme component ("bitcoin:") is case-insensitive, and implementations must === Bitcoin Address === -The bitcoinaddress body MUST be either a base64 P2SH or P2PKH address, bech32 Segwit version 0 address, bech32m Segwit address, or empty. Future address formats SHOULD instead be placed in query keys as optional payment instructions to provide backwards compatibility during upgrade cycles. After new addres types are near-universally supported, or for recipients wishing to avoid a standard on-chain fallback, the bitcoinaddress part of the URI MAY be left empty. +The bitcoinaddress body MUST be either a legacy base58 address (P2PKH, P2SH), or a bech32(m) encoded address. Future address formats that do not use bech32m encoding MUST instead be placed in query keys. Query keys SHOULD be defined by the respective BIP for the new address format. + +=== Human Readable Part === + +Bech32(m) encoded addresses contain a Human Readable Part (HRP) for identifying the address. Clients MUST use the HRP in lieu of a ([[#Query Keys|query key (see below)]]). Recipients SHOULD include an optional `=o` character at the end of their address to ensure backwards compatibility with clients that expect URI components of the form `?key=value`. Senders MUST check for the two character optional value at the end of the address and remove it before sending. + +Once the new method of using the HRP value in lieu of a query key is near-universally supported, recipients MAY omit the optional value. === Query Keys === @@ -65,13 +71,7 @@ The following keys are defined generally and apply to any URI regardless of paym *address: bitcoin address *message: message that describes the transaction to the user ([[#Examples|see examples below]]) -The following keys are currently defined for payment instructions of various forms: - -*lightning: Lightning BOLT 11 invoices -*lno: Lightning BOLT12 offers -*sp: Silent Payment addresses - -New payment instructions using bech32 encodings SHOULD reuse their address format's Human Readable Part as the parameter key. +Future payment instructions that are not bech32m encoded or where the HRP is not sufficient to unambiguosly identify the protocol SHOULD define a query parameter. ==== Transfer amount ==== @@ -108,27 +108,47 @@ Please see the BNF grammar above for the normative syntax. [foo] means optional, <bar> are placeholders - bitcoin:
[?amount=][?label=