mopro-ffi 0.1.1

Mopro is a toolkit for ZK app development on mobile. Mopro makes client-side proving on mobile simple.
Documentation

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.