zkmopro / mopro

Making client-side proving on mobile simple.
https://zkmopro.org
Apache License 2.0
131 stars 35 forks source link

Add instructions for how to prepare circuits #74

Open oskarth opened 9 months ago

oskarth commented 9 months ago

Problem

Right now using https://github.com/oskarth/mopro?tab=readme-ov-file#configure-settings for new circuits won't necessarily work out of the box.

We have to compile circuits, run trusted setup and generate arkzkey. This is done in prepare.sh for predefined circuits.

It'd be useful if this was documented. It might require tweaking some scripts too.

Details

https://github.com/oskarth/mopro/blob/main/scripts/prepare.sh

# Setup and compile complex-circuit
npm_install complex-circuit
compile_circuit complex-circuit complex-circuit-1000k-1000k.circom

# Run trusted setup for complex circuit
print_action "[core/circom] Running trusted setup for complex circuit..."
./scripts/trusted_setup.sh complex-circuit 21 complex-circuit-1000k-1000k

# Generate arkzkey for complex circuit
print_action "[core/circom] Generating arkzkey for complex circuit..."
./scripts/generate_arkzkey.sh complex-circuit complex-circuit-1000k-1000k