Skip to main content

developers-guide

Typical workflow

First, prepare the program and compile the core part(excutes logic of application) in WebAssembly, which can be used in any high-level programming language. This core program should be able to call the host functions provided in the zkcsdk (Zero-Knowledge Cryptography Software Development Kit) to interact with zkServices hosted in the fusion layer. Additionally, the core program should include the necessary logic for verification.

Next, load and run the core program in a web browser, cloud environment, or any other suitable environment. This allows users to play or interact with the core program while it is running in the selected environment.

Last, the part requires the interaction with layer 1 blockchains, dApps utilize the zkcsdk to generate a proof. This proof is then post to an on-chain zkproxy contract, which will initiate a callback for verification, settlement and other behaviors. The process triggers on-chain data modification, involving verification and settlement. The zk proofs required for this operation are automatically generated from the zkWasm prover network, relieving the developer from having to worry about the intricacies of zero-knowledge cryptography. Instead, the developer can focus on achieving on-chain verification and settlement.

How developers utilize ZKC product

In essence, the process can be broken down into two main steps:

  1. Development of Core Application Logic: Utilize programming languages such as C, C++, Rust, TypeScript, etc. to write the core logic of the application. This process should be done in conjunction with linking the ZKC libraries for certain ZKServices, such as VRT, State, and Shuffle. Once completed, compile this code into a WASM image.

  2. Integration with ZKCSDK API: This step involves two sub-tasks:

    • Deployment of WASM Image: Deploy the compiled WASM image, aggregate the execution trace (witness), and submit this data to the ZKCFusion layer. This process allows for the automatic generation of a ZKProof.

    • Settlement through ZKProxy Contract: Submit the generated ZKProof and any related information to the on-chain ZKProxy contract for settlement. For instance, this would apply in a scenario where a user has played a game and wishes to redeem their rewards or NFTs on-chain.