Skip to content
/ mopro Public

Making client-side proving on mobile simple.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

zkmopro/mopro

Repository files navigation

mopro

Crates.io

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.

Getting started

Run tests

  • 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

Performance

Circom

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.

Circuits snarkjs groth16 fullprove mopro (rust-witness + ark-works) witnesscalc + rapidsnark
Keccak256 8406.2 ms 1381.8 ms (~6x) 2792.6 ms (~3x)
SHA256 2537.6 ms 640.7 ms (~4x) 817.5 ms (~3.1x)
RSA 15.7 s 6.1 s (~2.5x) 3.1 s (~5x)
Semaphore 902 ms 257 ms (~3.5x) 347 ms (~2.5x)
Anon Aadhaar 26 s 17 s (~1.5x) 11 s (~2.3x)

Halo2

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

Community

  • X account:
  • Telegram group:

Acknowledgements

This work was initially sponsored by a joint grant from PSE and 0xPARC. It is currently incubated by PSE.