BIP21 bitcoin URI

Also called: bitcoin: URI, Bitcoin payment URI, BIP 21

Definition

A BIP21 bitcoin URI is a link that starts with bitcoin: and holds a bitcoin address plus optional amount, label and message, used in QR codes so wallets can prefill a payment.

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.

Frequently asked questions

What unit is the amount in a bitcoin QR code?

In a BIP21 URI the amount parameter is in bitcoin (BTC) as a decimal, for example amount=0.001.

Is a bitcoin address alone enough for a QR code?

A bare address works in most wallets, but a bitcoin: URI can also carry the amount and a note and signals that the code is a payment request.

Sources and standards

All terms