
Overview
Note: This comparison covers general information on two widely used Rollup mechanisms, which are used to scale (usually Ethereum-based) blockchains, and compares and contrasts how Polkadot achieves scalability.
Layer 2 networks, by offloading most of the computation from Layer 1 networks, are considered the way forward for blockchain scalability and are therefore popular.
Layer 2 solutions leverage the security and functionality of Layer 1 networks to build an additional layer that is usually faster, reduces costs, and addresses other platform-specific issues. In many cases, Layer 2 solutions focus on efficient and cost-effective use of block space on a specific blockchain.
Rollups are a Layer 2 scaling solution. At the most basic level, Rollup Layer 2 solutions are responsible for "rolling up" transactions by batching them and then publishing them to the Layer 1 chain, typically through a sequencer network. This mechanism can include thousands of transactions in a single Rollup.
Polkadot implements this functionality at the native level (i.e., without using Layer 2 scaling solutions), allowing the relay chain and its respective parachains to share security and scalability. Shared security is a concept similar to Optimistic and Zero-Knowledge Rollups based on the EVM. However, Polkadot does not implement it as a Layer 2 solution but ensures the native security and scalability of each parachain through the parachain protocol. Polkadot coordinates data from parachains into an aggregated representative state, which is somewhat similar to Layer 2 Rollup.
Optimistic Rollups
Optimistic Rollups are an interactive Layer 1 blockchain scaling approach. They assume that each proposed transaction is valid by default.
In order to prevent potential invalid transactions, Optimistic Rollups have introduced a challenge period during which participants can question suspicious Rollups. Fraud proofs are used to allow the submission of multiple fraud proofs, which can either validate or invalidate the Rollups. During the challenge period, if no challenge is raised (and the required proofs are in place), state changes may be disputed, resolved, or included.
Although Optimistic Rollups provide scalability, their approach has both advantages and disadvantages.
Advantages
They are not limited to specific types of state changes - any state change can be included, which means existing applications do not have to consider it.
They can be parallelized to achieve scalability.
A large amount of data can be accommodated in a single Rollup (for example, in Ethereum, a single state transition can accommodate tens of thousands of transactions).
Disadvantages
Transaction censorship and centralization are concerns, where sequencers/Layer 2 nodes can be compromised.
The challenge period can take a significant amount of time to pass, thereby increasing the time of the Rollup until it is finalized by the Layer 1 network.
Due to the general nature of including any state change of its parent network, Optimistic Rollups can encounter gas limits or network congestion on Ethereum.
Optimistic Rollups are frequently used in the Ethereum ecosystem. Examples of Optimistic EVM-based Rollup solutions include:
Optimism
Arbitrum
Unipig
Zero-knowledge Rollups
Zero-knowledge Rollups (commonly known as ZK Rollups) are a non-interactive method that uses zero-knowledge proofs to computationally verify the validity of specific state changes. Unlike Optimistic Rollups, which rely on fraud proofs, ZK Rollups depend on cryptographic verification in the form of ZK proofs.
Due to the cryptographic verification handling the subtle differences that ensure the Rollup is valid, Zero-knowledge Rollups are significantly faster in terms of finality. However, ZK Rollups often suffer from performance issues due to their complexity and difficulty in implementing them in resource-constrained environments. Additionally, their generalizability in terms of block space is reduced due to computational overhead and the difficulty in achieving Turing completeness. Nevertheless, they hold great promise in addressing some of the issues faced by Optimistic Rollups and solving security scalability.
Advantages
Requires only a small amount of data availability. In most cases, proofs are sufficient to ensure validity.
Can be obtained without the need for trust.
Finality is instantaneous since the proofs are immediately available.
Overall, they have promising prospects as they are still maturing.
Disadvantages
Face the same issue of centralization in Layer 2 operations as other Layer 2 solutions.
High computational costs and difficulty in implementing ZK circuits.
The possibility of congestion remains a factor as data volume could still be a problem.
Native Shared Security in Polkadot
While Rollups are considered as Layer 2 solutions, Polkadot incorporates this functionality through its parallel chain protocol. The parallel chain protocol is the way Polkadot handles network sharding, aiming to achieve a combination of security, scalability, and availability.
It allows parallel chains to validate their collective state and communicate with each other. Parallel chains have similarities to Optimistic and ZK Rollups, reflected in how Polkadot handles the validity and availability of parallel chain states. Collators are a crucial part of the Polkadot architecture, similar in principle to sequencers, as they pass data using Proof of Validity (PoV) functionality to ensure liveliness and communicate with the relay chain.
Each shard or parallel chain is equipped with a unique State Transition Function (STF) that ensures effective communication with the relay chain. Each STF is written in Wasm Runtime. If any state transition function is compiled into WASM and follows the parallel chain protocol, it is considered valid.
Each STF runs a proof of validity. Unlike non-interactive ZK Rollups, this proof (approval protocol) is interactive. Furthermore, unlike ZK Rollups, it is not difficult to create a parallel chain with Turing complete logic. Each parallel chain is also a mature state machine (typically in the form of a blockchain). Similar to Optimistic Rollups, the parallel chain protocol also has the possibility of disputing and resolving potentially harmful Parablocks (representing blocks of the parallel chain), in which case, if a malicious Parablock is discovered, the validators are slashed.
Advantages
Protocol-level sharding, shared security, and interoperability.
Low barriers to entry for each shard in terms of development, as anything compiled to Wasm is a valid target.
Fast finality (typically less than a minute on Polkadot).
Data availability is built-in, in mechanisms such as validators and erasure coding. (For more details, see: https://wiki.polkadot.network/docs/learn-parachains-protocol#erasure-codes)
There is no Layer 2, which means lower risks of centralization issues from sequencers or other L2 operators.
Disadvantages
Executing code in Wasm may become a performance bottleneck as it is slower than making native calls.
The relay chain imposes hard limits on the size and weight of PoV (Proof of Validity) blocks that contain parallel chain state transition data.
Despite these disadvantages, Polkadot can still be upgraded without forks, enabling the protocol to easily upgrade and keep pace with future technological advancements.