Thursday, April 28, 2022

Scaling Bitcoin With Lightning

 

There are many people who understand that Bitcoin can only do a certain number of on-chain transactions every 10 minutes and so think it can not scale.   The Bitcoin scaling solution is off-chain transactions with Lightning.  I am going to try to give you a way to think about this that might help people understand.

Think of on-chain Bitcoin transactions as being like an armored truck carrying money from one place to another.   With a certain number of armored trucks you can only do so many visit per day.   If a transaction is on the blockchain then it is like the funds have been physically moved to the other place.

However, this does not limit the number of financial transactions.  Banks have a huge optimization.   It is not necessary to send money for every transaction between two banks, at worse you just need to send the net different between money going one way and money going the other.   In the SWIFT wire transfer system it is really just a bunch of banks that have accounts with each other so they can "move money" mostly by doing debits and credits on accounts and not physically moving the money around.  A wire transfer might pass through several different banks along the way to its destination.

You can think of Lighting as similar to the SWIFT wire transfer network.  There are links between nodes that can effectively move funds between them just by updating an account balance between them.  However, instead of taking a couple days and costing on the order of $100 (humans are slow and costly) it takes about a second and costs on the order of $0.01 (computers are fast and cheap).  So around 10,000 times cheaper and 100,000 times faster than a bank wire transfer.  This is a very compelling improvement.

People complain about how much energy blockchain transactions take.   This is like worrying about how much gas the armored truck is going to burn to clear your wire transfer.   The vast majority of the financial transactions do not require any gas for any armored truck.  The same is true, or will be true, for Bitcoin.   There might be more off-chain Lightning transactions than on-chain Bitcoin transactions already but as the lightning transactions are confidential I don't think we can really tell.   

It is easy to imagine banks working together to net-out payments and so minimize the number of armored truck trips and so lower their costs.  Bitcoin/Lightning works like this.   If the on-chain transactions get too expensive, then people work a bit harder to use Lightning or use it for larger amounts.    It is a nice feedback for keeping Bitcoin on-chain fees in check.   So while Ethereum still gets crazy high "gas fees" the Bitcoin on-chain fees are steady and low.

Since Lightning transactions are not stored on the blockchain, the Bitcoin blockchain does not grow too fast and can still fit on an ordinary computer with ordinary Internet service.   Other cryptos that have more data to store get too large for normal computers and Internet feeds.   So others, unlike Bitcoin, can end up not being true Peer-2-Peer, and so easier for a government or other adversary to attack.  

It really seems like the Bitcoin/Lightning scaling system will be the winning payment system.   With lightning it has the lowest fees and fastest execution.  It is the most true P2P system.   It is the oldest and has the largest market share.   Like Google or Facebook, it has the dominant network effects. It is hard to imagine something else coming that is enough better to really threaten Bitcoin/Lightning at this point. 

 

Update May 13, 2022 

The recent stablecoin trouble and this video made me think.  Bitcoin/lightning use a blockchain to really solve the P2P Internet payment problem.  The 10,000 alt-coins that have come after really can be viewed as scams.  Most of them don't have any reasonable claim to doing anything better.  Some are centralized things just using a blockchain to trick investors.  When markets go down the scams become clear.  We will see many scams in the crypto area.   As Buffet says, “You don’t find out who’s been swimming naked until the tide goes out”.

 

Update June 5, 2022

I was watching a video where Elon say that a level 2 layer like Lightning you can scale Bitcoin to handle huge amounts of financial traffic but he would like to see if the base layer could scale further.   This is sort of like saying, sure by clearing transactions electronically between banks we can handle huge numbers of transactions, but I would like to see if we can get bigger armored trucks and drive them faster.   Why?  What is the point?   It does not improve things.    With lightning there is some incentive to run your own full node, it is nice that a full node can fit on a regular PC with a regular Internet connection.  

 

Update July 17, 2022

This tweet shows how many times channels were reused as of last year for one company.  For the cost of an on-chain transaction to open a channel you can do hundreds or thousands of off-chain transactions.   These numbers should get better and better over time.   These off-chain lightning transactions are very cheap and fast.   More and more traffic will move to lightning, in particular if on-chain fees are high.


Update Oct 5, 2022

After scaling, the other vector other coins might have been better than Bitcoin on was "privacy".   However, with lightning and "submarine swaps" or using "coinjoin" you can get good privacy just using Bitcoin.  So it really does not seem any other coin could be enough better in any way users care about to get them to switch.   Seems Bitcoin will be it forever.

 

Further reading on Bitcoin/Lightning


  1. A Look At the Lightning Network by Lyn Alden