What is the Lightning Network? (beginner's guide)

1. What is the Lightning Network?

The Lightning Network is a technical solution being developed as a second layer protocol for blockchain networks. Deployed on top of bitcoin, LN uses advanced smart contracts to achieve higher transaction throughput while maintaining the peer-to-peer nature of the bitcoin protocol.

The solution was first presented at the Scaling Bitcoin conference in Montreal in September 2015.

2. What is the purpose of Lightning Network technology?

The main purpose of the Lightning Network is to scale and make blockchain networks work faster, in particular to make instant micropayments with lower fees than regular transactions.

Simply put, the Lightning Network allows users to conduct transactions directly with each other without writing information to the public blockchain. This accomplishes two things at once: faster and cheaper transactions, as well as a reduction in the amount of blockchain data. In addition, this technology contributes to greater anonymity of users.

3. How does the Lightning Network work from a technical point of view?

The key principle behind Lightning Network is the use of payment channels into which funds are placed that are transferred between participants. A payment channel is a multisignature (multisig) wallet that holds a certain amount of bitcoins. Coins can be provided by both parties or only one of them.

The channel is opened through a normal bitcoin transaction, which means that in this case the data of this transaction is written to the blockchain (the data is also written to the blockchain when the channel is closed). However, thereafter, all transactions performed within the channel take place directly between the participants without writing data to the blockchain.

A payment channel is essentially analogous to a safe in which money is deposited and then available to a certain circle of people. But, if to open the safe you need to know the combination of digits, in our case private keys are used.

4. This is all a bit complicated. Can I give you an example?

The simplest example of using LN technology: Anatoly’s favorite coffee shop announced that it had started accepting bitcoins as payment. But paying each time for a cup of coffee, creating a separate transaction for that, can be too costly because of the fees involved, plus it takes a certain amount of time to confirm the transaction.

This is where the LN comes to the rescue. Anatoly opens a payment channel between himself and the coffee shop and deposits 0.01 BTC, let’s suppose, that he is going to spend later on ordering coffee. When the channel is created, the balance of Anatoly shows 0.01 BTC, while the balance of the coffee house shows 0 BTC.

Also you may like >  What is blockchain?

Let’s say that a cup of coffee costs 0.0005 BTC. After the first order, the balance of Anatoly will show 0.0095 BTC, the balance of the coffee house will show 0.0005 BTC. Thus, Anatoly can order coffee until his balance is zeroed out or he decides to close the channel. With each transaction, Anatoly and the coffee shop sign an updated smart contract showing how many coins in the channel belong to each party. As mentioned, this data is not written to the blockchain – instead, each party keeps its own copy of the smart contract.

5. Is it necessary to open a new payment channel for each new side of the transaction?

No, the Lightning Network, as the name says, is network-based. This means that Alice may not have an open payment channel with Dave, but may be connected to him through Dave or Bob, or even through several participants. That is, users can exchange transactions with any other users who are connected to their network of payment channels through nodes (nodes).

The financial incentive in opening such linking nodes is to receive small commissions each time a transaction occurs through one of the channels connected to it.

Through the use of smart contracts, the Lightning Network architecture does not require the trust of the parties. Thus, funds always reach their recipients through intermediaries, or are returned to the sender if an indirect route to the recipient is not possible for some reason.

In the graphic below, Bob and Carol act as nodes. Nodes on the Lightning Network can be compared to miners on the main bitcoin network – like miners, they process transactions and are just as out of control of the funds they help move. Bob cannot steal Alice’s coins because he will only receive an incoming payment if he sends a similar amount to the recipient.

6. What other possibilities do payment channels offer?

The situation mentioned above, when Anatoly opens a payment channel with a coffee shop, means the opening of the so-called unidirectional channel, that is, the funds are spent only one participant. Additionally, it is possible to open bidirectional payment channels, when both parties pay each other, as well as situations where smart contracts set certain conditions for the transaction.

Also you may like >  What are Proof-of-Work and Proof-of-Stake?

For example, Alexander and Nikita bet whether the bitcoin price will rise above $8000 by the end of 2019. Alexander is optimistic and says it will happen, while Nikita is convinced it won’t (at least this year). They both bet 0.1 BTC on their outcome, sending coins to their multisig wallets. The funds will remain locked in this wallet until:

  • Alexander and Nikita sign off on the final transaction using their private keys – depending on the outcome of the dispute, the locked funds will be sent to Alexander or Nikita;
  • one of the parties does not decide to withdraw from the dispute and completes the transaction in his/her own hand;
  • a certain time limit is reached (e.g., January 2, 2020), after which the funds are returned to the respective wallets of Alexander and Nikita.

7. Who is responsible for the development of Lightning Network?

As in the case of bitcoin and a number of other cryptocurrencies, the development of Lightning Network is decentralized, and the code of the protocol itself is publicly available. Consequently, there is no one “official” version of the LN. At the same time, there are a number of well-known companies and projects that offer their own implementation of the technology, and in this case, the decision of which of them to use, is up to the end user.

Among them are Lightning Labs, Blockstream, ACINQ, Bitfury and some other projects.

8. Sounds nice. What are the downsides?

First of all, Lightning Network is still in the experimental stage. Large and meaningful transactions at this point are better entrusted to the main bitcoin network.

It is important to remember that at this point, the p2p nature of the protocol means that both parties need to be online to open a channel and make payments. That is, offline payments, where you can just send some coins to a known address and the recipient will see them when they come online, are not possible in this case.

In addition, there is no clear answer yet regarding the security of payments. Everything happens on top of bitcoin and therefore the security model of bitcoin, which is provided by miners, Lightning Network does not use

Also you may like >  How to choose a cryptocurrency exchange?

There are also frequent concerns about the possible centralization of the network. For example, in mid-January 2019, over 64% of the network’s capacity was controlled by just one player.

9. What is the state of the Lightning Network today?

The development of the Lightning Network microtransaction protocol has been underway for the past few years, but only March 2018, when Lightning Labs presented the first beta version of the lnd client, can be considered the date of its official launch. In addition, last year saw the release of the Eclair wallet from French startup ACINQ, as well as the beta release of c-lightning, an implementation of the Lightning Network by Blockstream.

Another important event was the release of Casa Node – a physical Lightning-node from the American startup Casa, which significantly reduces the threshold of access to the technology, making the use of Lightning Network extremely easy for users who do not have extensive technical skills.

Also Lightning Network is increasingly used to pay for real goods and services. A true pioneer in this regard was the Swedish startup Bitrefill, which announced back in March 2018 that it could use the protocol to top up phone bills and buy gift vouchers and certificates.

In January 2019, Bitrefill also introduced Thor, a service to open a blank channel on the Lightning Network from the startup’s own node.

10. What can we expect in the future?

Lightning Network is still a very young technology, but it does have a great future. The capacity on the network is growing steadily, recently surpassing the 700 BTC mark, the number of nodes is approaching 6,500, and the number of open channels has already surpassed 28,000.

In addition, the technology opens the way to fundamentally new solutions like cross-platform atomic swaps, i.e. instant direct exchange of coins of one network for coins of another without intermediaries represented by exchanges and other exchange platforms. Thus, back in 2017, the first atomic transaction between bitcoin and Litecoin took place in the Lightning Network.

We can also expect soon support for the technology in a number of payment applications. A pioneer in this direction could be Cash App, being developed by Square. Additionally, the developers of Beam, a cryptocurrency focused on user privacy, announced plans to implement Lightning Network.

You may also like