Abstract: Zero-Knowledge Proofs (ZKPs) are critical for privacy-preserving techniques and verifiable computation. Many ZKP protocols rely on key kernels such as the SumCheck protocol and Merkle Tree commitments to enable their key security properties. These kernels exhibit balanced binary tree computational patterns, which enable efficient hardware acceleration. Although prior work has investigated accelerating these kernels as part of an overarching ZKP protocol, exploiting this common tree pattern remains relatively underexplored. We conduct a systematic evaluation of these tree-based workloads under different traversal strategies, analyzing performance on multi-threaded CPUs and the Multifunction Tree Unit (MTU) hardware accelerator. We introduce a hardware-friendly Hybrid Traversal for binary tree that improves parallelism and scalability while significantly reducing memory traffic on hardware. Our results show that MTU achieves up to $1478\times$ speedup over CPU at DDR-level bandwidth and that our hybrid traversal outperforms breadth-first search by up to $3\times$. These findings offer practical guidance for designing efficient hardware accelerators for ZKP workloads with binary tree structures.
Introduction
Zero-Knowledge Proofs (ZKPs) allow a prover to convince a verifier of a statement's truth without revealing sensitive underlying data. While revolutionary for blockchain privacy and verifiable AI, the computational overhead of generating ZKPs remains a significant barrier to adoption. Modern protocols like HyperPlonk and Spartan rely heavily on two core mathematical structures: the SumCheck protocol and Merkle Tree commitments. Both share a common computational pattern: they operate on balanced binary trees.
The primary challenge in accelerating these kernels lies in the memory-parallelism trade-off of tree traversal. Breadth-First Search (BFS) is easy to parallelize but suffers from high memory traffic as it requires storing entire levels of the tree. Conversely, Depth-First Search (DFS) is memory-efficient but difficult to pipeline and parallelize effectively in hardware. Current accelerators often target specific ZKP steps like Number Theoretic Transforms (NTT), leaving these tree-based bottlenecks underexplored.
The Multifunction Tree Unit (MTU) Architecture
To address these challenges, we propose the Multifunction Tree Unit (MTU). The MTU is a specialized hardware accelerator composed of Processing Elements (PEs) equipped with modular arithmetic units (addition and multiplication) and SHA3 hashing engines.
The core innovation of the MTU is its Hybrid Traversal strategy, which optimizes data flow by partitioning the tree:
- Upper Levels (BFS): For the initial levels (Levels 1–3), the MTU employs a BFS-like approach. This groups nodes to match the high input rate of upstream data, keeping the hardware pipeline saturated and ensuring continuous indexing.
- Lower Levels (DFS): For deeper levels (Level 4+), the MTU switches to a DFS-based "Accumulator." This allows the hardware to process branches to completion, drastically reducing the need to write intermediate results back to off-chip memory.
Evaluation and Workloads
We evaluated the MTU using a cycle-accurate simulator, scaling from 2 to 32 PEs across various memory technologies (DDR4 to HBM). The architecture was tested against five representative ZKP computational workloads with a table size of $2^{20}$ entries:
- Build MLE: Generating multilinear extensions.
- MLE Evaluation: Evaluating polynomials at specific points.
- Multiplication Tree: Standard binary product trees.
- Product MLE: A variant requiring the output of all intermediate levels.
- Merkle Tree Commitment: Cryptographic hashing of data into a single root.
Key Results and Discussion
Our evaluation demonstrates that traversal strategy is the primary driver of performance on specialized hardware. While the difference between BFS and DFS is marginal on CPUs, BFS quickly becomes bandwidth-bound on accelerators, leaving PEs idle. The MTU's Hybrid Traversal mitigates this by matching the generation rate between levels, allowing the unit to accept 8 inputs per cycle while maintaining a steady stream for deeper DFS units.
Compared to a 32-thread Intel Xeon CPU, the 32-PE MTU achieved an average speedup of 1478× at DDR-level bandwidth. When paired with High Bandwidth Memory (HBM), the speedup reached 9440×, showing excellent scalability. The Hybrid Traversal specifically outperformed standard BFS by up to 3× by eliminating redundant memory traffic. Notably, the MTU maintains a compact footprint, occupying only 4.7 $mm^2$ in a 7nm process, making it an ideal sub-module for larger ZKP-on-a-chip designs.
Conclusion and Future Work
The MTU provides a scalable and efficient solution for the tree-shaped bottlenecks in ZKP generation. While highly effective for balanced binary trees, future work will explore adjustments for different tree arities (e.g., quaternary trees) and investigate the integration of the MTU into full system-on-chip (SoC) environments alongside MSM and NTT engines. Currently, the DFS component assumes input can be partitioned into disjoint subtrees; handling non-contiguous upstream data may require additional buffering strategies.
Summary updated