zkStruDul: Programming zkSNARKs with Structural Duality
Rahul Krishnan, Ashley Samuelson, Emily Yao, Ethan Cecchetti
TL;DR
zkStruDul presents a compute-and-prove calculus that unifies input construction and predicate definition for zkSNARK systems, addressing the duplication and mismatch risks in conventional toolchains. By introducing a type-directed, label-based framework and a projection-based compiler, the approach extracts separate compute and prove procedures while enabling recursive proofs and layering on existing backends such as Circom or gnark. The authors formalize both an in-order source semantics and a projection semantics, prove their adequacy via a concurrent target semantics, and establish Robust Relational Hyperproperty Preservation for the compilation. Collectively, this yields a cleaner, more maintainable approach to building NIZK-based applications (e.g., Merkle proofs and zkVMs) with strong semantic guarantees and interoperability with existing cryptographic tooling.
Abstract
Non-Interactive Zero Knowledge (NIZK) proofs, such as zkSNARKS, let one prove knowledge of private data without revealing it or interacting with a verifier. While existing tooling focuses on specifying the predicate to be proven, real-world applications optimize predicate definitions to minimize proof generation overhead, but must correspondingly transform predicate inputs. Implementing these two steps separately duplicates logic that must precisely match to avoid catastrophic security flaws. We address this shortcoming with zkStruDul, a language that unifies input transformations and predicate definitions into a single combined abstraction from which a compiler can project both procedures, eliminating duplicate code and problematic mismatches. zkStruDul provides a high-level abstraction to layer on top of existing NIZK technology and supports important features like recursive proofs. We provide a source-level semantics and prove its behavior is identical to the projected semantics, allowing straightforward standard reasoning.
