Tag Archives: Lightning network

Lightning Network, Second Layer Scaling Solutions/Concerns and Neutrino Protocol

In this post, I plan to cover Lightning network (what it is, how it works and why is it important?), second layer scaling in general and its potential to reach mass scalability and Neutrino nodes (a newly introduced protocol that transfers data in a much more compressed manner as compared to full nodes, while preserving privacy, security and censorship resistance).

Lightning Network

Lightning is a second layer solution for blockchains such as Bitcoin, Litecoin and others that have scaling issues with their base layer infrastructure (limited block size, transaction time etc.)

2018 has been a great year for lightning development. First of all, it’s important to note that the idea of lightning network (off chain transactions) is not new. Satoshi himself talked about off chain transactions taking place in batches instantly before getting settled on the main chain. In simpler terms, what lightning does is, it allows users to keep record of transactions locally in channels, rather than instantly updating each transaction on the main chain. Lightning network (a second layer protocol) on top of Bitcoin’s blockchain only uses bitcoin for native denomination. In technical terms, lightning network is a web of bidirectional payment channels, which have transactions between different parties, transactions that do not get settled immediately on the main chain. Lightning is an open source protocol, just like other public blockchain protocols, that anyone can contribute to. When I see a new protocol, which is open source and has the characteristics to transfer data, I like to draw parallels and analogies to the internet (TCP/IP) protocol. While I see bitcoin’s base layer as Ethernet and LAN connections that handled data transfers, I see Lightning as the IP (Internet Protocol) that sits on top of Bitcoin’s base layer.

How does Lightning Network work ?

Lightning transactions appear more or less very similar to normal bitcoin transactions. We know that bitcoin’s transactions are based on UTXO (unspent transaction output) model. A transfer/ transaction on bitcoin’s blockchain (using a private key) results in movement of bitcoin from one or more input UTXO’s to new output UTXO’s. Lightning transactions, while use the same model to transfer bitcoins from one address to another, involve the use of multisig’s as well – multi signature transactions that require more than one private key and involve multiple parties to carry out a transaction. Lightning network uses payment channels. One directional or bidirectional payment channels can be setup between parties, that lets users transfer bitcoins to one another in those channels more than once and once the transactions are complete, the party that’s authorized to close the channel can do so by signing with their set of keys.

Importance of Lightning Network

The primary feature of lightning network is that it allows users/parties to transact infinitely by opening payment channels between them and settle on the main chain (broadcasting the channel state once it is closed or mid-way should a dispute arise) once they are done. The network allows bitcoins to travel all over instantly, without the downside of waiting for every  transaction to be confirmed on the main chain. Thus, what lightning network does is it makes bitcoin to be used more like a currency, through instant transfers, without the constraints of a slow confirmation process on the main chain.

Second Layer Scaling

Although second layer scaling solutions such as the lightning network are extremely promising and are being developed by credible companies such as the lightning labs and Blockstream (L-btc sidechain, I intend to cover this in a future post) there are several drawbacks that need to be considered at this point.

Firstly, although the lightning network allows more transactions for users within the lightning network, it is difficult to enter the network as a new user needs to open a channel with another existing user to use the network and it is advised that users use multiple channels. Secondly, Routing is another concern which needs to be addressed. In order for a transaction to go through, an established route between the sender and receiver must be found. It could be likely that such a route exists. Some people in the community have proposed the “hub and spoke” model as a potential solution for this but have received heavy criticism as the model (which has a few power users that everyone can connect to) creates intermediaries and risk of centralization and could led to censorship. Coming up with a viable solution to the routing issue remains an open concern. Lightning network and other second layer scaling solutions have immense potential to achieve mass scalability. However, coming up with viable solutions to the concerns we just discussed is necessary.

Neutrino Protocol

Satoshi Nakamoto, in his 2008 whitepaper (Bitcoin’s whitepaper), described something called “Simplified Payment Verification” – SPV, which is the process by which lightweight nodes could verify payments / transactions without downloading and storing the entire blockchain (Bitcoin’s blockchain takes up about 200 GB space presently). In this process light nodes only need to sync block headers and not the entire stack of transactions in the blocks. Unfortunately, until 2013, SPV’s were not implemented and no proposal was introduced to implement them. In 2013, a BIP (bitcoin improvement proposal) was created to implement SPVs. Although implemented, light nodes using SPVs face a few challenges – slow speeds due to slow adoption, risk of privacy loss as a listening node could easily detect wallet addresses (and figure out/track other transactions) and the risk of a malicious node omitting relevant transactions.

To overcome the above mentioned issues, Lightning Lab’s Olaoluwa Osuntokun and Alex Akselrod, along with Jim Posen introduced/proposed Neutrino protocol (BIP 157 and BIP 158). Neutrino protocol is designed to run nodes on lightweight nodes on devices (such as mobile phones), while not taking up significant power, storage, bandwidth and securing privacy.

How Neutrino works ?

Neutrino uses GCS filters (Golomb Coded Sets) to represent addresses contained in a block and these filters offer a much higher degree of compression (15 kb per block as compared to approx. 1.4 Mb for the source block/normal block). Thus, devices with low bandwidth and storage capacity such as mobile phones can observe the blockchain and determine if new blocks are relevant to the user’s wallet. Have a look at the steps involved in this filtering :

Source : Lightning Labs Blog

Using filters and the above shown approach, a user’s information (related to address – public keys) is never sent to the network. Rather, it stays with the user end of the software.

Although Neutrino protocol offers increased privacy and impressive reduction in bandwidth and storage requirements, there are concerns as much of the validation process is done on client side hence the client needs to provide additional verification in order to prove that the data being sent to server is true.

Despite the above mentioned concern, overall enthusiasm about neutrino implementation is quite high. Once it is deployed on the main net, lightweight wallets (using Lightning network) will be able to offer a high quality user experience, while preserving privacy and security.