Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improvements + remove evm #35

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions .github/workflows/foundry-test.yml

This file was deleted.

8 changes: 0 additions & 8 deletions .gitmodules

This file was deleted.

3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"rust-analyzer.linkedProjects": [
"program/Cargo.toml",
"script/Cargo.toml"
"Cargo.toml",
],
"rust-analyzer.check.overrideCommand": [
"cargo",
Expand Down
4 changes: 1 addition & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,13 @@ members = [
resolver = "2"

[workspace.dependencies]
alloy-sol-types = "0.7.7"
sp1-sdk = "2.0.0"
sp1-zkvm = "2.0.0"
sp1-helper = "2.0.0"
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
serde = { version = "1.0", default-features = false, features = ["derive"] }
clap = { version = "4.0", features = ["derive", "env"] }
tracing = "0.1.40"
hex = "0.4.3"

fibonacci-lib = { path = "lib" }
45 changes: 5 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@ that can generate a proof of any RISC-V program.

## Running the Project

There are four main ways to run this project: build a program, execute a program, generate a core proof, and
generate an EVM-compatible proof.
There are three main ways to run this project: execute the program, generate a core proof, and
generate a Groth16 or PLONK proof.

### Build the Program

To build the program, run the following command:

```sh
cd program
cargo prove build
```
The program is automatically built through `script/build.rs` when the script is built.

### Execute the Program

Expand All @@ -42,35 +37,6 @@ cd script
cargo run --release -- --prove
```

### Generate an EVM-Compatible Proof

> [!WARNING]
> You will need at least 128GB RAM to generate a Groth16 or PLONK proof.

To generate a proof that is small enough to be verified on-chain and verifiable by the EVM:

```sh
cd script
cargo run --release --bin evm -- --system groth16
```

this will generate a Groth16 proof. If you want to generate a PLONK proof, run the following command:

```sh
cargo run --release --bin evm -- --system plonk
```

These commands will also generate fixtures that can be used to test the verification of SP1 zkVM proofs
inside Solidity.

### Retrieve the Verification Key

To retrieve your `programVKey` for your on-chain contract, run the following command:

```sh
cargo prove vkey --elf elf/riscv32im-succinct-zkvm-elf
```

## Using the Prover Network

We highly recommend using the Succinct prover network for any non-trivial programs or benchmarking purposes. For more information, see the [setup guide](https://docs.succinct.xyz/generating-proofs/prover-network.html).
Expand All @@ -84,9 +50,8 @@ cp .env.example .env
Then, set the `SP1_PROVER` environment variable to `network` and set the `SP1_PRIVATE_KEY`
environment variable to your whitelisted private key.

For example, to generate an EVM-compatible proof using the prover network, run the following
command:
To generate a proof, run the following command:

```sh
SP1_PROVER=network SP1_PRIVATE_KEY=... cargo run --release --bin evm
SP1_PROVER=network SP1_PRIVATE_KEY=... cargo run --release
```
15 changes: 0 additions & 15 deletions contracts/.gitignore

This file was deleted.

61 changes: 0 additions & 61 deletions contracts/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions contracts/foundry.toml

This file was deleted.

1 change: 0 additions & 1 deletion contracts/lib/forge-std
Submodule forge-std deleted from c28115
1 change: 0 additions & 1 deletion contracts/lib/sp1-contracts
Submodule sp1-contracts deleted from af1ae0
1 change: 0 additions & 1 deletion contracts/remappings.txt

This file was deleted.

44 changes: 0 additions & 44 deletions contracts/src/Fibonacci.sol

This file was deleted.

8 changes: 0 additions & 8 deletions contracts/src/fixtures/groth16-fixture.json

This file was deleted.

8 changes: 0 additions & 8 deletions contracts/src/fixtures/plonk-fixture.json

This file was deleted.

58 changes: 0 additions & 58 deletions contracts/test/Fibonacci.t.sol

This file was deleted.

Binary file modified elf/riscv32im-succinct-zkvm-elf
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ version = "0.1.0"
edition = "2021"

[dependencies]
alloy-sol-types = { workspace = true }
serde = { workspace = true }
Loading
Loading