Blockchain Scaling Solutions Explained with Examples of Roads & Coffee Shops (Kopitiams)

By Pizzadren | Cryptaysia | 22 Mar 2023


This, is a traffic jam during peak hours of travelling to and from work. I think all of us, not just in Malaysia but also in other countries especially in densely, populated cities, will definitely experience the pain of having to stare at the same car for at least an hour during the whole journey, while entertaining yourselves for some twitter scrolling or car karaoke.

The reason we drive cars or take any type of public transportation is to go from A to B. Just like in blockchains, we all want to have our transactions be added on the blockchain, but sometimes due to network congestion similar to the traffic congestion as shown on the photo, we resorted to wait minutes, hours or even days before our transactions are fully confirmed. That’s why scaling solutions are needed to handle more transactional load as user adoption keeps growing.

But first, let’s talk about the similarities between a road and a typical blockchain.

 

Say you’re going from your home to a kopitiam (coffee shop), and without any traffic on the road, let’s say it takes you 10 minutes to reach the destination. If there’s minor traffic on the road, you’re still able to reach there at the same time. However, if more & more cars are driving at the same road and to the same kopitiam (coffee shop), the road will start to get congested and your time to reach your destination will be increasing, maybe it’ll reach an hour to arrive! Similarly, if a blockchain is only able to handle like say, 10 transactions per second, but there are 200 transactions happened every second, there’s bound to be transaction delays.

So how do we solve congestion our usual way? Well, let’s make the roads bigger!

 

1) Increase block space!

   

Sure, it does improve the traffic flow, until the point where the traffic keeps increasing and you’re back to square one. More cars on the road? Make the road bigger! Still got more cars on the road? Make them even bigger, and no matter how big is your road, you’ll still have traffic congestion if the cars on the road keep increasing. Similarly with blockchain, one way to handle more transactions per block is to increase the block size, but if number of users & transactions keep increasing, the network will still be congested, and with blockchain having to store the memory of the whole blockchain state, this will make the blockchain node hardware mor expensive and slower to sync to the blockchain.

What’s next? well, let’s make more roads to the same destination!

 

2) Layer-2s!

   

There, now we have alternative road options to choose from that will get you to the same destination. More roads = less congestion on the main road. This is similar to how layer 2s in blockchain works. Due to network congestions in the main blockchain layer with an increase number of users, blockchain developers create layer 2 solutions such as rollups & sidechains to offload the transactional load to different layers.

So how does a rollup work? Let’s add some policemen into the picture, shall we?

 

3) Roll-ups!

   

Alright, so right now we have 3 policemen, 1 guarding the main road (let’s call him Ali) and the other guarding 2 of the alternative roads (let’s call them Ahmad & Abu).

For Ali, his main job is to count the number of cars that pass by the main road to the kopitiam. Say in 10 minutes, he counted 50 cars passed the main road and recorded them in a notebook, verified that he has seen 50 cars passing by on the main road. Now, when Ali is the only one recording down, there’s a chance that he may record the wrong number of cars, thus his records will be invalid. Therefore, he needs a team of 10 policemen to also count the number of cars on the road. If the big majority of the policemen (say 8 out of 10 men) agreed with Ali that 50 cars have passed the main road, then we can say the policemen have reached to a consensus, to which I’m basically just repeating how blockchain works like the previous article I’ve written.

The challenging part is that since there are alternative roads, the number of cars that reached the kopitiam will definitely be more than 50 cars because other drivers will definitely drive on those alternative roads. Don’t forget that Ali needs to know how many cars have reached the kopitiam, so he reached out to Ahmad & Abu.

 

3.1) Optimistic Rollups!

   

For Ahmad, he counted there are 2,000 cars that passed by on the road, but if he tells Ali about it, Ali would wanna verify if 2,000 cars is the correct number that Ahmad counted. However for Ahmad, he’s optimistic that he has counted 2,000 cars have passed by on his road.

To ensure that Ali can trust Ahmad’s word, Ali ask a bystander who’s staring at the alternative road (for no reason) similar with Ahmad to check whether if Ahmad’s word is true or not. Thus, he took Ahmad’s notebook, did some calculations and show Ali a proof that Ahmad’s not a fraud and what he reports is correct.

Of course, Ali still doesn’t trust Ahmad & the bystander’s word, so Ali puts up the proof to different bystanders along the road to challenge the results in this proof is true or not. This process will take some time, probably in days. If no one objects, then the proof is deemed to be valid and Ali can trust Ahmad’s word.

That’s basically how Optimistic Rollups work in very, very layman terms. you can read up the details Ethereum’s blog.

Now, let’s switch to what Abu is doing.


3.2) Zero-Knowledge Rollups (ZK-Rollups)!

   

For Abu, he also counted 2,000 cars similar to Ahmad. However, rather than just asking Ali to trust him that his counting is correct, he has a high accuracy laser machine that measures each car that passes by and store each count in the machine. Once 2,000 cars has passed by, Abu generates the receipt of proof and gives it to Ali.

Because the laser machine is built to count anything that passes by with 100% accuracy, and as long as Abu (prover) & Ali (verifier) acts honestly, the proof can be verified correctly.

That’s basically how Zero-Knowledge Rollups (ZK-Rollups) works in very layman terms. It takes high computation resources, but you’re able to verify thousands of transaction in a single receipt of proof while maintaining truth without revealing the details inside it.

So we have covered roll-ups, now let’s talk about sidechains!

 

4) Sidechains!

   

Sidechains are like two different residential areas going to two different kopitiams. Both may use similar road infrastucture, but they build their roads differently and can be interoperable to each other. When one road is built narrower but needed to support many cars on the road, the other road may built wider that can support the same amount of cars, while the cars from Road 1 can switch to using Road 2 and go to the kopitiam.

Sidechains are more flexible and developers can build them with their own properties, such as how fast is the transaction finality, or maybe adding some unique privacy features. You can read more on sidechains in the Ethereum blog.

 

5) Sharding!

   

Sharding is like partitioning a large chunk of stuff into smaller chunks. In this roads & kopitiams, instead of everyone going to the same kopitiam, I just opened more branches and other alternative roads to enjoy the same coffee offerings with the main branch, so each sub-branch will help easing the customer load of the main branch.

That way, I can sell more coffees to more customers, just like sharding in blockchains will process more transactions by partitioning the chain to smaller chunks of chains and a smaller node set, then the transactions can be validated by these smaller blockchain partitions which will process transactions in a much more shorter time.

6) State Channels (Hail Hydra)!

   

Imagine another Monday blues and the road is filled with traffic to your favourite kopitiam, so you ask yourself: “If only I could have something like a Super Mario tunnel which might lead me to a pathway that could get me there instantly”. Enter State Channels!

State channels is basically like a temporary supersonic tunnel that enables you to get to your destination very fast while only paying a minimum toll fee.

Except, there’s a catch. the tunnel has many conditions that is required before you may use the tunnel.

  1. You need to put in a deposit amount to access the tunnel. Let’s say you put RM100, and the toll charges 5 sens every time you used the tunnel. With simple math, your deposit enables you to travel through the tunnel up to 2,000 times.

  2. During halfway, after you have performed 1,000 trips & spent RM50. If you don’t feel like using the tunnel anymore, you are free to withdraw your remaining deposit of RM50. When this happens, this magic tunnel will close itself and the total trips done will be cryptographically posted to the blockchain to be verified.

Basically, state channels are mini, temporary ledgers that you are able to process many transactions in a shortest amount of time as long as your transactions stay within the mini ledger environment. You can read more from Ethereum’s blog & Cardano’s Hydra Heads blog.

 

Summary

 

We have covered most of the popular scaling solutions using roads & coffee shops as examples for you to understand it in layman terms. There are still other scaling solutions that I haven’t mentioned yet, but this will be an article for another day. Although there’s still more details to these above explanations that I haven’t elaborate, I hope this article gives you a nice head start to dive in deeper into the different scaling solutions out there!

 

-------------------------------------------------------------------------------------
Twitter: https://twitter.com/pizzadren
Substack: https://pizzadcrypto.substack.com/
Follow me on Twitter & Medium for more Malaysia-related crypto content. Subscribe to my Substack newsletter so you won't miss any of my articles from your email.

How do you rate this article?

21


Pizzadren
Pizzadren

Malaysian cryptocurrency writer. Shooting for more crypto adoption in Malaysia!


Cryptaysia
Cryptaysia

Cryptocurrency experiences from a Malaysian perspective

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.