Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wiki reorg: Edit Comparisons #6394

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Wiki reorg: Edit Comparisons #6394

wants to merge 18 commits into from

Conversation

filippoweb3
Copy link
Contributor

Major reorg to the comparisons section.

- learn-comparisons as main page
- updates sidebar
- edit kusama
@filippoweb3 filippoweb3 self-assigned this Nov 18, 2024
@filippoweb3
Copy link
Contributor Author

@mmagician I am making a comparison in the wiki between ZK, Optimistic, and Polkadot rollups. I know you are working on ZK rollups and I would like to ask if you can provide a review on the content of this PR 🙏

@filippoweb3 filippoweb3 added A1 - In Progress Not ready for review yet. A2 - Please Review Pull request is ready for review. labels Dec 13, 2024
Copy link
Contributor

@CrackTheCode016 CrackTheCode016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks over all good, maybe we should mention ELVES at least one though, as that's the formal protocol that parachains follow. It would be nice to incoprorate a comparison of that somewhere here!

docs/learn/learn-comparisons.md Outdated Show resolved Hide resolved
docs/learn/learn-comparisons.md Outdated Show resolved Hide resolved
docs/learn/learn-comparisons.md Show resolved Hide resolved
docs/learn/learn-comparisons.md Outdated Show resolved Hide resolved
docs/learn/learn-comparisons.md Outdated Show resolved Hide resolved
docs/learn/learn-comparisons.md Outdated Show resolved Hide resolved
filippoweb3 and others added 10 commits December 18, 2024 11:24
Co-authored-by: bader y <ibnbassem@gmail.com>
Co-authored-by: bader y <ibnbassem@gmail.com>
Co-authored-by: bader y <ibnbassem@gmail.com>
Co-authored-by: bader y <ibnbassem@gmail.com>
Co-authored-by: bader y <ibnbassem@gmail.com>
- redirect
- sidebar updates
- sharding
- l2beat
[Cosmos](./learn-comparisons-cosmos.md) and [Avalanche](./learn-comparisons-avalanche.md).
**Rollups** are an L2 scaling solution. At the most basic level, a rollup L2 solution is responsible
for "rolling up" transactions by batching them before publishing them to the L1 chain, usually
through a network of **sequencers**. This mechanism could include thousands of transactions in a

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sequencer's role is not necessarily publishing the Txs to the L1. In theory the role of sequencing Txs and publishing could be assumed by separate entities.

In practice today they're probably the same machine, but this is likely to change as rollups decentralize more.


Layer two (L2) networks are popular as being the way forward for blockchain scalability by
off-loading the majority of computation from layer one (L1) networks. L2 solutions utilize the L1
network's security and functionality to build an additional layer that is often faster, reduces

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality is not re-used.
One could launch an EVM or SVM or Move rollups that settle to Ethereum.


An interactive method involves a back-and-forth process between parties to validate transactions. A
prominent example is the usage of fraud proofs, as used in optimistic rollups. If a dispute arises,
a challenge mechanism is triggered, where a "prover" submits evidence (fraud proof) to demonstrate

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if these are already deployed in prod, or just being worked on now, but it's possible to have non-interactive dispute mechanisms.

I'd frame this section differently, as fraud proofs vs. validity proofs, which is the standard terminology.

| **Aspect** | **Interactive** | **Non-Interactive** |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
| **Mechanism** | Back-and-forth dispute resolution. | One-time proof submission and verification. |
| **Latency** | Different time to finality depending on the technology, and mostly related to challenge periods. For instance, optimistic rollups can take a few hours while Polkadot rollups around 30 minutes. | Near-instant finality in theory. In practice ZK rollups can take hours to finalize. ZKsync for instance takes a whole day. |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The delay in validity rollup finality is not related to the technology used.
The delay is introduced artificially as "training wheels" - since this is still new tech and millions of $$ are secured there, they allow for some time for good old humans to intervene in case the social layer notices something being off, e.g. a ZK proof system having been broken.

Both approaches serve different needs and trade-offs, depending on the balance between scalability,
security, latency, and flexibility required.

### Zero-knowledge Rollups

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you really want to be picky, best to avoid the misleading term "ZK", since there is actually no zkSNARKs involved. These are just SNARKs.
But yeah the industry has kind of gotten used to calling them zk rollups

solutions), allowing for shared security and scalability for each rollup through the
[Parachains Protocol](./learn-parachains-protocol.md). Polkadot handles the coordination of data
from parachains into an aggregated, representative state, somewhat similar to L2 rollups.
- Each shard, or parachain, can be equipped with a unique state transition function (STF). This

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each L2 can also have its own STF - as outlined above they can run different VMs (implies different STF)

| **Finality** | Near-instant finality. Because the proof is immediately available, finality is also instantaneous. | Delayed finality (a week) due to fraud-proof mechanisms. | Fast finality (under 1 minute) via relay chain consensus. |
| **Security Model** | Relies on cryptographic validity proofs, ensuring high security and no reliance on game-theoretic assumptions. | Relies on economic incentives and a challenge period to catch fraud. Optimistic assumption makes it less secure than ZK Rollups. | "Cynical" model, where every transaction is checked by a subset of validators, with escalation and slashing in case of disputes. |
| **Scalability** | Limited scalability as they are a single state machine and are only as scalable as the prover machine and computation requirement. Many zk-rollups disable cryptographic precompiles on mainnet as a result of the immense computational requirement for them. | High, with parallelization, but limited by gas costs on L1 chains like Ethereum. | Inherently scalable through native execution sharding and parachains operating in parallel. [Pipelining](./learn-async-backing.md) and [core scheduling](./learn-agile-coretime.md) increase throughput and scalability for the single rollup. Execution sharding is enabled by multiple virtual cores using [coretime](./learn-agile-coretime.md). |
| **Decentralization** | Centralization risks for sequencers and zk proof computation. | Sequencer centralization risks; fewer validators can lead to potential censorship. | Collator decentralization is critical to ensure parachains remain trustless and independent. |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sequencer centralization risks are common problems to all rollups polkadot or not

