Developing Framework
The provided diagram represents all the major components of ZKCross framework which leverage WASM and zero-knowledge proofs. This framework allows for the creation of applications with provable executions, ensuring transparency and security. Below is a detailed description of each component and their interactions:
Components and Interactions:
-
Application:
- Consists of two main parts: Frontend UI and Backend Logic.
- The UI handles user interactions, sending transactions to the ZKCross framework through sequencer.
- The Backend Logic represents the application's core business rules. No matter in which language it is written (e.g. Rust, JavaScript or Solidity), it can be compiled into WASM and loaded by the Wasm executor within the ZKC Node. The Wasm exeuction will be triggered by user transactions.
-
Sequencer:
- Acts as an intermediary between the User and the Wasm Executor.
- It handles the sequencing of transactions from users, and forwards them to the Wasm Executor.
- dApp developers can build their prefer sequencer by setting up a sequencer service, or employ third-party sequencing service like Metis.
-
Wasm Executor:
- The core component of the ZKCross framework, consisting of:
- Wasm runtime: The module that load and execute the application logic compiled from the Application's logic code.
- Host SDK: The software development kit that provides the necessary tools and interfaces (library functions for signing, hashing, etc.) to interact with the WASM modules and other components.
- It processes the compiled application logic and manages interactions with the State and Prover Service.
- The core component of the ZKCross framework, consisting of:
-
Prover (zkWASM/zkVM):
- A module that interact with zkProving network to generate zero-knowledge proofs.
- Collect tracing information from Wasm Executor.
- Batch zkProofs produced by zkPoving network and construct txData to call on-chain smartcontract for settlement.
-
Services:
- ZKCross leverage Data Avail service for storing raw transactions and zkProofs.
- StateDB to manages the state of the application, ensuring that all changes are tracked and verifiable.
- Proving network for producing zkero-knowledge proofs.
Code Sample:
We provide some sample of codes in this repository, to help developers build their provable and trustless applications.