Layer 2 Solutions

What is Layer 2?

"Layer 2" refers to systems that handle batches of transactions separately from Layer 1 and periodically submit them to the main chain. This reduces the overall number of transactions requiring validation on Layer 1. Layer 2s are also referred to as "execution layers" or "rollups".

How do ZK rollups operate?

ZK rollups comprise two primary components:

  1. Off-chain batching mechanism (virtual machine): This generates a cryptographic proof from a compressed batch of transactions, along with the previous state root and the new state root.

  2. On-chain contract: This component stores the current state root of the rollup and verifies that the previous state root in the batch matches the current state root. If so, it updates the state root to the new one.

Here's how it functions:

  1. A set of layer 2 transactions is submitted to the batching mechanism, which then generates a cryptographic proof using the transactions, previous state root, and new state root.

  2. This proof is forwarded to the layer 1 smart contract for verification.

  3. The layer 1 smart contract validates that the proof's previous state root matches its current state root.

  4. If the match is confirmed, the layer 1 smart contract updates its current state root to the new state root of the batch.

Last updated