Skip to main content

ZKCross Architecture

ZKCross Architecture Overview

ZKCross provides a full-stack solution for building fully stateful, on-chain provable decentralized applications (dApps). This holistic framework sits between dApps and Layer 1 (L1) chains, offering a comprehensive set of tools and services for efficient and secure development.

Core Components

Sequencer

  • Function: Handles the sequencing of requests (transactions) from dApps
  • Role: Acts as the entry point for dApp interactions, ensuring ordered processing of transactions

ZKC Executor

The core component of the ZKCross architecture, consisting of two main parts:

  • App WASM: Contains the compiled application logic
  • Host SDK: A comprehensive hub of APIs and toolsets that:
    • Facilitates compiling and loading WASM images
    • Establishes links to other components and services
    • Provides standard API functions (e.g., Jubjub signature, Poseidon hash, random number generation)

Prover (zkWASM)

  • Type: A specialized zero-knowledge virtual machine supporting WebAssembly
  • Function: Generates zero-knowledge proofs for execution traces
  • Process:
    • Accepts execution tracing logs and witnesses from the ZKC executor
    • Produces zkProofs
    • Automatically batches proofs for maximum scalability

Settlement Module

  • Function: Manages the interaction between ZKCross and the L1 chain
  • Process:
    • Retrieves transaction data and execution results (pre and post Merkle roots)
    • Acquires corresponding zk-proofs
    • Submits data to the on-chain settlement smart contract
    • The smart contract verifies the zk-proof and updates the final state Merkle root on-chain

Supporting Services

DA (Data Availability) Service

  • Function: Saves user transactions and execution proofs
  • Partnership: ZKCross has partnered with Avail, a leading data availability solution provider
  • Benefit: Enables developers to access advanced DA features while building ZK dApps

State Service

  • Provided by: ZKCross
  • Features:
    • Key-value pair database service
    • MongoDB service
  • Communicates with the ZKC executor to update and maintain dApp states based on processed transactions

Host Service

  • Component: Part of the WASM software development kit (SDK)
  • Offerings:
    • Essential tools for interacting with WASM modules
    • Interfaces for communication with other components (e.g., State service)
    • Library functions for cryptographic operations (signing, hashing, etc.)

Workflow

ZKCross Workflow Overview
The ZKCross workflow enables efficient and secure deployment of dApps with robust state management and verifiable computations across multiple blockchain layers:

Application to Sequencer

Requests and transactions flow from the Application's UI to the Sequencer

Sequencer to ZKC Executor

The Sequencer forwards transactions to the ZKC executor for processing

ZKC Executor Operations

  • Execute dApp logic compiled into WASM
  • Interacts with the Prover to generate zero-knowledge proofs
  • Communicates with the State Service for state management
  • Connects with the DA Service for data availability

Settlement

  • Engages with L1 Chains for final settlement and state updates

This architecture ensures a seamless flow of data and computations, from the initial dApp interaction to the final on-chain settlement, while maintaining security, scalability, and verifiability throughout the process.