diff --git a/.env.example b/.env.example index 48913a1..5099d5f 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ # 'mock' for generating mock proofs locally, 'local' for generating proofs locally, 'network' for generating proofs using the proving network. SP1_PROVER=local # If using the proving network, set to your whitelisted private key. For more information, see: -# https://docs.succinct.xyz/prover-network/setup.html#key-setup -SP1_PRIVATE_KEY= \ No newline at end of file +# https://docs.succinct.xyz/docs/generating-proofs/prover-network/key-setup +NETWORK_PRIVATE_KEY= \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 5310932..be1c634 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1498,6 +1498,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" + [[package]] name = "downcast-rs" version = "1.2.1" @@ -1702,11 +1708,12 @@ version = "0.1.0" dependencies = [ "alloy-sol-types 0.7.7", "clap", + "dotenv", "fibonacci-lib", "hex", "serde", "serde_json", - "sp1-helper", + "sp1-build", "sp1-sdk", "tracing", ] @@ -4161,9 +4168,9 @@ dependencies = [ [[package]] name = "sp1-build" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a0466de2063deb545dba0723821df15e06992a05fce2981ee6334310f6ae0c" +checksum = "5e2e8eaf2d29f8e7170c1d901e7c0133399c7fe557aedea659f171a86f34a9f9" dependencies = [ "anyhow", "cargo_metadata", @@ -4174,9 +4181,9 @@ dependencies = [ [[package]] name = "sp1-core-executor" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2232f1fac622da63a98893bb6014cbc8169955355999a038d4c95b0fb18a41c9" +checksum = "386bdb534e0cf3643dd9dd67ed06933730913a03dd1ab0e64893cd969c1da57a" dependencies = [ "bincode", "bytemuck", @@ -4213,9 +4220,9 @@ dependencies = [ [[package]] name = "sp1-core-machine" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80bf55c47af18c3e4b369c0becd104883ef69f4bef23ce98854784247af9ae00" +checksum = "89881a2078d8e32933e9687a0f146e470842f3674f8a813524d80b7dc42eb7e9" dependencies = [ "bincode", "cbindgen", @@ -4270,9 +4277,9 @@ dependencies = [ [[package]] name = "sp1-cuda" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ab934478c06447ed2f5d069df063913ae6cd1b7d09efc4ceebcf95b609c1ad" +checksum = "8ef50ff96d561bb7e8a000ec35317863a517f7c68f9d1231e1483c4e93c174a1" dependencies = [ "bincode", "ctrlc", @@ -4287,9 +4294,9 @@ dependencies = [ [[package]] name = "sp1-curves" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c73ba59503249c055a44f97f895186ce6a429d856a50ac0938d4ccdeef966858" +checksum = "9b325b91b40643b36738a4abcdfde81ba8b158e04c3e1a2d94a1942df84e03c8" dependencies = [ "cfg-if", "dashu", @@ -4309,28 +4316,19 @@ dependencies = [ [[package]] name = "sp1-derive" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ca695c6394f4c1d7b1e7cbdddb306c62d6cad669b5ba815ff7b77699c072bd" +checksum = "0e0d6abd68038a6f688601cdd0cbec17b56f56e5d10e3f34f1a42bee8cc7ca2c" dependencies = [ "quote", "syn 1.0.109", ] -[[package]] -name = "sp1-helper" -version = "4.0.0-rc.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "082f02e10756d60a98a8bcc228a862f51e9a3601bcc4a0306d592103dd70a2f5" -dependencies = [ - "sp1-build", -] - [[package]] name = "sp1-lib" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4eb00d2fc1c7bcd56b926e8d335a2f9979932a957d05e4050ac0d9078231dbf" +checksum = "2378a017c2159e1ab89ed73ff797771ab8b00b11ee1d86852c00c2c9fabc76ce" dependencies = [ "bincode", "serde", @@ -4339,9 +4337,9 @@ dependencies = [ [[package]] name = "sp1-primitives" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08954e37cc693c59f6132db6f250b2d6b36d69a82827725ba2c00de1e8884d3f" +checksum = "dc7c741d8c2907ac96f71445ed8d7abb0fdbea115c6becbcbc7c35305068320c" dependencies = [ "bincode", "hex", @@ -4357,9 +4355,9 @@ dependencies = [ [[package]] name = "sp1-prover" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d4d59bef922b73b9b406c6bd39dcdfef66433beb04ec859b8f2bb19b6e5732c" +checksum = "82833ca900c54cd9f933560b433e56be97edd7322f8ec1654037e4326f3f6b7e" dependencies = [ "anyhow", "bincode", @@ -4400,9 +4398,9 @@ dependencies = [ [[package]] name = "sp1-recursion-circuit" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5d9ac385a59197465717c0687b04e6564a1d5d2e91459c61599a1902e7f720" +checksum = "4f0e78b19138ed445e02a2c69ae2115df6be3595bb464fc0e2ade550b7b9601a" dependencies = [ "hashbrown 0.14.5", "itertools 0.13.0", @@ -4434,9 +4432,9 @@ dependencies = [ [[package]] name = "sp1-recursion-compiler" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c792857d97ee7012814c7919d8b4b5ec3d78f0632debdca3f565fa4afe48c312" +checksum = "d6cd484565925bc9f10af6358ebe4f8a2193af635299725294a1ee8441854689" dependencies = [ "backtrace", "itertools 0.13.0", @@ -4456,9 +4454,9 @@ dependencies = [ [[package]] name = "sp1-recursion-core" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3cf090783787865fa2e123395309e0366256977c9aeb1f20c66455244dd95df" +checksum = "781a49a2ade18ebafc090070a3ce62854ee3aed802fe0f36074cd9984e9183ce" dependencies = [ "backtrace", "cbindgen", @@ -4499,9 +4497,9 @@ dependencies = [ [[package]] name = "sp1-recursion-derive" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b6b96b27d38b57e3c0541fa549016fe89c3fd8806b534dd37fe5df8e00adf1" +checksum = "5b8f0f802f8d5b1a3afca56c5b398c16a0382bef8969be8b9a3edc7b8e8b37be" dependencies = [ "quote", "syn 1.0.109", @@ -4509,9 +4507,9 @@ dependencies = [ [[package]] name = "sp1-recursion-gnark-ffi" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39677668adde207270b803d72f65d329acf7cace8167c7592d6fb3c3c991c9ab" +checksum = "ff5b4480f59b320bd25beaf3b19c0d3c9b60d140a99964805b18853a611a8eaf" dependencies = [ "anyhow", "bincode", @@ -4535,9 +4533,9 @@ dependencies = [ [[package]] name = "sp1-sdk" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5a369b012b852c0bbe13527573f13c7d3d7b5816221832c62bdd8b1024a5f6d" +checksum = "b47b98599a826c8d24976791495bc59c7d8be3af97a515cf5f7a7c3b02daa835" dependencies = [ "alloy-primitives 0.8.15", "alloy-signer", @@ -4583,9 +4581,9 @@ dependencies = [ [[package]] name = "sp1-stark" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fbf0a5d98aaa723ed3f675f1057eb674576dac85656aaeb37d9f15279abfdc" +checksum = "2a4779a915a218d668868fd6d11f6f225e6ec0033121345772214901edc8e9fa" dependencies = [ "arrayref", "hashbrown 0.14.5", @@ -4618,9 +4616,9 @@ dependencies = [ [[package]] name = "sp1-zkvm" -version = "4.0.0-rc.11" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "696fb397d323b05674a17044eb70478f30f786778d2e403de1ded0b14b0596f9" +checksum = "78c9380c49efdf34e6454a735922f794bb1d4b11114c302675087f110c207b56" dependencies = [ "cfg-if", "getrandom", diff --git a/README.md b/README.md index c662baf..504347e 100644 --- a/README.md +++ b/README.md @@ -65,15 +65,15 @@ inside Solidity. ### Retrieve the Verification Key -To retrieve your `programVKey` for your on-chain contract, run the following command: +To retrieve your `programVKey` for your on-chain contract, run the following command in `script`: ```sh -cargo prove vkey --program fibonacci-program +cargo run --release --bin vkey ``` ## 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). +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/docs/generating-proofs/prover-network). To get started, copy the example environment file: @@ -81,12 +81,12 @@ To get started, copy the example environment file: cp .env.example .env ``` -Then, set the `SP1_PROVER` environment variable to `network` and set the `SP1_PRIVATE_KEY` +Then, set the `SP1_PROVER` environment variable to `network` and set the `NETWORK_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: ```sh -SP1_PROVER=network SP1_PRIVATE_KEY=... cargo run --release --bin evm +SP1_PROVER=network NETWORK_PRIVATE_KEY=... cargo run --release --bin evm ``` diff --git a/contracts/lib/forge-std b/contracts/lib/forge-std index 1de6eec..726a6ee 160000 --- a/contracts/lib/forge-std +++ b/contracts/lib/forge-std @@ -1 +1 @@ -Subproject commit 1de6eecf821de7fe2c908cc48d3ab3dced20717f +Subproject commit 726a6ee5fc8427a0013d6f624e486c9130c0e336 diff --git a/contracts/lib/sp1-contracts b/contracts/lib/sp1-contracts index 1c4acae..0885c34 160000 --- a/contracts/lib/sp1-contracts +++ b/contracts/lib/sp1-contracts @@ -1 +1 @@ -Subproject commit 1c4acaeab86789995ae5c6baced66f81e4a57f4d +Subproject commit 0885c34b525708ed5f7e87a3d7b20c42564b4c00 diff --git a/contracts/src/fixtures/groth16-fixture.json b/contracts/src/fixtures/groth16-fixture.json index db32ddc..90f352a 100644 --- a/contracts/src/fixtures/groth16-fixture.json +++ b/contracts/src/fixtures/groth16-fixture.json @@ -2,7 +2,7 @@ "a": 6765, "b": 10946, "n": 20, - "vkey": "0x00467584e2e560847e9e96b5102c082f5e07155429c6622988799df9d95dbb47", + "vkey": "0x005aa1cbc05f992604b4f375159054d79b76501cf214b1fec6724ea14eceaf78", "publicValues": "0x00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000001a6d0000000000000000000000000000000000000000000000000000000000002ac2", - "proof": "0x090690900091bc3f08015e1ed96bee4e8c7a3ab074bfaa54129b1c63a9c6e478ec63255d3028cceaeed53e04bf0ee42f58ff0980ff00212e52a2a1d85b69b1268f5030820bc4589b0566e8a3f0738fa64405c10ee7347e58afbf4f1f431b327e5ba522c32f83c0c6e9e5bc37dfe2b31ae2bead89e0c7d8a0df1226b005d75f2e252b104a030d532c73f896df2328ce3322c055bda3b979dda22568ef85761b1d82bdcbec230f2838693d3663a0bd00006fa0f0dd4ea0e14b8b44273b0e8575e5478fa8d92a910cc26e0cdff4869f3fac686f91d245839368dbeadc9daaa4062ad1b3772523b284a3c41d60328f30461e03a465f4d6ec8d0fdfeeba176b8d0c7c82167c18" + "proof": "0x11b6a09d26e2118c306f7c64b4445c077f90764aaf4c3f0b5195ab76135914a2ba0e62be02216ef9ee42db956a50745c57dc6754a616995e6df07f027b32aafd83d9a9c30d129ff8fd534a67fe6a2fa1807f49e3045f8e85269fc90880da3a8063c45d500228c65c2772dd994f30db4ecb6745ab63ef7ea6e8b3ef6e9b600db7330b95c30a2ad71b04e752d8a045e15f803c3be01c0816f07823471294f204bc876d652f189720fa96d811da3e9d83acf730fef4da8bfd685530dd3867190e26e1ccf4d81b68ff5cf9bb36c36d522eac43653f7c3be5a3f022b680983fb04495633146062481a668712b472d6f18ac56f0eda3fedc9a5ee38d3679ef4aa4b3ea9e6208b7" } \ No newline at end of file diff --git a/contracts/src/fixtures/plonk-fixture.json b/contracts/src/fixtures/plonk-fixture.json index cbfaad2..664dadc 100644 --- a/contracts/src/fixtures/plonk-fixture.json +++ b/contracts/src/fixtures/plonk-fixture.json @@ -2,7 +2,7 @@ "a": 6765, "b": 10946, "n": 20, - "vkey": "0x00467584e2e560847e9e96b5102c082f5e07155429c6622988799df9d95dbb47", + "vkey": "0x005aa1cbc05f992604b4f375159054d79b76501cf214b1fec6724ea14eceaf78", "publicValues": "0x00000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000001a6d0000000000000000000000000000000000000000000000000000000000002ac2", - "proof": "0x54bdcae32122ba5d63ecb7d08cf7e217531928202417f27aa006e67ab53721eb386323bd1548e7a98de06f907d6067c9069866a6e8ca4a81a8553566abee9c2903efec8d0d3a52e9e717313d6fb5076bf3865cd8705a40b2613563b1d10f13adbeced54b179c997b00339169940341b4bb6ea21cd43992779b03e9a17fe6925f6273774e1b37fe45304344f3c66efee0b283cc6f8bb5d50e1f711d869080191284b5b93d10eafd8c57fab7d77ff15918e5e7fd93ed7ae6edc8629464aee148934e719c761e932ac3e956d05c70f9f2d2145c0b72f5e96127311b0b5ff805683091ec1f391beaffe65cf81e0613902331c700fcb0659c0c57e2f5d48d7e4eec04309060221f29322fc530473f367d34f38b47747afd4397acf8f75219ed6d393a468822b5152de3687df40b6ffebe49fbf0ceda8b54042283e454586875bb602b26a1175e165bdd7b6f29206896396e864904bb3cf5d375c84f311e5c557918dedccf27c30f43b11922ac6c9c0901634269de7d8ec9543ff834167149db30cd87b5c00c8d28cabf65079b6be84e5d013f514775e16d078215751f30547561ded0d2af784c0cbefb1fbd6149c09ed6eb0844265b1b0d038acd6b389cba9b3d6335e31567c706acf8cb896be0b70ce13eeb65990e69e29a48b85de56e2cda40d154034633f321f266a6af27e1adebe64e89a451bbeabb5fc0d9cf22c66c76710f599f39434b12f8ce865dda948710bed1755df69588eb5b0c21fb0f929b1bff7b7358c4cb1c271a65be960be28f2af49f3be51ddd6a4e552a3c1bb57204cd020d1057ae15602a43eb67628c5697ef5b181ded7e76a1f26997bca92ba31ef7337b63326a31cb1a13ec5b1d81605d83dbbf17f9699ebe3f2a2afa211dd09cf5de084d29ab28c212d9017f24ce6697e36d8c84b82970e1dedf5c74a821b73fce661c2a0bf1408f2c557c0e8962ad59cca1931cb276d3566e6f4a9411102cbf486c83aced09563d22a891e9abd3b6cee11963269c1f32f6131e97852584736ca8dbf7c6f9e34f660f79c2b9cd21515608ccc90af5e5689df83f623c08bc49284d93d4cfbf4ca60c2e2d8c1cb71195ac41b0788267d5af7092b421963519a1bb2e23774e7648344b19334175fa8031c8562bfb5209242b0a35282cbc7d05f96f4bf24318b6c37f0727f359fd9cf136abc923abbffc906a32cfb0e6d16ce61cc2d20748c2460f6844" + "proof": "0x1b34fe110b653a5bb2e727aacca6d4c9de41249fbd7586b9aa02af98399a3b3fd1666cec0c8473bae000e399aecaab29ecd01dcf66e08e638a7a7bae517ef9ed22be23df12c942a19b734fba23b60c1bbd9abca4f98c56dc118a0fc872ae921b54438e25185909e44fd21ab07cebba1de255741b72e8bad0620f05aebad4f765b1cbba112b4379c851beaac58afb53b98ff31dc9292c0163fdac2068608f197ff0be1c050857edec30d56a0373109031afc35e54b0b6383ee7944c8e3f1d08040fc0f5721fb16d8af362b7aff5855d2f6c4a843003a7b8020728114de8e4ef6dedbd532b1f7e65dbf48e8cc592cf8163f5de468e24e904d67b7ae3f58f7edc14fc38a60317b175cd23772ca939ffd13e9d7390cb4c811384d746fa874d4a84117c25c3ab2e124b51764997fefd97605bdfcf60f634bd0d3f47efb8d68ac077b8cac612bb15e2d52dc1662680acd46432e3415dbc936673a0060164f80d2a55d6e6a0eec709f763b91500f52ae86229b6f155aa7aa4a6350373b459027d959fbc8eeabc2d04a1e18f91b62d4094a6279def15868b9f01ed81be16b65e607f7eeb938c1018276c666be3300a1de112fbf3e3ebdf49c9daffab4711a11fecca183830639bbb1bfc81381e005f2c1d7702b2cc579719a32a2e8b8144cded8f19edb24ad709a01a49867454a0e9fe6253dbb04b4fd9484b2a2fa10fa974ff327b93ccf6f71a61061c2fd03794cb3badac3326b32467122480cf2810135832b89f8891248ff1c8035256d4e18515e1986d0995e6d945b02e88cace743fe19b86e7ac366c8448fb1dee3630fb6f57be5abded070ed4f04af597886e4d8f5188bcfb1d9fbca9f45b2223d5821917f386acf5ce74098e52f971257b5ad06039311e85f2bf4d3f6a7f300548634ba8c77666ad320f998cf42e6efa3fb84571959d055b394a7b9ede590ce87fda92632f6ece014fb9bd9b3ea3a919fc7139bc59003fa9f33a4342f46e2ca3d09e3d10af3d06906af1fea935bb06143d7525daa6a0cd5352d098d9af7c196d44286c029bf773f5dd8bcee23b60c44c2f7632224b880d4b856a9aaa0e832e2be26a5eb31a4f3697fdac727722eb76da934054937d29f44a01959fd571332a58e27cc753247c57817b338e30397fecff0fe609f6dae12cd54aae72a55ce60d46b7bb14ceba9b0e69f35be38547f7a3f71dbaea85459449daa1353f338fcf" } \ No newline at end of file diff --git a/contracts/test/Fibonacci.t.sol b/contracts/test/Fibonacci.t.sol index 9e065f1..b53bdd2 100644 --- a/contracts/test/Fibonacci.t.sol +++ b/contracts/test/Fibonacci.t.sol @@ -15,7 +15,50 @@ struct SP1ProofFixtureJson { bytes32 vkey; } -contract FibonacciTest is Test { +contract FibonacciGroth16Test is Test { + using stdJson for string; + + address verifier; + Fibonacci public fibonacci; + + function loadFixture() public view returns (SP1ProofFixtureJson memory) { + string memory root = vm.projectRoot(); + string memory path = string.concat(root, "/src/fixtures/groth16-fixture.json"); + string memory json = vm.readFile(path); + bytes memory jsonBytes = json.parseRaw("."); + return abi.decode(jsonBytes, (SP1ProofFixtureJson)); + } + + function setUp() public { + SP1ProofFixtureJson memory fixture = loadFixture(); + + verifier = address(new SP1VerifierGateway(address(1))); + fibonacci = new Fibonacci(verifier, fixture.vkey); + } + + function test_ValidFibonacciProof() public { + SP1ProofFixtureJson memory fixture = loadFixture(); + + vm.mockCall(verifier, abi.encodeWithSelector(SP1VerifierGateway.verifyProof.selector), abi.encode(true)); + + (uint32 n, uint32 a, uint32 b) = fibonacci.verifyFibonacciProof(fixture.publicValues, fixture.proof); + assert(n == fixture.n); + assert(a == fixture.a); + assert(b == fixture.b); + } + + function testFail_InvalidFibonacciProof() public view { + SP1ProofFixtureJson memory fixture = loadFixture(); + + // Create a fake proof. + bytes memory fakeProof = new bytes(fixture.proof.length); + + fibonacci.verifyFibonacciProof(fixture.publicValues, fakeProof); + } +} + + +contract FibonacciPlonkTest is Test { using stdJson for string; address verifier; diff --git a/program/Cargo.toml b/program/Cargo.toml index f2da863..24ce629 100644 --- a/program/Cargo.toml +++ b/program/Cargo.toml @@ -5,5 +5,5 @@ edition = "2021" [dependencies] alloy-sol-types = { workspace = true } -sp1-zkvm = "4.0.0-rc.11" +sp1-zkvm = "4.0.0" fibonacci-lib = { path = "../lib" } diff --git a/script/Cargo.toml b/script/Cargo.toml index 35a07ec..0c7e581 100644 --- a/script/Cargo.toml +++ b/script/Cargo.toml @@ -12,8 +12,12 @@ path = "src/bin/main.rs" name = "evm" path = "src/bin/evm.rs" +[[bin]] +name = "vkey" +path = "src/bin/vkey.rs" + [dependencies] -sp1-sdk = "4.0.0-rc.11" +sp1-sdk = "4.0.0" serde_json = { version = "1.0", default-features = false, features = ["alloc"] } serde = { version = "1.0.200", default-features = false, features = ["derive"] } clap = { version = "4.0", features = ["derive", "env"] } @@ -21,6 +25,7 @@ tracing = "0.1.40" hex = "0.4.3" alloy-sol-types = { workspace = true } fibonacci-lib = { path = "../lib" } +dotenv = "0.15.0" [build-dependencies] -sp1-helper = "4.0.0-rc.11" +sp1-build = "4.0.0" diff --git a/script/build.rs b/script/build.rs index bc5f025..7025fc6 100644 --- a/script/build.rs +++ b/script/build.rs @@ -1,4 +1,4 @@ -use sp1_helper::build_program_with_args; +use sp1_build::build_program_with_args; fn main() { build_program_with_args("../program", Default::default()) diff --git a/script/src/bin/main.rs b/script/src/bin/main.rs index 9ed23df..58f5771 100644 --- a/script/src/bin/main.rs +++ b/script/src/bin/main.rs @@ -35,6 +35,7 @@ struct Args { fn main() { // Setup the logger. sp1_sdk::utils::setup_logger(); + dotenv::dotenv().ok(); // Parse the command line arguments. let args = Args::parse(); diff --git a/script/src/bin/vkey.rs b/script/src/bin/vkey.rs new file mode 100644 index 0000000..e0de97a --- /dev/null +++ b/script/src/bin/vkey.rs @@ -0,0 +1,10 @@ +use sp1_sdk::{include_elf, HashableKey, Prover, ProverClient}; + +/// The ELF (executable and linkable format) file for the Succinct RISC-V zkVM. +pub const FIBONACCI_ELF: &[u8] = include_elf!("fibonacci-program"); + +fn main() { + let prover = ProverClient::builder().cpu().build(); + let (_, vk) = prover.setup(FIBONACCI_ELF); + println!("{}", vk.bytes32()); +} \ No newline at end of file