How does Bitcoin Lightning Network works?

in #bitcoin8 years ago

You may have heard about the Lightning Network already, because an alpha version for public testing was released on January 10.If the Lightning Network succeeds, then Bitcoin could become faster and cheaper to use.

IMG_6134.JPG

Current Bitcoin Network

A Bitcoin transaction is best thought of as a message that’s posted to the blockchain, which is a ledger secured by computers that have to do some serious math to add the next entry. Bitcoin is slow and expensive because every message, no matter how small, has to be computed and shared with all of the computers in the network.

Bitcoin Lightning Network

The Lightning Network lets Bitcoin users create "payment channels" with each other. In these channels, Bitcoin transactions can be sent without the normal wait times, because the transactions aren't committed to the Bitcoin blockchain. Instead, the Lightning Network keeps record of transactions without finalizing them, and later sends a message describing only the final balances of the channel to the Bitcoin network as a regular transaction, closing the channel and securing the balance on the blockchain.

This system cuts down on the number of messages that the Bitcoin network has to process, since only these important messages finalizing many smaller ones are included in a Bitcoin block—chronological entries that, together, make up the blockchain.

In practice, it looks something like this: Sara connects with her friend Dave, whom she frequently sends money to, over the Lightning Network to set up a payment channel. To begin, one (or both) of them puts up an initial amount of Bitcoin that “funds” a coded contract that's shared between them. That contract is broadcast to the Bitcoin network as a transaction and the funds are secured on the blockchain.

Now, Sara and Dave can spend as much as they’d like from that contract balance by creating new transactions to and from each other. These subsequent transactions aren’t recorded on the Bitcoin blockchain, though—instead, the changes are recorded in a micro-ledger shared between Sara and Dave. This is a payment channel, and for as long as it’s open transactions between Sara and Dave are instant, since they don't have to wait to be included in a block of Bitcoin data, a process that can take anywhere from ten minutes to hours.

The payment channel is “closed” later (the Lightning Network's contracts largely depend on time delays) when a transaction detailing the ledger’s final balance is broadcast to the Bitcoin blockchain. Many transactions may have taken place between Sara and Dave in the time the channel was open, but the Bitcoin blockchain only records two: the creation of the payment channel, and its closing.

The end result is a network of payment channels that can process potentially huge amounts of Bitcoin transactions without needlessly stressing the blockchain. If the Lightning Network becomes large enough, the effect could be less congestion on the Bitcoin blockchain and lower fees. Many (or even most) Bitcoin transactions would be happening on the Lightning Network, and only finalized on the blockchain.

Sort:  

This post received a 2.100 SBD (31.61%) upvote from @upvotewhale thanks to @kamlesh! For more information, check out my profile!

Coin Marketplace

STEEM 0.04
TRX 0.32
JST 0.076
BTC 63599.33
ETH 1666.79
USDT 1.00
SBD 0.43