---
id: "lightning_invoice"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["cryptocurrency", "finances"]
langs: ["common"]
quality: 80
url: "http://registry.apicrafter.io/datatype/lightning_invoice"
---

# Lightning Network invoice (BOLT 11) (`lightning_invoice`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Payment request of the Lightning Network as defined by BOLT 11. The human-readable part is ln, the network (bc for Bitcoin mainnet, tb for testnet, tbs for signet, bcrt for regtest) and an optional amount with a multiplier (m, u, n or p). The Bech32 data part, without the 90-character limit of BIP 173, holds a timestamp, tagged fields such as the payment hash, description and expiry, and the signature of the payee. Invoices are written in lower case, or in upper case in QR codes.

- Personal data (PII): no
- Categories: Cryptocurrency (cryptocurrency), Finances and banking (finances)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^(?:ln(?:bcrt|bc|tbs|tb)[0-9]*[munp]?1[02-9ac-hj-np-z]+|LN(?:BCRT|BC|TBS|TB)[0-9]*[MUNP]?1[02-9AC-HJ-NP-Z]+)$
```

Check digit algorithm: `bech32`

## Examples

- `lnbc1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq9qrsgq357wnc5r2ueh7ck6q93dj32dlqnls087fxdwk8qakdyafkq3yap9us6v52vjjsrvywa6rt52cm9r9zqt8r2t7mlcwspyetp5h2tztugp9lfyql` — BOLT 11 example, donation of any amount
- `lnbc2500u1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpu9qrsgquk0rl77nj30yxdy8j9vdx85fkpmdla2087ne0xh8nhedh8w27kyke0lp53ut353s06fv3qfegext0eh0ymjpf39tuven09sam30g4vgpfna3rh` — BOLT 11 example, 2500 micro-BTC for a cup of coffee
- `lnbc2500u1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpu9qrsgquk0rl77nj30yxdy8j9vdx85fkpmdla2087ne0xh8nhedh8w27kyke0lp53ut353s06fv3qfegext0eh0ymjpf39tuven09sam30g4vgpfna3rj` (invalid example) — last character changed, the checksum fails

## Translations

- ru: Счёт Lightning Network (BOLT 11)

## Sources

- doc: <https://github.com/lightning/bolts/blob/master/11-payment-encoding.md>
- wikipedia: <https://en.wikipedia.org/wiki/Lightning_Network>

## Quality

Score 80/100. Missing: mapping (Wikidata, Schema.org, ...), detector coverage.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/lightning_invoice.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/cryptocurrency/lightning_invoice.yaml>
