Lightning Invoice

Overview

An invoice is a request for payment on the Lightning Network. Invoices include the information necessary to complete a payment on the network, such as payment amount, which blockchain the invoice applies to, expiry date, payee pubkey, routing hints, and other information. Invoices are used to make payments on the Lightning Network, rather than using Bitcoin-style addresses.
Invoices are commonly presented as alphanumerical strings or QR codes. In order to parse specific information from the request string, users can pass the string into a decoding tool:

Invoice Components

Every Lightning invoice requires the following information in order to be valid:
    destination: The public key of the person receiving the LN payment.
    payment_hash: The hash of the preimage that is used to lock the payment. You can only redeem a locked payment with the corresponding preimage to the payment hash. This enables routing on the Lightning Network without trusted third parties.
    num_satoshis: The amount of satoshis to be paid.
    expiry: Time when your node marks the invoice as invalid. Default is 1 hour or 3600 seconds.
    timestamp: Time when the invoice was created. This is measured in seconds since 1970.
    cltv_expiry: Delta to use for time-lock of CLTV extended to the final hop.
Convert timestamps to regular human time: https://www.epochconverter.com/

Example Invoice

Below is a sample invoice decoded using an invoice decoding tool. The standard fields included are:
Key
Value
Request String
lntb10m1pwr6x4spp57r8y5aslqnrmaap0cv3uefy9puchccjzre5k2nl2f4s9uuxr8xeqdqqcqzysxqzjc4ssgpuk27qesndex0sna6e33skjqwju5sd4ydcp0mnzctsvuq23sjst0wedlx9n6q0vj6md7auv7hjapdzu5qg5v34vfd6snwa5hnrqqnvhulk
Network
bitcoin testnet
Amount
0.01 BTC
Date
Mon, 14 Jan 2019 23:26:40 GMT
Payment Hash
f0ce4a761f04c7bef42fc323cca4850f317c62421e69654fea4d605e70c339b2
Min Final CLTV Expiry
144
Expiration
600 seconds
Signature
R value
ac2080f2caf03309b7267c27dd663185a4074b94836a46e02fdcc585c19c02a3
S value
09416f765bf3167a03d92d6dbeef19ebcba168b940228c8d5896ea137769798c
Recovery Flag
0
Signing Data
6c6e746231306d0b87a356010d3c33929d87c131efbd0bf0c8f3292143cc5f1890879a5953fa9358179c30ce6c81a006002240c014b0
Checksum
nvhulk
1
{
2
"human_readable_part": {
3
"prefix": "lntb",
4
"amount": 1000000000
5
},
6
"data": {
7
"time_stamp": 1547508400,
8
"tags": [
9
{
10
"type": "p",
11
"length": 52,
12
"description": "payment_hash",
13
"value": "f0ce4a761f04c7bef42fc323cca4850f317c62421e69654fea4d605e70c339b2"
14
},
15
{
16
"type": "d",
17
"length": 0,
18
"description": "description",
19
"value": ""
20
},
21
{
22
"type": "c",
23
"length": 2,
24
"description": "min_final_cltv_expiry",
25
"value": 144
26
},
27
{
28
"type": "x",
29
"length": 2,
30
"description": "expiry",
31
"value": 600
32
}
33
],
34
"signature": {
35
"r": "ac2080f2caf03309b7267c27dd663185a4074b94836a46e02fdcc585c19c02a3",
36
"s": "09416f765bf3167a03d92d6dbeef19ebcba168b940228c8d5896ea137769798c",
37
"recovery_flag": 0
38
},
39
"signing_data": "6c6e746231306d0b87a356010d3c33929d87c131efbd0bf0c8f3292143cc5f1890879a5953fa9358179c30ce6c81a006002240c014b0"
40
},
41
"checksum": "nvhulk"
42
}
Copied!

References

    1.
    BOLT #11 standards document
    4.
    "Lightning Network Invoices" , Blockfuse (2018-12-08)
Last modified 1yr ago