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

https://github.com/fuellabs/fuel-sp1

Implementation of fuel's proving games with the sp1 zkvm
https://github.com/fuellabs/fuel-sp1

Last synced: 8 months ago
JSON representation

Implementation of fuel's proving games with the sp1 zkvm

Awesome Lists containing this project

README

          

# fuel-sp1

## Install Dependencies

- Rust MSRV 1.85.0
```
rustup toolchain install 1.85.0
```

- sp1 toolchain
```
curl -L https://sp1up.succinct.xyz | bash
sp1up --version 4.1.3
```

## Repository structure

Since each proving game should have its own entrypoint, it lives as its own crate.
We have `fuel-proving-games-sp1` which aims to aggregate these and provides the following features -

1. If imported as a library, you may access helpers to generate and verify proofs for the associated proving game.
2. If executed as a binary, you may run proof generation & verification via CLI (upcoming).

## Run proving tests

```
cargo test -p fuel-proving-games-sp1 prove_all_fixtures_and_collect_report
```

Make sure you use the correct env vars for the specific prover.

For CUDA proving, use the following feature flag:
```
SP1_PROVER=cuda cargo test -p fuel-proving-games-sp1 prove_all_fixtures_and_collect_report --features cuda
```

see [here](https://docs.succinct.xyz/docs/sp1/generating-proofs/hardware-acceleration/cuda#usage) for cuda instructions specific to sp1.

## Run execution tests

```
cargo test -p fuel-proving-games-sp1 run_all_fixtures_and_collect_report
```

## Integration example

Using the default prover configured via SP1_PROVER env var,

```rs
use fuel_proving_games_sp1::block_execution_game::defaults;
use fuel_proving_games_sp1::block_execution_game::common::ProvingMode;

fn main() {
let prover = defaults::game_prover();
let input = /* some input */;
let (proof, vk) = prover.prove(&input, ProvingMode::Groth16).unwrap(); // or Plonk / Core
prover.verify(&proof, &vk).unwrap();
}
```