Abstract
This paper investigates the feasibility of achieving zero-knowledge verifiability for graph databases, enabling database owners to cryptographically prove the query execution correctness without disclosing the underlying data. Although similar capabilities have been explored for relational databases, their implementation for graph databases presents unique challenges. This is mainly attributed to the relatively large complexity of queries in graph databases. When translating graph queries into arithmetic circuits, the circuit scale can be too large to be practically evaluated. To address this issue, we propose to break down graph queries into more fine-grained, primitive operators, enabling a step-by-step evaluation through smaller-scale circuits. Accordingly, the verification with ZKP circuits of complex graph queries can be decomposed into a series of composable cryptographic primitives, each designed to verify a fundamental structural property such as path ordering or edge directionality. Especially, having noticed that the graph expansion (i.e., traversing from nodes to their neighbors along edges) operation serves as the backbone of graph query evaluation, we design the expansion centric operator decomposition. In addition to constructing circuits for the expansion primitives, we also design specialized ZKP circuits for the various attributes that augment this traversal. The circuits are meticulously designed to take advantage of PLONKish arithmetization. By integrating these optimized circuits, we implement ZKGraph, a system that provides verifiable query processing while preserving data privacy. Performance evaluation indicates that ZKGraph significantly outperforms naive in circuit implementations of graph operators, achieving substantial improvements in both runtime and memory consumption.
Introduction
Graph databases are essential for analyzing interconnected data in sensitive domains like finance (fraud detection) and social networks. However, users often face a dilemma: they need to trust that the server's query results are accurate, but the server cannot show the raw data due to privacy concerns. Zero-Knowledge Proofs (ZKP) offer a solution, but they are notoriously difficult to apply to graphs. Standard ZKP "circuits" are static and data-independent, whereas graph algorithms are inherently dynamic, involving unpredictable loops and irregular memory access. A "naive" translation of a graph algorithm into a ZKP circuit results in a "circuit explosion," where the proof becomes too large and slow to be useful.
System Architecture and Methodology
The authors introduce ZKGraph, a system designed to bridge the gap between complex graph analytics and privacy-preserving cryptography. The core innovation is Expansion-Centric Operator Decomposition. Instead of trying to prove the entire execution trace of a complex algorithm, ZKGraph decomposes queries into fine-grained, composable primitives.
Key Methodological Components
- The Expansion Primitive: Most graph queries (reachability, shortest paths, neighborhood hops) are viewed as sequences of "expansions"—moving from a node to its neighbors.
- Property Verification: For complex tasks like Single-Source Shortest Path (SSSP), ZKGraph verifies that the result satisfies mathematical properties (e.g., the Bellman-Ford relaxation property) rather than proving every step of the algorithm's execution.
- PLONKish Arithmetization: Utilizing the Halo2 library, computations are represented as 2D tables, allowing for "custom gates" that efficiently handle specific graph operations.
- ZKP-Friendly Storage: The researchers found that standard optimizations like Compressed Sparse Row (CSR) are "ZKP-unfriendly" due to dynamic indexing requirements. ZKGraph utilizes an optimized Edge-List format to simplify circuit logic and reduce overhead.
Performance Evaluation
ZKGraph was evaluated using the LDBC Social Network Benchmark (SNB) on fact tables ranging from 60,000 to 180,000 edges.
The results demonstrate that ZKGraph significantly outperforms naive in-circuit implementations. For shortest path queries, it achieved a speedup of 1.8x to 17.4x and reduced memory consumption by 3.3x to 11.3x. While proof generation scales linearly with graph size, the verification time remains nearly constant at approximately 10ms, with proof sizes between 1.5KB and 6.2KB.
Conclusion
ZKGraph makes zero-knowledge proofs for graph databases practical and scalable by shifting the focus from algorithm execution to property verification via decomposed primitives. While proving overhead remains a challenge for real-time applications, the system provides a robust foundation for verifiable graph audits. Future work includes developing a compiler to automatically translate high-level graph languages like Cypher into these optimized ZK circuits.
Summary updated