Lightning, Plasma, Raiden, and State Channels

BlogPost Title Graphic

Introduction

Blockchains suffer from scaling issues.  This is due to the fact that every transaction has to be propagated to all the nodes in the network and after propagation is complete the mining activity to create a block and provide a confirmation.    In bitcoin blockchain a confirmation can take about ten minutes.  When it comes to the security of a blockchain the number of nodes is directly related to the security of the blockchain, more nodes mean better security.  Whereas the performance is indirectly proportional whereby as the number of nodes increases the blockchain starts to slow down as the transactions need to be propagated to more nodes.

Transactions Per Second (TPS) for some blockchains are:

  • Bitcoin Blockchain processes 7 TPS
  • Ethereum processes 13TPS
  • Ripple processes 1500 TPS
  • Visa processes 1700 TPS,  if required the system can process up to 56000 TPS

Scaling Solutions

Besides sharding, some of the scaling solutions,  called layer two solutions that I will be discussing are:

  • Plasma for Ethereum
  • Raiden for Ethereum
  • Lightning for Bitcoin and Litecoin

Plasma

Plasma addresses the scaling problem by providing a framework that allows implementation of nested chains.

As per the Plasma whitepaper:

“Plasma is a proposed framework for incentivized and enforced execution of smart contracts which is scalable to a significant amount of state updates per second (potentially billions) enabling the blockchain to be able to represent a significant amount of decentralized financial applications worldwide.

These smart contracts are incentivized to continue operation autonomously via network transaction fees, which is ultimately reliant upon the underlying blockchain (e.g. Ethereum) to enforce transactional state transitions.”

This is how you would deploy a Plasma chain:

  • A smart contract is deployed on Ethereum main net that serves as the “root” of the child chain. It contains the basic “state-transition rules” of the child chain, records hashes, and serves as bridge that lets users move assets between the child chain and Ethereum main net.
  • A child chain is created that has its own consensus algorithm such as PoA, PoS, or other.
  • Deploy Child chain related contracts to the child chain
  • As the child chain produces blocks, they are committed to the root contract created in #1 above.
  • The root contract commits the updates to mainnet.

Raiden

Raiden is a lightning implementation for Ethereum, and next I will talk about Lightning.

“The Raiden Network is an off-chain scaling solution for performing ERC20-compliant token transfers on the Ethereum blockchain. It is Ethereum’s version of Bitcoin’s Lightning Network, enabling near-instant, low-fee, scalable, and privacy-preserving payments.”

Lightning

Implements Smart contracts, using three technologies:

  • Multi Signatures.
  • Check Lock time and Check sequence verify, relative time from previous transaction.
  • Hash lock time contracts, forward a promise that can be unlocked by a secret.

State channels are setup between parties.  The party initiating the channel has to deposit bitcoin in escrow, this ensures that the other party will receive the funds once the channel is closed.  The amount deposited establishes the maximum value that can be transacted within the channel.

  • Final transaction is written to the bitcoin blockchain after the state channel has been closed.
  • You have to stay online all time to ensure other party does not close the channel on you
  • In case you get cheated, you have 8 hours to send a competing transaction
  • Scaling at every layer
  • Lightning applications (lApps)  vs dApps

You can deploy a lightning node.  BOLT(Basis of Lightning Technology) is an interoperability standard. Currently there are three BOLT compliant technologies to implement lightning.

  • LND from Lightning Labs
  • C-Lightning from Blockstream
  • Éclair from ACINQ

 

Conclusion

All blockchains throughput was tested in Q4 2017 when they got bogged down by the number of transactions and the transaction fees soared.  Lightning went live Q1 2018 while the other two are still in development.

 

References