Bitcoin
Bitcoin (BTC)
$96,840.00 3.84524
Bitcoin price
Ethereum
Ethereum (ETH)
$3,140.68 0.46911
Ethereum price
BNB
BNB (BNB)
$612.25 -0.43195
BNB price
Solana
Solana (SOL)
$242.22 1.46389
Solana price
XRP
XRP (XRP)
$1.12 2.12411
XRP price
Shiba Inu
Shiba Inu (SHIB)
$0.0000241 -2.27253
Shiba Inu price
Pepe
Pepe (PEPE)
$0.0000194 -5.21258
Pepe price
Bonk
Bonk (BONK)
$0.0000518 -8.34452
Bonk price
dogwifhat
dogwifhat (WIF)
$3.19 -5.05411
dogwifhat price
Popcat
Popcat (POPCAT)
$1.55 -10.75681
Popcat price
Bitcoin
Bitcoin (BTC)
$96,840.00 3.84524
Bitcoin price
Ethereum
Ethereum (ETH)
$3,140.68 0.46911
Ethereum price
BNB
BNB (BNB)
$612.25 -0.43195
BNB price
Solana
Solana (SOL)
$242.22 1.46389
Solana price
XRP
XRP (XRP)
$1.12 2.12411
XRP price
Shiba Inu
Shiba Inu (SHIB)
$0.0000241 -2.27253
Shiba Inu price
Pepe
Pepe (PEPE)
$0.0000194 -5.21258
Pepe price
Bonk
Bonk (BONK)
$0.0000518 -8.34452
Bonk price
dogwifhat
dogwifhat (WIF)
$3.19 -5.05411
dogwifhat price
Popcat
Popcat (POPCAT)
$1.55 -10.75681
Popcat price
Bitcoin
Bitcoin (BTC)
$96,840.00 3.84524
Bitcoin price
Ethereum
Ethereum (ETH)
$3,140.68 0.46911
Ethereum price
BNB
BNB (BNB)
$612.25 -0.43195
BNB price
Solana
Solana (SOL)
$242.22 1.46389
Solana price
XRP
XRP (XRP)
$1.12 2.12411
XRP price
Shiba Inu
Shiba Inu (SHIB)
$0.0000241 -2.27253
Shiba Inu price
Pepe
Pepe (PEPE)
$0.0000194 -5.21258
Pepe price
Bonk
Bonk (BONK)
$0.0000518 -8.34452
Bonk price
dogwifhat
dogwifhat (WIF)
$3.19 -5.05411
dogwifhat price
Popcat
Popcat (POPCAT)
$1.55 -10.75681
Popcat price
Bitcoin
Bitcoin (BTC)
$96,840.00 3.84524
Bitcoin price
Ethereum
Ethereum (ETH)
$3,140.68 0.46911
Ethereum price
BNB
BNB (BNB)
$612.25 -0.43195
BNB price
Solana
Solana (SOL)
$242.22 1.46389
Solana price
XRP
XRP (XRP)
$1.12 2.12411
XRP price
Shiba Inu
Shiba Inu (SHIB)
$0.0000241 -2.27253
Shiba Inu price
Pepe
Pepe (PEPE)
$0.0000194 -5.21258
Pepe price
Bonk
Bonk (BONK)
$0.0000518 -8.34452
Bonk price
dogwifhat
dogwifhat (WIF)
$3.19 -5.05411
dogwifhat price
Popcat
Popcat (POPCAT)
$1.55 -10.75681
Popcat price

A Brief Guide on how to Create Lightning Network Invoices

This article is more than 4 years old
Learn
A Brief Guide on how to Create Lightning Network Invoices

In this article, BTCManager will go through the information contained in a Lightning Network invoice and do a quick recap of how to create an invoice using Bitcoin’s Lightning Network.

Lightning Network Invoices

Being able to create invoices on the Lightning Network is a novelty that was only recently made possible, but should prove to be a relatively useful innovation. According to BlockFuse, the importance of invoices is that they are capable of streamlining and facilitating payments and as such, it is a much-awaited feature that is finally operational.

The sole purpose of invoices on the Lightning Network is mainly to facilitate payments. An invoice will generally contain the required information to allow for transactions between two parties. Once a Lightning Network invoice is created it is stored on a node which is responsible for managing and storing a Lightning Network invoice database.  

The Lightning Network is a second layer payment protocol that works on top of the Bitcoin, Litecoin and Monero blockchains and was created to deal with the scalability issue. The Lightning Network allows for fast transactions between participating nodes and features a peer-to-peer system for making micropayments of cryptocurrency through an alternative network of bidirectional payment channels without delegating custody of funds.

The Lightning Network also decreases transaction cost since the fees are much lower than on-chain operations.

Creating Invoices on the Lightning Network

A Lightning Network invoice is divided into two main parts; the human-readable part and the data part. Let’s understand how can we read simple information from the Lightning Network invoice.

The first part of the invoice refers to the network, so this is represented by “lnt” which refers to the Bitcoin Test Network. The following information refers to the number of tokens that are being sent which is represented by “1u,” meaning one token unit.

The two parts of the invoice are separated by the number one, and the following strain refers to the rest of the information related to the transaction itself.

These include:

  • When the invoice was created.
  • The node ID which receives the payment.
  • The time of the invoice expiration. Contrary to Bitcoin invoices, Lightning Network invoices have an expiry.
  • A description of this invoice.
  • A backup bitcoin address.
  • A route to make the payment.
  • Other relevant information such a transaction signature

To start using Lightning Network invoice payments, one can use the Lightning Network Daemon which contains the invoice protocol.

Lightning Network Invoices for Business

Some options allow Lightning Network invoices to be leveraged for businesses and applications.  

Fall Back Address Function

As said before, the fall back addresses allows for a Bitcoin (BTC) address to be used as a fail-safe if a transaction fails. By enabling this function all Lightning Network transactions that fail will be issued in an on-chain payment directly to the Bitcoin blockchain.

Description

The Lightning Network invoices allow for a memo line to be added.  This can be used to keep track of where payments are coming from and why.  

Description Hash

This allows for information regarding the payment to be attached to the receipt when you make the payment by scanning the QR code, your Lightning Network wallet stores the description hash. A small business can then upload the itemized receipt to a website which one can look up at a later time by providing the description hash.

AddIndex

AddIndex adds a sequence number to all invoices to keep track of their status. This function is well suited for subscriptions as it can keep track of invoices for which haven’t been paid.

Users can also send invoices using a QR Code.

LN Invoice QR Code

(Source: BlockFuse)

To be valid, the invoice needs to have the following information:

  • Destination: The public key of the person receiving the Lightning Network payment.
  • Payment_hash: The hash of the preimage that is used to lock the payment.
  • Num_satoshis: The number of satoshis to be paid.
  • Expiry: Time when your node marks the invoice as invalid.
  • Timestamp: Time when the invoice was created.  
  • Cltv_expiry: Delta to use for time-lock of CLTV extended to the final hop

This is the required information that must be present for an invoice to be valid, but there are a lot of details that can be included, such as a description or a fall back address which acts like a security feature in case the Lightning Network transaction fails.

Lightning Network invoices have shown to behave flexibly as they are capable of providing a lot more information regarding payment. For now, Lightning Network invoices are still a little bit difficult for the average joe to handle, but pretty soon the industry should see new developments that will enable easier ways to use the feature.