L2 Compatibility

L2 Compatibility

L2 Target Assumptions • Custom Rollup vs StarkEx vs General-Purpose ZK L2


SnarkSide is not a rollup. It is a cryptographic execution layer built to run on top of one.

Its encrypted, ZK-native architecture requires a base layer that can support:

  • Efficient ZK proof verification

  • Consistent finality guarantees

  • Low-cost calldata availability

  • Support for SNARK-verifiable commitments

  • Optional modular execution hooks

This section outlines SnarkSide’s assumptions around Layer 2 integration, compares existing L2 stacks, and explains why custom rollup deployment is the preferred path forward.


1. Protocol Execution Characteristics

SnarkSide relies on the following operational model:

Component
Requirement

Vault and intent state

Held off-chain; Merkle committed on-chain

Matching logic

Executed off-chain; verified via SNARK

Settlement

State transition proofs; on-chain constraint check

Liquidation

ZK proof of insolvency; no address disclosure

Oracle input

Commit-reveal mechanism with delayed validity

This architecture does not depend on Ethereum calldata visibility or public function exposure. Instead, it requires fast and cheap:

  • Proof verification

  • Root publication

  • Nullifier invalidation

These needs rule out certain chains and make proof-native L2s ideal hosts.


2. General-Purpose ZK L2s

These include Scroll, zkSync, Linea, Polygon zkEVM. Each offers:

  • EVM compatibility

  • ZK-rollup finality

  • Calldata availability on Ethereum

  • Relatively low gas cost for on-chain proof verification

Pros:

  • Interoperability with wallets and tooling

  • Standard Solidity verifier contracts

  • Bridge to Ethereum via canonical L1 settlement

Cons:

  • Limited proof complexity (Groth16 only in most cases)

  • Shared blockspace leads to performance contention

  • Lack of execution layer abstraction (no custom syscall environment)

  • ZK constraints may be imposed on app circuit design (i.e., field compatibility, size constraints)

SnarkSide can deploy to any of these for compatibility testing, but trades off expressivity and performance isolation.


3. StarkEx (StarkNet)

StarkEx offers high-throughput ZK execution using Cairo, ideal for apps needing custom settlement logic and proof optimization.

Pros:

  • High throughput

  • Native ZK constraint enforcement

  • Proven exchange infrastructure (e.g., dYdX, Immutable)

  • On-chain data availability and commitment handling

Cons:

  • Cairo-based: not Solidity-compatible

  • Intent matching and vault formats must be Cairo-native

  • Circuit migration required

  • More friction for Ethereum-native devs and wallets

StarkEx is an ideal match if SnarkSide migrates from Circom/Groth16 to Cairo/Stark-friendly circuits.


4. Custom Rollup Deployment (OP Stack / Sovereign ZK L2)

The preferred long-term deployment path is SnarkSide-as-a-Rollup. This involves:

  • A custom execution environment tailored to encrypted intent workflows

  • A minimal L2 runtime optimized for:

    • SNARK verifier contracts

    • Poseidon hashing

    • Fixed-cost calldata compression

    • Decentralized relayer arbitration

SnarkSide can use:

  • OP Stack with SNARK verifier precompiles

  • Polygon CDK with ZK runtime module

  • Sovereign SDKs (e.g., Sovereign Labs, Eclipse, Cartesi) for custom sequencing

This enables:

Feature
Benefit

Dedicated batch interval

Precise control over relayer cycles

Custom syscall layer

In-Vault ZK proof context access

Native token gas payment

Use $SNSD as L2 currency

No shared blockspace

Prevents priority distortion

ZK-specific upgrades

Add native Poseidon, MiMC, Rescue support


5. L2 Design Assumptions in SnarkSide

Design Feature
Layer Assumption

Proof posting

L2 must verify Groth16 SNARK in <200K gas

Vault root finality

Settlement contract must emit deterministic logs

Matching batching

L2 must support sub-minute block times

Relayer arbitration

Optional, needs calldata and state root access

Cross-chain oracle

L1→L2 bridge delays must be accounted for

SnarkSide also optionally supports light node clients on the execution layer, meaning fast finality and bounded state growth are prioritized.


6. Summary: Compatibility Matrix

L2 Platform
Compatibility
Notes

Scroll

Easy integration, moderate proof cost

zkSync Era

Possible with zkPorter integration

StarkNet

⚠️

Needs Cairo migration, high ZK overhead

Optimism / OPStack

EVM-based custom rollup with verifier hook

Polygon zkEVM

Poseidon support limited, SNARK verification efficient

Sovereign SDK

✅✅

Ideal for ZK-native chain with native $SNSD


Final Recommendation

SnarkSide will support Ethereum L1 + multiple L2s initially for compatibility. However, the architectural endgame is a sovereign ZK rollup with native vault processing, custom verifier circuits, and isolated batch control.

That rollup won’t just run SnarkSide. It will be SnarkSide—the exchange as a chain, with no external visibility, and no exploitable layer underneath.

Last updated