I felt the need to recap the basis of the Lightning Network, because sometimes we go a lot deep on it while forgetting to point out the basic concepts which are milestones for understanding how the magic takes place.
We know that the Lightning Network is a second-layer protocol built on top of the Bitcoin blockchain. This was designed to enable fast and cheap offchain transactions for making possible day-to-day Bitcoin spending.
The initial idea for the Lightning Network was proposed in 2015, and the first implementation was launched in 2018. We can say it’s something built on top of Bitcoin base layer, a kind of protocol built on top of the Bitcoin base layer protocol.
The Lightning Network is a routed network of payment channels. A payment channel is a financial relationship between two nodes on the Lightning Network, typically established by funding a 2-of-2 multisignature Bitcoin address.
Once a channel is open, the two parties can exchange multiple off-chain payments by updating the balances within the channel without needing to record each transaction on the Bitcoin blockchain and this makes the magic. These off-chain payments are instant and have low fees.
For users who do not have a direct payment channel, the Lightning Network can route payments through a series of interconnected channels. This process needs finding a path from the sender to the recipient across the network.
Key concepts
Key technologies that enable the Lightning Network include:
Hash Time-Locked Contracts (HTLCs): These are a special type of Bitcoin transaction that act as smart contracts, allowing for atomic and trustless multihop payments. An HTLC ensures that an intermediary node in a route only receives payment if they can prove they have forwarded the payment to the next node. HTLCs utilise a payment hash and a timelock to ensure conditional and time-bound transfers of value. As we discussed previously, timelocks are crucial for the security and functionality of both commitment transactions and HTLCs in the Lightning Network.
Onion Routing: To maintain privacy, the Lightning Network uses an onion routing protocol, specifically an implementation based on the SPHINX Mix Format. This involves encrypting the payment information in layers, like an onion, so that each intermediary node in the route can only see the next hop, but not the origin or the final destination.
Gossip Protocol: Lightning nodes use a peer-to-peer gossip protocol to share information about publicly announced channels and nodes, allowing them to build a channel graph of the network topology. This information is essential for path finding, the process of finding a route for a payment.
Advantages
The Lightning Network offers several defining features and benefits:
Speed and Low Cost: Transactions on the Lightning Network are fast and have significantly lower fees compared to traditional on-chain Bitcoin transactions because they do not require blockchain confirmations.
Privacy: Payments routed on the Lightning Network are transmitted between pairs of nodes and are not visible to everyone, resulting in greater privacy than broadcasting Bitcoin transactions.
Scalability: By moving a significant volume of transactions off-chain, the Lightning Network helps Bitcoin scale to handle a larger number of payments more efficiently, making it more suitable for everyday use.
Irreversibility: Once a payment on the Lightning Network is complete, it is final and cannot be reversed.
Trustless Operation: The Lightning Network operates in a trustless manner, relying on cryptographic protocols and the underlying security of the Bitcoin blockchain.
BOLT Standards
The Lightning Network's functionality and interoperability are governed by a set of open standards known as BOLTs (Basis of Lightning Technology). These specifications, developed by the community, ensure that different Lightning Network implementations (such as c-lightning, LND, and Eclair) can work together seamlessly.
BOLT 11 defines the encoding and interpretation of Lightning payment requests, also known as invoices, which are used to initiate payments.
BOLT 7 defines the mechanisms for peer-to-peer node and channel discovery through the gossip protocol.
BOLT 8 focuses on encrypted and authenticated transport between nodes. Furthermore,
BOLT 12 is still an ongoing development aimed at enhancing the user experience, for example, by simplifying QR codes for payment requests and enabling offers through Onion Messages. For some point of view is something similar to LNURL but without the use of a webserver while adding more features, natively to the Lightning Node.
Despite its advancements, the Lightning Network is still considered to be in its infancy. It has a growing number of use cases, including micropayments, gaming, cross-border payments, social media tipping, streaming, and P2P marketplaces. There is also ongoing innovation in the protocol, such as the potential integration of stable coins and the development of features like blinded paths. The channel graph of the Lightning Network is dynamic and complex, influenced by economic incentives, and understanding its structure and evolution is an area of ongoing research.
Follow my channel on Telegram: https://t.me/massmuxchannel with articles, speeches at conferences and more.