mopro
mopro copied to clipboard
Tachyon integration spike
Problem
For Groth16, we currently rely on wasm3 for witness generation and circom-compat for proof generation. There's circom-witness-rs which seems promising and would be roughly comparable with rapidsnark+witnesscalc.
Recently a new library has emerged, Tachyon, https://github.com/kroma-network/tachyon which seems promising and could lead to further performance gains. It seems useful to experimentally integrate this.
Currently it doesn't support mobile (Android or iOS), so this is the first step.
Details
See https://docs.google.com/spreadsheets/d/1irKg_TOP-yXms8igwCN_3OjVrtFe5gTHkuF0RbrVuho/edit#gid=289866675 for benchmarks @vivianjeng has done on MacOS.
First step here is to get Tachyon to work on iOS, which requires getting libgmpxx (libgmp for C++) and some other things to work. This is quite gnarly.
@vivianjeng has done a bunch of work to get this to compile and added to the https://github.com/zkmopro/benchmark benchmark app but not quite there.
See:
- https://github.com/vivianjeng/bazel-ios-app/tree/tachyon
- https://github.com/vivianjeng/tachyon
- https://github.com/vivianjeng/gmp-6.3.0
Acceptance criteria
Tachyon running on mobile real device with iOS.
Next steps
Once this is working, we want to integrate it with mopro. This would be better as a separate issue but here's a sketch of what it would likely involve:
- Adding a C header around C++ interface (currently this relies on some C++ template for curve etc)
- Using rust-bindgen to create a Rust shim layer for dealing with witness generation/proof generation
- Integrating it into mopro-core as a new adapter
- Exposing this in mopro-ffi and as template example app
(The same logic would apply to rapidsnark+witnesscalc).