BatchZK: A Fully Pipelined GPU-Accelerated System for Batch Generation of Zero-Knowledge Proofs

Tao Lu, Yuxun Chen, Zonghui Wang, Xiaohang Wang, Wenzhi Chen, Jiaheng Zhang

Introduction

Zero-Knowledge Proofs (ZKPs) are a cornerstone of modern privacy-preserving technologies, enabling a prover to validate the truth of a statement without exposing sensitive underlying data. However, the computational overhead of generating these proofs remains a significant barrier to widespread adoption, particularly in high-demand sectors like blockchain and Verifiable Machine Learning (VML).

While previous GPU-accelerated efforts have focused on minimizing the latency of individual proofs, BatchZK shifts the paradigm toward maximizing batch throughput. By prioritizing the number of proofs processed per second over the speed of a single proof, BatchZK addresses the industrial need for processing thousands or millions of proofs efficiently.

System Architecture and Modular Design

BatchZK moves away from traditional ZKP building blocks like Number Theoretic Transforms (NTT) and Multi-Scalar Multiplication (MSM), which are computationally expensive. Instead, it optimizes for modern, more efficient protocols based on the sum-check protocol, Merkle trees, and linear-time encoders.

Modular Prover Architecture in BatchZK

The system employs a modular architecture where the proof generation process is decomposed into specific stages. As shown in the architecture diagram, the "Prove" module is divided into three primary pillars:

  1. Linear-Time Encoders: Utilizing the Spielman encoder for efficient data representation.
  2. Merkle Trees: Serving as the commitment scheme.
  3. Sum-check Protocol: Handling the core algebraic verification.

Fully Pipelined Execution

The core innovation of BatchZK is its fully pipelined execution model. Rather than dedicating the entire GPU to a single proof task, the system divides the workload into stages handled by dedicated GPU kernels.

Fully Pipelined Execution Flow

As illustrated in the execution kernel diagram, multiple "trees" (proof tasks) are processed concurrently. As soon as a kernel completes its specific stage for one proof, it immediately begins work on the next proof in the batch. This keeps GPU threads continuously active, significantly reducing idle time and maximizing throughput. To manage resources, the authors manually balanced thread allocation across modules based on execution time ratios (roughly 35:12:113 for the encoder, Merkle tree, and sum-check modules, respectively).

Memory and Register Optimization

To handle large batches without exhausting GPU VRAM, BatchZK implements dynamic memory management. It loads data for only one proof at a time and uses multi-stream technology to overlap host-to-device data transfers with active computations. Furthermore, the system optimizes SHA-256 hashing—the bottleneck of Merkle tree generation—by forcing 32-bit data chunks into GPU registers, bypassing slower global or shared memory.

Key Results

BatchZK demonstrates transformative performance gains across various benchmarks:

  • Throughput: Achieved over 259.5× higher throughput than Bellperson, a leading GPU-accelerated ZKP system.
  • Verifiable Machine Learning: Generated 9.52 proofs per second for a VGG-16 model on the CIFAR-10 dataset, marking the first instance of sub-second proof generation in this field.
  • Efficiency: Compared to CPU-based Orion, BatchZK provided speedups of up to 793× for Merkle trees and 3823× for sum-check protocols.
  • Memory Footprint: Reduced device memory requirements by nearly 90% for large-scale proofs ($2^{22}$), enabling the processing of massive batches on standard hardware.

Conclusion

BatchZK proves that shifting the focus from latency to throughput is the key to scaling Zero-Knowledge Proofs for industrial applications. While the pipelined approach introduces a slight latency penalty for individual proofs, the massive gains in overall system capacity enable new use cases like real-time verifiable machine learning. Future work will focus on narrowing the latency gap while maintaining these unprecedented throughput levels.

Summary updated

BibTeX
@article{lu2024batchzk,
  author = {Tao Lu and Yuxun Chen and Zonghui Wang and Xiaohang Wang and Wenzhi Chen and Jiaheng Zhang},
  title = {{BatchZK: A Fully Pipelined GPU-Accelerated System for Batch Generation of Zero-Knowledge Proofs}},
  journal = {IACR ePrint},
  year = {2024},
}
Figure