zk-snark-example 中文文档教程
zk-snark-example
这个存储库包含 snarkjs 演示,其中提供了一个简单的电路并使用 snarkjs 证明和生成验证密钥,然后使用这两个密钥,在 snarkjs 的帮助下生成并验证秘密信息的电路证明,而不会泄露秘密信息。
如何运行演示
要运行演示,请按照以下步骤操作
1. 生成密钥
生成证明者和验证者验证密钥运行以下命令
npm run keyGen
2. Prover
要生成证明,您需要使用以下命令运行证明程序
npm run prover
3. Verifier
要验证证明,您需要使用以下命令运行验证程序
npm run verifier
zk-snark-example
This repositry contains snarkjs demo, where a simple circuit is provided and using snarkjs proving & verification keys are generated and later using both keys and the circuit proof of secret information is generated and verified with the help of snarkjs without revealing the secret information.
How to run demo
To run demo please follow following steps
1. Generate Keys
To generate prover & verification keys run following command
npm run keyGen
2. Prover
To generate proof you need to run prover using following command
npm run prover
3. Verifier
To verify proof you need to run verifier using following command
npm run verifier