2017-06-27 12:38:13 +02:00
# BOLT #11: Invoice Protocol for Lightning Payments
2018-11-07 04:05:32 +01:00
A simple, extendable, QR-code-ready protocol for requesting payments
2017-06-27 12:38:13 +02:00
over Lightning.
# Table of Contents
2017-12-16 01:35:10 +01:00
* [Encoding Overview ](#encoding-overview )
* [Human-Readable Part ](#human-readable-part )
* [Data Part ](#data-part )
* [Tagged Fields ](#tagged-fields )
2019-07-18 09:19:32 +02:00
* [Feature Bits ](#feature-bits )
2017-12-16 01:35:10 +01:00
* [Payer / Payee Interactions ](#payer--payee-interactions )
* [Payer / Payee Requirements ](#payer--payee-requirements )
* [Implementation ](#implementation )
* [Examples ](#examples )
* [Authors ](#authors )
2018-01-30 05:26:52 +01:00
2017-06-27 12:38:13 +02:00
# Encoding Overview
2017-12-16 01:35:10 +01:00
The format for a Lightning invoice uses
2017-06-27 12:38:13 +02:00
[bech32 encoding ](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki ),
2017-12-16 01:35:10 +01:00
which is already used for Bitcoin Segregated Witness. It can be
simply reused for Lightning invoices even though its 6-character checksum is optimized
2017-06-27 12:38:13 +02:00
for manual entry, which is unlikely to happen often given the length
2017-12-16 01:35:10 +01:00
of Lightning invoices.
2017-06-27 12:38:13 +02:00
2017-08-21 06:49:23 +02:00
If a URI scheme is desired, the current recommendation is to either
use 'lightning:' as a prefix before the BOLT-11 encoding (note: not
2018-11-07 04:05:32 +01:00
'lightning://'), or for fallback to Bitcoin payments, to use 'bitcoin:',
2017-12-16 01:35:10 +01:00
as per BIP-21, with the key 'lightning' and the value equal to the BOLT-11
2017-08-21 06:49:23 +02:00
encoding.
2017-06-27 12:38:13 +02:00
## Requirements
2018-11-10 04:17:26 +01:00
A writer:
2018-11-28 02:15:06 +01:00
- MUST encode the payment request in Bech32 (see BIP-0173)
2020-08-03 23:18:22 +02:00
- SHOULD use upper case for QR codes (see BIP-0173)
2018-11-28 02:15:06 +01:00
- MAY exceed the 90-character limit specified in BIP-0173.
2018-11-07 04:05:32 +01:00
2018-11-10 04:17:26 +01:00
A reader:
2018-11-07 04:05:32 +01:00
- MUST parse the address as Bech32, as specified in BIP-0173 (also without the character limit).
2020-08-03 23:18:22 +02:00
- Note: this includes handling uppercase as specified by BIP-0173
2018-11-07 04:05:32 +01:00
- if the checksum is incorrect:
- MUST fail the payment.
2017-06-27 12:38:13 +02:00
2017-12-16 01:35:10 +01:00
# Human-Readable Part
2017-06-27 12:38:13 +02:00
2017-12-16 01:35:10 +01:00
The human-readable part of a Lightning invoice consists of two sections:
2018-11-10 04:17:26 +01:00
1. `prefix` : `ln` + BIP-0173 currency prefix (e.g. `lnbc` for Bitcoin mainnet,
2021-03-02 09:16:36 +01:00
`lntb` for Bitcoin testnet, `lntbs` for Bitcoin signet, and `lnbcrt` for
Bitcoin regtest)
2017-12-16 01:35:10 +01:00
1. `amount` : optional number in that currency, followed by an optional
2018-09-17 21:35:56 +02:00
`multiplier` letter. The unit encoded here is the 'social' convention of a payment unit -- in the case of Bitcoin the unit is 'bitcoin' NOT satoshis.
2017-06-27 12:38:13 +02:00
The following `multiplier` letters are defined:
* `m` (milli): multiply by 0.001
* `u` (micro): multiply by 0.000001
* `n` (nano): multiply by 0.000000001
* `p` (pico): multiply by 0.000000000001
## Requirements
2018-06-27 02:39:06 +02:00
A writer:
2018-11-07 04:05:32 +01:00
- MUST encode `prefix` using the currency required for successful payment.
- if a specific minimum `amount` is required for successful payment:
- MUST include that `amount` .
- MUST encode `amount` as a positive decimal integer with no leading 0s.
2020-01-31 09:23:15 +01:00
- If the `p` multiplier is used the last decimal of `amount` MUST be `0` .
2018-11-07 04:05:32 +01:00
- SHOULD use the shortest representation possible, by using the largest
multiplier or omitting the multiplier.
2018-06-27 02:39:06 +02:00
A reader:
2018-11-07 06:35:30 +01:00
- if it does NOT understand the `prefix` :
2018-11-10 04:17:26 +01:00
- MUST fail the payment.
2018-11-07 04:05:32 +01:00
- if the `amount` is empty:
2018-11-28 02:15:06 +01:00
- SHOULD indicate to the payer that amount is unspecified.
2018-11-07 04:05:32 +01:00
- otherwise:
2018-11-10 04:17:26 +01:00
- if `amount` contains a non-digit OR is followed by anything except
2018-11-07 04:05:32 +01:00
a `multiplier` (see table above):
- MUST fail the payment.
- if the `multiplier` is present:
2020-05-11 23:24:15 +02:00
- MUST multiply `amount` by the `multiplier` value to derive the
2018-11-07 04:05:32 +01:00
amount required for payment.
2020-05-11 23:24:15 +02:00
- if multiplier is `p` and the last decimal of `amount` is not 0:
- MUST fail the payment.
2017-06-27 12:38:13 +02:00
## Rationale
The `amount` is encoded into the human readable part, as it's fairly
readable and a useful indicator of how much is being requested.
Donation addresses often don't have an associated amount, so `amount`
2017-12-16 01:35:10 +01:00
is optional in that case. Usually a minimum payment is required for
2017-06-27 12:38:13 +02:00
whatever is being offered in return.
2020-01-21 13:57:40 +01:00
The `p` multiplier would allow to specify sub-millisatoshi amounts, which cannot be transferred on the network, since HTLCs are denominated in millisatoshis.
Requiring a trailing `0` decimal ensures that the `amount` represents an integer number of millisatoshis.
2017-06-27 12:38:13 +02:00
# Data Part
2017-12-16 01:35:10 +01:00
The data part of a Lightning invoice consists of multiple sections:
2017-06-27 12:38:13 +02:00
1. `timestamp` : seconds-since-1970 (35 bits, big-endian)
2017-12-20 01:06:30 +01:00
1. zero or more tagged parts
2018-10-18 07:41:46 +02:00
1. `signature` : Bitcoin-style signature of above (520 bits)
2017-06-27 12:38:13 +02:00
## Requirements
2018-11-07 06:35:30 +01:00
A writer:
- MUST set `timestamp` to the number of seconds since Midnight 1 January 1970, UTC in
big-endian.
- MUST set `signature` to a valid 512-bit secp256k1 signature of the SHA2 256-bit hash of the
human-readable part, represented as UTF-8 bytes, concatenated with the
data part (excluding the signature) with 0 bits appended to pad the
data to the next byte boundary, with a trailing byte containing
the recovery ID (0, 1, 2, or 3).
2017-06-27 12:38:13 +02:00
2018-11-07 06:35:30 +01:00
A reader:
- MUST check that the `signature` is valid (see the `n` tagged field specified below).
2017-06-27 12:38:13 +02:00
## Rationale
2018-11-07 06:35:30 +01:00
`signature` covers an exact number of bytes even though the SHA2
2017-12-20 01:06:30 +01:00
standard actually supports hashing in bit boundaries, because it's not widely
2017-12-16 01:35:10 +01:00
implemented. The recovery ID allows public-key recovery, so the
2017-06-27 12:38:13 +02:00
identity of the payee node can be implied.
## Tagged Fields
2017-12-16 01:35:10 +01:00
Each Tagged Field is of the form:
2017-06-27 12:38:13 +02:00
1. `type` (5 bits)
1. `data_length` (10 bits, big-endian)
1. `data` (`data_length` x 5 bits)
2017-12-16 01:35:10 +01:00
Currently defined tagged fields are:
2017-06-27 12:38:13 +02:00
2018-11-07 06:35:30 +01:00
* `p` (1): `data_length` 52. 256-bit SHA256 payment_hash. Preimage of this provides proof of payment.
2019-11-26 04:15:48 +01:00
* `s` (16): `data_length` 52. This 256-bit secret prevents forwarding nodes from probing the payment recipient.
2018-11-10 04:17:26 +01:00
* `d` (13): `data_length` variable. Short description of purpose of payment (UTF-8), e.g. '1 cup of coffee' or 'ナンセンス 1杯'
2017-12-16 01:35:10 +01:00
* `n` (19): `data_length` 53. 33-byte public key of the payee node
2017-12-21 04:38:53 +01:00
* `h` (23): `data_length` 52. 256-bit description of purpose of payment (SHA256). This is used to commit to an associated description that is over 639 bytes, but the transport mechanism for the description in that case is transport specific and not defined here.
2017-12-16 01:35:10 +01:00
* `x` (6): `data_length` variable. `expiry` time in seconds (big-endian). Default is 3600 (1 hour) if not specified.
2020-07-07 09:02:57 +02:00
* `c` (24): `data_length` variable. `min_final_cltv_expiry` to use for the last HTLC in the route. Default is 18 if not specified.
2018-10-18 07:41:46 +02:00
* `f` (9): `data_length` variable, depending on version. Fallback on-chain address: for Bitcoin, this starts with a 5-bit `version` and contains a witness program or P2PKH or P2SH address.
2017-12-20 01:06:30 +01:00
* `r` (3): `data_length` variable. One or more entries containing extra routing information for a private route; there may be more than one `r` field
2017-06-27 12:38:13 +02:00
* `pubkey` (264 bits)
2017-07-24 10:26:49 +02:00
* `short_channel_id` (64 bits)
2018-01-30 05:26:52 +01:00
* `fee_base_msat` (32 bits, big-endian)
2017-12-07 10:39:37 +01:00
* `fee_proportional_millionths` (32 bits, big-endian)
2017-06-27 12:38:13 +02:00
* `cltv_expiry_delta` (16 bits, big-endian)
2019-08-28 03:20:02 +02:00
* `9` (5): `data_length` variable. One or more 5-bit values containing features
2019-07-18 09:19:32 +02:00
supported or required for receiving this payment.
See [Feature Bits ](#feature-bits ).
2017-06-27 12:38:13 +02:00
### Requirements
2018-11-10 04:17:26 +01:00
A writer:
2020-02-27 09:32:09 +01:00
- MUST include exactly one `p` field.
2021-08-10 17:22:23 +02:00
- MUST include exactly one `s` field.
2018-11-10 04:17:26 +01:00
- MUST set `payment_hash` to the SHA2 256-bit hash of the `payment_preimage`
2018-11-07 06:35:30 +01:00
that will be given in return for payment.
- MUST include either exactly one `d` or exactly one `h` field.
- if `d` is included:
- MUST set `d` to a valid UTF-8 string.
- SHOULD use a complete description of the purpose of the payment.
- if `h` is included:
2018-11-10 04:17:26 +01:00
- MUST make the preimage of the hashed description in `h` available
2018-11-07 06:35:30 +01:00
through some unspecified means.
- SHOULD use a complete description of the purpose of the payment.
- MAY include one `x` field.
2019-07-18 09:19:32 +02:00
- if `x` is included:
- SHOULD use the minimum `data_length` possible.
2020-07-21 09:15:34 +02:00
- MUST include one `c` field (`min_final_cltv_expiry`).
2018-11-10 04:17:26 +01:00
- MUST set `c` to the minimum `cltv_expiry` it will accept for the last
2018-11-07 06:35:30 +01:00
HTLC in the route.
2020-07-21 09:15:34 +02:00
- SHOULD use the minimum `data_length` possible.
2019-07-17 09:45:36 +02:00
- MAY include one `n` field. (Otherwise performing signature recovery is required)
2018-11-07 06:35:30 +01:00
- MUST set `n` to the public key used to create the `signature` .
- MAY include one or more `f` fields.
- for Bitcoin payments:
2018-11-10 04:17:26 +01:00
- MUST set an `f` field to a valid witness version and program, OR to `17`
2018-11-07 06:35:30 +01:00
followed by a public key hash, OR to `18` followed by a script hash.
- if there is NOT a public channel associated with its public key:
2018-11-10 04:17:26 +01:00
- MUST include at least one `r` field.
- `r` field MUST contain one or more ordered entries, indicating the forward route from
a public node to the final destination.
- Note: for each entry, the `pubkey` is the node ID of the start of the channel;
`short_channel_id` is the short channel ID field to identify the channel; and
`fee_base_msat` , `fee_proportional_millionths` , and `cltv_expiry_delta` are as
specified in [BOLT #7 ](07-routing-gossip.md#the-channel_update-message ).
2018-11-07 06:35:30 +01:00
- MAY include more than one `r` field to provide multiple routing options.
2019-07-18 09:19:32 +02:00
- if `9` contains non-zero bits:
- SHOULD use the minimum `data_length` possible.
- otherwise:
- MUST omit the `9` field altogether.
2018-11-07 06:35:30 +01:00
- MUST pad field data to a multiple of 5 bits, using 0s.
- if a writer offers more than one of any field type, it:
- MUST specify the most-preferred field first, followed by less-preferred fields, in order.
2017-06-27 12:38:13 +02:00
2018-11-07 06:35:30 +01:00
A reader:
2019-11-26 04:15:48 +01:00
- MUST skip over unknown fields, OR an `f` field with unknown `version` , OR `p` , `h` , `s` or
`n` fields that do NOT have `data_length` s of 52, 52, 52 or 53, respectively.
2019-07-18 09:19:32 +02:00
- if the `9` field contains unknown _odd_ bits that are non-zero:
- MUST ignore the bit.
- if the `9` field contains unknown _even_ bits that are non-zero:
2019-08-28 03:20:02 +02:00
- MUST fail the payment.
- SHOULD indicate the unknown bit to the user.
2018-11-10 04:17:26 +01:00
- MUST check that the SHA2 256-bit hash in the `h` field exactly matches the hashed
2018-11-07 06:35:30 +01:00
description.
- if a valid `n` field is provided:
- MUST use the `n` field to validate the signature instead of performing signature recovery.
2019-11-26 04:15:48 +01:00
- if there is a valid `s` field:
- MUST use that as [`payment_secret` ](04-onion-routing.md#tlv_payload-payload-format )
2020-07-21 09:15:34 +02:00
- if the `c` field (`min_final_cltv_expiry`) is not provided:
- MUST use an expiry delta of at least 18 when making the payment
2017-06-27 12:38:13 +02:00
### Rationale
The type-and-length format allows future extensions to be backward
2017-12-16 01:35:10 +01:00
compatible. `data_length` is always a multiple of 5 bits, for easy
2018-11-10 04:17:26 +01:00
encoding and decoding. Readers also ignore fields of different length,
for fields that are expected may change.
2017-06-27 12:38:13 +02:00
The `p` field supports the current 256-bit payment hash, but future
2018-11-10 04:17:26 +01:00
specs could add a new variant of different length: in which case,
writers could support both old and new variants, and old readers would
ignore the variant not the correct length.
2017-06-27 12:38:13 +02:00
The `d` field allows inline descriptions, but may be insufficient for
2018-11-10 04:17:26 +01:00
complex orders. Thus, the `h` field allows a summary: though the method
2017-12-16 01:35:10 +01:00
by which the description is served is as-yet unspecified and will
2018-11-10 04:17:26 +01:00
probably be transport dependent. The `h` format could change in the future,
2017-12-16 01:35:10 +01:00
by changing the length, so readers ignore it if it's not 256 bits.
2017-06-27 12:38:13 +02:00
The `n` field can be used to explicitly specify the destination node ID,
instead of requiring signature recovery.
2017-12-27 23:32:07 +01:00
The `x` field gives warning as to when a payment will be
2018-11-10 04:17:26 +01:00
refused: mainly to avoid confusion. The default was chosen
2017-12-16 01:35:10 +01:00
to be reasonable for most payments and to allow sufficient time for
2018-11-10 04:17:26 +01:00
on-chain payment, if necessary.
2017-06-27 12:38:13 +02:00
2018-11-10 04:17:26 +01:00
The `c` field allows a way for the destination node to require a specific
2018-01-30 05:26:52 +01:00
minimum CLTV expiry for its incoming HTLC. Destination nodes may use this
2018-11-10 04:17:26 +01:00
to require a higher, more conservative value than the default one (depending
on their fee estimation policy and their sensitivity to time locks). Note
2018-01-30 05:26:52 +01:00
that remote nodes in the route specify their required `cltv_expiry_delta`
2017-10-18 15:31:31 +02:00
in the `channel_update` message, which they can update at all times.
2018-11-10 04:17:26 +01:00
The `f` field allows on-chain fallback; however, this may not make sense for
tiny or time-sensitive payments. It's possible that new
address forms will appear; thus, multiple `f` fields (in an implied
preferred order) help with transition, and `f` fields with versions 19-31
2017-06-27 12:38:13 +02:00
will be ignored by readers.
2018-11-10 04:17:26 +01:00
The `r` field allows limited routing assistance: as specified, it only
allows minimum information to use private channels, however, it could also
2017-08-03 03:23:21 +02:00
assist in future partial-knowledge routing.
2017-06-27 12:38:13 +02:00
2018-01-08 19:59:00 +01:00
### Security Considerations for Payment Descriptions
Payment descriptions are user-defined and provide a potential avenue for
2018-11-10 04:17:26 +01:00
injection attacks: during the processes of both rendering and persistence.
2018-01-08 19:59:00 +01:00
Payment descriptions should always be sanitized before being displayed in
2018-11-10 04:17:26 +01:00
HTML/Javascript contexts (or any other dynamically interpreted rendering
frameworks). Implementers should be extra perceptive to the possibility of
reflected XSS attacks, when decoding and displaying payment descriptions. Avoid
2018-01-08 19:59:00 +01:00
optimistically rendering the contents of the payment request until all
2018-11-10 04:17:26 +01:00
validation, verification, and sanitization processes have been successfully
completed.
2018-01-08 19:59:00 +01:00
Furthermore, consider using prepared statements, input validation, and/or
2018-11-10 04:17:26 +01:00
escaping, to protect against injection vulnerabilities in persistence
2018-01-08 19:59:00 +01:00
engines that support SQL or other dynamically interpreted querying languages.
* [Stored and Reflected XSS Prevention ](https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting )_Prevention_Cheat_Sheet)
* [DOM-based XSS Prevention ](https://www.owasp.org/index.php/DOM_based_XSS_Prevention_Cheat_Sheet )
* [SQL Injection Prevention ](https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet )
Don't be like the school of [Little Bobby Tables ](https://xkcd.com/327/ ).
2019-07-18 09:19:32 +02:00
## Feature Bits
Feature bits allow forward and backward compatibility, and follow the
2019-10-30 07:02:10 +01:00
_it's ok to be odd_ rule. Features appropriate for use in the `9` field
are marked in [BOLT 9 ](09-features.md ).
2019-07-18 09:19:32 +02:00
The field is big-endian. The least-significant bit is numbered 0,
which is _even_ , and the next most significant bit is numbered 1,
which is _odd_ .
2019-11-26 04:15:48 +01:00
### Requirements
A writer:
2020-01-17 23:53:11 +01:00
- MUST set the `9` field to a feature vector compliant with the
[BOLT 9 origin node requirements ](09-features.md#requirements ).
2019-11-26 04:15:48 +01:00
A reader:
2020-01-17 23:53:11 +01:00
- if the feature vector does not set all known, transitive feature dependencies:
- MUST NOT attempt the payment.
2019-11-26 04:15:48 +01:00
- if the `basic_mpp` feature is offered in the invoice:
- MAY pay using [Basic multi-part payments ](04-onion-routing.md#basic-multi-part-payments ).
- otherwise:
- MUST NOT use [Basic multi-part payments ](04-onion-routing.md#basic-multi-part-payments ).
2017-06-27 12:38:13 +02:00
# Payer / Payee Interactions
2017-12-16 01:35:10 +01:00
These are generally defined by the rest of the Lightning BOLT series,
2019-07-09 09:38:34 +02:00
but it's worth noting that [BOLT #4 ](04-onion-routing.md#requirements-2 ) specifies that the payee SHOULD
2017-06-27 12:38:13 +02:00
accept up to twice the expected `amount` , so the payer can make
payments harder to track by adding small variations.
2019-09-25 12:34:18 +02:00
The intent is that the payer recovers the payee's node ID from the
2017-12-16 01:35:10 +01:00
signature, and after checking that conditions such as fees,
2019-09-25 12:34:18 +02:00
expiry, and block timeout are acceptable, attempts a payment. It can use `r` fields to
2018-11-10 04:17:26 +01:00
augment its routing information, if necessary to reach the final node.
2017-06-27 12:38:13 +02:00
If the payment succeeds but there is a later dispute, the payer can
2017-12-16 01:35:10 +01:00
prove both the signed offer from the payee and the successful
2017-06-27 12:38:13 +02:00
payment.
## Payer / Payee Requirements
2018-11-10 04:17:26 +01:00
A payer:
- after the `timestamp` plus `expiry` has passed:
- SHOULD NOT attempt a payment.
- otherwise:
- if a Lightning payment fails:
- MAY attempt to use the address given in the first `f` field that it
understands for payment.
- MAY use the sequence of channels, specified by the `r` field, to route to the payee.
- SHOULD consider the fee amount and payment timeout before initiating payment.
- SHOULD use the first `p` field that it did NOT skip as the payment hash.
2017-06-27 12:38:13 +02:00
2018-11-10 04:17:26 +01:00
A payee:
- after the `timestamp` plus `expiry` has passed:
- SHOULD NOT accept a payment.
2017-06-27 12:38:13 +02:00
# Implementation
https://github.com/rustyrussell/lightning-payencode
# Examples
2021-07-12 11:54:18 +02:00
NB: all the following examples are signed with `priv_key` =`e126f68f7eafcc8b74f54d269fe206be715000f94dac067d1c04a8ca3b2db734`.
All invoices contain a `payment_secret` =`1111111111111111111111111111111111111111111111111111111111111111` unless otherwise noted.
2017-07-15 03:00:26 +02:00
2017-06-27 12:38:13 +02:00
> ### Please make a donation of any amount using payment_hash 0001020304050607080900010203040506070809000102030405060708090102 to me @03e7156ae33b0a208d0744199163177e909e80176e55d97a2f221ede0f934dd9ad
2021-07-12 11:54:18 +02:00
> lnbc1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq0py3tfrnxkt5xadpzangn5rry6r0kqt4f3g36lwln8wwpxtxqccn5agpyte3nx0v78uwn78zu6k30k5mgdgn50yvnd20namlmzp2ersq8065fg
2017-06-27 12:38:13 +02:00
Breakdown:
2018-10-18 07:41:46 +02:00
* `lnbc` : prefix, Lightning on Bitcoin mainnet
2017-06-27 12:38:13 +02:00
* `1` : Bech32 separator
* `pvjluez` : timestamp (1496314658)
2021-07-12 11:54:18 +02:00
* `s` : payment secret
* `p5` : `data_length` (`p` = 1, `5` = 20; 1 * 32 + 20 == 52)
* `zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygs` : payment secret 1111111111111111111111111111111111111111111111111111111111111111
2017-09-04 02:26:52 +02:00
* `p` : payment hash
2017-12-20 01:06:30 +01:00
* `p5` : `data_length` (`p` = 1, `5` = 20; 1 * 32 + 20 == 52)
2017-09-04 02:26:52 +02:00
* `qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypq` : payment hash 0001020304050607080900010203040506070809000102030405060708090102
2017-07-15 03:00:26 +02:00
* `d` : short description
2017-12-20 01:06:30 +01:00
* `pl` : `data_length` (`p` = 1, `l` = 31; 1 * 32 + 31 == 63)
2017-07-15 03:00:26 +02:00
* `2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq` : 'Please consider supporting this project'
2021-07-12 11:54:18 +02:00
* `0py3tfrnxkt5xadpzangn5rry6r0kqt4f3g36lwln8wwpxtxqccn5agpyte3nx0v78uwn78zu6k30k5mgdgn50yvnd20namlmzp2ersq` : signature
* `8065fg` : Bech32 checksum
2017-12-08 03:08:49 +01:00
* Signature breakdown:
2021-07-12 11:54:18 +02:00
* `784915a47335974375a1176689d0632686fb01754c511d7ddf99dce0996606313a750122f31999ecf1f8e9f8e2e6ad17da9b43513a3c8c9b54f9f77fd882ac8e` hex of signature data (32-byte r, 32-byte s)
2017-12-08 03:08:49 +01:00
* `0` (int) recovery flag contained in `signature`
2021-07-12 11:54:18 +02:00
* `6c6e62630b25fe64500d04444444444444444444444444444444444444444444444444444444444444444021a00008101820283038404800081018202830384048000810182028303840480810343f506c6561736520636f6e736964657220737570706f7274696e6720746869732070726f6a65637400` hex of data for signing (prefix + data after separator up to the start of the signature)
* `22a303652832bb8d1e86a4c6333c8795111592831f3422f19a9f7c786b48fd69` hex of SHA256 of the preimage
2017-06-27 12:38:13 +02:00
2018-10-18 07:41:46 +02:00
> ### Please send $3 for a cup of coffee to the same peer, within one minute
2021-07-12 11:54:18 +02:00
> lnbc2500u1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpuu4tgyw2zt3v3c7eljkv2cn8a3etgn8kh8ukctqdmuxdfa7xup0w5ruwpt6eugv73pgzqczz3nc8tcqt2pcljp8ldkrnu5klff35vyscq6lp6ja
2018-01-08 23:04:26 +01:00
Breakdown:
2018-10-18 07:41:46 +02:00
* `lnbc` : prefix, Lightning on Bitcoin mainnet
2018-01-08 23:04:26 +01:00
* `2500u` : amount (2500 micro-bitcoin)
* `1` : Bech32 separator
* `pvjluez` : timestamp (1496314658)
2021-07-12 11:54:18 +02:00
* `s` : payment secret...
2018-01-08 23:04:26 +01:00
* `p` : payment hash...
* `d` : short description
* `q5` : `data_length` (`q` = 0, `5` = 20; 0 * 32 + 20 == 20)
* `xysxxatsyp3k7enxv4js` : '1 cup coffee'
* `x` : expiry time
* `qz` : `data_length` (`q` = 0, `z` = 2; 0 * 32 + 2 == 2)
* `pu` : 60 seconds (`p` = 1, `u` = 28; 1 * 32 + 28 == 60)
2021-07-12 11:54:18 +02:00
* `u4tgyw2zt3v3c7eljkv2cn8a3etgn8kh8ukctqdmuxdfa7xup0w5ruwpt6eugv73pgzqczz3nc8tcqt2pcljp8ldkrnu5klff35vyscq` : signature
* `6lp6ja` : Bech32 checksum
2018-01-08 23:04:26 +01:00
* Signature breakdown:
2021-07-12 11:54:18 +02:00
* `e5568239425c591c7b3f9598ac4cfd8e56899ed73f2d8581bbe19a9ef8dc0bdd41f1c15eb3c433d10a040c08519e0ebc016a0e3f209fedb0e7ca5be94c68c243` hex of signature data (32-byte r, 32-byte s)
* `0` (int) recovery flag contained in `signature`
* `6c6e626332353030750b25fe64500d04444444444444444444444444444444444444444444444444444444444444444021a000081018202830384048000810182028303840480008101820283038404808103414312063757020636f66666565030041e0` hex of data for signing (prefix + data after separator up to the start of the signature)
* `0c23bee14ec6b62e062af54840c7ba0e5b0e41566dff2f8e0f55f1649ac8219b` hex of SHA256 of the preimage
2018-01-08 23:04:26 +01:00
2018-10-18 07:41:46 +02:00
> ### Please send 0.0025 BTC for a cup of nonsense (ナンセンス 1杯) to the same peer, within one minute
2021-07-12 11:54:18 +02:00
> lnbc2500u1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpquwpc4curk03c9wlrswe78q4eyqc7d8d0xqzpuy0x9mrk2a32xsyvz6lzmrs38vzemux64pv6vdtmshnr9fc8eqgt4j74fnf3s60tzgeh6dnwzyv56wftaqwyyl3xu9nccq3py2hnnvsgqu5lqmm
2017-06-27 12:38:13 +02:00
Breakdown:
2018-10-18 07:41:46 +02:00
* `lnbc` : prefix, Lightning on Bitcoin mainnet
2017-06-27 12:38:13 +02:00
* `2500u` : amount (2500 micro-bitcoin)
* `1` : Bech32 separator
* `pvjluez` : timestamp (1496314658)
2021-07-12 11:54:18 +02:00
* `s` : payment secret...
2017-09-04 02:26:52 +02:00
* `p` : payment hash...
2017-06-27 12:38:13 +02:00
* `d` : short description
2017-12-21 04:35:32 +01:00
* `pq` : `data_length` (`p` = 1, `q` = 0; 1 * 32 + 0 == 32)
* `uwpc4curk03c9wlrswe78q4eyqc7d8d0` : 'ナンセンス 1杯'
2017-06-27 12:38:13 +02:00
* `x` : expiry time
2017-12-20 01:06:30 +01:00
* `qz` : `data_length` (`q` = 0, `z` = 2; 0 * 32 + 2 == 2)
* `pu` : 60 seconds (`p` = 1, `u` = 28; 1 * 32 + 28 == 60)
2021-07-12 11:54:18 +02:00
* `y0x9mrk2a32xsyvz6lzmrs38vzemux64pv6vdtmshnr9fc8eqgt4j74fnf3s60tzgeh6dnwzyv56wftaqwyyl3xu9nccq3py2hnnvsgq` : signature
* `u5lqmm` : Bech32 checksum
2017-12-08 03:08:49 +01:00
* Signature breakdown:
2021-07-12 11:54:18 +02:00
* `23cc5d8ecaec54681182d7c5b1c22760b3be1b550b34c6af70bcc654e0f90217597aa99a630d3d62466fa6cdc22329a7257d03884fc4dc2cf180442455e73641` hex of signature data (32-byte r, 32-byte s)
2017-12-21 04:35:32 +01:00
* `0` (int) recovery flag contained in `signature`
2021-07-12 11:54:18 +02:00
* `6c6e626332353030750b25fe64500d04444444444444444444444444444444444444444444444444444444444444444021a000081018202830384048000810182028303840480008101820283038404808103420e3838ae383b3e382bbe383b3e382b92031e69daf30041e00` hex of data for signing (prefix + data after separator up to the start of the signature)
* `6cf6a69d27da81339c117489222f2e91263c63fc240590add902762742bec1b6` hex of SHA256 of the preimage
2017-06-27 12:38:13 +02:00
> ### Now send $24 for an entire list of things (hashed)
2021-07-12 11:54:18 +02:00
> lnbc20m1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqhp58yjmdan79s6qqdhdzgynm4zwqd5d7xmw5fk98klysy043l2ahrqs6e4fy93me7wjwdf9sxgrzr8xldm570z02ur92rv6pa7wkhzpfehnecuyhp4mdhsv5t7em4jz4tjtchs8zmx3tr555yl59lk848due0gqvkanpl
2017-06-27 12:38:13 +02:00
Breakdown:
2018-10-18 07:41:46 +02:00
* `lnbc` : prefix, Lightning on Bitcoin mainnet
2017-06-27 12:38:13 +02:00
* `20m` : amount (20 milli-bitcoin)
* `1` : Bech32 separator
* `pvjluez` : timestamp (1496314658)
2021-07-12 11:54:18 +02:00
* `s` : payment secret...
2017-09-04 02:26:52 +02:00
* `p` : payment hash...
2017-06-27 12:38:13 +02:00
* `h` : tagged field: hash of description
2017-12-20 01:06:30 +01:00
* `p5` : `data_length` (`p` = 1, `5` = 20; 1 * 32 + 20 == 52)
2017-06-27 12:38:13 +02:00
* `8yjmdan79s6qqdhdzgynm4zwqd5d7xmw5fk98klysy043l2ahrqs` : SHA256 of 'One piece of chocolate cake, one icecream cone, one pickle, one slice of swiss cheese, one slice of salami, one lollypop, one piece of cherry pie, one sausage, one cupcake, and one slice of watermelon'
2021-07-12 11:54:18 +02:00
* `6e4fy93me7wjwdf9sxgrzr8xldm570z02ur92rv6pa7wkhzpfehnecuyhp4mdhsv5t7em4jz4tjtchs8zmx3tr555yl59lk848due0gq` : signature
* `vkanpl` : Bech32 checksum
2017-12-08 03:08:49 +01:00
* Signature breakdown:
2021-07-12 11:54:18 +02:00
* `d66a92163bcf9d2735258190310ce6fb774f3c4f5706550d9a0f7ceb5c414e6f3ce384b86bb6de0ca2fd9dd642aae4bc5e0716cd158e94a13f42fec7a9dbccbd` hex of signature data (32-byte r, 32-byte s)
2017-12-08 03:08:49 +01:00
* `0` (int) recovery flag contained in `signature`
2021-07-12 11:54:18 +02:00
* `6c6e626332306d0b25fe64500d04444444444444444444444444444444444444444444444444444444444444444021a000081018202830384048000810182028303840480008101820283038404808105c343925b6f67e2c340036ed12093dd44e0368df1b6ea26c53dbe4811f58fd5db8c100` hex of data for signing (prefix + data after separator up to the start of the signature)
* `ac4814cf47b9ffc20056eb6d6f0902427a765df8bdf0c375eb80df9dd69e2c44` hex of SHA256 of the preimage
2017-06-27 12:38:13 +02:00
> ### The same, on testnet, with a fallback address mk2QpYatsKicvFVuTAQLBryyccRXMUaGHP
2021-07-12 11:54:18 +02:00
> lntb20m1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygshp58yjmdan79s6qqdhdzgynm4zwqd5d7xmw5fk98klysy043l2ahrqspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqfpp3x9et2e20v6pu37c5d9vax37wxq72un989yc66dftyfrx5g53s7r80rxljxj8wugm7nhqcnfdmqzw758jda4yur0nxahhyg04ln2p47wmjdrz5weu2ajfqh4l2qya4244ujuytvgp6nw4dc
2017-06-27 12:38:13 +02:00
Breakdown:
2018-10-18 07:41:46 +02:00
* `lntb` : prefix, Lightning on Bitcoin testnet
2017-06-27 12:38:13 +02:00
* `20m` : amount (20 milli-bitcoin)
* `1` : Bech32 separator
* `pvjluez` : timestamp (1496314658)
2017-12-16 01:35:10 +01:00
* `h` : tagged field: hash of description...
2021-07-12 11:54:18 +02:00
* `s` : payment secret...
2017-09-04 02:26:52 +02:00
* `p` : payment hash...
2017-06-27 12:38:13 +02:00
* `f` : tagged field: fallback address
2017-12-20 01:06:30 +01:00
* `pp` : `data_length` (`p` = 1; 1 * 32 + 1 == 33)
2017-10-11 12:25:44 +02:00
* `3` = 17, so P2PKH address
2018-10-18 07:41:46 +02:00
* `x9et2e20v6pu37c5d9vax37wxq72un98` : 160-bit P2PKH address
2021-07-12 11:54:18 +02:00
* `9yc66dftyfrx5g53s7r80rxljxj8wugm7nhqcnfdmqzw758jda4yur0nxahhyg04ln2p47wmjdrz5weu2ajfqh4l2qya4244ujuytvgp` : signature
* `6nw4dc` : Bech32 checksum
2017-12-08 03:08:49 +01:00
* Signature breakdown:
2021-07-12 11:54:18 +02:00
* `2931ad352b22466a22918786778cdf91a477711bf4ee0c4d2dd804ef50f26f6a4e0df3376f7221f5fcd41af9db93462a3b3c5764905ebf5009daaab5e4b845b1` hex of signature data (32-byte r, 32-byte s)
2017-12-08 03:08:49 +01:00
* `1` (int) recovery flag contained in `signature`
2021-07-12 11:54:18 +02:00
* `6c6e746232306d0b25fe64500d044444444444444444444444444444444444444444444444444444444444444442e1a1c92db7b3f161a001b7689049eea2701b46f8db7513629edf2408fac7eaedc608043400010203040506070809000102030405060708090001020304050607080901020484313172b5654f6683c8fb146959d347ce303cae4ca7` hex of data for signing (prefix + data after separator up to the start of the signature)
* `c1c4b94d0e537cec5c6dd9ffc7f66d665476d3392e7bb860ebcaddc7d88ac569` hex of SHA256 of the preimage
2017-06-27 12:38:13 +02:00
2017-08-03 03:23:21 +02:00
> ### On mainnet, with fallback address 1RustyRX2oai4EYYDpQGWvEL62BBGqN9T with extra routing info to go via nodes 029e03a901b85534ff1e92c43c74431f7ce72046060fcf7a95c37e148f78c77255 then 039e03a901b85534ff1e92c43c74431f7ce72046060fcf7a95c37e148f78c77255
2021-07-12 11:54:18 +02:00
> lnbc20m1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqhp58yjmdan79s6qqdhdzgynm4zwqd5d7xmw5fk98klysy043l2ahrqsfpp3qjmp7lwpagxun9pygexvgpjdc4jdj85fr9yq20q82gphp2nflc7jtzrcazrra7wwgzxqc8u7754cdlpfrmccae92qgzqvzq2ps8pqqqqqqpqqqqq9qqqvpeuqafqxu92d8lr6fvg0r5gv0heeeqgcrqlnm6jhphu9y00rrhy4grqszsvpcgpy9qqqqqqgqqqqq7qqzqg042ea62q6wnxh909rfuu4x2amxc59mj99mrhr32kvqhytrm04us8edg0syy9n0ukgam0ud20jcxwskphv3rzpnengjsf8m3w9u5w8cqzrhtg2
2017-06-27 12:38:13 +02:00
Breakdown:
2018-10-18 07:41:46 +02:00
* `lnbc` : prefix, Lightning on Bitcoin mainnet
2017-06-27 12:38:13 +02:00
* `20m` : amount (20 milli-bitcoin)
* `1` : Bech32 separator
* `pvjluez` : timestamp (1496314658)
2021-07-12 11:54:18 +02:00
* `s` : payment secret...
2017-09-04 02:26:52 +02:00
* `p` : payment hash...
2017-06-27 12:38:13 +02:00
* `h` : tagged field: hash of description...
2017-08-03 03:23:21 +02:00
* `f` : tagged field: fallback address
2017-12-20 01:06:30 +01:00
* `pp` : `data_length` (`p` = 1; 1 * 32 + 1 == 33)
2017-10-11 12:25:44 +02:00
* `3` = 17, so P2PKH address
2018-10-18 07:41:46 +02:00
* `qjmp7lwpagxun9pygexvgpjdc4jdj85f` : 160-bit P2PKH address
2017-08-03 03:23:21 +02:00
* `r` : tagged field: route information
2018-10-18 07:41:46 +02:00
* `9y` : `data_length` (`9` = 5, `y` = 4; 5 * 32 + 4 == 164)
2018-11-10 04:17:26 +01:00
* `q20q82gphp2nflc7jtzrcazrra7wwgzxqc8u7754cdlpfrmccae92qgzqvzq2ps8pqqqqqqpqqqqq9qqqvpeuqafqxu92d8lr6fvg0r5gv0heeeqgcrqlnm6jhphu9y00rrhy4grqszsvpcgpy9qqqqqqgqqqqq7qqzq` :
2018-05-29 17:39:44 +02:00
* pubkey: `029e03a901b85534ff1e92c43c74431f7ce72046060fcf7a95c37e148f78c77255`
* `short_channel_id` : 0102030405060708
* `fee_base_msat` : 1 millisatoshi
* `fee_proportional_millionths` : 20
* `cltv_expiry_delta` : 3
* pubkey: `039e03a901b85534ff1e92c43c74431f7ce72046060fcf7a95c37e148f78c77255`
* `short_channel_id` : 030405060708090a
* `fee_base_msat` : 2 millisatoshi
* `fee_proportional_millionths` : 30
* `cltv_expiry_delta` : 4
2021-07-12 11:54:18 +02:00
* `g042ea62q6wnxh909rfuu4x2amxc59mj99mrhr32kvqhytrm04us8edg0syy9n0ukgam0ud20jcxwskphv3rzpnengjsf8m3w9u5w8cq` : signature
* `zrhtg2` : Bech32 checksum
2017-12-08 03:08:49 +01:00
* Signature breakdown:
2021-07-12 11:54:18 +02:00
* `43eaacf74a069d335caf28d3ce54caeecd8a177229763b8e2ab301722c7b7d7903e5a87c0842cdfcb23bb7f1aa7cb06742c1bb223106799a25049f717179471f` hex of signature data (32-byte r, 32-byte s)
2017-12-08 03:08:49 +01:00
* `0` (int) recovery flag contained in `signature`
2021-07-12 11:54:18 +02:00
* `6c6e626332306d0b25fe64500d04444444444444444444444444444444444444444444444444444444444444444021a000081018202830384048000810182028303840480008101820283038404808105c343925b6f67e2c340036ed12093dd44e0368df1b6ea26c53dbe4811f58fd5db8c104843104b61f7dc1ea0dc99424464cc4064dc564d91e891948053c07520370aa69fe3d258878e8863ef9ce408c0c1f9ef52b86fc291ef18ee4aa020406080a0c0e1000000002000000280006073c07520370aa69fe3d258878e8863ef9ce408c0c1f9ef52b86fc291ef18ee4aa06080a0c0e101214000000040000003c000800` hex of data for signing (prefix + data after separator up to the start of the signature)
* `998925a544c62142fdc56942096dc4f2b532267b1d94bb67f3cab7a6ea7e8e76` hex of SHA256 of the preimage
2017-06-27 12:38:13 +02:00
> ### On mainnet, with fallback (P2SH) address 3EktnHQD7RiAE6uzMj2ZifT9YgRrkSgzQX
2021-07-12 11:54:18 +02:00
> lnbc20m1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygshp58yjmdan79s6qqdhdzgynm4zwqd5d7xmw5fk98klysy043l2ahrqspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqfppj3a24vwu6r8ejrss3axul8rxldph2q7z9859drl0equ52uf58vpc4ekc58katdnsa0wpxrp7x8m34kz9wh4rhlk2ke89c5uuwcngz8axxkhs9drar8j3h83k5yx27s7fw7l9va2cpt3h3em
2017-06-27 12:38:13 +02:00
Breakdown:
2018-10-18 07:41:46 +02:00
* `lnbc` : prefix, Lightning on Bitcoin mainnet
2017-06-27 12:38:13 +02:00
* `20m` : amount (20 milli-bitcoin)
* `1` : Bech32 separator
* `pvjluez` : timestamp (1496314658)
2021-07-12 11:54:18 +02:00
* `s` : payment secret...
2017-12-16 01:35:10 +01:00
* `h` : tagged field: hash of description...
2017-09-04 02:26:52 +02:00
* `p` : payment hash...
2017-12-16 01:35:10 +01:00
* `f` : tagged field: fallback address
2017-12-20 01:06:30 +01:00
* `pp` : `data_length` (`p` = 1; 1 * 32 + 1 == 33)
2017-10-11 12:25:44 +02:00
* `j` = 18, so P2SH address
2018-10-18 07:41:46 +02:00
* `3a24vwu6r8ejrss3axul8rxldph2q7z9` : 160-bit P2SH address
2021-07-12 11:54:18 +02:00
* `859drl0equ52uf58vpc4ekc58katdnsa0wpxrp7x8m34kz9wh4rhlk2ke89c5uuwcngz8axxkhs9drar8j3h83k5yx27s7fw7l9va2cp` : signature
* `t3h3em` : Bech32 checksum
2017-12-08 03:08:49 +01:00
* Signature breakdown:
2021-07-12 11:54:18 +02:00
* `3d0ad1fdf90728ae268760715cdb143dbab6ce1d7b826187c63ee35b08aebd477fd956c9cb8a738ec4d023f4c6b5e0568fa33ca373c6d42195e8792ef7caceab` hex of signature data (32-byte r, 32-byte s)
* `1` (int) recovery flag contained in `signature`
* `6c6e626332306d0b25fe64500d044444444444444444444444444444444444444444444444444444444444444442e1a1c92db7b3f161a001b7689049eea2701b46f8db7513629edf2408fac7eaedc608043400010203040506070809000102030405060708090001020304050607080901020484328f55563b9a19f321c211e9b9f38cdf686ea07845` hex of data for signing (prefix + data after separator up to the start of the signature)
* `47b81292dcda0b7399d1b6ee89a5640f56fad5494c8b61db2bc0036ff81f9cd4` hex of SHA256 of the preimage
2017-06-27 12:38:13 +02:00
> ### On mainnet, with fallback (P2WPKH) address bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4
2021-07-12 11:54:18 +02:00
> lnbc20m1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygshp58yjmdan79s6qqdhdzgynm4zwqd5d7xmw5fk98klysy043l2ahrqspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqfppqw508d6qejxtdg4y5r3zarvary0c5xw7k2v7at953q5p0dyg8axg4xxfxsm5d4hl8x2j606a5usxzgzs35rjq2m05ly7qlt293get8qct3tsv2h0f87ygthvg5mentx24yf39v4gpgx7n58
2017-06-27 12:38:13 +02:00
2018-10-18 07:41:46 +02:00
* `lnbc` : prefix, Lightning on Bitcoin mainnet
2017-06-27 12:38:13 +02:00
* `20m` : amount (20 milli-bitcoin)
* `1` : Bech32 separator
* `pvjluez` : timestamp (1496314658)
2021-07-12 11:54:18 +02:00
* `s` : payment secret...
2017-12-16 01:35:10 +01:00
* `h` : tagged field: hash of description...
2017-09-04 02:26:52 +02:00
* `p` : payment hash...
2017-12-16 01:35:10 +01:00
* `f` : tagged field: fallback address
2017-12-20 01:06:30 +01:00
* `pp` : `data_length` (`p` = 1; 1 * 32 + 1 == 33)
2017-12-16 01:35:10 +01:00
* `q` : 0, so witness version 0
2017-10-11 12:25:44 +02:00
* `w508d6qejxtdg4y5r3zarvary0c5xw7k` : 160 bits = P2WPKH.
2021-07-12 11:54:18 +02:00
* `2v7at953q5p0dyg8axg4xxfxsm5d4hl8x2j606a5usxzgzs35rjq2m05ly7qlt293get8qct3tsv2h0f87ygthvg5mentx24yf39v4gp` : signature
* `gx7n58` : Bech32 checksum
2017-12-08 03:08:49 +01:00
* Signature breakdown:
2021-07-12 11:54:18 +02:00
* `533dd596910502f69107e99153192686e8dadfe732a5a7ebb4e40c240a11a0e4056df4f93c0fad458a32b3830b8ae0c55de93f8885dd88a6f335995522625655` hex of signature data (32-byte r, 32-byte s)
* `1` (int) recovery flag contained in `signature`
* `6c6e626332306d0b25fe64500d044444444444444444444444444444444444444444444444444444444444444442e1a1c92db7b3f161a001b7689049eea2701b46f8db7513629edf2408fac7eaedc60804340001020304050607080900010203040506070809000102030405060708090102048420751e76e8199196d454941c45d1b3a323f1433bd6` hex of data for signing (prefix + data after separator up to the start of the signature)
* `1b3b688ca6a84b91e0097ad6def95523333db50a27b9e15fa719a5d18683b409` hex of SHA256 of the preimage
2017-06-27 12:38:13 +02:00
> ### On mainnet, with fallback (P2WSH) address bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3
2021-07-12 11:54:18 +02:00
> lnbc20m1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygshp58yjmdan79s6qqdhdzgynm4zwqd5d7xmw5fk98klysy043l2ahrqspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqfp4qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qdplqpgddtaej8regxl46lj2jgu0s8yeent3dugye96zsldwtu2a3edz947azn7qksetrrk38mx2kryp0vxnh2nqgenuwcdau5flwa2cqcnjrk0
2017-06-27 12:38:13 +02:00
2018-10-18 07:41:46 +02:00
* `lnbc` : prefix, Lightning on Bitcoin mainnet
2017-06-27 12:38:13 +02:00
* `20m` : amount (20 milli-bitcoin)
* `1` : Bech32 separator
* `pvjluez` : timestamp (1496314658)
2021-07-12 11:54:18 +02:00
* `s` : payment secret...
2017-12-16 01:35:10 +01:00
* `h` : tagged field: hash of description...
2017-09-04 02:26:52 +02:00
* `p` : payment hash...
2017-12-16 01:35:10 +01:00
* `f` : tagged field: fallback address
2017-12-20 01:06:30 +01:00
* `p4` : `data_length` (`p` = 1, `4` = 21; 1 * 32 + 21 == 53)
2017-12-16 01:35:10 +01:00
* `q` : 0, so witness version 0
2017-06-27 12:38:13 +02:00
* `rp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q` : 260 bits = P2WSH.
2021-07-12 11:54:18 +02:00
* `dplqpgddtaej8regxl46lj2jgu0s8yeent3dugye96zsldwtu2a3edz947azn7qksetrrk38mx2kryp0vxnh2nqgenuwcdau5flwa2cq` : signature
* `cnjrk0` : Bech32 checksum
2017-12-08 03:08:49 +01:00
* Signature breakdown:
2021-07-12 11:54:18 +02:00
* `687e00a1ad5f73238f2837ebafc952471f0393399ae2de20992e850fb5cbe2bb1cb445afba29f816865631da27d99561902f61a7754c08ccf8ec37bca27eeeab` hex of signature data (32-byte r, 32-byte s)
2017-12-08 03:08:49 +01:00
* `0` (int) recovery flag contained in `signature`
2021-07-12 11:54:18 +02:00
* `6c6e626332306d0b25fe64500d044444444444444444444444444444444444444444444444444444444444444442e1a1c92db7b3f161a001b7689049eea2701b46f8db7513629edf2408fac7eaedc608043400010203040506070809000102030405060708090001020304050607080901020486a01863143c14c5166804bd19203356da136c985678cd4d27a1b8c632960490326200` hex of data for signing (prefix + data after separator up to the start of the signature)
* `18d04bc7ea5d8f839c9e83a4feb270b7e7ce3e572434333801825a379d560237` hex of SHA256 of the preimage
2017-06-27 12:38:13 +02:00
2020-05-11 23:24:05 +02:00
> ### Please send 0.00967878534 BTC for a list of items within one week, amount in pico-BTC
2021-07-12 11:54:18 +02:00
> lnbc9678785340p1pwmna7lpp5gc3xfm08u9qy06djf8dfflhugl6p7lgza6dsjxq454gxhj9t7a0sd8dgfkx7cmtwd68yetpd5s9xar0wfjn5gpc8qhrsdfq24f5ggrxdaezqsnvda3kkum5wfjkzmfqf3jkgem9wgsyuctwdus9xgrcyqcjcgpzgfskx6eqf9hzqnteypzxz7fzypfhg6trddjhygrcyqezcgpzfysywmm5ypxxjemgw3hxjmn8yptk7untd9hxwg3q2d6xjcmtv4ezq7pqxgsxzmnyyqcjqmt0wfjjq6t5v4khxsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygsxqyjw5qcqp2rzjq0gxwkzc8w6323m55m4jyxcjwmy7stt9hwkwe2qxmy8zpsgg7jcuwz87fcqqeuqqqyqqqqlgqqqqn3qq9q0777th7sgnqqpykcmu4c2u65vtnefrnjzws78maaxy87euvpj0hr8t5ma58cyw5f3f9ej4aw9swcyvk4vp6vjlxtgpcfdy8u9m4c6wgpdqfxt2
2020-05-11 23:24:05 +02:00
Breakdown:
* `lnbc` : prefix, Lightning on bitcoin mainnet
* `9678785340p` : amount (9678785340 pico-bitcoin = 967878534 milli satoshi)
* `1` : Bech32 separator
* `pwmna7l` : timestamp (1572468703)
2021-07-12 11:54:18 +02:00
* `s` : payment secret...
* `p` : payment hash
2020-05-11 23:24:05 +02:00
* `p5` : `data_length` (`p` = 1, `5` = 20; 1 * 32 + 20 == 52)
* `gc3xfm08u9qy06djf8dfflhugl6p7lgza6dsjxq454gxhj9t7a0s` : payment hash 462264ede7e14047e9b249da94fefc47f41f7d02ee9b091815a5506bc8abf75f
* `d` : short description
* `8d` : `data_length` (`8` = 7, `d` = 13; 7 * 32 + 13 == 237)
* `gfkx7cmtwd68yetpd5s9xar0wfjn5gpc8qhrsdfq24f5ggrxdaezqsnvda3kkum5wfjkzmfqf3jkgem9wgsyuctwdus9xgrcyqcjcgpzgfskx6eqf9hzqnteypzxz7fzypfhg6trddjhygrcyqezcgpzfysywmm5ypxxjemgw3hxjmn8yptk7untd9hxwg3q2d6xjcmtv4ezq7pqxgsxzmnyyqcjqmt0wfjjq6t5v4khx` : 'Blockstream Store: 88.85 USD for Blockstream Ledger Nano S x 1, \"Back In My Day\" Sticker x 2, \"I Got Lightning Working\" Sticker x 2 and 1 more items'
* `x` : expiry time
* `qy` : `data_length` (`q` = 0, `y` = 2; 0 * 32 + 4 == 4)
* `jw5q` : 604800 seconds (`j` = 18, `w` = 14, `5` = 20, `q` = 0; 18 * 32^3 + 14 * 32^2 + 20 * 32 + 0 == 604800)
* `c` : `min_final_cltv_expiry`
* `qp` : `data_length` (`q` = 0, `p` = 1; 0 * 32 + 1 == 1)
* `2` : min_final_cltv_expiry = 10
* `r` : tagged field: route information
* `zj` : `data_length` (`z` = 2, `j` = 18; 2 * 32 + 18 == 82)
* `q0gxwkzc8w6323m55m4jyxcjwmy7stt9hwkwe2qxmy8zpsgg7jcuwz87fcqqeuqqqyqqqqlgqqqqn3qq9q` :
* pubkey: 03d06758583bb5154774a6eb221b1276c9e82d65bbaceca806d90e20c108f4b1c7
* short_channel_id: 589390x3312x1
* fee_base_msat = 1000
* fee_proportional_millionths = 2500
* cltv_expiry_delta = 40
2021-07-12 11:54:18 +02:00
* `0777th7sgnqqpykcmu4c2u65vtnefrnjzws78maaxy87euvpj0hr8t5ma58cyw5f3f9ej4aw9swcyvk4vp6vjlxtgpcfdy8u9m4c6wgp` : signature
* `dqfxt2` : Bech32 checksum
2020-05-11 23:24:05 +02:00
2020-01-17 23:53:13 +01:00
> ### Please send $30 for coffee beans to the same peer, which supports features 9, 15 and 99, using secret 0x1111111111111111111111111111111111111111111111111111111111111111
> lnbc25m1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5vdhkven9v5sxyetpdeessp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygs9q5sqqqqqqqqqqqqqqqpqsq67gye39hfg3zd8rgc80k32tvy9xk2xunwm5lzexnvpx6fd77en8qaq424dxgt56cag2dpt359k3ssyhetktkpqh24jqnjyw6uqd08sgptq44qu
2019-07-18 09:19:34 +02:00
Breakdown:
* `lnbc` : prefix, Lightning on Bitcoin mainnet
* `25m` : amount (25 milli-bitcoin)
* `1` : Bech32 separator
* `pvjluez` : timestamp (1496314658)
* `p` : payment hash...
* `d` : short description
* `q5` : `data_length` (`q` = 0, `5` = 20; 0 * 32 + 20 == 20)
* `vdhkven9v5sxyetpdees` : 'coffee beans'
2019-11-26 04:15:48 +01:00
* `s` : payment secret
* `p5` : `data_length` (`p` = 1, `5` = 20; 1 * 32 + 20 == 52)
* `zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygs` : 0x1111111111111111111111111111111111111111111111111111111111111111
2019-07-18 09:19:34 +02:00
* `9` : features
2020-01-17 23:53:13 +01:00
* `q5` : `data_length` (`q` = 0, `5` = 20; 0 * 32 + 20 == 20)
* `sqqqqqqqqqqqqqqqpqsq` : b1000....00001000001000000000
2021-07-12 11:54:18 +02:00
* `67gye39hfg3zd8rgc80k32tvy9xk2xunwm5lzexnvpx6fd77en8qaq424dxgt56cag2dpt359k3ssyhetktkpqh24jqnjyw6uqd08sgp` : signature
2020-01-17 23:53:13 +01:00
* `tq44qu` : Bech32 checksum
2019-07-18 09:19:34 +02:00
2020-05-11 23:24:15 +02:00
> ### Same, but all upper case.
> LNBC25M1PVJLUEZPP5QQQSYQCYQ5RQWZQFQQQSYQCYQ5RQWZQFQQQSYQCYQ5RQWZQFQYPQDQ5VDHKVEN9V5SXYETPDEESSP5ZYG3ZYG3ZYG3ZYG3ZYG3ZYG3ZYG3ZYG3ZYG3ZYG3ZYG3ZYG3ZYGS9Q5SQQQQQQQQQQQQQQQPQSQ67GYE39HFG3ZD8RGC80K32TVY9XK2XUNWM5LZEXNVPX6FD77EN8QAQ424DXGT56CAG2DPT359K3SSYHETKTKPQH24JQNJYW6UQD08SGPTQ44QU
> ### Same, but including fields which must be ignored.
> lnbc25m1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5vdhkven9v5sxyetpdeessp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygs9q5sqqqqqqqqqqqqqqqpqsq2qrqqqfppnqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqppnqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpp4qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqhpnqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqhp4qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqspnqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqsp4qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqnp5qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqnpkqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq2jxxfsnucm4jf4zwtznpaxphce606fvhvje5x7d4gw7n73994hgs7nteqvenq8a4ml8aqtchv5d9pf7l558889hp4yyrqv6a7zpq9fgpskqhza
Breakdown:
* `lnbc` : prefix, Lightning on Bitcoin mainnet
* `25m` : amount (25 milli-bitcoin)
* `1` : Bech32 separator
* `pvjluez` : timestamp (1496314658)
* `p` : payment hash...
* `d` : short description
* `q5` : `data_length` (`q` = 0, `5` = 20; 0 * 32 + 20 == 20)
* `vdhkven9v5sxyetpdees` : 'coffee beans'
* `s` : payment secret
* `p5` : `data_length` (`p` = 1, `5` = 20; 1 * 32 + 20 == 52)
* `zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygs` : 0x1111111111111111111111111111111111111111111111111111111111111111
* `9` : features
* `q5` : `data_length` (`q` = 0, `5` = 20; 0 * 32 + 20 == 20)
* `sqqqqqqqqqqqqqqqpqsq` : b1000....00001000001000000000
* `2` : unknown field
* `qr` : `data_length` (`q` = 0, `r` = 3; 0 * 32 + 3 == 3)
* `qqq` : zeroes
* `f` : tagged field: fallback address
* `pp` : `data_length` (`p` = 1, `p` = 1; 1 * 32 + 1 == 33)
* `nqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq` : fallback address type 19 (ignored)
* `p` : payment hash
* `pn` : `data_length` (`p` = 1, `n` = 19; 1 * 32 + 19 == 51) (ignored)
* `qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq`
* `p` : payment hash
* `p4` : `data_length` (`p` = 1, `4` = 21; 1 * 32 + 21 == 53) (ignored)
* `qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq`
* `h` : hash of description
* `pn` : `data_length` (`p` = 1, `n` = 19; 1 * 32 + 19 == 51) (ignored)
* `qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq`
* `h` : hash of description
* `p4` : `data_length` (`p` = 1, `4` = 21; 1 * 32 + 21 == 53) (ignored)
* `qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq`
* `s` : payment secret
* `pn` : `data_length` (`p` = 1, `n` = 19; 1 * 32 + 19 == 51) (ignored)
* `qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq`
* `s` : payment secret
* `p4` : `data_length` (`p` = 1, `4` = 21; 1 * 32 + 21 == 53) (ignored)
* `qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq`
* `n` : node id
* `p5` : `data_length` (`p` = 1, `5` = 20; 1 * 32 + 20 == 52) (ignored)
* `qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq`
* `n` : node id
* `pk` : `data_length` (`p` = 1, `k` = 22; 1 * 32 + 22 == 54) (ignored)
* `qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq`
* `2jxxfsnucm4jf4zwtznpaxphce606fvhvje5x7d4gw7n73994hgs7nteqvenq8a4ml8aqtchv5d9pf7l558889hp4yyrqv6a7zpq9fgp` : signature
* `skqhza` : Bech32 checksum
# Examples of Invalid Invoices
2019-11-26 04:15:48 +01:00
> # Same, but adding invalid unknown feature 100
2020-01-17 23:53:13 +01:00
> lnbc25m1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5vdhkven9v5sxyetpdeessp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygs9q4psqqqqqqqqqqqqqqqpqsqq40wa3khl49yue3zsgm26jrepqr2eghqlx86rttutve3ugd05em86nsefzh4pfurpd9ek9w2vp95zxqnfe2u7ckudyahsa52q66tgzcp6t2dyk
2019-07-18 09:19:34 +02:00
Breakdown:
* `lnbc` : prefix, Lightning on Bitcoin mainnet
* `25m` : amount (25 milli-bitcoin)
* `1` : Bech32 separator
* `pvjluez` : timestamp (1496314658)
* `p` : payment hash...
* `d` : short description
* `q5` : `data_length` (`q` = 0, `5` = 20; 0 * 32 + 20 == 20)
* `vdhkven9v5sxyetpdees` : 'coffee beans'
2019-11-26 04:15:48 +01:00
* `s` : payment secret
* `p5` : `data_length` (`p` = 1, `5` = 20; 1 * 32 + 20 == 52)
* `zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygs` : 0x1111111111111111111111111111111111111111111111111111111111111111
2019-07-18 09:19:34 +02:00
* `9` : features
* `q4` : `data_length` (`q` = 0, `4` = 21; 0 * 32 + 21 == 21)
2020-01-17 23:53:13 +01:00
* `psqqqqqqqqqqqqqqqpqsqq` : b000011000....00001000001000000000
* `40wa3khl49yue3zsgm26jrepqr2eghqlx86rttutve3ugd05em86nsefzh4pfurpd9ek9w2vp95zxqnfe2u7ckudyahsa52q66tgzcp` : signature
* `6t2dyk` : Bech32 checksum
2019-07-18 09:19:34 +02:00
2020-05-11 23:24:15 +02:00
> ### Bech32 checksum is invalid.
> lnbc2500u1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpquwpc4curk03c9wlrswe78q4eyqc7d8d0xqzpuyk0sg5g70me25alkluzd2x62aysf2pyy8edtjeevuv4p2d5p76r4zkmneet7uvyakky2zr4cusd45tftc9c5fh0nnqpnl2jfll544esqchsrnt
> ### Malformed bech32 string (no 1)
> pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpquwpc4curk03c9wlrswe78q4eyqc7d8d0xqzpuyk0sg5g70me25alkluzd2x62aysf2pyy8edtjeevuv4p2d5p76r4zkmneet7uvyakky2zr4cusd45tftc9c5fh0nnqpnl2jfll544esqchsrny
> ### Malformed bech32 string (mixed case)
> LNBC2500u1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpquwpc4curk03c9wlrswe78q4eyqc7d8d0xqzpuyk0sg5g70me25alkluzd2x62aysf2pyy8edtjeevuv4p2d5p76r4zkmneet7uvyakky2zr4cusd45tftc9c5fh0nnqpnl2jfll544esqchsrny
> ### Signature is not recoverable.
> lnbc2500u1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpuaxtrnwngzn3kdzw5hydlzf03qdgm2hdq27cqv3agm2awhz5se903vruatfhq77w3ls4evs3ch9zw97j25emudupq63nyw24cg27h2rspk28uwq
> ### String is too short.
> lnbc1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6na6hlh
> ### Invalid multiplier
> lnbc2500x1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpujr6jxr9gq9pv6g46y7d20jfkegkg4gljz2ea2a3m9lmvvr95tq2s0kvu70u3axgelz3kyvtp2ywwt0y8hkx2869zq5dll9nelr83zzqqpgl2zg
2020-05-11 23:24:15 +02:00
> ### Invalid sub-millisatoshi precision.
> lnbc2500000001p1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpu7hqtk93pkf7sw55rdv4k9z2vj050rxdr6za9ekfs3nlt5lr89jqpdmxsmlj9urqumg0h9wzpqecw7th56tdms40p2ny9q4ddvjsedzcplva53s
2017-06-27 12:38:13 +02:00
# Authors
2017-12-16 01:35:10 +01:00
[ FIXME: ]
2017-06-27 12:38:13 +02:00
![Creative Commons License ](https://i.creativecommons.org/l/by/4.0/88x31.png "License CC-BY" )
< br >
This work is licensed under a [Creative Commons Attribution 4.0 International License ](http://creativecommons.org/licenses/by/4.0/ ).