BOLT11

From Bitcoin Wiki
Jump to navigation Jump to search

BOLT11 is the Lightning Network invoice format specified in BOLT 11 of the Basis of Lightning Technology. An invoice encodes a payment hash, amount, expiry, destination node, and optional routing hints in a Bech32-style string that usually starts with lnbc on Bitcoin mainnet. Wallets scan a QR code or paste the string, then send an onion-routed HTLC to the destination.

Lightning payments need a way for a receiver to communicate a payment hash (the SHA256 of a secret preimage), the amount, and how to reach the receiving node if it is not in the public graph. BOLT 11 defined a signed, human-copyable invoice before BOLT12 offers. It remains the most widely scanned Lightning invoice type on the Lightning Network.

The string is a human-readable prefix plus a Bech32 data part. The prefix is ln concatenated with a currency code (bc for Bitcoin mainnet, tb for testnet) and an optional amount with a multiplier (for example lnbc2500u for 2500 microbitcoin). The data part contains a timestamp and tagged fields, then a 512-bit recoverable signature over the invoice data using the destination node's key.

Tagged fields include p (required 256-bit payment hash), n (destination public key if not recovered from the signature), d or h (description or description hash), x (expiry in seconds, default 3600), c (min_final_cltv_expiry), f (on-chain fallback address), r (private routing hints for unannounced channels), and 9 (feature bits the payer must understand). The payer looks up the destination in the network graph, builds an onion (BOLT 4), and sends an HTLC whose payment hash matches the invoice. The receiver reveals the preimage to settle; the preimage is the proof of payment.

BOLT11 invoices are usually single-use: paying the same hash twice reuses HTLC correlation. Amount is fixed in the invoice, though some nodes allow overpayment. There is no built-in reusable offer, payer-blinded path, or asynchronous request for an invoice (those are BOLT12 features). Invoice length grows with routing hints and metadata, which makes QR codes dense. Feature bits signal multi-path payments, payment secrets, and other BOLT 4/9 capabilities; a payer that does not understand compulsory bits must fail. Related receive UX includes Lightning address and LNURL.

See also

External links