Scaling: Peeling Back the Layers

‘The Scalability Trilemma’ taught us to think differently in how we approach the issue of scaling Blockchain networks and revealed that our perceived limitations are often based on incorrect assumptions. In this article, we continue our journey by peeling back the layers to reveal what scaling looks like today as well as what the future holds.


On our last adventure down the crypto rabbit hole, we looked at the Scalability Trilemma and discussed the concept of scaling and how it applies to Blockchain architecture using the concept of ‘Layers.’ We also learned that our limitations are often rooted in false assumptions about what we can do.

In this article, we’ll continue our journey by ‘peeling back the layers’ to get a better look at just how these layers are used and what solutions currently exist. There is indeed some ground to cover, but fear not, young Padawan…for the Force will be with you, always!

We got this! ✊

Ready Layer-1

(Warner Bros./Getty Images/Ringer illustration)
(Warner Bros./Getty Images/Ringer illustration)

Much like the Oasis in Ready Player One , a Blockchain’s Layer-1 (L1) is considered the ‘Base Layer.’ This is the lowest level where solutions affect the main way that a Blockchain works. To scale on L1 means changing the rules of the protocol itself and doesn’t offer much to combat the inherent issues involved in L1 scaling.

For instance, the Oasis doesn’t seem to have any major latency issues, and that’s because it suffers from a high level of centralization. I mean, the entire premise of the story is a race for control over its fate. And while a more robust architecture spanning multiple layers sounds awesome, it would make for a pretty boring story…‘IOI’ could be like, ‘All your eggs are belong to us! Bwahahaha!’ and everyone else would just be like, ‘Cool story, bro.’

“If you push [the button]…and the whole simulation shuts down.”


Consensus Changes

‘Consensus changes’ affect how blocks are created.

src: https://ig.com
src: https://ig.com

Most notably, on the Bitcoin Network, different ideas on how consensus should operate have led to contentious forks that resulted in projects like Bitcoin Cash and Bitcoin Gold .

In Ethereum 2.0, the consensus algorithm will change from Proof-of-Work (PoW) to Proof-of-Stake (PoS) . The main idea behind this is to allow for faster block creation by getting rid of the computational overhead associated with mining/PoW.

In PoS, blocks are processed and validated by network participants who instead are required to stake collateral on-chain. This effectively incentivizes being honest since they have ‘skin in the game.’ Basically, acting dishonestly means losing some of their collateral via a mechanism known as slashing .

Sharding

Sharding changes how the network itself is distributed.

https://vitalik.ca/general/2021/04/07/sharding.html - Original diagram by Hsiao-wei Wang, design by Quantstamp
https://vitalik.ca/general/2021/04/07/sharding.html - Original diagram by Hsiao-wei Wang, design by Quantstamp

With sharding, a network’s database is split across different sub-networks where each ‘shard’ contains a portion of the network’s data. In the case of Ethereum 2.0, the main chain becomes one of these shards and will be the only one allowed to process transactions or execute smart contracts, where an additional Beacon Chain coordinates communication between the main chain and its shards.

Layer-2: Insert Coin

In contrast to L1 solutions, Layer-2 (L2) solutions change the way you use a Blockchain and can function independently from the main chain.

In our Scalability Trilemma article, we compared L1 vs L2 to writing a penalty in grade school with L1 being the act of writing 50 lines by hand onto a single sheet of paper. L2 would be more like typing the line once, then copy-pasting the remaining lines before printing it off to turn in to your teacher.

State Channels

‘State Channels’ use multi-signature contracts that allow participants to interact freely off-chain with the final results settling on the main chain. State Channels can be implemented in various ways that are often application-specific.

https://research.csiro.au/blockchainpatterns/general-patterns/data-management-patterns/state-channel
https://research.csiro.au/blockchainpatterns/general-patterns/data-management-patterns/state-channel

One notable example of a State Channel is the Lightning Network which creates peer-to-peer (P2P) payment channels where the final results settle on the Bitcoin Network.

The drawback to using State Channels is that the main chain has no way to validate what takes place off-chain. Each solution requires that participants rely on the security of the protocol they’re using.

This can be thought of as something like having a table at a swap or rummage sale. Payments and items can change hands quite a bit over the duration of the sale. But at the end of the day, everyone gets paid out accordingly.

Projects using State Channels:

Sidechains

‘Sidechains’ are essentially clones of their main chain. They’re, functionally speaking, almost completely identical; the only distinctions being that they run in parallel to the main chain and often implement their own consensus algorithms.

https://en.bitcoinwiki.org/wiki/Sidechain
https://en.bitcoinwiki.org/wiki/Sidechain

On Ethereum, Sidechains are based on the Ethereum Virtual Machine (EVM) and are even able to execute Ethereum smart contracts.

Sidechains, like State Channels, also require that participants rely on the security of the protocol they’re using as the main chain has no way to guarantee data that’s processed off-chain.

Projects using Side Chains:

Plasma

‘Plasma’ chains are anchored to their main ‘parent’ as a ‘child’ chain. While each ‘child’ has its own consensus model, its primary function is to offload computations from their ‘parent’ chain.

https://coincentral.com/plasma-an-innovative-framework-to-scale-ethereum
https://coincentral.com/plasma-an-innovative-framework-to-scale-ethereum

Much like Optimistic Rollups, discussed further below, Plasma chains submit a transaction ‘fraud proof’ to their parent.

A popular analogy to explain Sidechains is to compare child chains to a Casino. You swap Dollars for poker chips, then cash out when you’re done, basically ensuring that your chips are backed by something of the same value.

Projects using Plasma:

Rollups

‘Rollups’ are one of the newest and most promising ways to further scale a Blockchain.

One way to think about Rollups is to consider the act of sending holiday cards to your Aunt and Uncle. Using L1 methods, you could send one card to each of them as well as each of your cousins. Using L2 would be more like putting all the cards into one envelope and sending them together. So one stamp vs five stamps, which is cheaper and less work for the Post Office, and your relatives still get all the cards.

The key advantage of Rollups over other L2 scaling solutions is that Rollups require that proofs be committed to the main chain. This means users don’t have to rely solely on the security of a given L2 implementation as transactions and contract executions can be secured by the main chain.

Optimistic Rollups

‘Optimistic Rollups’ batch transactions and contract executions off-chain and commit the result to the parent chain along with a ‘fraud proof’.

https://ethereum.org/en/developers/docs/scaling/layer-2-rollups
https://ethereum.org/en/developers/docs/scaling/layer-2-rollups

A ‘fraud proof’ is an on-chain ‘statement’ or ‘promise’ that can be challenged by any party that suspects fraud. These statements and challenges require collateral to be locked by each party, where either acting dishonestly means losing some (or all) of their locked collateral. Results committed to a parent chain by Optimistic Rollups are essentially presumed to be correct… (<– that’s the ‘optimistic’ part).

This is kinda like playing Guess Who or Battleship . Players operate on the honor system, except bystanders are allowed to call out cheaters. If the player was cheating, their funds get slashed; but if the challenger was wrong, their funds get slashed.

In the case of Optimistic Rollups, the challenge period can last up to a week or more. This gives extra time for the transactions to be scrutinized but also means users have to wait to withdraw their funds until after the challenge period has ended.

Projects using Optimistic Rollups:

ZK Rollups

‘ZK Rollups’ batch transactions and contract executions off-chain, but commit the result to the parent chain along with a cryptographically provable ‘validity proof’ known as a ‘zk-SNARK’, or Zero-Knowledge Succinct Non-Interactive Argument of Knowledge.

https://medium.com/fcats-blockchain-incubator/how-zk-rollups-work-8ac4d7155b0e
https://medium.com/fcats-blockchain-incubator/how-zk-rollups-work-8ac4d7155b0e

Wait…ZK what?

Zero-knowledge…Succinct…Mmkay…So that’s some pretty heavy terminology, to say the least. What this basically means is that, instead of assuming ‘optimistically’ that all participants are being honest, the on-chain commit includes mathematical evidence proving the results are valid without revealing details about what happened inside the batch.

This, in a way, would be more like playing Scrabble . Players can’t see each other’s tiles until they’re placed on the board, and the only way to make a new word is to branch off one that already exists. You can’t just add gibberish with tiles you don’t have on an empty section of the board…and if you do, I’m totally not playing with you anymore.

Projects using ZK-Rollups:

Conclusion

L1 and L2 solutions do offer great ways to approach scaling. However, the true benefits are realized when they are used in conjunction.

A perfect example of this duality are the many changes involved on the road to ETH 2.0 which include consensus changes, the addition of the Beacon Chain , and sharding ability. These upgrades prime Ethereum’s L1 to further improve the efficiency and effectiveness of the various L2 solutions we covered earlier in this article.

How exactly the ETH 2.0 upgrades work to better-serve L2 scaling solutions totally warrants a separate article altogether, but hopefully our adventure thus far has served to bring the massive potential a bit more into focus.


The journey doesn’t end here! Stay tuned for more technical topics just like this one!

Let us know if there are topics you’d like to learn more about too. We’re only just getting started, my friends 🦾


Simon is a WEB3 developer and technical writer. When he isn't busy programming microcontrollers, documenting Blockchain software, and saving the world from centralization, he enjoys creating music and exploring the latest technological trends.

Subscribe to sl33p.eth
Receive the latest updates directly to your inbox.
Verification
This entry has been permanently stored onchain and signed by its creator.