The Panama Canal & The Bitcoin Lightning Network: Surpassing Limits by Tightening Them

Aug 22, 2018 · 16 min read

There is an often heard fallacy that I go over briefly in one of my previous articles answering the common FUD around the Lightning Network (LN). Unfortunately, most people seem to have not read or not understood my explanation (how either is possible I’m not sure). But ignorant persons continue to claim that the Lightning Network is fractional reserve and uses fake/IOU based “Lightning tokens.” This empty statement stubbornly persists despite proof to the contrary. Some individuals I argue with on a regular basis, don’t even seem concerned with countering the evidence that I give or explaining in even the slightest of ways, how these “fake coins” will get inserted. Instead they immediately move the goalposts to predicting a future version of Lightning where all their baseless claims are suddenly validated. Here’s a simplified generalization of what I mean:

Lightning Hater: “Lightning uses fake tokens that are fractional reserve just like the banks!”

Me: “The only script elements involved are CheckLockTimeVerify, CheckSequenceVerify, and HashTimeLockContracts that are all signed from a valid and confirmed multisig address. Please explain where in any of these there is the remotest possibility of arbitrarily creating fake coins.”

Lightning Hater: “yeah, until they change it.”

Me: “Sigh, ok. So are we now agreed that your first statement is wrong, but your concern is that, at some point in the future, you expect it to be true? “It can be changed,” is a basic truism of software. Of course someone could make a shittier version that grants no guarantees, doesn’t sign anything, or present security of any kind. In fact, such a thing is trivial to do. This conspicuous group that goes by the name of ‘They’ could also easily change bitcoin to have 100 billion coins. It’s been done many times as a matter of fact, we call them altcoins. Any change to LN regarding how coins are signed, locked, and released makes it incompatible with the current implementation. All anyone has to do is refrain from downloading their terrible software.”

Lightning Hater: “Except the Banks will do it on their nodes and you’ll never know.”

Me: “Again, it wouldn’t matter, they have no control over my channels and would merely gain the ability to screw themselves out of their own Bitcoin… which would make me happy. Any coins that I spend OR receive are directly in the channel that I have full reserve & signature authority over, meaning it’s never out of my control or ability to validate. Same with anyone receiving a lightning payment. All a bank could do is forward coins without claiming them from their own input. They cannot force or trick anyone else into accepting coins that don’t exist within their channels.”

Lightning Hater: “Sure whatever, the banks will control lightning! Enjoy your crippled shitcoin!”

… 2 days later…

Lightning Hater: “Lightning uses fake tokens that are fractional reserve just like the banks!”



How easy it is to create an imaginary future where everything you claim is true, and then point at it.

I do understand that the concept of Lightning is not easy to grasp, it took me weeks of reading and looking up bitcoin scripts that I didn’t understand, and defining words that I didn’t know. The Lightning Network whitepaper goes into my top ten of lowest words per minute read. Practically every few paragraphs had me digging through mastering bitcoin, the bitcoin wiki, or the bitcoin stack exchange just to make sense of what was being explained.

So it is not unreasonable to be skeptical of the Lightning Network. “Off-chain transactions” just sounds like “not real bitcoins.” Unfortunately, the technical proof that there are no “fake coins” doesn’t resonate with most people. I believe this is the case because most simply don’t understand the evidence anymore than the operation of LN itself. It is similar to defining a word for someone in a language they don’t speak. If you only speak English, explaining a concept to you in Chinese won’t do any good. So instead, I’m going to tell a story that makes the function of the Lightning Network less abstract and hopefully, easier to picture in your mind. We will do this by explanation of the system that runs The Panama Canal.

The Limits of Lightning

When you actually have a solid understanding of the Lightning Network, you will quickly notice how many detractors of it will argue “it sucks” by listing in the same thread, criticisms that actually contradict each other. Here are 3 specific problems I hear regularly repeated, 2 of which are based in truth:

  1. Lightning network uses fake tokens that can be created arbitrarily.
  2. You can’t receive any payments that are greater than the amount you have locked in a channel.
  3. If your channel is out of balance, you will be unable to either send or receive payments with it depending on which direction the channel “is leaning.”

The second and third considerations are true in a basic sense. Payment channels are nothing more than reserved coins signed by you, and another node on the LN which you choose to connect with.

