Mopro App Development
This skill helps users create and develop mobile applications that use mopro for zero-knowledge proof generation and verification.
When to Use
- User wants to build a mobile app with ZK proofs
- User needs help integrating mopro bindings into an existing app
- User asks about platform-specific setup (Xcode, Android Studio, Flutter, RN)
- User wants to generate/verify proofs in their app code
- User encounters app integration errors
Related Skills
- mopro-project: If bindings don't exist yet, use to init + build first
- mopro-device: For running the app on simulators or physical devices
- mopro-test: For testing the integrated app
Prerequisite Check
Before proceeding, verify the user has an initialized mopro project with completed bindings. Check for:
Cargo.tomlcontainingmopro-ffi— if missing, direct tomopro init- At least one binding output directory (
MoproiOSBindings/,MoproAndroidBindings/,mopro_flutter_bindings/,MoproReactNativeBindings/, orMoproWasmBindings/) — if missing, direct tomopro build
Only proceed to app development once bindings exist.
Two Modes
Mode 1: Template (Quick Start)
Use mopro create to generate a starter app. This is the fastest path.
mopro create --framework <framework>
The template includes:
- Pre-configured project with mopro bindings
- Example proof generation/verification using default circuits
- Platform-specific boilerplate already set up
Mode 2: Custom Integration
For users who have an existing app or want to build from a description, guide them through manual integration:
- Copy bindings to their project
- Configure project settings (dependencies, build config)
- Write proof generation/verification code
- Handle circuit inputs and proof results
Platform Workflow
Regardless of platform, the integration follows this pattern:
- Copy bindings from the mopro build output to the app project
- Add dependencies (JNA for Android, flutter_rust_bridge for Flutter, etc.)
- Place circuit artifacts (.zkey, .bin, .json) as app assets
- Import bindings in app code
- Call prove/verify functions with circuit inputs
- Display results in the UI
Platform-Specific Guides
For detailed integration instructions, see the reference guides:
- iOS (Swift): references/ios-guide.md
- Android (Kotlin): references/android-guide.md
- Flutter (Dart): references/flutter-guide.md
- React Native (TypeScript): references/react-native-guide.md
- Web (JavaScript/WASM): references/web-guide.md
API Functions (Cross-Platform)
All platforms expose the same core functions with platform-specific naming:
Circom Proofs
generateCircomProof(zkeyPath, circuitInputs, proofLib) → ProofResult
verifyCircomProof(zkeyPath, proofResult, proofLib) → Boolean
Halo2 Proofs
generateHalo2Proof(name, srsKey, provingKey, input) → ProofResult
verifyHalo2Proof(name, srsKey, verifyingKey, proof) → Boolean
Circuit Input Format
All inputs are JSON strings with flat, one-dimensional arrays:
{"a": ["3"], "b": ["5"]}
Values are always string arrays, even for single values.
ProofLib Enum
Platform-specific casing:
- Swift:
ProofLib.arkworks - Kotlin:
ProofLib.ARKWORKS - React Native:
ProofLib.Arkworks - Dart:
ProofLib.arkworks
Custom App Generation
When the user describes an app they want to build (e.g., "a ZK voting app"), follow this process:
- Identify the circuit: What is being proved? (identity, vote, credential)
- Choose the platform: iOS, Android, Flutter, RN, or Web
- Start from template: Use
mopro createas the base - Modify the UI: Build the user-facing interface
- Wire up circuits: Connect the custom circuit inputs to the proof functions
- Add verification: Display proof status to the user
Always start from the mopro template and modify, rather than building from scratch.
Troubleshooting
For common app integration errors, see references/troubleshooting.md.
Key issues:
- Xcode signing/provisioning errors
- Android Gradle sync failures
- Missing jniLibs or .so files
- Circuit asset not found at runtime
- Flutter code shrinking breaking JNA