In times of high network usage, blockspaces become scarce, transactions become ridiculously expensive, and MEV miners make banks. Thus is the bane of monolithic blockchains. There have been several 'proposed solutions' to solve these. But first, let's have an overly simplified explanation of what blockchains are; Blockchains are distributed and immutable ledgers. Distributed because all transactions/events are broadcasted to all of the participants connected to the network (referred to as nodes) irrespective of location. Immutable because once a block is signed and appended to the other blocks, it cannot (reasonably) be altered.
The means by which blocks are signed and transactions validated and added to the blockchain is referred to as 'consensus'. The two most widely used methods of consensus across blockchains are;
The proof_Of_Work (POW).
The Proof_Of_Stake (POS).
On proof of work blockchains, miners solve complex cryptographic (and mathematical) equations to mine new blocks and validate transactions. They do so by means of mining machines. These machines are 'heavy' and consume a lot of electricity. This fact, has drawn large criticism to bitcoin mining and it's contribution to global carbon footprint).
On proof of stake, we have validators instead of miners, and stakes instead of mining machines. Here, validators are randomly selected based off their ‘stakes’ (the higher the staked asset, the higher the odds of selection) in the system to validate transactions and sign new blocks to the blockchain. The carbon footprint with POS chains is effectively zero (this explains in part why Ethereum moved from POW to POS with the event dubbed “The Merge”).
To become a validator on a proof of stake blockchain, one would have to stake the native asset of the chain. To become a validator on the Ethereum blockchain for example, one would have to stake Eth. The least amount of Eth one can stake is 32.
The security of a POS blockchain is a measure of the amount of validators in the chain. The higher the number of validators, the higher the cost of attacking the network. Here; I'll explain. The higher the number of validators in a chain, the higher the amount of illiquid supply staked to secure the chain. Going by the laws of demand and supply, higher validators = more illiquid supply= higher price of the asset. It would thus be ridiculously expensive for a bad actor to acquire 51% of the network (since they’d have to spend a gargantuan sum of money).
However the more validators on a network, the harder for it to scale. This phenomenon has been dubbed the blockchain trilemma. A blockchain that wishes to scale must sacrifice either one of security/decentralisation. A blockchain looking to be more secure on the other hand sacrifices the ability to scale.
An example can be taken of Sol vs Eth.
Sol is fast, can scale, but is not nearly as decentralised as Eth. Layer twos, rollups and shards are all solutions that have been proposed to deal with this dilemma. We shall discuss each one after the other.
Sidechains;
By definition, Sidechains are independent chains that run parallel to the mainchain (which in this case is Ethereum), but are connected to the mainchain by a 'two-way bridge'. This “bridge” essentially allows the Sidechain and the mainchain to communicate (this is referred to as interoperability, and is basically the ability of two chains to exchange and use assets between themselves). Sidechains by their nature, are not bound by the same designs as the mainchain. This means for example, that a Sidechain can employ a consensus mechanism different from that of the mainchain, and as a result, there are no shared security between the sidechain and the mainchain. Some well known Sidechains include the Ronin sidechain and Polygon Network.
Roll-ups:
Rollups are Layer 2 solutions built on top of a layer 1 (the mainchain). Rollups process transactions outside the mainchain. By so doing, they reduce 'traffic' on the mainchain, and by extension, reduce the cost of transacting on the chain. There are basically two types of rollups; the optimistic rollups, and the zero-knowledge rollups.
Optimistic rollups;
These kind of rollups are so called because they assume the validity of transactions published, and do not publish corresponding proofs of validity for the transactions posted on-chain (on the mainchain). Arbitrum and Optimism are both optimistic rollups.
Zero-knowledge rollups;
These kind of rollups publish on-chain transactions without revealing specific details. For instance, it is possible for a blockchain user A to send ‘x' amount of Eth to B without having the details of this transaction revealed on-chain. The Zk-rollup simply publishes the 'fact' that A has indeed transferred Eth to B without disclosing any further information. It does so by publishing proofs of validity. Infact, zk rollups have no need to post any further transaction details on chain as proofs of validity are enough to validate/finalize transactions on the mainchain. Since they post minimal data to the mainchain, they allow for lesser traffic and greater throughput. zkSync, Loopring and Aztec are zk rollups.
Shards;
These are (to put simply) smaller independent blockchains within a blockchain, each tasked with specific 'roles'. By assigning each chain its own task, you free up 'load' and increase its throughput. Blockchain shards mirror the economic concept of specialization of labour; where specialization of labour leads to increased productivity, sharding results in increased throughput.
Conclusion;
Whilst there is no one superior layer 2 solution, the designs of these solutions means they have some trade-offs, especially when placed in comparisons with other layer 2s;
For instance, sidechains are much less secure than rollups and shards since Sidechains do not inherit the security of the mainchain and instead rely on their own consensus mechanisms.
The design of a zk rollup also means it guarantees higher throughput than an optimistic rollup since zk rollups only need to post proofs of validity on chain and no other transaction details. This means the zk rollups takes up a lot less data space than an optimistic rollup does.
Sidenote;
*Throughput refers to the number of transactions that a blockchain protocol can process within a given time period. This is most commonly expressed as transaction per second (TPS) on the blockchain explorer.
*Validity proofs are cryptographic proofs that allow participants to a transaction to verify the correctness/validity of that transaction without revealing the details of the transaction.
*Sharding is still being actively tested/developed by Ethereum Devs, and is likely to hit mainnet next year (2023).
Hey Fren.. thanks for reading all the way. I began this newsletter as a means of reaching out to, and helping ease/fast-track the learning curve of newbies in the crypto space. The blockchain space is vast, intriguing, sometimes complex and requiring prior knowledge of some concepts and theories. It is for this reason that I have now began the ‘Noob’s Defi series' with this piece being the first entry. It is my hope (and desire) that this series provides the background knowledge any newbie would need to get better at understanding the vast utilities the blockchain presents.
Till I come your way again fren.