#2 accurately explains that the amount of bitcoin that can be used in a payment is capped to the total amount of bitcoin locked inside of your channel. If you and the other node only lock up a total of 10 mBTC, but you need to make an 11mBTC payment, then you are stuck being unable to sign inputs that don’t exist. This would either require a regular transaction, a closing/reopening of the channel, spreading the payment across multiple channels, or what is called “splicing” additional coins into an existing channel.

#3 calls attention to the fact that the channel also needs to have balances owned by both parties, or the transfer can only move one direction. If you own bitcoins, you can send them forward to the next node, and they will send the same amount forward in a channel they have with the next node, and so on. However, if you don’t own any coins in your channel (i.e. you already spent them), you have nothing you can sign over to the other node, and therefore can receive, but cannot send a payment. Therefore Lightning channels have liquidity limits, if it gets lopsided to one node or the other, the coins have to move back the opposite direction in order to be spendable again. There are many trust-minimized solutions to these issues like LN-> on-chain swaps, splicing into channels, opening or using an second existing channel to rebalance the first, etc. Despite being fun topics by themselves, these tools aren’t what this article is about.

The key here, is that these further complaints directly contradict #1, the idea that there are any fake Lightning tokens involved. If a balance must be present within the channel to sign over to the other node, and a payment fails without it, then obviously, no one is sending fake tokens, but fully validated bitcoins. Same with the liquidity limitations. If this is just a fractional reserve network, then why are we constrained to the balance of the channel? Why not simply make some extra coins to fulfill the payment? When was the last time you heard the Federal Reserve make the public statement, “we need to inject money into the economy in order to increase employment, investment, and ̶m̶a̶n̶i̶p̶u̶l̶a̶t̶e̶ stabilize interest rates, but unfortunately we checked and it looks like we don’t have enough in our account.”

Luckily, The Panama Canal can shed a little more light on these claims, so lets dive in.

Panama Payment Channels

The thought came upon me rather randomly on the way to the grocery. My realization was that the way the Panama Canal moves water to achieve something that, at a cursory glance would sound impossible, is actually an excellent real world parallel to how the Lightning payment system moves value in bitcoins. It also demonstrates how this would be possible, without contradicting the underlying laws of that system. In other words, how we can increase the number and kinds of limitations on a specific balance of bitcoin, in order to get around a different limitation. In the Lightning Network sense, how do Bitcoin payments become instant and bridged across payment channels, without ever contradicting the cryptographic validation & scarcity that it’s built on top of?

To get this out of the way, Lightning is not related to token contracts on Ethereum. I often see people claiming LN payments are like ERC20 tokens that would have to be “redeemed” for real Ethereum or Bitcoin. In truth, there is no meaningful similarity between how the two operate. ERC20 tokens are transferred with ETH keys, but they have nothing to do with ETH the asset, at all. They don’t sign ETH inputs, they don’t transfer ETH during payment, and they don’t care whether ETH is present at all. The ONLY connection to Ethereum is in the use of ETH keys and addresses for controlling/moving the balance of these new tokens. Just like I could use my Bitcoin public key to encrypt some arbitrary text, and then decrypt it with my private key, it makes zero difference to the encryption of the text whether I have any bitcoin attached to those keys.

With that out of the way, it’s time to get into the design of The Panama Canal.

Disclaimer: I’m employing a little creative license here as these are not the exact means by which the Panama Canal operates. My explanation will work with individual reserve tanks, while the Canal doesn’t perfectly follow this model. This is because all locks are operated by a single station, while in Lightning every lock is a channel with independent operators, and each have individual “reserve lakes.” These minor differences are unimportant to the underlying design that make it possible.

If you don’t know, most of the Panama Canal is 26m above sea level. Ships are literally lifted 85ft above the ground, and then “shipped” to the other end, and dropped back down to sea level. This seems to defy fluid dynamics right? How can you keep water, accessible by boat, significantly above sea level without it just draining into the ocean? It’s accomplished with a series of locks and water reserves at either end of the canal. In relation to the Lightning Network, the “locking bays” are analogous to individual payment channels, the water demonstrates the balances of the coins within those channels, and the ships are the value being moved despite the water only moving back and forth from the locking bay and the reserves. This is what moves the ships, some even as large as cruise ships, up the 26m “hill of water.”

