Skip to content

Commit

Permalink
remove evm
Browse files Browse the repository at this point in the history
  • Loading branch information
ctian1 committed Oct 8, 2024
1 parent d261050 commit 63b1d10
Show file tree
Hide file tree
Showing 23 changed files with 15 additions and 437 deletions.
40 changes: 0 additions & 40 deletions .github/workflows/foundry-test.yml

This file was deleted.

10 changes: 0 additions & 10 deletions .gitmodules

This file was deleted.

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.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ resolver = "2"
sp1-sdk = "2.0.0"
sp1-zkvm = "2.0.0"
sp1-helper = "2.0.0"
alloy-sol-types = "0.7.7"
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"] }
Expand Down
34 changes: 2 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,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 @@ -79,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 }
15 changes: 7 additions & 8 deletions lib/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
use alloy_sol_types::sol;
use serde::{Deserialize, Serialize};

sol! {
/// The public values encoded as a struct that can be easily deserialized inside Solidity.
struct PublicValuesStruct {
uint32 n;
uint32 a;
uint32 b;
}
/// The public values encoded as a struct.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PublicValuesStruct {
pub n: u32,
pub a: u32,
pub b: u32,
}

/// Compute the n'th fibonacci number (wrapping around on overflows), using normal Rust code.
Expand Down
1 change: 0 additions & 1 deletion program/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ name = "fibonacci-program"
edition = "2021"

[dependencies]
alloy-sol-types = { workspace = true }
sp1-zkvm = { workspace = true }
fibonacci-lib = { workspace = true }
Loading

0 comments on commit 63b1d10

Please sign in to comment.