Article
NYDIG

The Bitcoin Lightning Network

Key Takeaways

  1. Lightning is a second layer protocol built on top of Bitcoin.
  2. Lightning doesn’t have its own token or blockchain. It uses Bitcoin’s currency (bitcoin) and its blockchain for opening and closing channels.
  3. Payments made on Lightning are cheap and instantaneous because they don’t go through the Bitcoin blockchain.
  4. The Lightning Network solves Bitcoin’s scalability problem. Lightning can handle billions of transactions a second compared to twelve per second for Bitcoin.
  5. Lightning is being rapidly adopted because it allows for instant and free remittances, cheaper payment processing than credit cards and makes micropayments possible.

The Bitcoin Lightning Network 

The Bitcoin Lightning Network (Lightning Network) is a payment protocol built on top of Bitcoin (often referred to as the base layer). Lightning doesn’t issue a token or have a blockchain. Instead, Lightning utilizes the Bitcoin network’s1 currency (bitcoin) for payments and its blockchain for final settlement and security. 

As a simple analogy, you can think of the Lightning Network as being like Venmo and the Bitcoin network as similar to sending a bank wire. The two networks, while related, each have unique use cases. For example, you wouldn’t use Venmo to make a down payment on a home. Conversely, using a wire transfer to send a friend your share of an Uber ride would be excessive, not to mention costly. 

Lightning, then, isn't a substitute for the Bitcoin base layer. Instead, deciding between Lightning or the base layer is simply a matter of picking the right tool for the job. For example, if the task at hand is a small transaction, then the right tool might be payment via Lightning. Lightning becomes an obvious choice if you know that you will have multiple transactions with the same person or business. 

At a high level, the Lightning Network is a web of individual connections (known as channels). The secret behind Lightning's instant and cheap payments is that it takes bitcoin transactions "off-chain." 

On Bitcoin, transactions must be added to the blockchain by miners. To be included in a block in a timely fashion, most transactions incur a fee that can, at times, be relatively expensive. In addition, Bitcoin adds blocks of transactions once every ten minutes on average, with best practices of waiting an hour for transactions to be considered finalized. Lightning only uses the Bitcoin blockchain to open and close channels, the gateway that connects one Lightning user to another. By doing so, Lightning bypasses base layer transaction fees and wait times. It also provides a definitive answer to the question of scalability that has dogged Bitcoin since its inception. Whereas the Bitcoin network can only process about twelve transactions per second with SegWit enabled,2 Lightning is theoretically capable of billions.3

For comparison, Visa, the world’s largest credit card network, processes just 1,700 transactions per second.4

The Lightning Network is a crucial step on Bitcoin's path to becoming a mainstream currency and, ultimately, a widely accepted medium of exchange. Lightning adoption is growing as people become more familiar with its use cases. For example, cross-border payments such as remittances are practically free and instantaneous via Lightning. Merchants have an excellent reason to adopt Lightning: it's as fast as a credit card swipe with a tiny fraction of the fees. Micropayments, which have been impractical in the digital realm, become possible with Lightning. Lightning Network channels have more than doubled to 70,0005 over the last year for these reasons and more. 

Lightning’s History 

Lightning might have just popped up on your radar, but the seed for its development is practically as old as Bitcoin itself. In Bitcoin version 0.1, Satoshi Nakamoto, Bitcoin's creator, included unfinished code that hinted at creating personal payment channels.6 In 2013, Bitcoin programmers shared Nakamoto's explanation for how the system would work on the Bitcoin development mailing list. 

In the years after Satoshi's code appeared, developers made multiple attempts to build a payment protocol on top of Bitcoin. Unfortunately, none of these early efforts succeeded. The idea didn’t truly come to life until the 2015 publication of "The Bitcoin Lightning Network: Scalable Off-Chain Instant Payments" by Joseph Poon and Thaddeus Dryja. 

In the two years following Poon and Dryja’s white paper, many companies would build versions of the Lightning Network using different programming languages. In 2016, developers drafted a protocol known as the Basis of Lightning Technology (BOLT) to ensure these different versions would be interoperable. The last step of the puzzle was Bitcoin's 2017 activation of the SegWit upgrade. SegWit included changes to the Bitcoin Core software that made the Lightning Network possible. A few months later, developers officially launched Lightning for Bitcoin. 

Getting Started 

The first step to using Lightning is setting up a node or downloading one of the many Lightning-enabled digital wallets. A node is a computer that runs the Bitcoin Core software. Nodes keep a record of the blockchain, verify transactions, and communicate with other users. However, Lightning nodes differ from regular Bitcoin nodes. Lightning nodes only verify transactions they are involved in and only communicate through established channels. On the other hand, full Bitcoin nodes monitor all network activity7 and broadcast and relay transactions to a wider group of peers. 

Lightning wallets, ready-to-use applications, are readily available for download for those who don't want to run a node. Wallets come in two flavors: custodial and non-custodial. The difference is that non-custodial wallets allow users to maintain the key for their bitcoin. With custodial wallets, users trust a third party to safeguard their bitcoin. 

With either type of wallet, the user is routing their transactions through a node maintained by the wallet provider. While using a Lightning wallet is more accessible, running a node provides more flexibility, lower fees, and increased security. In addition, node operators can receive routing fees, small bitcoin payments for helping pass along transactions throughout the network. 

How Lightning Works 

Here’s how the Lightning Network functions at a high level. 

Lightning users lock up bitcoin in an address that they share control over with another person. One channel owner can't access this locked bitcoin without the permission of their counterpart. When you pay someone with Lightning, the bitcoin that is locked in the address doesn't move anywhere. Instead, the Lightning Network keeps a running tally over who controls what portion of the funds. This lack of movement is why Lightning is fast and practically free. When the address owners wish to "settle up," they publish the latest address statement to the base layer blockchain. Then, the bitcoin in the address is unlocked, and the Bitcoin network distributes the fair share to each owner. 

Let's go through an example of how Lightning works between two friends, Alice and Bob, who are always splitting small expenses after weekly nights on the town. 

First, Alice and Bob deposit funds via the Bitcoin network to a Lightning account they both control. This type of address is known as a multi-signature address. If Alice or Bob want to close the channel, they need the other to approve the transaction.8 Since depositing funds for the channel requires base layer transactions, Alice and Bob will both be charged a transaction fee and have to wait about an hour for final settlement to the Lightning account. 

Once the channel is open and funded, Alice and Bob can use Lightning to manage their tab with each other. To receive a payment, Alice or Bob will create an invoice. Wallets typically generate invoices as QR codes that other wallets can scan. For example, if Alice owes Bob for a meal, Bob would create an invoice from his wallet software that Alice would then scan with her wallet to pay Bob. This payment would only occur on the Lightning Network. The only restriction is that Alice must have adequate funds to make the payment. When Alice makes a payment to Bob, bitcoin doesn't move out of the multi-signature address. Instead, Lightning records that Alice now owns fewer of the account's bitcoin, and Bob has more. 

When Alice and Bob want to settle the tab with each other, they'll close the channel and send the last account statement to the Bitcoin blockchain. Reasons for closing a channel could include: one participant running low on funds or if the two parties don't expect to transact anymore. Their closing transaction will incur the Bitcoin base layer's usual charges, and the final settlement will take about an hour. However, by using Lightning, they paid only the fees to open and close their channel while sending money to each other instantaneously and free of charge. 

Hops 

Now assume that Alice wants to send a one-time payment to Charlie. Unfortunately, Alice and Charlie don't interact very often, so they haven't established a channel. And since they don't expect to make future payments to each other, creating a new channel wouldn't justify the effort or cost. 

But just because Alice and Charlie aren't directly connected doesn't rule out the possibility of using Lightning. For instance, Charlie can send Alice an invoice and let the protocol determine if a path between them through existing channels exists. As it turns out, Alice and Charlie both have channels with their mutual friend Bob. 

Bob agrees to facilitate Alice's payment to Charlie in exchange for a small routing fee. A payment that goes through an intermediary, in this case, Bob, is said to have taken a "hop." A payment can go through a maximum of 20 hops, but the shorter the path, the better. Each hop comes with an additional routing fee. 

To ensure that Bob passes along the bitcoin meant for Charlie, the Lightning Network uses hashed timelock contracts (HTLCs). HTLCs are smart contracts that effectively force Bob to pay Charlie before Alice pays Bob. For the sake of privacy, Bob's node doesn't know who the payment originated with or who the end recipient is. His node only knows it received bitcoin from Alice and that it had to pass it to Charlie. But for all Bob knows, the payment didn't start with Alice or end with Charlie. The path could have started with Adele, whose node routed a payment through Alice, Bob and Charlie to get to Dave. In that example, only Adele and Dave would know the start and end of the chain. However, only Adele is privy to any of the intermediate steps. 

Real World Use Cases 

The most significant adoption of the Lightning Network to date has been through El Salvador's ratification of bitcoin as legal tender. The country's Chivo wallet is Lightning-enabled, and merchants use the network to accept bitcoin for everyday payments. But Lightning is for more than just buying a cup of coffee. El Salvadorans are using the protocol for sending and receiving remittances, avoiding the high fees of traditional money transmitters.9

For merchants, Lightning is substantially cheaper than accepting credit cards. The median fee for a Lightning payment is mere fractions of a penny. On the other hand, credit card companies charge anywhere from 1.4 to 3.5% in fees for each transaction.10

Unlike the base layer Bitcoin Network, Lightning has no minimum transaction value. A single satoshi, the smallest unit of a bitcoin, can be sent over Lightning. As a result, Lightning opens the frontier of micropayments. Think about the publishing industry, which currently struggles with ad- and subscription-based revenue models. Micropayments could represent a middle ground for publishers that hasn't yet been available because of the limitations and fees imposed by incumbent payment processors. A publisher could charge users small amounts to read a single online article rather than forcing them to contemplate buying an annual subscription. In this way, micropayments could make previously uneconomic businesses financially viable, all thanks to the Lightning Network. 

Warnings

For all of the good Lightning is already doing and can do in the future, there are some considerations users should keep in mind. 

Lightning has only been operational since 2018. While users and liquidity are rapidly growing, the network can still reject payments because it can't find an adequately funded path. 

Getting the most out of Lightning takes a little work. Users must keep tabs on their channel balances, particularly if they're trying to run a profitable11 Lightning node. As users make payments, the amount of bitcoin available for outbound liquidity in a channel decreases. Rebalancing channels, adding more bitcoin to some channels, and removing it from others, is a manual process that costs time and money. Adding or removing bitcoin from a channel means closing it and settling the balance on the Bitcoin blockchain, paying the base layer transaction fees in the process. Suppose the user wants to reopen the channel. They'd again pay base layer transaction fees. Rebalancing then should be done judiciously and, ideally, when base layer transaction fees are low. 

Finally, because Lightning is still in its infancy and not yet widely adopted, it has yet to be truly battle-tested. Lightning developers have identified a handful of attack methods that malicious actors could exploit. None of these identified hazards are severe enough to derail Lightning's adoption, but users should be mindful that they exist. 

An example of one weakness that malicious actors can exploit is cheating a node that isn't paying attention 

to its channel. In what is known as a protocol breach, one user will close a channel and submit a false account balance for settlement on Bitcoin. Unfortunately, if the victim's node is offline or is compromised, it might not detect the fraud. Thankfully, the Lightning Network provides a deterrence for this type of attack. If the fraud is detected, the perpetrator forfeits their share of the bitcoin in the account. 

Here’s a simplified example of how a protocol breach would play out: 

  • Bob and Dave have a channel that they each funded with 100,000 satoshis each. 
  • Bob pays Dave 50,000 satoshis. Dave now has a claim to 150,000 satoshis in the account. 
  • Bob closes the channel after the payment without consulting Dave. Bob submits the original balance of 100,000 satoshis held by him and Dave as final to the Bitcoin blockchain. 
  • Suppose Dave's node doesn't detect that Bob submitted the prior balance within 2,016 blocks on the Bitcoin blockchain (roughly two weeks).12 In that case, Dave risks losing the 50,000 satoshis Bob paid him. 
  • If within that 2,016 block period Dave’s node notices that Bob tried to cheat, Dave will get his 150,000 satoshis plus, as a penalty, Bob’s 50,000 remaining satoshis in the channel. 
  • If Dave’s node doesn’t detect Bob’s cheating, Bob and Dave will receive 100,000 satoshis. 

Other attacks directly target nodes. Griefing, eclipse attacks, and flood and loot attacks are all examples of methods for stealing funds. Each assault works differently, but the basic concept is to overwhelm a node with fake payments or false connections to the network so that it cannot function properly. Users can reduce the risk of these attacks by only opening channels with people they know or with reputable businesses. 

What Lightning Means for Bitcoin 

The Lightning Network solves Bitcoin’s scalability problem. Small payments are made off the Bitcoin blockchain on Lightning's second layer protocol. Each payment can be transmitted instantaneously on this layer since only the counterparties' nodes need to validate transactions. In addition, because Lightning isn't a blockchain, there's no mining involved until final settlement is made on the Bitcoin network. That is why there's no wait for blocks to be processed and no need to pay what can be costly transaction fees. 

But while Lightning doesn't incorporate the Bitcoin blockchain into transactions on its layer, it does utilize it for opening and closing channels. Consequently, Bitcoin secures Lightning. 

As more people join the Lightning Network, the use cases for holding bitcoin will rapidly expand. Its continued development could foster new business models and provide billions of disenfranchised people with a fast, cheap, and reliable payment system.

Footnotes

1 In actuality, Lightning is not exclusive to Bitcoin. It can be implemented on top of any Bitcoin-like blockchain, but it has so far been most widely adopted for use with Bitcoin. 

2 https://www.coindesk.com/tech/2021/07/14/nodes-on-bitcoins-lightning-network-double-in-3-months/ 

3 https://lightning.network/

4 https://utilli.com/2021/04/26/the-lightning-network-is-poised-to-disrupt-utility-payments/ 

5 https://bitcoinvisuals.com/ln-channels 

6 https://bitcoinmagazine.com/technical/history-lightning-brainstorm-beta 

7 There are lighter node implementations, SPV’s, that don’t require the node to download the entire blockchain.

8 This is a simplification of how multi-signature accounts work on Lightning. In reality, it only takes one user to close an account, but this is frowned upon. However for final settlement to occur, both parties will have a chance to verify the accuracy of the final account statement.

9 https://www.cnbc.com/2021/09/09/el-salvador-bitcoin-move-could-cost-western-union-400-million-a-year.html 

10 https://www.bankrate.com/finance/credit-cards/merchants-guide-to-credit-card-processing-fees/ 

11 Profitable simply means collecting more fees than you pay.

12 This period is known as the lock time. It’s a feature meant to prevent fraudulent activity by preventing funds from being spent immediately after an account is closed. It gives both parties ample time to check that the final balance is accurate..

Disclosures

This report has been prepared solely for informational purposes and does not represent investment advice or provide an opinion regarding the fairness of any transaction to any and all parties nor does it constitute an offer, solicitation or a recommendation to buy or sell any particular security or instrument or to adopt any investment strategy. Charts and graphs provided herein are for illustrative purposes only. This report does not represent valuation judgments with respect to any financial instrument, issuer, security or sector that may be described or referenced herein and does not represent a formal or official view of New York Digital Investment Group or its affiliates (collectively, “NYDIG”). 

It should not be assumed that NYDIG will make investment recommendations in the future that are consistent with the views expressed herein, or use any or all of the techniques or methods of analysis described herein in managing client accounts. NYDIG may have positions (long or short) or engage in securities transactions that are not consistent with the information and views expressed in this report. 

The information provided herein is valid only for the purpose stated herein and as of the date hereof (or such other date as may be indicated herein) and no undertaking has been made to update the information, which may be superseded by subsequent market events or for other reasons. The information in this report may contain projections or other forward-looking statements regarding future events, targets, forecasts or expectations regarding the strategies, techniques or investment philosophies described herein. NYDIG neither assumes any duty to nor undertakes to update any forward-looking statements. There is no assurance that any forward-looking events or targets will be achieved, and actual outcomes may be significantly different from those shown herein. The information in this report, including statements concerning financial market trends, is based on current market conditions, which will fluctuate and may be superseded by subsequent market events or for other reasons. 

Information furnished by others, upon which all or portions of this report are based, are from sources believed to be reliable. However, NYDIG makes no representation as to the accuracy, adequacy or completeness of such information and has accepted the information without further verification. No warranty is given as to the accuracy, adequacy or completeness of such information. No responsibility is taken for changes in market conditions or laws or regulations and no obligation is assumed to revise this report to reflect changes, events or conditions that occur subsequent to the date hereof. 

Nothing contained herein constitutes investment, legal, tax or other advice nor is it to be relied on in making an investment or other decision. Legal advice can only be provided by legal counsel. NYDIG shall have no liability to any third party in respect of this report or any actions taken or decisions made as a consequence of the information set forth herein. By accepting this report in its entirety, the recipient acknowledges its understanding and acceptance of the foregoing terms.

Related Articles
See all articles
Right arrow