The Locks

The locking bays that make this possible have massive doors at either end, able to trap the water inside them. They are large enough to fit the ships, and have reserve tanks in parallel to them for moving water into, or out of the locking bay. When the ship first arrives from the Atlantic, still at sea level, it begins by entering the first open locking bay. The massive doors are shut behind it, trapping the ship and water level within the small space. Water is then pumped from the reserve tank into the locking bay with the ship. The added water, literally millions of gallons, floats the ship higher and higher until it matches the water level of the next locking bay. With the water levels now matching, the forward doors are opened, and the ship moves into the next bay. Again the massive doors are shut behind the ship, and the process is repeated in the second bay, and the third, etc. This is continued through a handful of locks until the ship finally reaches the canal height, 26m (or 85ft) above sea level, to travel across the stretch of Panamanian land until reaching the locks that will lower it back into the Pacific Ocean.

The lowering process is the reverse. On the lowering side, the water is pumped into the reserve rather than out, in order to drop the ship a few meters. The next lock is opened, and again this happens until the ship is back at sea level, and can exit the canal to continue their journey into the Pacific.

Pretty simple concept right? Believe it or not, so is the Lightning Network. At a very basic level, this system is remarkably similar to Lightning channels. So much in fact, that the analogy actually addresses all three criticisms we have discussed about Lightning earlier. The fact that no LN coins are created, the liquidity problem, and the balancing problem.

Fake Water?

First, there is no point where “fake water” is involved in this process. In the same way that the ships cannot move forward without real water to pump into/out of the locking bay, payments cannot move through Lighting without real bitcoin to sign and move within a payment channel. Just like bitcoins in a channel, the water used to transport the ship sits in reserve at every individual lock. If there is no water in the reserve, you cannot raise the ship to access the next lock. In other words, without real water, the “Panama payment” will fail.

Another interesting parallel is that the water in the entrance bay of the canal, is not the same water that leaves the exit bay of the canal. A normal river will see the water flow down the river and exit into the body of water at the other end. The ship makes this same journey with the water. In any other situation it would seem, if the water cannot make the journey, certainly the ship cannot make it either. Within the canal locks however, water in each lock (aside from some obvious mixing) is just water cycled into and out of each reserve tank and locking bay. In order to transport the value, the water doesn’t have to move forward or backward down the canal, it simply has to move back and forth from the locking bays and reserve tanks.

In the same way that water doesn’t travel through the canal, a specific bitcoin being used for payment doesn’t travel through the Lightning Network. Instead it just shifts balances higher or lower through a series of channels (just like the water level) in order for the value of the bitcoins (the ship) to make the journey across the canal. Just like Newton’s cradle, the first ball that is dropped, isn’t the same ball that swings out the other end.

exhibit at Musashino Art University in Tokyo, by Yasutoki Kariya

This is one of the reasons why Lightning introduces such an interesting element to the privacy problem. In Bitcoin, every transaction has a chain of the entire history of each coin back to its creation. If used for a payment, the bitcoins previously in your possession, are transferred directly to the receiver. Similar to how you could track the flow of water from its origin to destination using a buoy that flows with the current. In the Panama Canal, however, the water in each lock, is the same water that’s been oscillated in and out with every ship that passes. Our little buoy, would simply stay inside the locking bay it was originally placed, being raised or lowered with the water level every time a ship comes through. Similarly, in a Lightning payment, the bitcoins connected to your address and inside your payment channel, are not the same bitcoins that end up fulfilling the payment at the other end. Just like our buoy that never leaves its locking bay, or the balls in Newton’s cradle, that remain stationary but transmit the force to the end of the path.

The Water/Liquidity Problem

The Lightning Network also has a liquidity limitation to overcome as mentioned earlier. So how does this apply? This is the same problem the canal has with the amount of water, the size of ship it can transport, and how high it can lift the ship. The locks and reserve tanks don’t have the size or amount of water necessary to transport an aircraft carrier, nor can it lift a ship 200m. In a similar way, if the amount of bitcoin locked in a channel isn’t enough to cover a large payment, then the value cannot travel through its “lock.”

