A small demo of running a homomorphic multiplication (using BFV) with Bonsai.
The FHE library and the example are here and here. The Risc0 zkVM template that was used to start this project is described here.
For this repo a fork of the FHE library is used which uses a compatible Rust version for the zkVM.
Init and update submodule:
git submodule init
git submodule update
To build all methods and execute the method within the zkVM, run the following command:
cargo run
To run in developer mode, without generating valid proofs (much faster):
RISC0_DEV_MODE=1 cargo run
If you have access to the URL and API key to Bonsai you can run your proofs
remotely. To prove in Bonsai mode, invoke cargo run
with two additional
environment variables:
BONSAI_API_KEY="YOUR_API_KEY" BONSAI_API_URL="BONSAI_URL" cargo run
- fhe.rs: https://github.com/tlepoint/fhe.rs
- Risc0 zkVM: https://github.com/risc0/risc0
- Bonsai access: https://bonsai.xyz/apply