Almost everyone is aware of the controversial bitcoin scaling debate that happened over the last couple of years which resulted to a split in the community. Bitcoin’s scalability roadmap is geared towards an off-chain framework to process transactions – this is called lightning network. Anybody who falls in love with bitcoin cannot help but hope for the success of the lightning network. Understanding the lightning network can be confusing at first. Here is a quick read about what is it, and what it does.
What is Lightning Network
The lightning network is a network of computers acting as payment channels outside of bitcoin’s blockchain although it remains anchored into it. The lightning network is not a blockchain per se, it is an additional layer of network and protocol that allows two or more parties to transact with each other instantaneously and nearly free by opening a payment channel and saving only the most important transactions into the bitcoin blockchain. To be able to process a payment, you must have an open channel either directly or indirectly by routing it to the party you wish to send your bitcoins to. Once a channel is opened, you can transact with the other party as many times as you wish. Only the first and last transactions in the channel are recorded in the blockchain, while transactions in between are not. This allows for more transactions to be processed in Bitcoin. This opens the idea of streaming money on the internet. Imagine yourself getting paid by your employer every second instead of having to wait for one whole month to receive your salary.
A simple analogy would be to imagine yourself in a classroom full of students and a teacher. You have to send your homework to someone who is seated in the last row with the condition that the homework can only be sent to a classmate whom you are friends with. The students are allowed to talk to each other but they cannot send a homework to a fellow student unless they are friends with each other.
You are seated in the front row, Bob, your friend, is seated beside you. You are going to send your homework to Alice who is seated in the last row. Alice is the final recipient but she is not your friend. Now there’s Charlie, not a friend of yours but Bobs’s and Alices’s. Charlie is seated in the second row. Why do we emphasize on who are friends with who? Just keep on reading and you’ll learn why. Remember you can only send a homework to a friend, so how will Alice receive your homework? By routing it from one friend to another. How will you make sure that the homework will be delivered to Alice then? Before sending your homework, Alice who is the final recipient would need to think of a secret code with a random number, and only the secret code can prove that it matches that particular number. Alice will send the random number to you and at the end of all the transactions, Alice needs to prove that she owns the random number by decoding it with the secret code.
Here are the steps involved:
- Alice thinks of a secret code and a random number and sends the random number to you. Only Alice knows what the secret code is so that she can prove that she is the final owner of your homework.You send your homework and the random number to Bob. The teacher records your grades, initially you had a grade of 100%, but after sending the homework to Bob, your grade will be 0 then Bob will have 100%. Now you and Bob both agreed to it and the grades are recorded in the teacher’s book. Bob doesn’t know the secret code hence, he is not the owner of the homework.
- Bob sends your homework to Charlie, Charlie’s grade is 100% and Bob has 0%. Charlie doesn’t know the secret code hence, he is not the owner of the homework.
- Charlie sends your homework to Alice, Alice’s grade is 100% and Charlie’s grade is now 0%. Alice knows the secret code, and she can prove that the random number came from her, hence she is the correct recipient of your homework. The teacher will now record the grades in her book, you have 0% and Alice has 100%.
In summary, this is what happens to a multi-hop scenario in the lightning network. The lightning network serves as a routing mechanism for payments via payment channels, all nodes can communicate with each other but a node can only send bitcoins to another node only if it has an open channel to it. A channel should be funded in bitcoins. In our analogy, the classroom is the lightning network, the teacher is the blockchain and the students are the nodes in the network. The friendships are the channels which represented a connection from one student to another.
As of this writing, there are 2,461 nodes and 5,855 channels in the lightning network. View the current status of the lightning network here.
To understand more about bitcoin, check out our simplified guide.
Disclaimer: BitChikka makes no representations or warranties as to the accuracy or timeliness and completeness of the information contained herein.