DELPHINUS-ZKWASM
  • ZKWASM-Book
  • ZKWASM for beginners
    • Quick Start
      • Setup & Build the ZKWASM binary
      • Prepare WASM Image
      • Setup ZKWASM circuit
      • Prove WASM execution
      • Aggregate (Batch) proofs
    • Host(Builtin) Functions
      • IO Functions
      • State Related Functions
      • Poseidon Signature
  • Build a Rollup Application
    • Rollup Application Sketch
    • Writing ZKWASM Application
      • Debug Execution Trace Size of Your Code
    • Proof Generation Architectrue
      • Segment Proof Generation
      • Batch ZKWASM proofs
      • Continuation Proof of Segments
    • Build a Rollup Protocol
  • Circuit Design
    • ZKWASM Circuits
      • Guest Circut
      • Host Circuits.
      • Aggregation(Batch) Circuit
  • ZKWASM Cloud Service
    • Typescript SDK for connecting with ZKWASM cloud.
  • MISC Q&A
Powered by GitBook
On this page
  1. ZKWASM for beginners
  2. Quick Start

Aggregate (Batch) proofs

Suppose that we have generated a guest proof with its loading info and stored in the following directory.

.
├── Makefile
├── output.wasm
├── params
  ├── K22.params
  ├── testwasm.circuit.finalized.data
  └── testwasm.zkwasm.config
├── output
  ├── traces
  ├── testwasm.loadinfo.json
  ├── testwasm.0.transcript.data
  └── testwasm.0.instance.data

Also suppose the overall information of the proof is stored in the zkwasm.loadinfo.json which looks like the following

{
  "k": 18,
  "proofs": [
    {
      "circuit": "testwasm.circuit.finalized.data",
      "instance_size": 4,
      "witness": "testwasm.0.witness.json",
      "instance": "testwasm.0.instance.data",
      "transcript": "testwasm.0.transcript.data"
    }
  ],
  "param": "K18.params",
  "name": "testwasm",
  "hashtype": "Poseidon"
}

Here, for simplification, we use ZKWASM batcher to batch the above proof into a small one.

Suppose that your project directory is the following:

.
├── Makefile
├── output.wasm
├── params
  ├── K22.params
  ├── testwasm.circuit.finalized.data
  └── testwasm.zkwasm.config
├── output
  ├── traces
  ├── testwasm.loadinfo.json
  ├── testwasm.0.transcript.data
  └── testwasm.0.instance.data
  1. write a simple empty batch config batchconfig.json:

{
    "equivalents": [
    ],
    "expose": [
    ],
    "absorb": []
}
  1. clone the repo https://github.com/DelphinusLab/continuation-batcher

  2. run the continuation batcher in batch mode:

cargo run --release --features cuda -- --params ./params --output ./output batch -k 22 --challenge sha --info output/testwasm.loadinfo.json  --name proofbatch --commits batchconfig.json

This will generates a batch proof proofbatch.loadinfo.json and the file structure in your project becomse the following

├── Makefile
├── output.wasm
├── params
  ├── K22.params
  ├── proofbatch.circuit.data
  ├── proofbatch.vkey.data
  ├── testwasm.circuit.finalized.data
  └── testwasm.zkwasm.config
├── output
  ├── proofbatch.0.aux.data
  ├── proofbatch.0.instance.data
  ├── proofbatch.0.transcript.data
  ├── proofbatch.loadinfo.json
  ├── testwasm.loadinfo.json
  ├── testwasm.0.transcript.data
  └── testwasm.0.instance.data
PreviousProve WASM executionNextHost(Builtin) Functions

Last updated 7 months ago

Although the guest circuit proof is constant size, it is still big and its verify algorithm is a bit costy. In ZKWASM we have a structured layer of batching multi proofs into a simple small proof to reduce the cost of onchain verification. (Please refer to )

while the proofbatch.circuit.data is the verify circuit of the batcher and proofbatch.loadinfo.data describes the proof of the batching result. Since design a product ready rollup process is much more complicated than just batching a few proofs of a single circuit, please refer to for more details.

proof batch
advanced topics of building a rollup application