Mopro is a toolkit for ZK app development on mobile. Mopro makes client-side proving on mobile simple.
To learn more about mopro, please refer to the documentation at zkmopro.
- Make sure you've installed the prerequisites.
- Getting started with this tutorial.
- circom
cd mopro-ffi cargo test --features circom
- halo2
cd mopro-ffi cargo test --features halo2
- circom-e2e
cd test-e2e curl -L https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar -o jna-5.13.0.jar CLASSPATH=jna-5.13.0.jar cargo test --test circom -- --nocapture
- halo2-e2e
cd test-e2e curl -L https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar -o jna-5.13.0.jar CLASSPATH=jna-5.13.0.jar cargo test --test halo2 -- --nocapture
Both native witness generation and proof generation are generally faster than snarkjs
in the browser, with potential speed improvements of up to 20 times.
Check the details here: performance.
Android (Samsung S23U) | snarkjs groth16 fullprove | mopro (rust-witness + ark-works) | witnesscalc + rapidsnark |
---|---|---|---|
Keccak256 | 11.388 s | 2.54 s (~4.4x) | 0.847 s (~13x) |
SHA256 | 3.672 s | 1.68 s (~2.1x) | 0.257 s (~14x) |
RSA | 17.4 s | 9.59 s (~1.8x) | 1.1 s (~16x) |
Semaphore | 2.22 s | 0.309 s (~7.1x) | 0.176 ms (~12x) |
Anon Aadhaar | 54.753 s | 35.955 s (~1.5x) | 3.759 s (~14x) |
iOS (iPhone 16 Pro) | snarkjs groth16 fullprove | mopro (rust-witness + ark-works) | witnesscalc + rapidsnark |
---|---|---|---|
Keccak256 | 5.329 s | 1.097 s (~5x) | 0.772 s (~7x) |
SHA256 | 1.578 s | 0.592 s (~2.6x) | 0.227 s (~6.9x) |
RSA | 9.584 s | 4.563 s (~2.1x) | 0.9 s (~10.6x) |
Semaphore | 1.079 s | 0.189 s (~5.7x) | 0.165 ms (~6.5x) |
Anon Aadhaar | 28.679 s | 12.171 s (~2.3x) | 3.416 s (~8.3x) |
The performance of the Mopro build is comparable to the native Halo2 build.
Circuits | Native (M1 Pro) | iPhone 15 Pro |
---|---|---|
Keccak256 | 10.3 s | 11.0 s |
RSA | 76.5 s | crashes |
This work was initially sponsored by a joint grant from PSE and 0xPARC. It is currently incubated by PSE.