实现 zkSNARK 的 C++ 库:libsnark
libsnark 是实现了 zkSNARK 模式的 C++ 库。zkSNARK 是一个证明/验证计算完整性的加密方法。
This library implements zkSNARK schemes, which are a cryptographic method for proving/verifying, in zero knowledge, the integrity of computations.
A computation can be expressed as an NP statement, in forms such as the following:
- "The C program foo, when executed, returns exit code 0 if given the input bar and some additional input qux."
- "The Boolean circuit foo is satisfiable by some input qux."
- "The arithmetic circuit foo accepts the partial assignment bar, when extended into some full assignment qux."
- "The set of constraints foo is satisfiable by the partial assignment bar, when extended into some full assignment qux."
A prover who knows the witness for the NP statement (i.e., a satisfying input/assignment) can produce a short proof attesting to the truth of the NP statement. This proof can be verified by anyone, and offers the following properties.
- Zero knowledge: the verifier learns nothing from the proof beside the truth of the statement (i.e., the value qux, in the above examples, remains secret).
- Succinctness: the proof is short and easy to verify.
- Non-interactivity: the proof is a string (i.e. it does not require back-and-forth interaction between the prover and the verifier).
- Soundness: the proof is computationally sound (i.e., it is infeasible to fake a proof of a false NP statement). Such a proof system is also called an argument.
- Proof of knowledge: the proof attests not just that the NP statement is true, but also that the prover knows why (e.g., knows a valid qux).
本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!