Skip to content

zkmopro/mopro-zkemail-nr

Repository files navigation

Noir with Mopro

This project demonstrates how to integrate a Noir circuit with the mopro CLI to generate platform bindings. See how to install mopro CLI: Getting started.

📚 Prepare Noir Circuits

  1. Compile your circuit using the Noir compiler to generate the bytecode and SRS files.

  2. Replace the existing srs.local and bytecode file in the example app with the newly generated ones.

Warning

The bytecode file only needs to be updated once in src/lib.rs. The srs.local file must be updated separately for each platform:

🔧 Build the Bindings

iOS

Run

mopro build

and select aarch64-apple-ios

Android

Activate android-compat feature in Cargo.toml.

- noir = { git = "https://github.com/zkmopro/noir-rs", features = ["barretenberg"] }
+ noir = { git = "https://github.com/zkmopro/noir-rs", features = ["barretenberg", "android-compat"] }

Run

mopro build

and select aarch64-linux-android

🔄 Manually Update Bindings

iOS

Copy the generated MoproiOSBindings directory into your iOS project:

cp -r MoproiOSBindings ios

Android

Copy the generated files into your Android project:

cp -r MoproAndroidBindings/uniffi android/app/src/main/java && \
cp -r MoproAndroidBindings/jniLibs android/app/src/main

React Native

Copy the generated files into your React Native project:

cp -r MoproiOSBindings react-native/modules/mopro/ios && \
cp -r MoproAndroidBindings/uniffi react-native/modules/mopro/android/src/main/java && \
cp -r MoproAndroidBindings/jniLibs react-native/modules/mopro/android/src/main

Flutter

Copy the generated files into your Flutter project:

cp -r MoproiOSBindings flutter/mopro_flutter_plugin/ios && \
cp -r MoproAndroidBindings/uniffi flutter/mopro_flutter_plugin/android/src/main/kotlin && \
cp -r MoproAndroidBindings/jniLibs flutter/mopro_flutter_plugin/android/src/main

📂 Open the project

Follow the instructions to open the development tools

iOS

open ios/MoproApp.xcodeproj

Android

open android -a Android\ Studio

React Native

cd react-native && npm install

For iOS simulator:

npm run ios

For iOS device:

npm run ios:device

For Android device/simulator:

npm run android

Flutter

  • Go to flutter directory

    cd flutter
  • Check flutter environment

    flutter doctor
  • Install Flutter Dependencies

    flutter pub get
  • Run the app (Please turn on emulators before running the command)

    flutter run

📊 Benchmarks

The following benchmarks were conducted on Apple M3 chips in release mode:

zkEmail Operation iOS, Time (ms) Android, Time (ms)
Proof Generation 1309 3826
Verification 962 2857

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •