Bitcoin's Lightning Network - How Does It Work and How to Test It

in #bitcoin6 years ago (edited)

Bitcoin's Lighting Network will revolutionize the way we spend money. It's coming soon - it was already tested on Bitcoin's Mainnet and it's available for pubic testing on the Testnet.

I'm crazy excited about it and I genuinely believe this will be the future of digital currency.

Lightning Network Node Display.png

Why Lightning Is Revolutionary

  • Real time and almost fee-free transactions.
  • Significantly increases Bitcoin's operating scale (without compromising security).
  • Opens the economy to micro streamed payments.
  • Adds a layer of privacy (not all transactions are settled on the blockchain).

A Quick History

When will it be here? What's The Release Date?

  • Most people expect it to fully launch on Bitcoin's Mainnet sometime in the next 6 months (up to June 2018).
  • There's no official release date. Developers are cautious because security is their priority (no rushed deployment).
  • It's an agreed open source protocol - it's not owned or developed by any one individual or company. So now it's up to companies, individuals and the community to develop the applications to support it.
  • There are three main companies that are actively involved in its development: Blockstream, Acinq and Lightning Labs. Blockstream was co-founded by Adam Back, check out my earlier post on Adam's paper and his influence on Satoshi Nakamoto (founder of Bitcoin). Lightning Labs was originally co-founded by Joseph Poon and Thaddeus Dryja, the original authors of the Lightning paper.

See It In Action - Live Test Net

View a video of my experience on Testnet.

The Problem It Solves

  • Bitcoin can only settle ~220 million transactions a year (7 transactions a second) because of its 1MB block every 10 minutes limitation (refer to my post here for background on blocks and mining). This assumes 250 bytes/tx (source).
  • Increasing the block size won't permanently fix the problem, in order to allow 7 billion people (world's population) to make 2 transactions a day, you would need 24GB Blocks. A block of this size would lead to a massive concentration in mining, making a 51% attack a key security risk.

The blockchain as a payment platform, by itself, cannot cover the world’s commerce anytime in the near future. If each node in the bitcoin network must know about every single transaction that occurs globally, that may create a significant drag on the ability for the network to encompass all global financial transactions.

Lightning Network White Paper, 2015

How The Solution Works

  • Lightning Network is essentially an agreement between end users to net off the ownership of funds at a later time, thereby deferring what is broadcast to the blockchain.
  • It does not require trust. The two end users pre-commit/guarantee their funds for use on the Lightning Network and can always enforce against each other on the blockchain.
  • It allows for real time payments because there is no need for confirmations.
  • The power of this solution comes from the fact that it is a network. If you have a channel open to Bob, and Bob has a channel open to Alice, you can transact on the Lightning Network to Alice

What's All This About Bitcoin Cash?

  • Supporters of Bitcoin Cash (including the website Bitcoin.Com which is run by Bitcoin Cash's biggest ambassador, Roger Ver) do not like Lightning Network and claim it violates Satoshi Nakamoto's vision. If you don't know who Satoshi is please check out my first post.
  • Bitcoin Cash is literally just a copy of the Bitcoin code back in August. It made some simple amendments (i.e. increasing the size of blocks from 1MB to 8MBs) in order to speed up the network and lower transaction fees. It also avoided a key upgrade/change to Bitcoin - Segregated Witness, which was and remains controversial.
  • Bitcoin's developer team chose not to increase the block size. They pointed out that it isn't a permanent solution to the scalability problem (eventually 8MBs will be insufficient) and because bigger block sizes can lead to concentration in mining, they instead encouraged solutions like the Lightning Network.
  • Bitcoin Cash will not be able to accept Lightning transactions because it does not support Segregated Witness. If Bitcoin Cash was widely adopted, it will suffer scaling problems (high fees and slow transactions) due to its 8MB block limit.

Thank You!

Thanks for reading my post! Check out my other posts here - I focus on Cryptocurrency and Finance.

For a general overview of Bitcoin check out Bitcoin - so how does it actually work.

Upvotes are appreciated for motivation. Comments/questions/corrections are welcomed. 🙃

Sort:  

Grat article, can't believe how big the fees are these days, the lightning network can't come soon enough! BTC is dead! Long live BTC!.

this high quality content could be much appreciated by the guys behind utopian.io, maybe submit them there first, next time ;)

Thanks decebal2dac - I'll check it out!

Is this for real? If so, I have a reason to like BTC again.

Yep - I can't wait. It will hopefully make Bitcoin usable again.

@inthearena great article, I really appreciate some of the insight you provided. I was wondering about the BCH and the future of BTC and you helped to clarify some things for me. I am excited about this coming update to BTC, it gives me more reason to buy and hold more! With BCH offering a short term solution, do you see a future for BCH or is it a stepping stone to a better competitor?

