#proving #mobile #client-side #zk #bindings-generator #input #mopro

mopro-ffi

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

3 releases

new 0.1.1 Feb 14, 2025
0.1.1-alpha.1 Dec 17, 2024
0.1.1-alpha.0 Feb 6, 2025
0.1.0 Jul 26, 2024

#12 in #proving

Download history 4/week @ 2024-12-04 76/week @ 2024-12-11 48/week @ 2024-12-18 135/week @ 2025-02-05

135 downloads per month

MIT/Apache

77KB
1.5K SLoC

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.

Dependencies

~10–20MB
~282K SLoC