generate-vk
Example
To verify the created proof, we first need to create a verification key. This can be done with:
co-noir create-vk --circuit test_vectors/poseidon/poseidon.json --crs test_vectors/bn254_g1.dat --hasher POSEIDON --vk test_vectors/poseidon/verification_key
Here, poseidon.json
is the circuit file from Noir, bn254_g1.dat
is the file storing the prover CRS, and the output is written to verification_key
. Again, --hasher POSEIDON
defines that Poseidon2 is used as the transcript hasher.
The corresponding Barretenberg command (from barretenberg/cpp/build/bin
) is:
bb write_vk_ultra_honk -b poseidon.json -o verification_key
Here, poseidon.json
is the circuit file from Noir. The output verification key is the same, regardless of using Co-Noir or Barretenberg.
Note: Barretenberg does not require the file for storing the CRS, since Barretenberg automatically downloads it if it is not present.
Reference
Create a verification key for the specified circuit
Usage: co-noir create-vk [OPTIONS]
Options:
--config <CONFIG> The path to the config file
--hasher <HASHER> The transcript hasher used for the proof [possible values: POSEIDON, KECCAK]
--circuit <CIRCUIT> The path to the circuit file, generated by Noir
--crs <CRS> The path to the prover crs file
--vk <VK> The output path to the verification key file
--recursive Generate a recursive proof
-h, --help Print help (see more with '--help')