| **Security Model** | Relies on cryptographic validity proofs, ensuring high security and no reliance on game-theoretic assumptions. | Relies on economic incentives and a challenge period to catch fraud. Optimistic assumption makes it less secure than ZK Rollups. | "Cynical" model, where every transaction is checked by a subset of validators, with escalation and slashing in case of disputes. |
| **Scalability** | Limited scalability as they are a single state machine and are only as scalable as the prover machine and computation requirement. Many zk-rollups disable cryptographic precompiles on mainnet as a result of the immense computational requirement for them. | High, with parallelization, but limited by gas costs on L1 chains like Ethereum. | Inherently scalable through native execution sharding and parachains operating in parallel. [Pipelining](./learn-async-backing.md) and [core scheduling](./learn-agile-coretime.md) increase throughput and scalability for the single rollup. Execution sharding is enabled by multiple virtual cores using [coretime](./learn-agile-coretime.md). |
| **Decentralization** | Centralization risks for sequencers and zk proof computation. | Sequencer centralization risks; fewer validators can lead to potential censorship. | Collator decentralization is critical to ensure parachains remain trustless and independent. |
| **Interoperability** | Limited interoperability, often restricted to compatible L1s. | Limited interoperability, often confined to the parent blockchain ecosystem. See the [comparison about interoperability](#interoperability-comparison) for more information. | Native interoperability through [XCM](./learn-xcm.md), allowing seamless communication between parachains having different logic. [Trustless bridges](./learn-bridges.md) can connect Polkadot to other blockchains. |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Teams are working on native interoperability within rollup hubs, e.g. rollups within the OP Stack ecosystem will have "better" interop than independent L2s.
How exactly it's going to work is TBD, but at least being worked on by multiple teams

| **Scalability** | Limited scalability as they are a single state machine and are only as scalable as the prover machine and computation requirement. Many zk-rollups disable cryptographic precompiles on mainnet as a result of the immense computational requirement for them. | High, with parallelization, but limited by gas costs on L1 chains like Ethereum. | Inherently scalable through native execution sharding and parachains operating in parallel. [Pipelining](./learn-async-backing.md) and [core scheduling](./learn-agile-coretime.md) increase throughput and scalability for the single rollup. Execution sharding is enabled by multiple virtual cores using [coretime](./learn-agile-coretime.md). |
| **Decentralization** | Centralization risks for sequencers and zk proof computation. | Sequencer centralization risks; fewer validators can lead to potential censorship. | Collator decentralization is critical to ensure parachains remain trustless and independent. |
| **Interoperability** | Limited interoperability, often restricted to compatible L1s. | Limited interoperability, often confined to the parent blockchain ecosystem. See the [comparison about interoperability](#interoperability-comparison) for more information. | Native interoperability through [XCM](./learn-xcm.md), allowing seamless communication between parachains having different logic. [Trustless bridges](./learn-bridges.md) can connect Polkadot to other blockchains. |
| **State Transition Logic** | General-purpose but constrained by zk-circuit implementation complexity. | Can only support EVM state transitions with assumptions of optimistic validity since they have to be checked in the EVM environment<sup>1</sup>. | Each parachain can define its unique state transition function (STF), compiled to Wasm and validated per Parachain Protocol rules. |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not true, optimistic rollups' opcodes aren't natively checked by the L1. Instead, the individual opcodes of the L2 are interpreted by the EVM.
One could equally implement the interpretation logic of other VMs aside from the EVM.

| **Interoperability** | Limited interoperability, often restricted to compatible L1s. | Limited interoperability, often confined to the parent blockchain ecosystem. See the [comparison about interoperability](#interoperability-comparison) for more information. | Native interoperability through [XCM](./learn-xcm.md), allowing seamless communication between parachains having different logic. [Trustless bridges](./learn-bridges.md) can connect Polkadot to other blockchains. |
| **State Transition Logic** | General-purpose but constrained by zk-circuit implementation complexity. | Can only support EVM state transitions with assumptions of optimistic validity since they have to be checked in the EVM environment<sup>1</sup>. | Each parachain can define its unique state transition function (STF), compiled to Wasm and validated per Parachain Protocol rules. |
| **Development Complexity** | Complex due to the mathematics of zero-knowledge proofs. | Moderate complexity, requiring fraud-proof implementation. | Moderate to high complexity; parachain runtimes must be written in Wasm-compatible languages but can define custom logic and governance. Parachain maintainance can be an overhead. |
| **Data Availability** | Requires posting minimal data proofs to L1. | Posts complete data on-chain during challenge periods, increasing cost. | Built-in data availability with validators ensuring distributed state storage and reconstruction in case of disputes. |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data availability requirements posted by the optimistic and ZK rollups is precisely the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A1 - In Progress Not ready for review yet. A2 - Please Review Pull request is ready for review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants