Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI to generate iOS/Android bindings without creating rust project #366

Open
vivianjeng opened this issue Mar 13, 2025 · 0 comments
Open

Comments

@vivianjeng
Copy link
Collaborator

Problem

Now users need to go through mopro init, mopro build to generate MoproiOSBindings/MoproAndroidBindings
but if we just need bindings in existing projects (e.g. Anon Aadhaar)
we can have something like mopro bindgen to output just MoproiOSBindings/ MoproAndroidBindings

Details

mopro bindgen

  • platforms: ios/android
  • proving systems: circom/halo2
  • adapters: rust-witness/witnesscalc + arkworks/rapidsnark (could be an advanced feature)
  • input circuits dir: e.g.test-vectors/circom
  • (optional) output folder: e.g. ../AnonAadhaariOSBindings

Acceptance criteria

Without running mopro init and mopro build, just runnnig mopro bindgen to generate MoproiOSBindings/MoproAndroidBindings
so the mopro bindgen can be written as a shell script in e.g. anon-aadhaar-react-native
the shell script would be like

#!/bin/sh

# install CLI
git clone https://github.com/zkmopro/mopro
cd mopro/cli
cargo install --path .
cd ../..

# generate bindings
mopro bindgen --platform ios --prover circom --adapters witnesscalc,rapidsnark --keys test-vectors/circom --output AnonAadhaariOSBindings
mopro bindgen --platform android --prover circom --adapters witnesscalc,rapidsnark --keys test-vectors/circom --output AnonAadhaarAndroidBindings

# replace bindings
cp -r AnonAadhaariOSBindings/* ios/AnonAadhaariOSBindings/
cp -r AnonAadhaarAndroidBindings/uniffi/* android/src/main/java/uniffi
cp -r AnonAadhaarAndroidBindings/jniLibs/* android/src/main/jniLibs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant