Skip to content

zkmopro/mopro-r0-example-app

Repository files navigation

RISC0 + Mopro Example App

Minimal Flutter template for RISC0 zkVM proof generation and verification on mobile devices using Mopro.

Note

For ECDSA (p256) example, please check https://github.com/moven0831/mopro-r0-ecdsa-app

Architecture

├── risc0-circuit/          # RISC0 zkVM circuit and host code
│   ├── src/main.rs         # Host program (proof generation)
│   └── methods/guest/      # Guest program (runs in zkVM)
├── mopro-r0-example-app/   # Mopro FFI bindings
│   ├── src/lib.rs          # UniFFI exports for mobile
│   └── flutter/            # Flutter app (cross platforms)
└── Cargo.toml              # Rust workspace configuration

App Demo

Mopro Risc0 Example App demo running live on Pixel 10 Pro.

Noir Wallet Connect Noir On-Chain Verification

Prerequisites

Install required tools:

# Install the latest Mopro CLI
git clone [email protected]:zkmopro/mopro.git
cd cli && cargo install --path .

# Install Flutter SDK
# See: https://flutter.dev/docs/get-started/install

# Verify installation
mopro --version
flutter --version

Quick Start

  1. Clone and setup:
git clone [email protected]:zkmopro/mopro-r0-example-app.git
cd mopro-r0-example-app/mopro-r0-example-app
  1. Build native bindings:
mopro build
  1. Update bindings:
mopro update
  1. Run Flutter app:
cd flutter
flutter pub get
flutter run

# Run `flutter emulator` to check available one if you want to run on PC first

Development Commands

Circuit Development

Currently the risc0 is basic template. You can write your risc0 program in risc0-circuit/. More more examples, please refers to risc0/examples.

risc0-circuit/: Contains a risc0 program

  • src/main.rs: Host code that generates proofs
  • methods/guest/src/main.rs: Guest code that runs inside zkVM
# Run RISC0 host program directly
cd risc0-circuit && cargo run

# Run with execution logs
RUST_LOG="[executor]=info" RISC0_DEV_MODE=1 cargo run

Mobile Development

For customizing your risc0 program with Mopro, you can refer to Mopro Docs.

mopro-r0-example-app/: FFI bindings and mobile integration

  • src/lib.rs: Exported functions for mobile apps
  • flutter/: Flutter template
# Run tests
cargo test      # Rust tests

# Rebuild after Rust changes
mopro build && mopro update

Acknowledgement

This work is highly inspired by https://github.com/ElusAegis/MobiScale

About

Minimal Flutter template for RISC0 zkVM + Mopro

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors