You are currently viewing Bitcoin Lightning Network Explained

Bitcoin Lightning Network Explained

The Bitcoin blockchain added the Bitcoin Lightning Network as a second layer to the Bitcoin blockchain. The Lightning Network allows you to do off-chain transactions, and off-chain transactions are between parties not on a blockchain network.

In this post, I’ll provide some background information about the Lightning Network: its history, mechanics, advantages, disadvantages, and expectations for the future.

The Basics of the Lightning Network

When you have a Lightning Network channel, you create a two-party transaction method in which both parties can generate or receive payments from each other. Layer two expands the scalability of blockchain applications because it manages transactions outside the blockchain main net (layer one). However, the main net still provides powerful decentralized security mechanisms, which you still have at your disposal.

One of the biggest challenges of adopting cryptocurrencies is the barrier of scalability. When cryptocurrencies are only limited and scalable, they can’t be widespread, so that they won’t evolve into a generally accepted monetary payment method. If a blockchain network is appropriately scaled, it can handle millions to billions of decentralized transactions per second (TPS). The Lightning Network makes this possible for Bitcoins, charging relatively low fees because it transacts and settles off-chain. These small fees allow new applications like instant micropayments that can solve traditional problems like buying coffee with Bitcoins while in a coffee shop, speeding up processing times, and reducing energy costs associated with the Bitcoin blockchain. We are not entirely there yet, though: the Lightning Network still has challenges it has to solve. New problems occurred, like low routing fees (payments that go toward nodes that validate crypto transactions) and malicious attacks.

The Lightning Network: a History Lesson

In 2015, two researchers (Thaddeus Drya and Joseph Poon) published a paper describing an off-chain protocol created by payment channels. Inside these payment channels, two unvalidated parties would be able to transfer value without plugging into the mainnet because the channels were off-chain. Off-chain channels solve the scalability challenge of Bitcoin.

In 2016, the two researchers founded Lightning Labs. Lightning Labs dedicated itself entirely to the development of the Lightning Network, and it made the protocol compatible with the Bitcoin network core.

In 2017 Bitcoin’s SegWit (Segregated Witness)-based soft fork freed up space for more transactions that fitted in each block, removing an old Bitcoin bug. This bug, named transaction malleability, enabled users to lie to the Bitcoin network by making fake transactions that could be kept in their Bitcoin wallets. The soft fork helped the Lightning Network considerably because developers used the Lightning Network to test the SegWit soft fork. Developers tried this soft fork by building small apps, including simple use cases like wallets and gambling platforms on the Lightning Network, because microtransactions were its strength.

In 2018 the Lightning Network launched a beta version. This version launched the Lightning Network into the Bitcoin mainnet.

Mechanics of the Lightning Network

The Lightning Network protocol creates a peer-to-peer payment channel between two parties: a buyer and a seller. When the Lightning Network has established the track, it allows both parties to send unlimited transactions without almost any expenses. The channel is its small ledger for both users that manages all transactions, even more, miniature goods and services without affecting the Bitcoin network.

To create a payment channel, you must lock a certain amount of the Bitcoin you own into the network. When that amount is locked in, the recipient of your transactions can invoice any amounts as they see fit. If you (as a customer) want to keep the channel open, you can continuously add Bitcoins. You can see it as a mini payment channel between two parties: both parties transfer funds between themselves for an indefinite period without communicating this to the main blockchain. All the nodes in the blockchain do not have to approve transactions, creating a lot of efficiency and scalability advantages and speeding up transaction times. The Lightning Network forms nodes capable of routing transactions by combining the individual payment channels between all concerned parties. Because of this, the Lightning Network is the result of many small payment systems linked together.

After you finish transactions with the other party, you can close the channel, after which the Lightning Network consolidates all information into one transaction. The Lightning Network then sends the consolidated transaction to the Bitcoin mainnet for recording. Consolidation guarantees that all the small transactions enter the network simultaneously, simplifying them into one single transaction. This simplification takes less time and effort (resources) for the nodes to validate.

The technical functionality of the Lightning Network might be challenging to grasp as an outsider, and the practical example I’m going to give now will help to make this all easier to understand.

Let’s pretend that supermarkets accept Bitcoins and that you want to pay for your groceries with Bitcoin. Because Bitcoin has scalability issues, every transaction can take one hour to validate. You also have to pay the high fees of the Bitcoin network, although the transaction is relatively small. Waiting for one hour at the supermarket counter to validate your payment at a high additional transaction fee is not practical, so this would never work. But let’s imagine you use the Lightning Network. You open a payment channel with the supermarket by putting Bitcoin in the channel. The Lightning Network records every purchase you make with the supermarket inside that payment channel. When paying, the supermarket immediately receives the sum you got charged. This way, the transactions are cheap and maybe even free and also instant. Quite a difference compared to paying inside the Bitcoin mainnet! When you have entirely spent the amount of Bitcoin that started the payment channel, you can choose to close the channel or refill it. All transactions are recorded to the main Bitcoin blockchain if you close the channel.

The parties receive a smart contract created by the Lightning Network. The rules of the agreement are coded into the contract when you create the payment channel. These fixed agreement rules, instated by smart contract coding, can’t be broken. The smart contract coding also ensures that fulfillment of the contract is automatic with all the requirements built in and agreed to by the participating parties. If all conditions are met, for instance, if you pay the supermarket, you automatically fulfill the contract without third-party involvement. The Lightning Network fully anonymizes transactions within a payment channel once they are validated. You can only see the total transfer of value, not the individual transactions inside. The mainnet is the referee of all the transactions, and the off-chain protocols have their ledger. The Lightning Network always integrates this ledger into the mainchain once open payment channels are closed.

Pros of the Lightning Network

Transactions inside the Lightning Network are faster and cheaper, enabling micropayments in a way that was impossible before. Without the Lightning Network functionalities, you would have to pay high fees for a simple transaction and wait over an hour to validate your payment. You always have to wait a long time because miners always choose to validate more significant transactions, and this is because miners earn more substantial rewards for more important transactions.

Because of the connection of the Lightning Network to the Bitcoin blockchain, it still benefits from all Bitcoin’s security protocols and the other features of the most mature blockchain out there. All small transactions inside the Lightning Network payment channels are private, meaning that onlookers can’t peek at any individual transaction; they only see the overall package. Another advantage (but only for more frequent users) is atomic swaps. Atomic swaps allow a user to swap one type of cryptocurrency to another without the involvement of a third party or an exchange. Atomic swaps are easier to use in the Lightning Network than on an exchange, and this is because an atomic swap offers near-instant swapping with little to no fees or wallet transfers, contrary to an exchange.

Cons of the Lightning Network

To operate within the Lightning Network, you must acquire a compatible wallet. It would be best if you funded it with a traditional Bitcoin wallet, which might be a problem. The initial transaction from a classic Bitcoin wallet to a Lightning Network wallet will initiate a fee, meaning that users will lose some Bitcoin to interact with the protocol. After the funds are in the wallet of the Lightning Network, you have to lock up your Bitcoin to create a payment channel. Because transferring Bitcoins between wallets can be time-consuming and expensive, it might put off newer users. However, some wallets can manage on- and off-chain payments without charging you a fee. Within time this process will mature (I’m sure of this), making handling transfers between wallets easier and less time-consuming.

In case you want to pull some funds from your payment channel, you have to actively close a channel and receive the Bitcoin back before you can use the funds. It is impossible to pull just a bit of Bitcoin and leave the channel open. Every opening or closing of a payment channel requires both participating parties to make an initial transaction: a routing fee. All these extra payments can make the process more expensive than many potential users will quantify as adequate.

The biggest issue is offline transaction scams, though. When one of the participants in a payment channel decides to close it while the other party is offline, the former can steal all funds. After the latter party finally comes online, it is too late to take action, and the scammer can remain offline without the option to contact them.

Because the Lightning Network is still in beta, it has bugs like stuck payments: outgoing transactions that don’t see verification. Although the Bitcoin network refunds a stuck amount, it can take days to receive back your funds because valid transactions have more priority than stuck transactions when they have to be verified.

Last but not least, regulators may have problems understanding the Lightning Network concept to set up proper legislation. If regulators struggle, mainstream crypto users might also struggle to use the Lightning Network. One of the critical issues that regulators might have with the Lightning Network is its anonymity. Fully anonymous transactions might scare legislators because they can only see a fully finalized transaction after a user has closed down a payment channel. They can’t look into individual transactions made between parties inside a payment channel.

The Future of the Lightning Network

Adoption is rising, with $120 million of Bitcoin locked into the Lightning Network. You can use the Bitcoins currently locked inside the Lightning Network for goods, services, apps, and much more. Now, traders cannot utilize the Lightning Network without an optimized wallet. If the adoption of the Lightning Network continues to grow, we can expect more wallet developers to integrate support to the Lightning Network. Dedicated users might also decide to become a node inside the Lightning Network, which would speed up the transaction times.

A third-party protection service has set up various specialized nodes to prevent scams for the Lightning Network: Watchtowers. Nodes go offline once in a while, which leaves their payment channels open to offline transaction scams, as previously mentioned in this post. Instead of leaving the channel unattended, a participant can pay a small fee for a watchtower. You receive a signifier related to the channel transaction by paying this fee. The watchtower assigns a signifier to identify the user’s channel between all the rest: it keeps an eye on it. In case the watchtower senses a malicious activity, for instance, when an opposing party attempts to close the payment channel, it automatically freezes the funds and refunds them to the offline user. The watchtower also penalizes the malicious party by removing their funds from the channel.

All these developments will create more initiatives to provide security and stability to the Lightning Network, increasing adoption and maturity.

Final Thoughts

I like the Lightning Network concept, although it’s still immature. Within time, it can grow into a serious alternative to other (centralized) FinTech options. The big difference is that this would be fully decentralized compared to the centralized options. Maybe even NFC (Near-Field Communication) Bitcoin payments by your phone would be possible, competing with giants like the Apple Wallet and the Google Wallet.

However, like all successful technological advancements, the Lightning Network can only be a smashing success in case of mass adoption, meaning that it needs to be safe, user-friendly, widely spread, and accessible anywhere. Only time will tell if this will be the case, but for me, this concept is worthwhile following. I love the idea of decentralized wallet payments without any third parties, enriching themselves by doing practically nothing at the buyer’s and seller’s expense.   Feel free to contact me if you have any questions or if you have any additional advice/tips about this subject. If you want to keep me in the loop if I upload a new post, do not forget to subscribe to receive a notification by email.

Gijs Groenland

I live in San Diego, USA together with my wife, son, and daughter. I work as Chief Financial and Information Officer (CFIO) at a mid-sized company.

Leave a Reply