What are State Channels?

Feature - What are State Channels?

As we have previously discussed (https://magnetcapital.com.au/blog/), blockchain technology is currently battling many scaling issues with numerous solutions being proposed: Off-chain channels, Sharding, Efficient consensus algorithms, Acyclic graphs, Distributed meshes and so on. Currently, each of these proposed solutions is being developed, iterated and tested across numerous projects to determine the best scaling mechanism for blockchains. Broken down however, each of these fall into two broader categories:

  1. Layer one solutions: These scaling solutions are embedded within the protocol layer and work to improve the speed and efficiency of on chain transactions (E.g. similar to improving the efficiency of a boat's 150 horse power engine so that is produces 300 horse power)
  2. Layer two solutions: These scaling solutions are built on top of the protocol layer and process transactions off chain to improve speed and efficiency  (E.g. similar to adding a second 150 horse power engine to your boat)

State Channels
State channels allow for work that may have once previously been conducted on a blockchain to be completed elsewhere (e.g. transactions). Every transaction conducted on the blockchain requires it to be digitally signed, validated and written into the blockchain's ledger. However, by creating state channels, work is moved off the blockchain which frees up capacity and improves the total throughput of the ecosystem. In state channels the aforementioned process is still required, however, it is validated by a third party, bundled together with numerous other transactions and then written to the blockchain's ledger as the sum of transactions.

E.g. If Ben transfers Egor $10 for breakfast and later in the day Egor transfers Ben $4 for coffee before dinner where Egor transfers Ben another $20:

  • If the blockchain only has Layer one solutions each transaction is individually written to the blockchain - I.e. Three separate transactions. 
  • If Ben and Egor have set up a state channel at the end of the day the state channel can post a transaction of Egor transfers Ben $14 - I.e. Only one transaction. 

Benefits of state channels
To date layer one scaling solutions have not been overly successful. Bitcoin can only process 7 transactions per second and Ethereum only 15. This has hindered many to consider Bitcoin a global currency alternative or Ethereum a viable distributed application platform. State Channels allow blockchains to:

  • Provide privacy of transactions - Only Egor and Ben know what the individual transactions were - the blockchain ledger knows the final balances.
  • Improve user experience - Provide 'Instant finality'  to transactions rather than requiring users to wait for hours for transactions to be processed.
  • Lower the cost for users to transact on blockchain technology - some fees when processed on blockchains can be quite significant, however moving them into cheaper state channels the fee is lowered. 

These solutions are currently being worked on with developers currently implementing the 'Lightning Network' on Bitcoin and still working on 'Raiden' on Ethereum. Both solutions look to utilise state channels to process transactions off chain and improve the overall user experience and efficiency of the two most well known blockchains. 

Egor Sidelska