Abstract
Data analytics often faces a tension between transparency and privacy. Zero-Knowledge Proofs (ZKPs) offer a potential solution, but existing tools are either too low-level for analysts or too inefficient for complex computations. We present Zinnia, a tensor-oriented ZKP programming framework that combines a Python-like domain-specific language (DSL) with a symbolic execution engine. Zinnia bridges the gap between high-level data science and low-level cryptographic circuits, achieving significant performance gains—up to a 5.8× speedup over existing zero-knowledge virtual machines (zkVMs)—while maintaining high usability for data analysts.
Introduction: The Verifiability-Privacy Paradox
In modern data analytics, stakeholders often require proof that a computation was performed correctly on private data. However, privacy regulations or proprietary interests frequently prevent the sharing of raw datasets. While Zero-Knowledge Proofs (ZKPs) allow a prover to demonstrate the correctness of a result without revealing the underlying data, their adoption in data science has been hindered by a steep learning curve and performance bottlenecks.
Existing ZKP tools generally fall into two categories: low-level circuit domain-specific languages (cDSLs), which are difficult for non-cryptographers to use, and high-level zero-knowledge virtual machines (zkVMs), which suffer from extreme overhead due to CPU architecture emulation. Zinnia addresses these challenges by providing a high-level, tensor-oriented interface that compiles directly into optimized arithmetic circuits.
The Zinnia Framework
Zinnia introduces a full-stack approach to make ZKPs practical for data science through several key components:
1. Zinnia DSL and Symbolic Execution
The Zinnia DSL features a Pythonic syntax supporting multidimensional arrays, dynamic loops, and early exits. The core innovation lies in its Symbolic Execution Engine. Instead of executing code on concrete data, the compiler interprets it over symbolic values, exploring execution paths and merging data-dependent branches into a single, optimized intermediate representation (IR). This approach sidesteps the "path explosion" problem typically associated with symbolic execution by using conditional symbolic expressions.
2. Data Analytics and Circuit Synthesis
To support real-world analytics, Zinnia includes a specialized module for:
- Real-valued arithmetic: Utilizing quantization and fixed-point math to handle decimals within integer-based prime fields.
- Non-linear functions: Approximating functions such as
log,exp, andsinvia Taylor series. - Tensor Operations: Providing efficient implementations for array slicing, reshaping, and axis-wise aggregations.
The resulting optimized IR is backend-agnostic, allowing it to be synthesized into arithmetic circuits for various proving systems like Halo2 or Noir.
Evaluation and Results
Zinnia was evaluated across 25 programming tasks, including machine learning (K-Means, Linear Regression), LeetCode problems, and real-world data science tasks from the DS-1000 benchmark.
Performance and Efficiency
Zinnia demonstrates substantial improvements over state-of-the-art zkVMs (such as RISC0 and SP1), achieving at least a 5.8× speedup in proof generation time. Furthermore, the circuits generated by Zinnia are 19.3% smaller on average than those produced by existing high-level ZKP languages like Noir.
Usability
A user study involving six participants compared Zinnia to Cairo (a popular zkVM language). Participants using Zinnia completed tasks significantly faster and with higher accuracy, particularly when dealing with complex loops and tensor operations, highlighting the framework's accessibility for data analysts.
Conclusion and Future Work
Zinnia successfully balances usability and performance, offering a viable path for integrating ZKPs into standard data science workflows. While highly specialized tools may still outperform Zinnia on specific, hand-optimized tasks, its general-purpose expressiveness and backend portability make it a powerful tool for verifiable data analytics. Future work will focus on expanding support for richer data types (e.g., strings), advanced graph algorithms, and backend-specific optimizations to further close the performance gap with hand-tuned circuits.
Summary updated