Episode XIII. Block height: 808500. Scalable, instant and lightning fast Bitcoin transactions explained. Including a step-by-step guide to set up your own Bitcoin Lightning Node.
The original Post: https://carlbmenger.substack.com/p/the-lightning-network
Bitcoin is often accused of being slow and sluggish, old technology being replaced by new 'better' (faster) blockchains. And it is true that the main layer of the Bitcoin network is relatively slow, considering transaction speed and not final settlement. However, Bitcoin was deliberately designed like this (10 minutes per block) because it serves the security of the network and allows everyone to run their own node without high cost nor effort. Therefore, the relative slowness of the base layer serves decentralisation and security purposes.
But you maybe ask yourself rightfully, how can Bitcoin become a medium of exchange or scale to a broader audience with 7 transactions per second? Well let us have a look.
Scaling in Layers
What many people forget is that Bitcoin scales in layers. The reason for this is that if one blockchain network layer is attempting to be used for all purposes, it makes too many sacrifices to be useful for anything in the long run. However, if each layer of the system is optimized according to certain variables to serve a specific purpose, then the full network can optimize for multiple use-cases simultaneously without making fundamental trade-offs.
For example, suppose you want to increase the transaction speed of Bitcoin by increasing the block size. This may sound like a good solution at first glance, but if you think it through, it's not: a larger block size would increase the requirements for running a Bitcoin node. If ordinary people are not able to run a Bitcoin node, the network will become highly centralized, so increasing the block size to increase transaction speed would lead to less decentralization. This is the reason why scaling in layers is so much better.
Currently, the most important Bitcoin layer is the Lightning Network, a set of 2-of-2 multisignature smart contracts running on top of the Bitcoin base layer. Because of its increasing importance to the Bitcoin ecosystem, I want to dive a little deeper into this second-layer technology.
The Lightning Network
The Bitcoin Lightning Network is a second-layer solution built on top of the Bitcoin base layer. It aims to address some of the scalability and speed limitations of the Bitcoin base layer by enabling faster and cheaper transactions.
Suppose you and your friend spend some time in a bar talking about Bitcoin. Let's say you gave the bar owner your credit card information at the beginning of the visit, and everything you order is put on your tab. When you're ready to leave, the waiter gives you the receipt, you sign it, and then it's charged to the credit card you already gave. This way you have opened a payment channel with the bar owner. This is basically how the Lightning Network works, but without a credit card or credit at all.
P2P Channels
To use the Lightning Network, you need to open a channel that uses a bitcoin base layer transaction. The channel is a 2-of-2 multisignature channel with a time lock, which means we both have to agree to open it, but either of us can unilaterally close the channel if we need or want to. To conduct transactions, one party or both must add liquidity in the form of sats (a small bitcoin unit). As long as we have enough liquidity in the channel, we can instantly make as many transactions back and forth as we want.
So unlike our bar tab, a Lightning channel is not based on credit. All participants of the Lightning channel can close the channel and get back the liquidity provided. Closing a channel means that all transactions that took place while the channel was open are combined and closed with a single transaction on the Bitcoin base layer.
Routing Transactions
Now take this step further: You and your friend do not even need a tab with the bar owner directly, it would be sufficient if you have a tab with another person who has a tab with the bar owner, so the payment would flow through the channel that you have with another person and then to the bar owner. And since the Lightning Network uses onion routing technology, your other friend wouldn't even know where the payment was coming from or where it was going.
Since the Lightning Network is a network of computers, you don't need a direct channel to every single person you want to send to or receive payments from. You can use existing channels to send or receive. As the Lightning Network becomes more widespread, it will become easier to find channels with enough liquidity to send instant transactions around the globe at the speed of light.
The result of this is that this network of channels is that one base layer transaction to open a channel gives you access to many individual payments to various separate entities, and thus gives Bitcoin the possibility to scale significantly. The only requirement is sufficient liquidity throughout your routing channels.
This means that the amount a user can send or receive is limited by the liquidity of the channels they use. At the time of writing, most Lightning wallets (Wallet of Satoshi or Moon) are capable of sending about $450 in one transaction, which should be enough for daily expenses. If you use your own Lightning node, make sure you have enough liquidity to complete your desired transactions.
Privacy
As the second layer on top of Bitcoin, the Lightning Network can greatly enhance the privacy of Bitcoin usage. While all transactions on the main Bitcoin layer are public, there is no central ledger or permanent record of individual transactions taking place in a Lightning Channel on the Lightning Network. All transactions are peer-to-peer, and transactions are not naturally related to each other. Only the opening and closing of the channel is synchronized with the Bitcoin base layer, but not the individual transactions that take place in your channel.
Nevertheless, the Lightning Network is not completely private. Receiving payments, requesting refunds, and opening and closing payment channels (connections between Lightning Nodes) have some privacy concerns for users. These concerns have led to protocol-based solutions such as Basis of Lightning Technology 12 (BOLT 12), a proposed upgrade that not only improves privacy but also introduces many other useful features.
Although the Lightning Network improves privacy, there is still work to be done. The beauty of the Bitcoin ecosystem is that it is open source and anyone around the globe can contribute to its success. As a result, the Bitcoin network is getting stronger and more user-friendly every day.
Main Features
- Payment Channels: Lightning Network creates a network of off-chain payment channels. These channels allow users to transact directly with each other, off the main blockchain.
- Fast and Low-Cost Transactions: Transactions within these channels are incredibly fast and typically have lower fees compared to on-chain Bitcoin transactions. This makes microtransactions and day-to-day payments more feasible.
- Scalability: By reducing the number of on-chain transactions, the Lightning Network helps alleviate congestion on the Bitcoin blockchain, potentially allowing for more scalability and accommodating a larger user base.
- Privacy: Lightning Network transactions can be more private since they don’t appear on the public blockchain until the channel is closed. This can enhance user privacy.
- Micropayments: It enables new use cases, such as microtransactions for content creators, pay-per-minute services, and more, which were previously impractical due to high on-chain transaction fees.
- Financial Inclusion: Lightning Network has the potential to bring financial services to underserved populations, especially in regions with limited access to traditional banking infrastructure.
- Cross-Border Payments: It can facilitate faster and cheaper cross-border payments, potentially disrupting the remittance industry.
- Smart Contracts: Lightning Network can support basic smart contracts, expanding its utility for various financial and non-financial applications A Game Changer
A Game Changer
Imagine a global system with a large number of interconnected Lightning Nodes spread across the globe. Anyone can join the payment network by running their own payment server (Lightning Node) and opening channels to others. Because the network is efficient, transaction fees are a penny or less. Microtransactions and/or buying your daily coffee are instantaneous and frequent machine-to-machine transactions are easy. No more discrimination, no more high fees, just pure and private P2P transactions. What a bright future!
Like the Bitcoin network itself, the Lightning network relies on as many Lightning nodes as possible. For example, if you're running a Bitcoin node with Umbrel, it's super easy to run a Lightning node at the same time. For this reason, I want to show you how to run a Lightning node, how to provide it with liquidity, and how to open channels and route your own Lightning payments. Pretty cool, indeed. So let's get started:
Step-By-Step Lightning guide
- Check out my ‚Don‘t trust, verify ‘episode (https://carlbmenger.substack.com/p/dont-trust-verify) on why and how to set up your own Bitcoin Node using a Raspberry-Pi with Umbrel. After setting up your own Bitcoin Node you can also open up your own Bitcoin Lightning node/channel on the same device easily. So you have two features for one, which is pretty amazing.
- If you got your Bitcoin Node up and running, go to your browser and enter http://umbrel.local/ in the address bar. Type in your password and click on ‚Bitcoin‘ to your left.
- First, we need to add a bit of liquidity to your Node: Click on ‚deposit‘ and send some Sats by scanning your personal QR-Code.
- Then click on ‚Lightning‘ on the left.
- Now we have to open our first channel: You will see this window appear. Sadly it’s not very intuitive so let’s go through it.
A) The Lightning address is NOT your address. It’s the Lightning address of the person you are connecting to. B) The amount is the amount of sats that you’ll create the channel with. C) At the bottom, you’ll see a Transaction Fee. This is the ‘cost’ of creating the transmission channel.
- To close a channel do the following: Click on the Channel you like to close in your Umbrel Lightning wallet. Then click on the red ‚Close Channel‘ button at the bottom of the ‚channel details‘ page and ‚confirm close‘.
That's basically it. You can also connect your own Lightning channel to Lightning apps like "Zeus" and start sending Lightning transactions through your own Lightning node wherever you are. If you're interested, check out the video tutorial from Bitcoin-Sessions (https://www.youtube.com/watch?v=hmmehTnV3ys).
The End
That's it for this episode. I hope you gathered some valuable knowledge from this one. Keep stacking and sending Sats via Lightning. Thanks for reading and see you hopefully in the next one. Until then, remember: F* central bank digital currencies and embrace open-source freedom money.
₿ critical, ₿ informed, ₿ prepared. Yours,
Stay tuned:
Subscribe to my Newsletter: https://open.substack.com/pub/carlbmenger/p/coming-soon
Follow me on Twitter: https://mobile.twitter.com/CarlBMenger
Follow me on NOSTR: