Header Ads

Header ADS

What is Bitcoin lightening network?

Many people believe that Bitcoin is the future of our financial system, but there is a big issue standing in the way of this goal, and that is scalability.
 Let me give an example. The payment provider visa processes on average around 4000 transactions per second and can scale up to a maximum of 65,000. Bitcoin, on the other hand, can handle up to 7 transactions per second with the current block size of 1 megabyte. Not 10s of thousands, but just seven. Clearly, the main blockchain isn't very scalable, but it doesn't have to be. The community has come up with a new technique called the Lightning network to solve the scalability issues. The key idea is that small and everyday transaction don't have to be stored on the main blockchain. This avoids the seven transactions per second. And is also called the off-chain approach. So how does it work?

 Well, let's take a look at an example. Let's say that every morning Bob buys a cup of coffee on his way to work. Creating a transaction on the blockchain for a simple coffee is really overkill. He might end up paying more fees than the actual price of his coffee. However, with the Lightning network, Bob can set up a payment channel with the coffee shop. To do that, both the coffee shop and Bob deposit a certain amount of Bitcoin in what is called a multi-signature address. Let's assume that Bob deposits 0.05 Bitcoin and at the coffee shop deposits nothing because they don't offer refunds.
 This multi-signature address is basically like a safe that can only be opened when both parties agree. When we open the payment channel we also make a balance sheet that says how the funds in the address should be distributed. So right now it says that Bob will get 0.05 Bitcoin and that the coffee shop will get zero Bitcoin the same as they deposit it.
 Opening the payment channel happens on the main blockchain so that there is full transparency. The coffee shop owner can see that Bob has deposited 0.05 Bitcoin and he can rest assured that he will get his money once the channel closes. Now that the channel is open, Bob can order his morning coffee. Let's say that coffee costs 0.01 Bitcoin. To pay for it, Bob simply changes the balance sheet. He subtracts the cost of a coffee from his balance and adds it to the coffee shop's balance. So now it says that Bob will get 0.045 Bitcoin and that the coffee shop gets 0.005 Bitcoin. Bob and the coffee shop now signed the updated balance sheet with their private keys. They then each keep a copy of it, but they don't do anything else with it.
 Bob can keep ordering coffee for as long as he has a balance in the payment channel. Both of them can make hundreds of thousands of transactions between them. There's really no limit because this happens away from the main blockchain.
 But all good stories come to an end. The payment channel can be closed at any time by either Bob or the coffee shop. All they have to do is take the latest balance sheet, which was signed by both parties, and broadcast it to the Bitcoin network.
 Miners will then validate the signatures on the balance sheet and if everything checks out, release the funds according to the balance sheet. This will create a single transaction on the Bitcoin blockchain. So the Lightning network can significantly reduce the load on the main blockchain. It only requires 2 transactions on the blockchain, one to open the payment channel and another one to close it. It's also very safe. The system ensures that only the latest signed balance sheet can be used to unlock the money. And because both parties have a signed copy of the balance sheet, they can release the funds at any time, even if the other one doesn't want to cooperate anymore. So for example, Bob cannot hold the money hostage that belongs to the coffee shop and vice versa, but it doesn't end there. You don't need to open a direct payment channel with everyone you want to send bitcoins to. You can simply use the network to pass your coins around. Here is Alice, she's a friend of Bob's. They have exchanged money on the Lightning network before, so they have an active payment channel. Now let's say that Alice wants to buy a coffee instead of opening a direct channel to the coffee shop she can transfer the money to Bob, who will then transfer it to the coffee shop, so there's no need to create a payment channel with everyone in the Lightning network. Your payment tries to find a route from person A to person B, and it tries to do this with the least amount of intermediates and the least amount of fees.
 This further reduces the strain on the blockchain, but it requires the intermediates to have enough money in their payment channels. So now you know what the Lightning network is and how it works. But when will it actually go live? Well, right now there is a proof of concept implementation running on the Bitcoin testnet.   
  

No comments

Powered by Blogger.