Casper, lightning and open-heart surgery — the race for scalability

TTM Agency
TTM Agency
Published in
9 min readSep 24, 2018

If blockchain is to meet all the hype about how it will disrupt the world, it will have to address its basic weakness: poor scalability. We look at some solutions for Bitcoin and Ethereum.

Scalability could probably be regarded as the Achilles heel of the blockchain. It is the weakness in this technology that otherwise offers so much and for so many purposes. The existing blockchain public chain cannot support large-scale commercial applications.

Scalability could probably also be regarded as the spur to the growth of blockchain as smart minds around the world try to tackle and solve the problem.

So, we’ll start by giving some description of what scalability is, and then talk about some of the possible solutions that have been presented, specifically for Bitcoin and Ethereum. We will talk about some other newer blockchains in a later post.

The scalability problem

Wikipedia defines scalability like this:

“Scalability is the capability of a system, network, or process to handle a growing amount of work, or its potential to be enlarged to accommodate that growth.”

In the blockchain environment, it is about the number of transactions that a blockchain can handle in a period of time. Current transaction capacity of the major blockchains can be compared to other financial systems to highlight the problem:

Visa: 1667 transactions per second

PayPal: 193

Ethereum: 15–20

Bitcoin: 7

There are two parts to this slow speed: the time taken to put a transaction into a block and the time taken to reach consensus.

The peer-to-peer network of cryptocurrencies is part of their philosophy of having a trustless system with no central authority and everybody (or every node) being equal. One of the consequences of this is that each node must confirm the correctness of a transaction, and each must have a full copy of the blockchain to do so. This is based on a “gossip” protocol — one node gets the news from another and passes it on to a third, and so on until every node has a full record and can reach consensus. This means that the more popular a blockchain becomes, the more nodes are added, and the slower it will become. Ethereum has suffered most from this, thanks to the ICO craze and the number of people wanting to have a share in this blockchain.

For bitcoin, a new block is mined (and is filled with transaction records) every 10 minutes. However, the number of transactions is limited by a block size of 1 MB. So this is an issue of both size and frequency creating a bottleneck.

Transaction fees add to the problem. The miner charges a “toll” to add your transaction to the block, and the higher the toll you are prepared to pay, the faster your transaction will be processed. In fact, a study undertaken by blockchain.com showed that if you paid only the minimum transaction fee, you would wait a median time of 13 minutes for your transaction to go through.

Ethereum should theoretically be able to deal with 1,000 transactions per second, but each block is constrained by a 6,7 million gas limit. The “toll” on Ethereum is paid in “gas” and once that limit is reached, further transactions will have to wait for a subsequent block.

While this is not a technical scalability issue, the very high electricity cost involved with mining should also be considered, as it certainly makes mass adoption less likely.

This is a somewhat simplistic description of a very complicated problem. The difficulty is perhaps more clearly shown by the complications of the proposed solutions. Disruptions have been caused by trying to change the size of the Bitcoin block. There have been debates for years with highly qualified Ethereum developers. We have a constant rash of “just like Bitcoin/Ethereum, only better” new solutions, many of which are largely unproven and in some cases are still at the Whitepaper stage.

So, what is the current status?

A bit of history: Blockchain 1.0 to 3.0

Blockchain 1.0, as introduced by Satoshi Nakamoto, introduced the public ledger and used the “proof-of-work” consensus to solve the problem of double-spending, without the need for a middleman.

Blockchain 2.0 came with the development of the Ethereum platform and smart contracts, together with the notion that blockchain could be used for more than just currencies. However, this opening of the potential for use also exposed the scalability weakness.

Blockchain 3.0 is really about solving the scalability problem and establishing a decentralized internet. This is still largely uncharted territory.

Some solutions for Bitcoin

SegWit

The number of bitcoin transactions was increased somewhat with the introduction of the SegWit protocol upgrade in August 2017. This was a soft fork that altered the way that data is stored on the blockchain, separating the “witness” or signature data from the transaction data. In effect, it allowed more space within the 1MB block. It also reduced the fees structure. Because it was a soft fork, it was backward-compatible, and those with old software can recognize new blocks as valid. To note, it’s not clear why miners would want to maintain the signature sidechain, as there will be no incentive for doing this.

Lightning network

SegWit also fixed a bug in the bitcoin blockchain and opened the opportunity for more complex usage, including the lightning network. This is a second layer protocol on top of the blockchain — also sometimes referred to as “state channels”. State channels involve a mechanism where certain transactions are completed and agreed off-chain. Usually, this would involve small and frequent transactions. This off-chain agreement would be governed by some form of smart contract and conditions would be set as to when a whole transaction set is committed to the blockchain. This significantly increases the speed and capacity of the blockchain. In fact, the promise is that millions and even billions of transactions per second will be possible.

Other BIPs (Bitcoin Improvement Proposals)

Other Bitcoin Improvement Proposals (BIPs) being considered as a result of SegWit are MAST (to further reduce the size of the data within a block, increase speed and add smart contract functionality), and Schnorr signatures (to increase transaction speed and clear backlogs). Neither is likely to be incorporated any time soon, as there is nervousness about anything that might mess up the way bitcoin works.

Hard forks

SegWit was meant to go on to SegWit2x which would have involved a hard fork and increased the block size to 2MB — but that was put on hold towards the end of 2017, amid much disagreement within the bitcoin community. A hard fork involves a complete change in some of the rules of the blockchain, and new blocks will not be recognized as valid by old network software.

