# Snarkjs-Circom Tuturial **Published by:** [lienhage](https://paragraph.com/@lienhage/) **Published on:** 2022-12-03 **URL:** https://paragraph.com/@lienhage/snarkjs-circom-tuturial ## Content 本文主要侧重于使用snarkjs和circom在工程上跑通Trusted setup以及由circom电路生成对应的solidity验证文件Verifier Phase 1:Power tau contributionsThird-party challengeApply a random beacon to finalize phase 1 of the trusted setupPhase 2:Create the circuitCompile the circuitSet up input and calculate the witnessGroth16 setup or PLONK setupCreate the proofTurn the verifier into a smart contractSimulate a verification call1. 依赖安装:snarkjs, circomnpm install -g snarkjs npm install -g circom snarkjs是zkSnark和PLONK方案的JavaScript和纯web Assembly实现,使用growth16协议和PLONK,包含了执行多方可信设置所需的工具。snarkjs需要与circom生成的电路配合使用 circom是零知识证明系统的电路编译器,关于其更多介绍,可以参考: http://kimiwublog.blogspot.com/2020/01/circom.html 工程上的snark可以分为两个步骤,这里作简单介绍:Trusted setupReference:https://github.com/iden3/snarkjs https://learnblockchain.cn/article/1078 ## Publication Information - [lienhage](https://paragraph.com/@lienhage/): Publication homepage - [All Posts](https://paragraph.com/@lienhage/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@lienhage): Subscribe to updates