VACP vs ZK & Optimistic: A Hands-on Analysis

The rollup landscape

In this article, we will provide an overview of off-chain scaling solutions designed to enhance the performance of the Ethereum network, known as rollups. We will focus on two prominent types of rollups, namely ZK rollups and optimistic rollups, along with our smart contract scaling paradigm known as VACP. Our discussion will encompass their primary utility, architectural frameworks, shared features, key differences, and the rationale behind the development of each solution.

We will start this article by exploring some fundamental concepts that form the core of our thesis.

VACP & MEM

The Verifiable Atomic Computing Paradigm (VACP) is a new scalability solution introduced by the Decent Land Labs team.

The Molecular Execution Machine (MEM) is the first practical implementation of this new data-driven smart contract protocols scalability solution.

Ethereum off-chain scalability solutions

Off-chain solutions operate independently from Ethereum's Layer 1 (mainnet) and do not necessitate modifications to the Ethereum protocol. These layer 2 solutions derive their security directly from the Ethereum layer 1 consensus.

Notable examples include optimistic and zero-knowledge rollups. By handling execution outside of the L1 blockchain, these solutions aim to boost scalability and efficiency while preserving the security and decentralisation inherent in the underlying layer 1 infrastructure.

So, what is a layer 2 (L2)?

Let's dive into the core concepts of our thesis by exploring Layer 2 scaling solutions. Layer 2, within the Ethereum ecosystem, refers to off-chain solutions that bolster application scalability while maintaining security through Ethereum's Mainnet (Layer 1). The necessity for Layer 2 arises from Ethereum Mainnet's congestion issues, causing sluggish transaction speeds and high gas costs. Layer 2 solutions work by offloading transactions to specialized servers or clusters (referred as nodes), reducing congestion and costs. These solutions batch transactions before anchoring them to Layer 1, where they become immutable.

Key points:

  • Enhanced performance: Layer 2 significantly boosts transactions per second, improving user experiences and easing Mainnet congestion.

  • Reduced costs: Transactions are consolidated and sent to Mainnet, reducing gas fees and making Ethereum more accessible.

  • Security and decentralization: Layer 2 builds upon Ethereum's security and decentralization while enhancing scalability.

Rollups

Rollups present an innovative approach to transaction execution by conducting it outside of layer 1, and then posting the resulting data (depending on the rollup type) to layer 1 for consensus. By including transaction data in layer 1 blocks, rollups inherit the native security of Ethereum. There are two distinct types of rollups, each with its own security mode

  • Optimistic Rollups: These rollups assume the validity of transactions by default and only engage in computation when challenged (via fraud proofs).

  • Zero-Knowledge Rollups: Zero-Knowledge Rollups execute computations off-chain and subsequently submit a cryptographic proof to the chain.

ZK and optimistic

Now that we've gained a high-level understanding of the fundamental components of the thesis, we can delve into the exploration of the two primary models within Ethereum's off-chain scaling solutions: ZK and optimistic rollups.

Distinguishing ZK rollups from optimistic

ZK and Optimistic rollups primarily diverge in their approaches to proof validation.

Optimistic rollups earn their name from their optimistic stance, presuming the validity of all Layer 2 transactions unless proven otherwise. In contrast, ZK rollups employ an intricate cryptographic tool called a zero-knowledge proof to substantiate transaction validity without delving into the transaction specifics. Another noteworthy contrast lies in the data transmission to their respective base chains.

ZK rollups, thanks to their transaction validation mechanism prior to base chain submission, transmit less data compared to their optimistic counterparts. Specifically, ZK rollups only post validity proofs for settling transactions with finality on the base chain, while optimistic rollups transmit the complete transaction data.

Comparing the architecture of optimistic vs. ZK rollups

Both ZK optimistic rollups exhibit a dual-root structure, featuring a pre-state root and a post-state root.

The pre-state root signifies the rollup state before transaction execution, while the post-state root reflects the state after transaction execution.

In terms of smart contracts, ZKrollups rely on two distinct contracts: a main contract for storing rollup blocks, asset deposits, and withdrawals, and a verifier contract responsible for validating the zero-knowledge proofs posted to Layer 1.

Conversely, optimistic rollups employ bridge smart contracts deployed on both the rollup and the underlying Layer 1. These bridge contracts mint identical assets on the rollup for each asset locked in the Layer 1 bridge contract.

Both ZK and optimistic rollups feature an operator, known as a sequencer. The sequencer plays a pivotal role in facilitating transactions, generating rollup blocks, adding transactions to contracts, and transmitting data to Layer 1. Sequencers effectively bridge the Layer 1 and Layer 2 networks, ensuring the smooth migration of assets between them.

When a sequencer submits transaction data, it simultaneously proposes a new post-state root to the rollup smart contract. The rollup contract verifies that the current state root matches the pre-state root. Once verified, the sequencer's proposed post-state root becomes the new current state root, ensuring the integrity of the system.

Rollups, as off-chain scaling solutions for Ethereum Layer 1, present a unique mix of advantages and limitations. Both Optimistic and ZK-Rollups leverage Layer 1 as a data availability layer, transmitting data as 'calldata.' It's worth mentioning that these rollups are mainly designed to cater to financial use cases and services, rather than being focused on data-driven applications.