Thanks nastyneste. Really appreciate the feedback.

It is a very heated debate in the Bitcoin community - like modern day politics it has all become a little tribal; the truth and the technology matter less than what team you are on.

When I look at the facts (say https://bitinfocharts.com/ and a fee comparison) other altcoins, such as Etherium and Litecoin are faster and the fees are similar to BCH (BCH fees are a little lower at the moment given the transaction volumes/traffic are also the lowest). So if fees and speed are our primary concern, BCH is not necessarily the answer and as noted above, it's only a short term solution, eventually 8MBs will not be enough.

The real value of Bitcoin Cash comes from the fact that it forked from Bitcoin, so it is compatible with existing Bitcoin infrastructure and uses the Bitcoin brand and logo. It also has powerful commercial interests backing it - Roger Ver (owner of Bitcoin.Com) and Jihan Wu (largest producer of mining equipment) own substantial amounts of BCH and openly disagree with Bitcoin's "core" development team.

I personally support Segregated Witness and I am excited about Lightning, so I favor Bitcoin and do not see BCH as a long term solution in its current form. I do consider it to a threat though - given the brand overlap, powerful resources and constant attacks on Bitcoin - I don't think newbies are properly able to differentiate between the two. I hate seeing Roger Ver on CNBC criticizing Bitcoin or BCH supporters attacking Nick Szabo, Adam Back etc (some of the greats that were involved in the very beginning).

I do not want to leave you with a biased opinion though so I suggest you also look at this article from Bitcoin.Com (owned and managed by Roger Ver, so pro-BCH) and suggest you do some of your own research to balance the view. Good luck!

P.S. if you have the time this is an interesting insight into the intensity of the debate!

BCH selling off from the same price level for the sixth time in a row should tell you all you need to know.

Süper birşey yapmaya karar verdisen ilk önce nasıl ve neler yapacagın önemlidir

What about the segwit2x hard fork that may possibly happen on 28 December, is it not related to lightning network?

Hi vishalbty.

That's a tricky one to explain in a comment because there is a long history to the Segwit2x debate. I'll do my best!

Basically Segwit2x refers to an agreement to upgrade Bitcoin with two improvements (1) Segregated Witness ("Segwit" for short) and (ii) an increase in the block size from 1MB to 2MBs ("2x"). Bitcoin ended up adopting the first (Segregated Witness) but never adopted the second (the increase in block size from 1MB to 2MB).

So now, when people talk about the "Segwit2x Hard Fork" - they are really just referring to the increase in the block size from 1MB to 2MBs (because Bitcoin has already adopted Segregated Witness). Hence the answer to your question is no, Segwit2x doesn't impact Lightning Network - Lightning Network only requires Segregated Witness so it already works on Bitcoin and doesn't need an increase in block size.

Check out this Fortune article if you want to read more, it's a dated article but I found it was useful when I was researching this topic back in October. Just remember this article was written before the Segwit2x was cancelled (and now it looks like it's coming back!).

Others - please feel free to help out by recommending more recent articles.

Thanks for the explanation.

Just as a correction to my above comment - it looks like the December Segwit2x is a little different from the earlier November proposal.

The fork is not the same as the one originally proposed in the NYA but shares some features. The most important part of the Segwit2x fork is the increased block size to 4MB, double what the original proposal called for [2MBs]. It also decreases the block production time from ten minutes to two and a half minutes.

https://bitcoinist.com/back-from-the-dead-segwit2x-fork-announced-for-later-this-week/

I don't think is related to lighting network. Is a different fork of bitcoin.

A would agree on the huge fees to pay! Even tho they are lower now but still too high.

Interesting stuff. Thanks for the info. Will definitely look into it. I might even add it to my portfolio.

Thanks pyrophorus! Good luck with your picks

with the latest developments in Bitcoin (especially in fees and transaction time), lightning is a much needed addition to bitcoin.

Thank you for the informative post. I hope the Lightning Network is all that it's hyped up to be. As of right now, Bitcoin can't feasibly be used as a currency unless it's a huge order. It's just not worth the fees or long wait time if you're buying a cup of coffee.

Very Informative Port...Thanks for sharing...Good Job

Thanks bhavin4mech!

Interesting post. Makes me now wonder if BCH was just a band-aid while this lightning network is the solution to bitcoin's transaction hurdles. Thanks.

Thanks mawit07. I'm looking forward to lightning. It will be interesting to see how this space plays out and what impact it will have on the altcoins.

Very impressive and informative post. I am new here so please guide me follow and vote me.

Thanks ansarmehmood. Welcome to steemit!

Great overview, thanks :)

Thanks david!

