Lightning Network: Channels and Invoices

The Lightning Network is an example of Layer 2 bitcoin service. It is an off-chain approach first formally proposed in a paper by Joseph Poon and Thaddeus Dryja in 2015.

The technology uses micropayment channels to scale the bitcoin blockchain’s capability by processing transactions more efficiently. 

Micropayment channels are opened between two parties looking to conduct a transaction. This channel is opened off-chain and without the overhead of the consensus mechanism, can process transactions much more efficiently than those that occur on-chain.

Transactions are added to the chain once both parties have closed the channel, i.e. agreed to the transaction’s validity. 

Think of it like having credit at your local convenience store, agreed up to a fixed point, say €50. Once that limit is reached, you get an invoice and settle up.

On the Lightning Network, payment channels are opened between two parties through multi-signature addresses. These act as mutual vaults that both parties can deposit funds into; multi-signature means that more than one signature is needed to release funds, a fail-safe ensuring one side cannot walk away with the funds within the channel.

When funds are deposited, a channel is opened, creating a balance sheet between the two parties; this is then added to the main chain. 

Transactions between the two parties are recorded by updating this balance sheet to include the new balance between the two parties. These updates come in the form of Invoices

An invoice is a request for payment via the Lightning Network. Just like a traditional Invoice, say from your builder, includes instructions of where to remit the payment for services rendered, a Lightning Invoice is a structured set of instructions.

  • The payment amount
  • Which blockchain the invoice applies to 
  • An expiry date
  • Payee pubkey

Rather than using Bitcoin-style addresses Lightning Invoices are generally generated as QR codes, to ease the user experience, though they can be presented as alphanumeric strings. 


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *