What BIP21 defines
BIP21 is a Bitcoin Improvement Proposal, written in 2012 by Nils Schneider and Matt Corallo, that defines a URI scheme for bitcoin payments. The URI starts with bitcoin:, followed by the receiving address and optional query parameters. When a wallet scans a QR code that holds such a URI, it opens a send screen with the address and amount already filled in.
The amount is written in bitcoin as a decimal number, not in smaller units. For example, bitcoin:bc1q...?amount=0.001&label=Maple%20Street%20Bakery&message=Order%2042 asks for 0.001 BTC. Text values in label and message are percent-encoded.
- amount: requested amount in BTC, as a decimal
- label: a name for the recipient
- message: a note describing the payment
- Parameters prefixed with req- must be understood by the wallet, or it should refuse the URI
Using BIP21 in QR codes
A QR code can hold either a bare address or a full BIP21 URI. The URI is more useful for payments because it carries the amount and scheme, so the phone knows to open a wallet. Some wallets also add extra parameters, such as a lightning invoice, that are conventions rather than part of the original BIP21 text, and not every wallet reads them.
Always check the address shown in the wallet before sending. Bitcoin transactions cannot be reversed, and a code placed over a real one can send funds to someone else.