This repository contains Rust FFI bindings for the Gnark zero-knowledge proof library from Go. It has been extracted and adapted from the SP1 project (commit a80c17c66313918352b14561fbe5f12cc8416409).
This branch is for debugging the integration of icicle-gnark and GPU acceleration of groth16 recursive proofs.
The repository contains two main crates:
gnark-ffi
- Rust FFI bindings to the Gnark Go librarygnark-cli
- A command-line interface for interacting with the Gnark FFI bindings
You can also run the CLI using Docker:
docker build -t gnark-sandbox .
The test-data folder is not included in this repository and should be downloaded separately. It contains the necessary circuit definitions, witness data, and expected outputs for running tests and examples.
To obtain the test data:
- Download it from the official release page
- Extract it to the project root directory
- Ensure the folder is named 'test-data'
The test-data directory structure should contain:
groth16_circuit/
- Circuit definitions for Groth16 testsgroth16_output/
- Expected output files for verification- Additional test vectors and example inputs
# Show help
docker run gnark-sandbox --help
# Generate a Groth16 proof with test data
docker run --gpus all -v $(pwd)/test-data:/test-data gnark-sandbox prove --system groth16 /test-data/groth16_circuit /test-data/groth16_circuit/groth16_witness.json /test-data/groth16_output/proof.bin
The Docker container mounts the test-data directory from your local machine, allowing the container to access the necessary files and write the output back to your local filesystem.