The scripts in this repository will not work without installing the dependencies.
To install, please run:
./install-deps.sh
To generate a sample prover and verifier key pair, run the following commands:
./trusted-setup.sh --local tmp
# ./trusted-setup.sh main sample_keypair
./create-proofs-for-testing.sh --local ./tmp/prover_key.zkey ./tmp
To generate a sample proof for the statement encoded in input-gen.py
, do the following.
First, make sure you have a proving key set up (see above).
Second, call the following script, where:
<keyless-circuit-branch>
is the branch of thekeyless-circuit
repo that contains the version of the circuit you want to use<proving_key_path>
is the path to the proving key.<output_dir>
is an optional output directory where theproof.json
andpublic.json
files will be created.
./create-proofs-for-testing.sh <keyless-circuit-branch> <proving_key_path> [<output_dir>]
For example, the command could be:
./create-proofs-for-testing.sh main ../aptos-keyless-trusted-setup-contributions/contributions/main_final.zkey
(Note: Here, we are assuming the main_final.zkey
proving key is in the aptos-keyless-trusted-setup-contributions repo, stored in the parent directory.)
This command will create two files in the current working directory:
- An
input.json
file containing the inputs to the circuit that are to be proved - A
proof.json
file containing the actual proof. - A
public.json
file containing the public inputs under which the proof verifies
Command:
circom -l . main.circom --r1cs
Output:
non-linear constraints: 1312453
linear constraints: 0
public inputs: 1
private inputs: 7123 (7033 belong to witness)
public outputs: 0
wires: 1282587
labels: 6162830