How the lightning network works
The lightning network is not a blockchain. Instead it is an interconnected payment channel created by the two parties on the bitcoin network. Let’s break down the definition with a simple example.
As you may understand already, the basic concept behind the lightning network is the payment channel.
Let’s imagine, every morning I take a cup of coffee from the coffee shop nearby. Because I am a loyal customer. I don’t have to pay in every occasion I got my cup of coffee. Rather than, Me and the coffee shop owner, agreed to open a payment channel or a record of payment that I only pay the total amount at the end of the month.
The lightning network is here to help to store all these payment records that occur during the whole month.
Lightning network usage
After agreement to use the lightning network, We start by opening a channel payment on the bitcoin blockchain. Then, send a deposit of btc to what we call a multi signature wallet. This deposit must be greater or equal to the amount supposed to be spent when the month is over.
As the name suggests, multi signature wallet is a crypto wallet where both parts (Me and the coffee shop owner) have access. In other words, any transaction can’t be proceed unless, we both unlock the wallet with our signatures.
To be precise, what we transact across the lightning network is not btc but nothing else than what we call an IOU or ” I owe you ” a digital written acknowledgment of debt to another party. Differently, before we close the payment channel we are just adjusting how much btc each of us will get when the payment channel is closed. This IOU set of records is kept on both of our computers as receipt waiting for the final balance when the month is over.
To store the IOU updates, We don’t need to create a new block on the bitcoin blockchain. Rather than, we just need both, hardware and fast internet.
Finally, When the month is over, the btc in the multi signature wallet is sent back to each of our btc own wallet based on the balance of the digital IOU receipt, This creates a second transaction on the bitcoin blockchain and closes the payment channel.
Note that the payment channel, cannot be kept open indefinitely and can be close by one or both parties.