zkp-android is an Android application that demonstrates Noir Zero-Knowledge Proof (ZKP) generation and verification. The project is built with the mopro toolchain, which generates cross-platform bindings from Rust source code to Kotlin (Android) via UniFFI and JNA.
All tooling is managed with devbox and the
Makefile. Enter the dev environment first:
devbox shellThen install the toolchain (srs_downloader, mopro-cli) and build the native
bindings:
devbox run setup # equivalent to: make setupDownload the SRS for each circuit and copy it into the Android assets:
Important
The app will not work without this step. Proof generation and verification require the structured reference string (SRS) for each circuit. The SRS files are large and are not committed to git, so you must download them yourself before running the app.
devbox run download-srs # equivalent to: make download-srsFinally, open the Android project in Android Studio:
studio android/After changing the Rust source, regenerate the Kotlin bindings:
mopro build --auto-update # build + copy into android/
# or, to copy existing bindings only:
mopro updateThe Noir circuits live in the zkp-pocs
submodule. To rebuild them and copy the compiled circuit JSON into this project
(both test-vectors/noir/ and android/app/src/main/assets/), run:
devbox run circuits # equivalent to: make circuitsThis initializes the submodule, runs devbox run circuits inside zkp-pocs
(which compiles the circuits), and copies the resulting *.json files into place.
Warning
After updating the circuits, the on-device proofs will fail. The proof inputs are hard-coded in the Android code, so a regenerated circuit no longer matches them. You must update the hard-coded inputs to match the new circuit before proofs will succeed again.
Run the Rust tests (the JNA jar is downloaded automatically if missing):
devbox run test # equivalent to: make test