Affiliation:
1. Veridise, USA
2. Harvard University, USA / 0xparc, USA
3. Complutense University of Madrid, Spain
4. ZKonduit, USA
5. 0xparc, USA
Abstract
As zero-knowledge proofs gain increasing adoption, the cryptography community has designed domain-specific languages (DSLs) that facilitate the construction of zero-knowledge proofs (ZKPs). Many of these DSLs, such as Circom, facilitate the construction of arithmetic circuits, which are essentially polynomial equations over a finite field. In particular, given a program in a zero-knowledge proof DSL, the compiler automatically produces the corresponding arithmetic circuit. However, a common and serious problem is that the generated circuit may be underconstrained, either due to a bug in the program or a bug in the compiler itself. Underconstrained circuits admit multiple witnesses for a given input, so a malicious party can generate bogus witnesses, thereby causing the verifier to accept a proof that it should not. Because of the increasing prevalence of such arithmetic circuits in blockchain applications, several million dollars worth of cryptocurrency have been stolen due to underconstrained arithmetic circuits.
Motivated by this problem, we propose a new technique for finding ZKP bugs caused by underconstrained polynomial equations over finite fields. Our method performs semantic reasoning over the finite field equations generated by the compiler to prove whether or not each signal is uniquely determined by the input. Our proposed approach combines SMT solving with lightweight uniqueness inference to effectively reason about underconstrained circuits. We have implemented our proposed approach in a tool called
QED
2
and evaluate it on 163 Circom circuits. Our evaluation shows that
QED
2
can successfully solve 70% of these benchmarks, meaning that it either verifies the uniqueness of the output signals or finds a pair of witnesses that demonstrate non-uniqueness of the circuit. Furthermore,
QED
2
has found 8 previously unknown vulnerabilities in widely-used circuits.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Reference52 articles.
1. 2019. Tornado.cash got hacked. by Us.. https://tornado-cash.medium.com/tornado-cash-got-hacked-by-us-b1e012a3c9a8 2019. Tornado.cash got hacked. by Us.. https://tornado-cash.medium.com/tornado-cash-got-hacked-by-us-b1e012a3c9a8
2. Aleo. 2022. Leo code translates to invalid Aleo instruction code. https://github.com/AleoHQ/leo/issues/2042 Aleo. 2022. Leo code translates to invalid Aleo instruction code. https://github.com/AleoHQ/leo/issues/2042
3. A Certifying Compiler for Zero-Knowledge Proofs of Knowledge Based on Σ-Protocols
4. Aztec. 2022. Disclosure of recent vulnerabilities. https://hackmd.io/@aztec-network/disclosure-of-recent-vulnerabilities Aztec. 2022. Disclosure of recent vulnerabilities. https://hackmd.io/@aztec-network/disclosure-of-recent-vulnerabilities
5. aztec. 2022. Disclosure of recent vulnerabilities. https://hackmd.io/@aztec-network/disclosure-of-recent-vulnerabilities aztec. 2022. Disclosure of recent vulnerabilities. https://hackmd.io/@aztec-network/disclosure-of-recent-vulnerabilities
Cited by
6 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Specular: Towards Secure, Trust-minimized Optimistic Blockchain Execution;2024 IEEE Symposium on Security and Privacy (SP);2024-05-19
2. Scalable Verification of Zero-Knowledge Protocols;2024 IEEE Symposium on Security and Privacy (SP);2024-05-19
3. PP-CSA: Practical Privacy-Preserving Software Call Stack Analysis;Proceedings of the ACM on Programming Languages;2024-04-29
4. Split Gröbner Bases for Satisfiability Modulo Finite Fields;Lecture Notes in Computer Science;2024
5. Formal Verification of Zero-Knowledge Circuits;Electronic Proceedings in Theoretical Computer Science;2023-11-14