Making client-side proving on mobile simple (and fast).
mopro-core
- core mobile Rust library.mopro-ffi
- wrapsmopro-core
and exposes UniFFI bindings.mopro-ios
- iOS CocoaPod library exposing native Swift bindings.mopro-android
- Android library exposing native Kotlin bindings.mopro-example-app
- example iOS app usingmopro-ios
.ark-zkey
- helper utility to make zkey more usable and faster in arkworks.
The following illustration shows how mopro and its components fit together into the wider ZKP ecosystem:
Zooming in a bit:
- Install cocoapods
To build bindings for iOS simulator debug mode, run
./scripts/build_ios.sh simulator debug
Open the mopro-ios/MoproKit/Example/MoproKit.xcworkspace
in Xcode.
To update bindings, run ./scripts/update_bindings.sh simulator|device debug|release
.
simulator
is for building library to run on iOS simulator,device
is for running on a real devicedebug
is for Rust library to be in debug mode andrelease
for release mode
- Install Android Studio
- Open Android Studio, and navigate to SDK Manager > SDK Tools > NDK (Side by Side) as laid out on the Android Developer site.
- Export
$ANDROID_HOME
and change{USER_NAME}
to your usernameexport ANDROID_HOME="/Users/{USER_NAME}/Library/Android/sdk"
- Locate which NDK version you have by
and set it to your
ls $ANDROID_HOME/ndk # 26.1.10909125
NDK_PATH
environment variable. e.g.NDK_PATH=$ANDROID_HOME/ndk/26.1.10909125
Reference: Running Rust on Android with UniFFI
To build bindings for android simulator debug mode, run
./scripts/build_android.sh arm64 debug
- Device types:
x86_64
,x86
,arm
,arm64
Check your device architecture here: https://doc.e.foundation/devices For Android Studio simulator (Pixel series), choosearm64
- Mode:
debug
,release
Join the Telegram group here.
Talk by @oskarth at ProgCrypto/Devconnect (Istanbul, November 2023): Slides (video pending)
Preliminary benchmarks on an iPhone 14 Max Pro:
- Keccak256 (150k constraints): 1.5s
- ~x10-20 faster vs comparable circuit in browser
- anon-aadhaar / RSA Verify: ~6.5s
- ~5s for witness generation (still in WASM), ~2s prover time
- 80% of time on witness generation
- ~x10 faster vs browser on phone
- Bottlenecks: loading zkey and wasm witness generation
This work is sponsored by a joint grant from PSE and 0xPARC.