Learn how Lightning network works, explained in plain English
Let’s start from the definition of what the Lightning Network is, taken from the official website https://lightning.network/:
Scalable, Instant Bitcoin/Blockchain Transactions
Lightning Network is trying to solve a few of the current problems that the Bitcoin is suffering: scalability (number of transactions per second, right now Bitcoin handles about seven transactions per second), speed (time required to confirm a transaction,), cost (fee to pay for each transaction).
How Lightning Network works?
Lightning network is based on a simple idea: if two users make recurring transactions between them, there is no need to involve the blockchain for each transaction, they can keep a “signed rolling balance sheet”, and commit on the blockchain only a “final transaction”.
The single channel
The first step to implement this idea is to create a “channel” between 2 user in the network, the usual Alice and Bob. The 2 users need to first fund the channel, sending, for example, 10 BTC each into the channel. This step requires a transaction on the Bitcoin blockchain, to lock the amounts sent in a 2 of 2 multisig address. Here is the schema of the channel opened by Alice and Bob:
Alice <= 10 BTC == 10 BTC => Bob # new channel opened
Alice and Bob are now able to make transactions “off-chain”, as many as they want: they just need to exchange “balance-sheet” with the updated balance of each user. This is simply a transaction signed by other party (so it’s missing one of the signatures) that is not propagated to the bitcoin blockchain, and that pays the updated funds to the participants.
Because the transaction are stored “off-chain”, Alice and Bob don’t need to wait for the confirmation from the bitcoin blockchain, nor to pay a fee to the miners: they just did an instant transaction at almost zero fee.
Here is the situation of the open channel while the transactions are happening:
Alice <= 8 BTC == 12 BTC => Bob # Bob sent 2 BTC to Alice
Alice <= 9 BTC == 11 BTC => Bob # Alice sent 1 BTC to Bob
Alice <= 4 BTC == 16 BTC => Bob # Alice sent 5 BTC to Bob
At any moment, a user can add a signature to the latest multisig transaction received from (and signed by) the other party and make the balance sheet “real”. When this transaction is broadcasted as regular Bitcoin transaction on the mainnet blockchain, the channel is closed.
The power is in the network
The real power of the Lightning Network comes from the “six degrees of separation” principle: a user of the network can reach any other in just a few hops, if the “routing” is know.
Let’ s say that Alice has an open channel with Bob, and Bob has an open channel with Charlie: this is enough to enable Alice to make a transaction with Charlie, and send for example 0.5 BTC to him.
Here is the situation of the channels before transaction:
Alice <= 1 BTC == 1 BTC => Bob # Bob has 3 BTC on 2 channels
Bob <= 2 BTC == 2 BTC => Charlie
and after the transaction:
Alice <= 0.5 BTC == 1.5 BTC => Bob # Bob is still having 3 BTC
Bob <= 1.5 BTC == 2.5 BTC => Charlie
The total balance of Bob remains unchanged, while the balance of Charlie increase of 0.5 BTC and the balance of Alice decreased of 0.5 BTC.
Lightning Network project is in its very early stage, and is suffering some issues: you can find several discussions regarding topology concerns, centralized hubs and routing problem. But the vision of enabling billions of user to “buy coffee with bitcoin” is so inspiring that it’s worth to give this project a chance.
Recharge Prepaid Mobile Phones with Bitcoin and Altcoins Now