Blockchain offers an innovative solution for introducing trust in a trustless environment. Blockchains and the features they bring have innumerable applications, but most of them cannot be implemented in the current generation of blockchains due to the scalability issues. To compare with real numbers, VISA processes about 2000 transactions per second while ethereum can only manage 1% of that. Don’t forget that ethereum is supposed to do a lot more than only basic transactions, but It can’t even handle basic transactions right now. I will try to explain the underlying issues and proposed solutions in brief. I will not be going into in-depth technical details, but I will describe what the various solutions are offering. This article is aimed at making the readers aware of the possible solutions and give an outline of their working. I will mainly be talking about ethereum in this article, but the same technologies can be or are already being applied to different blockchains.
What’s limiting the TPS?
Bitcoin can manage about 7 transactions per second (TPS) while ethereum can do 20. What’s stopping them from doing more? There are 2 significant blockades:
In its current state, every full ethereum node has to fetch every single transaction, validate it and share it further. As new transactions are being added every second and the nodes may be situated far away, They face the problem of limited bandwidth. Not much processing power is required to process 20 transactions/second but If every node has to verify thousands of transaction every second, then it will need to be a supercomputer. Storage space is also is a problem but storage prices have been decreasing consistently, and it is much easier to just add another disk. Adding more bandwidth, however, is very difficult. This tweet may help you understand the bandwidth problem better
Need further clarification?
Let’s say the volume of data your geth node needs to process to stay synced is currently ~100 “units”.
Your rig can process 150 units. Tomorrow the network demands 101 units. Next month: 125 units.
A backlog will eventually occur. pic.twitter.com/kzwedihiQj
— StopAndDecrypt (@StopAndDecrypt) May 2, 2018
2) Consensus Algorithm
Ethereum, as well as Bitcoin, currently use Proof-of-Work as their distributed consensus algorithm. Proof-of-Work works by adding artificial difficulty to the calculation of acceptable block hash. Not only is it not scalable (without compromising security), It is also incredibly inefficient. Right now, bitcoin network consumes approximately $3 billion worth of electricity every year! Creating a new consensus algorithm that is secure and efficient is perhaps one of the most significant challenges.
Solutions for scaling
There are two basic types of scaling solutions. The first set of solutions is Layer 1 solutions which are changes in the ethereum protocol itself and require a hardfork. Examples of such solution are Sharding and Casper. The second set of solutions, Layer 2 solutions are those that work on top of the existing protocol and don’t require a hardfork. Plasma and sidechains are the top examples of layer 2 solutions. Both of these types of solutions can be used in conjunction, and their effects will theoretically be multiplied. Let’s discuss a few of these solutions in a bit more detail.
In its current setup, all the ethereum full nodes have to verify each and every transaction. This severely limits the scalability as the blockchain becomes only as scalable as a single node can be. Sharding proposes to divide the network into shards such that every shard node will have to verify just the transactions in its own shard. This will mean that the blockchain will theoretically become up to N times more scalable where N is the number of shards in the network. Every node in a shard will only have to worry about the transactions in its own shard which means that it will just have to process a tiny fraction of the transactions being done on the ethereum network. There are some blockchains like Zilliqa which already have implemented sharding (although, half-cooked) and ethereum is planning to introduce sharding in a couple of years. There are challenges like Cross-Shard communication and Shart takeover attacks which need addressing.
Ethereum developers are actively developing a sharding protocol, and you can read about Sharding in detail on https://github.com/ethereum/wiki/wiki/Sharding-FAQs
Ethereum uses a Proof-of-Work algorithm right now as its distributed consensus algorithm. Proof-of-Work is a consensus protocol in which miners compete with each other to generate a hash which complies with the set restriction. The set restriction adds artificial difficulty to the calculations which require additional computation power and energy. The artificial difficulty required makes Proof-of-Work detrimental to the environment. Although the exact number is not known, Proof-of-Work blockchains are assumed to be already consuming power equivalent to about 40 Denmarks!
Proof-of-Stake is another protocol for verification and validation of transactions and procurement of a distributed consensus. As opposed to Proof-of-Work, in which mathematical complexity is used to create new blocks, in Proof-of-Stake, the creator is chosen per its stake in the currency. Users can join to become a stakeholder and join the validator pool by locking some of their wealth by sending a particular transaction. Creator of the new block is chosen from the validator pool, and the validators are awarded some percentage of the transaction fee. The exact implementation can vary, but this should help you understand the zest of it.
The ethereum team is working on a Proof-of-Stake algorithm named Casper. You can read more about Proof-of-Stake on https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQs
Casper’s specifications are still not final but it is going to be a Proof-of-Stake based distributed consensus algorithm that will punish malicious users. Just a few months back, an EIP describing specifications of Hybrid Casper FFG was submitted. The EIP specified a hybrid PoW/PoS consensus model where existing PoW mechanics are used for new block creation, and a novel PoS mechanism called Casper the Friendly Finality Gadget (FFG) is layered on top using a smart contract. However, The EIP has since been deprecated as the team decided to merge the efforts being put into the development of sharding and Casper. Now, the developers are working on a single Casper + Sharding chain.
A sidechain is a different blockchain than the main chain that runs in parallel to the main chain. Sidechains can communicate with the main chain to exchange assets and information. Sidechains are a practical solution to scalability as they offer much cheaper transactions. Whenever sidechains are discussed, one of the first questions that pop up is, “Are sidechains secure?”. Well, not all sidechains are secure, but there are technologies like plasma which are not just a sidechain.
Plasma is a layer 2 scaling solution for ethereum that makes use of off-chain calculations. In over-simplified terms, Plasma works by doing all the computation off-chain and storing the final result on the main chain. Consider a tree of blockchains in which the parent node/chain can enforce the ledger entries in the child node/chain. The root chain will be the main ethereum chain, and it will have many child/sidechains branching from it. The main chain will act as a supreme court and will be able to enforce the entries on the child chains. These child chains will further have child chains of their own in which they will be able to enforce the ledger entries. The computations will be done on the child chains, and the final state change will be updated as and when needed on the parent chain. Doing the calculations away from the main chain will make smart contract transactions considerably cheaper and allow for extremely high throughput. Plasma will be implemented using smart contracts on the main chain that will be able to communicate with the child chains. Plasma is very similar to the lightning network for bitcoin, but it’s much more complex due to the smart contracts.
One of the main selling points and security feature of plasma is “Plasma exit”. Using the plasma exit, any user can transfer all their assets back to the main chain and stop using the plasma chain whenever they want. For plasma exit to work, the user needs to submit an exit transaction along with proof of their current standing. There is a challenge period after the exit transaction has been submitted during which, anyone can challenge the proofs. Plasma exit can come in real handy if the sidechain gets taken over by a malicious entity. It’s still not a perfect solution though, and plasma needs a lot more work in general before it can become a standard part of ethereum. Imagine a situation when a sidechain gets attacked, all the users will want to transfer back their assets to the main chain but they can’t do that as the main chain cannot handle those many transactions (not yet, at least). Although, they will be eventually able to get their assets back, but it is a bottleneck that needs addressing.
You may check out https://plasma.io/ for more technical details about the Plasma framework.
I hope that this article was able to make you aware of the problems and proposed solutions for scalability on blockchains. I tried to keep things brief and simple rather than focusing on technical accuracy. There probably will be separate technical articles for each of the mentioned solutions in the future but in the meanwhile, this article along with the resources mentioned should help you get started. If you want to know more scaling solutions, you should consider checking out state channels. truebit and PoA. Let me know your thoughts, suggestions, and requests for future articles in the comments section. Cheers!