Is there any full explanation like blockchain has for this Lightning Network ? I am having some hard time to imagine how off-blockhain transaction does not require trust?

Hi fiyufiyt,

Yes there is! Check out my response to sweetwilliam who had a similar question:

Here

"Lightning Network is essentially an agreement between end users to net off the ownership of funds at a later time, thereby deferring what is broadcast to the blockchain." I'm not sure I understood this? So these funds are locked in some kind of holding? So they are available to be used as part of a payment channel. If this information is not on the blockchain how is it stored?

Hi Sweetwilliam,

It's a really good (and interesting) question. Essentially you are correct. The funds are set aside in some form of holding account - similar to the way a checking account is separate from a savings account.

The two parties send one on chain transaction into a "multi-signature address". The balance between the two parties is sorted out at a later date.

A general summary of how this works is found here

Funds are placed into a two-party, multisignature "channel" bitcoin address. This channel is represented as an entry on the bitcoin public ledger. In order to spend funds from the channel, both parties must agree on the new balance.

The more technical/specific explanation of how it works is here

Two parties send an initial amount of Bitcoin into a multisignature transaction with a local consensus on the current balance allocated between the two participants.

One on­blockchain transaction is made to deposit the funds into a multisignature output. Before this transaction is made, a refund transaction is created, which returns the original deposit to both parties.... In effect, they have created numerous "double spends" from an on­blockchain transaction, but have elected not to broadcast the spend until either party wants to redeem their funds on­chain.

Very informative. Thanks a lot!

Thanks y2x37!

I recently saw a YouTube video attempting to illustrate the Lightning Network. A lot of folks had a problem with the idea of an added later atop the blockchain. I’m not a very well versed in the nuts and bolts of the Bitcoin blockchain but didn’t anyone foresee this problem early on?

Thanks Din. Lightning still uses on chain transactions. An on-chain transaction is used to set aside funds for use on Lightning (like moving savings to a checking account) and the final balance for the chanel is eventually settled on the chain too.

I'm not really sure why people have an issue with it. It's completely voluntary - you don't have to use it if you don't want to. Everyone should benefit though (even those that don't use it) because it takes traffic off the chain, reducing the mempool and reducing fees.

Nice chunk of pertinent information. I am new so learning All Things Crypto daily. I have been wondering about longterm scalability issues with Block Chain. God Bless.

Thanks jakeduck! I really appreciate the feedback. Good luck with your investments

nice dude your thinking power is very nice

Thanks Shafiq! Really appreciate it.

Thanks for sharing this high technical content. We the steemians has learnt a lot from you. I follow and upvote.

Thanks comrade! Much appreciated

The test works,
The fees need to come down I guess.

Cheers

I'm glad I stumbled onto your post. I got what I needed to know about Bitcoin Lightning in a neat structured way. Thanks!

Thanks acdevan! I really appreciate the feedback (and the resteem). I like your blogs too and will follow. Cheers

I hope LN solve bitcoin problemes

Thanks rize20100 - me too!

Thanks sames. I'll check out your post!

Made a better one with bitcoin core announcements and more scaling solutions :) https://steemit.com/bitcoin/@sames/bitcoin-newest-scaling-method-adding-bech32-plus-others

I wish I had more STEEM POWER to upvote u more..
resteemed it as I appreciate this great article..thanks for sharing such a post..
@bitpost

Thanks bitpost! Really appreciate it!

Good news. We heard from core that February bext year bitcoin scaling will be getting a boost without increasing blocks.
https://steemit.com/bitcoin/@sames/bitcoin-newest-scaling-method-adding-bech32-plus-others

hello
good work bro ..
can you tell me how u got high $ on your posts ?

Hi umh. I'm pretty new to SteemIt so I'm just working it out myself. Basically it seems to take time. If you go to my blog history you'll see that it builds as I've accumulated steem power and as followers have been kind enough to upvote. I have promoted my last few posts to test it out (using SBD) and that seems to help get your posts more attention - so i recommend it for bigger posts that you put some effort into.

You're better off googling it - I'm no expert! I'm not really in it for the Steem (I chose SteemIt over Medium because I'm interested in blockchains and I wanted to test out the social media blockchain first hand). Good luck with it and let me know if you find any good tips!

Awesome Article! I've been trying to explain this project to my peers and will send their traffic your way! Thank you for sharing :)

Thanks Jmazo - really appreciate it!

We wouldn't need the Lightning Network if Blockstream would allow Bitcoin to have a larger block size as per Satoshis plan.

Congratulations @inthearena! You have received a personal award!

1 Year on Steemit
Click on the badge to view your Board of Honor.

Do not miss the last post from @steemitboard:

Trick or Treat - Publish your scariest halloween story and win a new badge
SteemitBoard notifications improved

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @inthearena! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!