Skip to main content

Architecture

ZKCross Architecture Overview

ZKCross provides developers with a full-stack solution to build fully stateful on-chain provable dApp. It is a holistic framework setting between dApps and L1 chains. Viewed from a high-level perspective, ZKCross is composed of serveral fundamental parts:

  • Sequencer: The Sequencer handles the sequencing of requests aka transactions from dApps, and forwards them to the ZKC executor.

  • ZKC executor: The ZKC executor is the core component, consisting of the App WASM and the Host SDK. The WASM module contains the compiled application logic. The SDK is a comprehensive hub of various APIs and toolsets, to facilitate applications in compiling and loading WASM images and to establish a link to other components and services.

  • Prover: The Prover is a zkWASM, a virtual machine that supports WebAssembly and can generate zero-knowledge proofs. It accept the exeuction tracing log and witness from ZKC executor and produce zkProofs. The proofs will be auto batched so as to achieve maximum scalability by default.

  • Settlement: The Settlement module retrieves transaction data and execution results (both the pre and post Merkle roots), acquires the corresponding zk-proof, and submits these to the on-chain settlement smart contract. The smart contract verifies the zk-proof, executes on-chain settlement as required upon successful verification, and updates the final state Merkle root on-chain.

  • Services:

    • DA Service: ZKCross leverage DA service to save user transaction and execution proofs. ZKCross has partnered with Avail, a leading data availability solution provider, to help developers gain access to advanced DA features while building ZK dApps.

    • State Service: Provided by ZKCross, the State Service encompasses key-value pair database service and MongoDB service. It communicates with the ZKC executor to update and maintain the dApp states based on the transactions processed, ensuring that all changes are tracked and verifiable.

    • Host Service: The Wasm software development kit (SDK) offers essential tools and interfaces (such as library functions for signing, hashing, etc.) for interacting with WASM modules and other components like State service mentioned above.

Workflow

ZKCross Workflow Overview

ZKCross's workflow enables developers to deploy dApps efficiently and securely, 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 to other components:
    • Compiles application logic 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 settlement.