MTZK: Testing and Exploring Bugs in Zero-Knowledge (ZK) Compilers
Dongwei Xiao, Zhibo Liu, Yiteng Peng, Shuai Wang
Abstract
—Zero-knowledge (ZK) proofs have been increasingly popular in privacy-preserving applications and blockchain systems. To facilitate handy and efficient ZK proof generation for normal users, the industry has designed domain-specific languages (DSLs) and ZK compilers. Given a program in ZK DSL, a ZK compiler compiles it into a circuit, which is then passed to the prover and verifier for ZK checking. However, the correctness of ZK compilers is not well studied, and recent works have shown that de facto ZK compilers are buggy, which can allow malicious users to generate invalid proofs that are accepted by the verifier, causing security breaches and financial losses in cryptocurrency. In this paper, we propose MTZK, a metamorphic testing framework to test ZK compilers and uncover incorrect compila-tions. Our approach leverages deliberately designed metamorphic relations (MRs) to mutate ZK compiler inputs. This way, ZK compilers can be automatically tested for compilation correctness using inputs and mutated variants without requiring manual intervention. We propose a set of design considerations and optimizations to deliver an efficient and effective testing framework. In the evaluation of four industrial ZK compilers, we successfully uncovered 21 bugs, out of which the developers have promptly patched 15. We also show possible exploitations of the uncovered bugs to demonstrate their severe security implications.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 8698b1e0-175c-49c7-b51b-2bc35fd61933Cited by top-tier papers7
- zkFuzz: Foundation and Framework for Effective Fuzzing of Zero-Knowledge CircuitsHideaki Takahashi, Jihwan Kim, Suman Jana, Junfeng YangS&P 2026 · 8 citations
- Arguzz: Testing zkVMs for Soundness and Completeness BugsChristoph Hochrainer, Valentin Wüstholz, Maria ChristakisUSENIX Security 2026 · 2 citations
- Divergence-Aware Testing of Graphics Shader Compiler Back-EndsDongwei Xiao, Shuai Wang, Zhibo Liu, Yiteng Peng et al.PLDI 2025 · 1 citation
- Testing and Understanding Deviation Behaviors in FHE-Hardened Machine Learning ModelsYiteng Peng, Daoyuan Wu, Zhibo Liu, Dongwei Xiao et al.ICSE 2025 · 1 citation
- MetaSpace: Metamorphic Testing for Spatial Cognition in Embodied AgentsGengyang Xu, Dongwei Xiao, Yiteng Peng, Shuai WangOOPSLA 2026
Builds on38
- Marlin: Preprocessing zkSNARKs with Universal and Updatable SRSAlessandro Chiesa, Yuncong Hu, Mary Maller, Pratyush Mishra et al.EUROCRYPT 2020 · 356 citations
- Testing Database Engines via Pivoted Query SynthesisManuel Rigger, Zhendong SuOSDI 2020 · 150 citations
- Random testing for C and C++ compilers with YARPGenVsevolod Livinskii, Dmitry Babokin, John RegehrOOPSLA 2020 · 140 citations
- Systematic Fuzzing and Testing of TLS LibrariesJuraj SomorovskyCCS 2016 · 136 citations
- DifuzzRTL: Differential Fuzz Testing to Find CPU BugsJaewon Hur, Suhwan Song, Dongup Kwon, Eunjin Baek et al.S&P 2021 · 126 citations
Related papers
- Metamorphic Testing of Secure Multi-party Computation (MPC) CompilersYichen Li, Dongwei Xiao, Zhibo Liu, Qi Pang et al.FSE 2024 · 5 citations
- Fuzzing Processing Pipelines for Zero-Knowledge CircuitsChristoph Hochrainer, Anastasia Isychev, Valentin Wüstholz, Maria ChristakisCCS 2025 · 1 citation
- Bounded Verification for Finite-Field-Blasting - In a Compiler for Zero Knowledge ProofsAlex Ozdemir, Riad S. Wahby, Fraser Brown, Clark W. BarrettCAV 2023 · 11 citations
- Metamorphic Shader Fusion for Testing Graphics Shader CompilersDongwei Xiao, Zhibo Liu, Shuai WangICSE 2023 · 12 citations
- Automated Verification of Consistency in Zero-Knowledge Proof CircuitsJon Stephens, Shankara Pailoor, Isil DilligCAV 2025 · 2 citations
