Mopro (Mobile Prover) 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.
This repository contains the following components:
Package | Version | Description |
---|---|---|
mopro-ffi |
|
Uses UniFFI to generate bindings for ZK provers (currently: Circom, Halo2, and Noir). It includes build scripts that eliminate the need for manual setup when integrating with iOS and Android. |
mopro-wasm | WIP | Uses wasm-bindgen to generate bindings for web environments, with rayon support for parallel performance. It includes a build script to streamline ZK integration for WASM projects. |
mopro-cli |
|
A command-line tool that makes it easy to scaffold ZK projects using selected proving systems and target platforms. Currently supports: Swift (Xcode), Kotlin (Android Studio), React Native, Flutter and Web. |
circom-prover |
|
A Rust-based Groth16 prover for Circom. It supports multiple witness generators (rust-witness, witnesscalc, and circom-witnesscalc) and provers (arkworks, rapidsnark). It is designed to work across devices including desktop, iOS, and Android. |
test-e2e | End-to-end test examples for verifying integrations between mopro-ffi and mopro-wasm. | |
docs | The source for zkmopro.org, containing up-to-date documentation. |
All tasks related to the Mopro implementation are public. You can track their progress, statuses, and additional details in the Mopro Kanban.
To get started with building a mobile app using Mopro, check out the Getting Started guide and ensure youβve installed all required prerequisites.
Clone this repository:
git clone https://github.com/zkmopro/mopro.git
Run Rustfmt to automatically format the code.
cargo fmt --all
Run rust-clippy to catch common mistakes and improve your Rust code.
cargo clippy --all-targets --all-features
To test all witness generators and proof generators:
cd circom-prover
cargo test --all-features
To run specific witness generator or proof generator
cd circom-prover
cargo test --features witnesscalc --features rapidsnark
Important
To learn more about circom-prover
, please visit circom-prover
-
To test for circom adapter
cd mopro-ffi cargo test --features circom
-
To test for halo2 adapter
cd mopro-ffi cargo test --features halo2
-
To test for noir adapter
cd mopro-ffi cargo test --features noir --release
Important
To learn more about mopro-ffi
, please visit mopro-ffi
To test the wasm bindings with wasm-pack test
wasm-pack test --chrome --headless -- --all-features
Important
To learn more about mopro-wasm
, please visit mopro-wasm
To install the CLI
cd cli
cargo install --path .
Important
To learn more about mopro-cli
, please visit cli
-
Update bindings for iOS e2e app
cargo run --bin ios
or
mopro build # with mopro CLI
and choose
iOS
. -
To test for iOS e2e app
cd test-e2e open ios/mopro-test.xcodeproj
Then choose an iOS simulator to run on.
Or you can use xcodebuild and choose an iOS simulator to run the test.
xcodebuild -project ./test-e2e/ios/mopro-test.xcodeproj \ -scheme mopro-test \ -destination 'platform=iOS Simulator,name=iPhone 15' \ test CODE_SIGN_IDENTITY="" \ CODE_SIGNING_REQUIRED=NO \ -maximum-parallel-testing-workers 1
-
Update bindings for Android e2e app
cargo run --bin android
or
mopro build # with mopro CLI
and choose
iOS
. -
To test for Android e2e app
cd test-e2e open android -a Android\ Studio
Similar to the iOS app, choose an Android emulatro to run on.
Or you can use
cd test-e2e/android ./gradlew connectedAndroidTest
to run on a connected emulator/device.
- Install dependencies
yarn
- Build for the website
yarn build
- Start a server
yarn start
Both native circom 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 for circom, halo2, and noir provers here: performance.
This work was initially sponsored by a joint grant from PSE and 0xPARC. It is currently incubated by PSE.
Important
We do not accept minor grammatical fixes (e.g., correcting typos, rewording sentences) unless they significantly improve clarity in technical documentation. These contributions, while appreciated, are not a priority for merging. If there is a grammatical error feel free to message the team.