Compile Circuit - Beginner
This option is for novice users.
This command sets up everything required to generate zk-SNARK proofs for a given circuit, automating the multi-step trusted setup process. Just type the below command, press enter and let the magic unfold!
py poseidon.py --init-setup circuit_name
π§ What it does:
Compiles the specified Circom file (
<circuit_name>
)Produces
.r1cs
,.wasm
, and.sym
files
Runs Trusted Setup (Powers of Tau + Phase 2)
Initializes a new ceremony if none exists
Contributes randomness
Prepares final
.zkey
proving key
Generates Keys:
proving_key.zkey
β for generating zk-proofsverification_key.json
β for verifying proofs
Ready for Proofs: After this, you're ready to run
--prove
and--verify
.
Expected Folder Layout
If everything went well your folder structure should look something similar to this,
poseidon/
βββ circom
βββ circomlib/ # Standard library for Circom components
βββ circuit1_js
βββ circuit1.wasm # WebAssembly file used to compute the witness
βββ generate_witness.js
βββ witness_calculator.js
βββ circuits/ # Where your .circom files go
β βββ circuit1.circom # A starter circuit with boilerplate
βββ circuit1_000.zkey # Final proving key used for generating zk-SNARK proofs
βββ circuit1_final.zkey
βββ circuit1.r1cs
βββ circuit1.sym # Symbol file used for debugging constraint errors
βββ pot10_0000.tau
βββ pot10_0001.tau
βββ pot10_final.tau # Finalized Powers of Tau file used in Phase 2
βββ requirements.txt
βββ poseidon.py
Last updated