mopro-ffi

Crates.iomopro-ffi
lib.rsmopro-ffi
version
sourcesrc
created_at2024-07-26 07:23:44.242437
updated_at2025-02-14 11:13:16.348133
descriptionMopro is a toolkit for ZK app development on mobile. Mopro makes client-side proving on mobile simple.
homepagehttps://zkmopro.org/
repositoryhttps://github.com/zkmopro/mopro
max_upload_size
id1315883
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Ya-wen, Jeng (vivianjeng)

documentation

https://zkmopro.org/

README

Mopro FFI

mopro-ffi is a tool designed to assist programmable cryptography application or rust application developers in efficiently creating bindings for client-side targets.

Key features include:

  • Function Serialization and Export: Enables serialization and export of functions within each proving system. To generate FFI bindings for different targets, inputs and outputs must conform to the specific types defined in uniffi.
    • Supported proving systems: circom, halo2.
  • Executable Binaries: Provides pre-built binaries, allowing developers to generate bindings for various targets effortlessly.
    • Supported targets: swift, kotlin.
  • Customize Exported Functions: Supports the ability to customize the exported functions. Users can define the functions in the src/mopro.udl file.

Usage

Usage for general Rust application

  • Integrate the mopro-ffi like the above tutorial.

  • Update the src/mopro.udl file to add the functions you want to export. Check out how to define the functions in UDL file: UniFFI: The UDL file

    • E.g. export Rust function like
      pub fn hello_world() -> String {
        "Hello World!".to_string()
      }
      
      and define the function in the UDL file like:
      namespace mopro {
        // ...
        string hello_world();
      }
      
  • Run cargo run --bin ios or cargo run --bin android again.

Community

Acknowledgements

This work was initially sponsored by a joint grant from PSE and 0xPARC. It is currently incubated by PSE.

Commit count: 596

cargo fmt