Understanding Lightning Network; a Guide for Dummies
Bitcoin has one major limitation. It has a significantly low capacity to process transactions. While Visa, for example, can do up to 45,000 per second, Bitcoin can only manage a paltry seven in the same time. The Bitcoin community has been deliberating, in what we’ve come to know as the block size debate, on how to fix this problem. Indeed, nearly everyone agrees that for the cryptocurrency to be truly disruptive, it has to scale.
But how can we achieve that?
There are several proposals and, as a matter of fact, highly developed technologies on the table. And one of these is the so-called Bitcoin Lightning Network. It is so much promising that already three companies are engaging users with it. Blockstream, a blockchain startup headquartered in Montreal Canada, has tasked Bitcoin’s core developer, Rusty Russell, with the responsibility to see that Lighting Network works. Blockstream has the majority of the leading Bitcoin’s core developers amongst its founders as well as members of staff and has raised close to $76 million in three rounds of investor funding. The other company working on the technology is Blockchain, best known for the Blockchain.info Bitcoin wallet. Blockchain has called its Lightning Network Thunder Network and in May it announced its alpha release. Last but not least, is the company that bears the name of the technology; Lightning Network. Joseph Poon and Tadge Dryja, both of whom were among the first developers to work on the Bitcoin project, founded this company in late 2013. As a matter of fact, Lightning Network is the brainchild of Joseph Poon and Tadge Dryja. It is them who first put the idea on paper. Ever since many have almost described the Lightning network as the silver bullet that Bitcoin has been waiting for.
What exactly is the lightning network?
The Lightning network, as the name suggests, is a network of Bitcoin users or rather nodes. However, the network is outside of the main bitcoin network and stops every transaction from being immediately broadcasted to the Bitcoin network. Instead, users aggregate transactions over time in their local drives and only broadcast the nets of the transactions on the blockchain. This could be after an agreed time has passed, or there is a dispute amongst users in the network. The idea is to reduce the volume on the main blockchain while at the same time creating capacity off it. This is possible because there is no limit on how many or how big the Lightning Network should be. Of course, like any other platform where value is involved, security and safety are critical. In the white paper, they published in early 2015, Joseph Poon and Tadge Dryja go to great lengths to explain how the security on the blockchain is maintained on the lightning network.
How does the network work?
The primary element of a Lightning Network is a payment channel. This is a link between two users, let’s say, Alice and Bob. The users have to create it by opening and funding what you would call a joint account on the blockchain (a multisig wallet). With that, they can aggregate transactions between themselves without broadcasting them to the network.
This is possible through smart contracts that auto-execute, double spend protection and time-locks that prevent anyone from changing history. In case there is a disagreement between Alice and Bob or the period they agreed to maintain the channel expires, one of them will broadcast the net of their most recent version of transactions. Then they have to wait for a period stipulated in the smart contract before cashing out.
Just like with the mother Bitcoin network, the Lightning Network has an incentive to play by the rules. In the event that one broadcasting chooses to overlook the most recent status and goes for an older version that favours them, then the other party is at liberty to broadcast the latest version. However, unlike the other party, the latter broadcaster will cash out immediately. This encourages both to play fair even when they’ve disagreed.
What’s more, a payment channel between two players is a building block of a larger network. Indeed, the network only forms when numerous payment channels join to form a web. It is in that arrangement two individuals who are not directly connected can transact with each other. Let’s say Alice wants to pay John. She can still do it even if she doesn’t have a payment channel with him, but that is subject to them belonging to the same chain of payment channels. Thus we can have an arrangement where both Alice and John are connected to Bob. John will have to develop a random number (R) and hash it. He will share the hash (H) of R with Alice. At that point, Alice will request Bob to pay John on condition that John discloses R to him. After Bob has paid John, he will turn R to Alice who will confirm its validity using the H she has and refund him his money.
Ok, how Lightning Network works under the hood is more complicated than the picture I have drawn here. However, that is basically how it is structured.