An open API service indexing awesome lists of open source software.

https://github.com/zkmopro/mopro

Making client-side proving on mobile simple.
https://github.com/zkmopro/mopro

mobile zk

Last synced: 3 months ago
JSON representation

Making client-side proving on mobile simple.

Awesome Lists containing this project

README

          








Github license


GitHub Workflow test

Repository top language

Commitizen friendly







## Mopro: ZK Toolkit for Mobile

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

📖 To learn more about mopro, please refer to the documentation at [zkmopro](https://zkmopro.org/docs/intro).

## Repository Structure

This repository contains the following components:

Package
Version
Description




mopro-ffi








Uses UniFFI to generate bindings for ZK provers (currently: Circom, Halo2, and Noir). It includes build scripts that eliminate the need for manual setup when integrating with iOS and Android.





mopro-cli








A command-line tool that makes it easy to scaffold ZK projects using selected proving systems and target platforms. Currently supports: Swift (Xcode), Kotlin (Android Studio), React Native, Flutter and Web.





circom-prover








A Rust-based Groth16 prover for Circom. It supports multiple witness generators (rust-witness, witnesscalc, and circom-witnesscalc) and provers (arkworks, rapidsnark). It is designed to work across devices including desktop, iOS, and Android.





tests





End-to-end test examples for verifying integrations for mopro-ffi.





docs





The source for zkmopro.org, containing up-to-date documentation.


## 🎯 Mopro Kanban board

All tasks related to the Mopro implementation are public. You can track their progress, statuses, and additional details in the [Mopro Kanban](https://github.com/orgs/zkmopro/projects/1/views/3).

## 📱 Getting started

To get started with building a mobile app using Mopro, check out the [Getting Started](https://zkmopro.org/docs/getting-started/) guide and ensure you’ve installed all required [prerequisites](https://zkmopro.org/docs/prerequisites).

## 🛠 Install

Clone this repository:

```sh
git clone https://github.com/zkmopro/mopro.git
```

## 📜 Usage

### Code quality and formatting

Run [Rustfmt](https://github.com/rust-lang/rustfmt) to automatically format the code.

```sh
cargo fmt --all
```

Run [rust-clippy](https://github.com/rust-lang/rust-clippy) to catch common mistakes and improve your Rust code.

```sh
cargo clippy --all-targets --all-features
```

### `circom-prover`

To test all witness generators and proof generators:

```sh
cd circom-prover
cargo test --all-features
```

To run with specific witness generator and/or proof generator

```sh
cd circom-prover
cargo test --features witnesscalc --features rapidsnark
```

> [!IMPORTANT]
> To learn more about `circom-prover`, please visit [circom-prover](./circom-prover/README.md)

### `mopro-ffi`

To test the wasm bindings with `wasm-pack test`

```sh
wasm-pack test --chrome --headless -- --no-default-features --features wasm
```

> [!IMPORTANT]
> To learn more about `mopro-ffi`, please visit [mopro-ffi](./mopro-ffi/README.md)

### `mopro-cli`

To install the CLI

```sh
cd cli
cargo install --path .
```

> [!IMPORTANT]
> To learn more about `mopro-cli`, please visit [cli](./cli/README.md)

### `tests`

#### iOS

- Update bindings for iOS

```sh
cargo run --bin ios
```

or

```sh
mopro build # with mopro CLI
```

and choose `iOS`.

#### Android

- Update bindings for Android

```sh
cargo run --bin android
```

or

```sh
mopro build # with mopro CLI
```

and choose `Android`.

#### Flutter

- Update bindings for Flutter

```sh
cargo run --bin flutter --no-default-features --features flutter
```

or

```sh
mopro build # with mopro CLI
```

and choose `flutter`.

#### React Native

- Update bindings for React Native

```sh
cargo run --bin react_native
```

or

```sh
mopro build # with mopro CLI
```

and choose `react-native`.

#### Web

- Update bindings for wasm

```sh
cargo run --bin web --no-default-features --features wasm
```

or

```sh
mopro build # with mopro CLI
```

and choose `web`.

### docs

- Install dependencies
```sh
yarn
```
- Build for the website
```sh
yarn build
```
- Start a server
```sh
yarn start
```

## Performance

Both native circom witness generation and proof generation are generally faster than `snarkjs` in the browser, with potential speed improvements of up to 20 times.
Check the details for circom, halo2, and noir provers here: [performance](https://zkmopro.org/docs/performance).

## Community

- X account:
- Telegram group:

## Acknowledgements

This work was initially sponsored by a joint grant from [PSE](https://pse.dev/) and [0xPARC](https://0xparc.org/). It is currently incubated by PSE.

> [!IMPORTANT]
> We do not accept minor grammatical fixes (e.g., correcting typos, rewording sentences) unless they significantly improve clarity in technical documentation. These contributions, while appreciated, are not a priority for merging. If there is a grammatical error feel free to message the team.