The same disagreement led to the “breakaway” hard fork for Bitcoin Cash in August of 2017. The main change was an increase of block size to 8MB. Miners can, therefore, process more payments per second, provide faster service and can afford to drop fees. Supporters of the opposing coins — Bitcoin Core and the new Bitcoin Cash — are vocal about the superiority of their choice. It remains to be seen which one will eventually dominate the market.

Some solutions for Ethereum

Casper

Casper is a fascinating story of the thinking processes and caution required to make a significant change to the Ethereum blockchain.

In essence, Casper is the protocol that will allow a change in the consensus mechanism for Ethereum from proof-of-work to proof-of-stake (PoW to PoS). At a very simple level, proof-of-work requires miners to commit large amounts of electric energy and hardware to win the right to a new block, together with the reward of a new coin and the transaction fees that are linked to it. In proof-of-stake, validators confirm the correctness of the transactions in the block and are paid the transaction fees associated with it. They commit or “stake” coins in order to participate.

Vitalik Buterin, the inventor of Ethereum, and Vlad Zamfir, a developer who joined him in 2014, have taken different routes in their attempts to develop the Casper protocol. Buterin has supported what has become known as the FFG version of Casper, while Zamfir has supported the CBC version. There has been the debate about whether there should be a hybrid version, with initial validations being done by PoW miners and then with PoS validators finalizing the blocks. The latest thinking from Buterin seems to be moving towards Zamfir’s proposal of a complete move to PoS.

Even if you are not a developer, and much of the technical side might be lost on you, I would highly recommend that you read Buterin’s story of the race between himself and Vlad Zamfir. An equally entertaining and illuminating read is all the chapters of Vlad Zamfir’s “History of Casper”.

Some of the key decisions have revolved around preventing malicious nodes from contaminating the truth of the blockchain. Slasher was one way, where validators who tried to support more than one version of the truth — ie placing stakes on two different chains simultaneously — could be identified by other validators and have all of their stakes confiscated.

Vlad Zamfir suggests that it is naïve to assume that most validators or miners are honest and that there is likely to be only a small number of malicious nodes. The “51% threat” is a real one in any blockchain — PoW or PoS — where if a cartel of malicious players gets together they can disrupt the entire system. He believes that we ought to assume an “oligopoly” –

“An oligopoly is (where) a market or industry is dominated by a small number of large sellers. Oligopolies can result from various forms of collusion which reduce competition and lead to higher prices for consumers.” Wikipedia

He adds that we ought also to factor in “coordinated-choice game theory”. Coordination games are where players choose the same or corresponding strategies.

He warns that those who are trying so hard to solve problems inherent in blockchain (and he includes Ethereum in this) should be cautious of ignoring this threat of cartels. Just because it is difficult to find a solution is not an excuse for placing potential clients at risk:

“I know it sounds hard to provide protocol guarantees in the context of these models, but this is our context. Difficulty of getting your software from where it is now to a place where cartels do not stand to benefit from screwing your clients is not an excuse for being negligent of your clients interests.”[1]

He specifically points to some projects, including the newer, supposedly Blockchain 3.0, projects, as examples of where more thought is required. He refers to all PoW-based blockchains (and mentions Bitcoin, Ethereum, Dogecoin and ZCash as examples). Proof-of-stake examples include Nxt, Peercoin, NEM, Cosmos (Tendermint) and Polkadot.

Sharding

An important part of the Ethereum debate has been around sharding. This involves breaking up transactions into smaller pieces that are spread out to the network of nodes, allowing for many parallel transactions at the same time to increase performance.

Proof-of-stake makes the blockchain faster as it is easier to check on who has more stake than it is to check on who has the greatest hashing power. More importantly, it will make the integration of sharding much easier. In fact, sometimes the two projects are jointly referred to as the “Shasper” upgrade.

eWASM

Possibly the most difficult change currently being contemplated for Ethereum is the replacement of the EVM (the Ethereum Virtual Machine), or central computer, with a new virtual machine called eWASM. This has been likened to performing open-heart surgery on Ethereum!

WASM — WebAssembly code — has been developed by the World Wide Web Consortium (W3C), a group of developers who maintain and standardize the web itself. eWASM is the Ethereum version — and it promises to be a much more streamlined and broadly usable engine for the Ethereum blockchain than the previous one. Among other things, developers building DApps on the platform will not be limited to the Solidity language. Certain computations, that would otherwise require hard forks, will be possible via smart contracts.

A testnet version of the eWASM code will be launched at Devcon 4 — a major conference for Ethereum developers to be held in Prague in October 2018.

Current status of the scalability race

Despite all of the debates and development, final changes to Ethereum are still some way away. Changing fundamental elements of the original design is very risky, and clearly, neither Vitalik nor the broader Ethereum community will move too fast. They might, however, run the risk of being left behind.

A number of competing platforms are emerging — these include EOS, Cardano, IOTA, NEO and others. They propose different codes, algorithms, consensus and security mechanisms — and all of them promise better transaction times and the potential for wide-scale application.

They are all still in the development stage — only time will tell whether they will indeed be better than Bitcoin and Ethereum.

--

--

TTM Agency
TTM Agency

We offer full-stack services for implementation and promotion of the next big idea inspired by the advent of the blockchain technology.