In addition, if the reserve tank doesn’t have enough water in order to fill it to the height needed to match the next lock, then the ship (or payment) cannot get through. The lock operator can’t lie and claim there IS enough water “liquidity” to get the ship through. The ship won’t float on promises and wishful thinking, it needs “proof-of-water.” If there isn’t enough water in the reserve, then they would have to pull additional water from some other location to cover the difference, this is similar to what would be called a “splice” in Lightning. Moving additional bitcoin from a different address with a “splicing” transaction to make it available within the channel’s reserves. With the additional bitcoins or water, the level can now be further raised to make the path traversable again.

The Balancing Act

Pink Sherbet Photography

The last element we discussed is the balancing problem. Let’s say we have a ship that needs to be lowered in order to exit the canal. If the water level of the next lock is still below the level in the previous lock, where our impatient ship captain awaits, then water has to be transferred from the reserve tank in order to fill it to the same level. The ship cannot be moved until this is done. Luckily for the Panama Canal operators, this simply means pumping water from the reserves into the locking tank.

In a similar way, if all the “liquid” of a lightning channel is in your half of the tank (the reserve), then you can only send a payment out (by shifting to the locking bay). In our canal example, you would only be able to *raise* the level of a ship, but would have no reserve space left to *lower* the ship. Your canal, or your Lightning channel, become a one way path. You either need to send a ship in the other direction first (send a payment) or shift the water/LN balance into the other tank yourself. In Lightning this would be equivalent to an on-chain swap that moves the balance *out* of your reserve even though you aren’t actually paying anyone, but you get the bitcoin back as a normal transaction to a different address.

The Brilliant Simplicity of Lightning

Hopefully this analogy makes the operation of the Lightning Network a little easier to picture in your mind. But there is another thing that makes this analogy beautiful, it helps to show the awesome power of the Lightning Network. The Panama Canal, considered one of the “7 Modern Wonders of the World,” is an extraordinary feat of engineering. By heavily and purposefully limiting the flow in a set of cascading intervals, it is able to surpass a physical limitation on traversable bodies of water. Lightning, by contracting strict limitations on the flow of bitcoins, is able to securely surpass a limitation on the flow of value.

But going further makes you realize that the Lightning Network is infinitely more powerful than the Panama Canal’s system. The canal is a series of locks that produce just a single path. The Lightning Network, on the other hand, is thousands upon thousands of different paths that can be constructed or deconstructed with just a single Bitcoin transaction. And the number of paths is limited only by the individual choices of every node that opens a set of channels. A single node can have hundreds of channels themselves, like a locking bay with 3, 5 or even a 100 different exists, connecting to even more nodes with an even greater number of available paths. A global, distributed network of dynamic, multi-path, Panamanian locks that can lift a ship to any height, over mountains, across continents, and ultimately to any corner of the world. Even more amazing, where Lightning may run into a lack of water to send a large ship through a channel, we can divide that ship up into many pieces, send them on separate paths, through separate locks, and reconstruct the ship at its destination. And this can all be accomplished with a series of mathematical contracts that mean we never need to trust the nodes along the way to fulfill our payment, or worry about contradicting the underlying rules that secure the system from corruption and monetary manipulation.

The Lightning Network doesn’t need or use “fake bitcoins” anymore than the Panama Canal uses “fake water” to get a ship through. And both systems are valuable for largely the same reason. Where a ship would be forced to take a costly and time consuming trip around the South American continent, the canal gets it to its destination in a few hours at a fraction of the cost. Where a normal Bitcoin transaction has to be validated by tens of thousands of nodes across the world, pay a network fee, and wait 10 minutes or longer for a confirmation, Lightning payments pay mere 1000ths of that fee, and are confirmed at the speed of light.

This is only the beginning. There is still enormous potential in the Lightning Network yet to be tapped and use cases yet to be realized. The Millionth vessel passed through the Panama Canal in September of 2010. And since its construction, the canal has transported hundreds of billions of dollars worth of value through its locks. The Lightning Network, with the right engineers and infrastructure, may very well one day facilitate the transfer of hundreds or even thousands of times more economic value, than even the Panama Canal.

Don’t forget to check out The Cryptoconomy Podcast where I read all the best Bitcoin & Crypto content, including my own contributions.

If you would like to support my work:

Donate To:

Looking to Secure your Bitcoin with TREZOR? Affiliate Link

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade