What is the Lightning Network? The Lightning Network is a payment protocol that operates on top of the Bitcoin network. It is a network of decentralized nodes that allows for sending a huge number of transactions extremely fast and for a negligible fee. The Lightning Network facilitates micro payments, making the existence of a completely new type of applications possible.
To illustrate how the Lightning Network works, let's imagine ordering drinks in a pub. The first option is to pay for every single drink separately. This means you have to pay each time you want to order a drink, and each of these transactions will be settled with the pub separately. If we imagine these are Bitcoin transactions, each one of them would have to be settled on the Bitcoin blockchain. The second option is to open a bar tab. Now you can order as many drinks as you want without having to settle each transaction separately. At the end, you can just pay once, settling the whole bill in one transaction. This is a similar approach to how the Lightning Network works, and it is considered a layer 2 solution, as not every transaction is settled on the blockchain. Not settling every transaction on the blockchain allows for achieving a dramatic increase in both transaction speed and throughput, and makes Bitcoin scalable to the level necessary to become a viable means of payment for the whole world.
The Lightning Network was first described by Joseph Poon and Thaddeus Dryja in February 2015. You can find a link to the white paper in the description below. The Lightning Network is built on the concept of payment channels that can be established between two parties. We are going to dive into this later in the video.
OK, this all sounds really cool, but why does Bitcoin even need the Lightning Network? The quick answer is scaling. Concerns about Bitcoin scaling problems were raised multiple times, and they became obvious during the end of the 2017 bull run in Bitcoin. Every single transaction has to be broadcast to every single node in the network. Broadcasted transactions have to be included in a block to be mined and settled on the blockchain. As Bitcoin blocks are created every ten minutes on average, and each block has a limited size, it creates a natural bottleneck on the number of transactions that can be processed. When it comes to fixing Bitcoin's scalability problems, developers came up with a few different approaches: mainly increasing the block size, or the sidechain approach, or moving part of the transactions off-chain. Both of the approaches come with their own trade-offs, but the Lightning Network tries to increase the network throughput and speed by processing some of the transactions in the second layer. Currently, the Bitcoin network can process on average between three and seven transactions per second. If Bitcoin wants to become a viable means of payment, it has to start competing with already existing solutions. One of them is, of course, Visa, which processes around 4,000 transactions per second and can handle spikes up to 65,000 transactions per second quite easily. The good news is that the Lightning Network can potentially scale to millions of transactions per second and dramatically increase transaction speed. That is exactly why this technology started attracting a lot of attention.
Now that we have gone through the necessary overview, let's get into the nitty-gritty details of the Lightning Network. We cannot talk about the Lightning Network without mentioning payment channels, which are the basic building blocks of the network. Payment channels are examples of state channels, which represent an off-chain state alteration secured by eventual settlement on the blockchain. In order to open a new payment channel, two parties, Alice and Bob, have to commit funds to a two-of-two multisig address by sending a transaction, also called a funding transaction, to the Bitcoin network. Committed funds represent the maximum channel capacity, which is the amount of Bitcoin that can be transferred via this channel. After the channel is established, the two parties can start signing and exchanging transactions called commitment transactions, which alter the initial state and are not broadcast to the Bitcoin network. This allows for exchanging thousands of transactions without having to interact with the underlying Bitcoin network, and makes the whole solution scalable. When Alice and Bob at some point decide they want to close the payment channel, they can sign a closing transaction. This transaction will be mined, and it will resolve the final balance between the two parties. In the whole lifetime of a payment channel, there are only two transactions that have to be mined, and these are the opening and the closing transactions.
The Lightning Network is built on the concept of multiple payment channels connected end to end, which allow for routing transactions to any of the network participants. In the Lightning Network, a transaction can be sent through the network of payment channels without trusting any of the intermediaries, by leveraging a mechanism called a hash time lock contract. Every time a node wants to send a payment to another node, it must first construct a path. It does so by connecting channels with enough capacity, using possibly the shortest route. It also takes into account the fees of the intermediate nodes. The communication between Lightning Network nodes is encrypted point-to-point. The Lightning Network achieves this by implementing an onion routing protocol, similar to Tor, which ensures that intermediate nodes can verify and decrypt their portion of the route, and they cannot identify the length of the payment path or their own position in the path. To deal with bad actors, the Lightning Network leverages many game-theoretical elements that incentivize nodes to act honestly. These are mostly timelocks, asymmetric revocable commitments, and HTLCs. This was only a quick overview of payment channels, and we are going to cover more details in the following videos.
The beauty of Bitcoin and the Lightning Network is that it can not only provide a better alternative to existing systems but also facilitate the creation of completely new types of applications. Have you ever realized you kept paying a subscription fee even though you barely used a service? What if, instead of a monthly fee, the service was charging you by the minute, or maybe even by the second? A good example would be a movie streaming service that charges a small fee for every second of watched content. This type of business is currently not a viable option due to high fees for processing card transactions. How about receiving your salary every hour, or even every minute, instead of once or twice per month? This is where the time value of money comes into play. With the Lightning Network, micro payments become a new possibility. This opened the world to a new concept of streaming money, a new way of transacting that was hard to imagine before the Lightning Network. Although it is mostly discussed as a Bitcoin technology, the Lightning Network is not limited to Bitcoin. In fact, most cryptocurrencies supporting basic constructs like timelocks or HTLCs can make use of the Lightning Network to exchange value. There is also a possibility of exchanging one coin for another via the Lightning Network, in a process called atomic swap. This concept can power decentralized exchanges and allow people to exchange coins without losing control of their private keys.
As the Lightning Network continues to grow at a very high rate, it is important to make sure that different implementations can communicate with each other. To achieve that, the community came up with a BOLT standard, which specifies guidelines that allow for seamless interoperability between different implementations. This also allows different teams to work on their own Lightning Network implementation at their own pace, which speeds up innovation. The most popular implementations, with the highest number of developers, are c-lightning, LND, and Eclair. When it comes to wallet apps supporting the Lightning Network, there are already a few good solutions, but we have to remember that most of them are still in beta stage and may contain bugs, so it might not be the best idea to deposit a lot of money into them. The most popular wallets are Blue Wallet, Wallet of Satoshi, and Zap.
As we mentioned before, the Lightning Network grows at a very high rate. These are some of the current network statistics: the number of nodes is almost 8,000, the number of channels is approaching 40,000, and the network capacity is over 1,000 Bitcoin. If you are curious about more Lightning Network stats, check the link to a website that tracks them in the description box below.
The Lightning Network is currently one of the most exciting projects in the crypto industry, and it has a big chance of bringing a scalable second-layer solution to Bitcoin, which will enable micro payments and create a new way of building financial applications. We need to remember that the Lightning Network is still a very new technology, and despite its potential, it is also facing a lot of challenges. Some of them are a lack of incentives to open a new channel with a new user, capped channel capacity, or storing a lot of intermediate state. Fortunately, there are also many improvements currently being developed to deal with some of these challenges, for example dual-funded channels, splicing, or L2s. The Lightning Network has recently started attracting more and more attention from the broader community, with people like Jack Dorsey endorsing the technology. If you want to learn more about the Lightning Network, please check some of the links in the description box below and also visit the website Finematics.com. If you liked the video, please hit the like button and subscribe to the channel. Thanks for watching.