However, it's important to highlight that the ZK-Rollups' built-in privacy features have led to the creation of various identity and private attestation dapps, effectively utilizing this functionality.

How the VACP stacks up

As previously mentioned, MEM is a scalable smart contract platform built on the principles of VACP. MEM, operating under VACP, shares several key similarities with optimistic rollups, outlined below:

  • Pushing data to a DA layer: MEM pushes all network data to Arweave

  • Single to few nodes: Both MEM and optimistic rollups employ a single node to submit and process transactions and assume the transactions are valid.

  • Low technical barrier: MEM, like optimistic rollups, doesn't demand a complex technical setup, making it straightforward and cost-effective to run a node.

  • Accessible data: Data in the MEM network is public, accessible without encryption, and can be retrieved by anyone at no cost by accessing the Arweave network.

Nevertheless, there exist significant distinctions between MEM and an optimistic Rollup, including:

  1. Single shared state: In contrast to optimistic rollups, MEM networks adhere to the VACP principles. Each MEM node operates as an independent entity, forming its own network and state. Consequently, contracts deployed under MEM node #1 do not share their state with those under MEM node #2, and vice versa. This separation arises from each MEM node running its distinct VACP network instance, a concept referred to as Atomic Computing.

  2. Fraud proofs and latency: MEM transactions offer near-instant latency due to their truth-based approach – VACP employs lazy evaluation, allowing contract final states to be reconstructed by any party by loading the contract's transactions from the data availability layer (Arweave) and applying the contract logic to these transactions. In case of dishonesty detected in a MEM node, the resolution differs from optimistic rollups (~7 days latency window). Rather than reverting back to the malicious transaction and re-executing it, the dishonest MEM node is disqualified by social consensus. Any participant can initiate a hard fork from the last valid state root, ensuring network integrity.

  3. Public vs. private data: Unlike optimistic rollups, MEM has the potential to transition to end-to-end encrypted (E2EE) states, transactions, and smart contract source codes.

  4. Use case focus: Rollups primarily serve financial applications. In contrast, VACP and its MEM implementation are primarily tailored for data-driven applications and use cases requiring complex manipulation of data sets.

In summary, MEM and VACP, when compared to optimistic rollups, reveal notable distinctions that make them particularly suited for specific use cases.

MEM vs. Mina's o1js: a comparative look

According to the docs, “Mina is an L1 blockchain based on zero-knowledge proofs (ZKP) with smart contracts written in TypeScript. It is the first cryptocurrency protocol with a succinct blockchain (22KB).”

To root this argument in a concrete implementation, we’ll examine Mina’s o1js. By comparing the optimistic VACP with the o1js zk implementation, we showcase how MEM is better suited for data-only apps when no default encryption is required. Both o1js and MEM have similar approaches to smart contract syntax, but MEM is simpler and supports straightforward programming language usage.

When comparing MEM to Mina's o1js, which is based on zk technology for building ZkApps, we notice several key differences:

Mina's o1js: cons

  1. Limited state size. o1js has a restricted state size, allowing for a maximum of 8 fields, each containing 32 bytes. In contrast, MEM offers an unlimited state size.

  2. Limited smart contract functionality: o1js provides limited smart contract functionalities, encompassing logic and methods. MEM, on the other hand supports the full set of JavaScript features and offers a broader range of capabilities including deterministicFetch.

  3. Gas fees: Mina's o1js, like many blockchain platforms, requires gas fees for transaction processing. MEM does not impose such fees, enhancing accessibility.

  4. Not fully REST callable: o1js lacks the full REST callability found in MEM, potentially impacting the ease of interacting with the smart contracts in a wide range of environments.

  5. Costly onchain data storage: ZK rollups rely on Ethereum mainnet as their data availability layer, which can be considerably more expensive compared to Arweave, a network specifically designed for cost-effective storage solutions.

Mina's o1js: pros

  1. Default ZK encryption: o1js employs zero-knowledge (ZK) encryption by default, enhancing data security and privacy.

  2. Native financial functionalities: o1js contracts are well-suited for handling financial functionalities directly, making them a suitable choice for financial applications.

Here's an example of a smart contract that increments the value of the x property in the state every time the increment function is invoked.

Written in o1js:

Written in MEM - a simpler and more straightforward syntax using vanilla JS:

MEM contracts are better suited than zk apps for decentralized applications (dApps) that heavily depend on intricate data manipulation, data-driven operations, key-value (KV) updates, or serverless-like utilities.

In summary, the choice between MEM and Mina's o1js depends on the specific requirements of the use case, particularly in terms of state size, smart contract capabilities, gas fees, callability, and encryption needs.

Rolling up

The purpose of this piece was to address the confusion that arose following the VACP v0.1 announcement, particularly regarding the distinctions between VACP and ZK/rollups technologies. As a parting thought, we trust that this article has effectively clarified the utilisation of these scaling solutions, emphasising that each of them comes with its own set of advantages, disadvantages, and trade-offs that dictate their optimal use cases.

Subscribe to Decent Land Labs
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.