From 89ccc1c1e87eb59a1e0df5737fe997e72da9893f Mon Sep 17 00:00:00 2001 From: Artem Storozhuk Date: Thu, 20 Jun 2024 16:19:36 +0100 Subject: [PATCH] chore: SP1 -> Sphinx renaming in Solidity assets --- .../assets/{ISP1Verifier.txt => ISphinxVerifier.txt} | 9 ++++----- .../{SP1MockVerifier.txt => SphinxMockVerifier.txt} | 11 +++++------ .../assets/{SP1Verifier.txt => SphinxVerifier.txt} | 11 +++++------ recursion/gnark-ffi/src/plonk_bn254.rs | 12 ++++++------ sdk/src/artifacts.rs | 4 ++-- 5 files changed, 22 insertions(+), 25 deletions(-) rename recursion/gnark-ffi/assets/{ISP1Verifier.txt => ISphinxVerifier.txt} (72%) rename recursion/gnark-ffi/assets/{SP1MockVerifier.txt => SphinxMockVerifier.txt} (73%) rename recursion/gnark-ffi/assets/{SP1Verifier.txt => SphinxVerifier.txt} (83%) diff --git a/recursion/gnark-ffi/assets/ISP1Verifier.txt b/recursion/gnark-ffi/assets/ISphinxVerifier.txt similarity index 72% rename from recursion/gnark-ffi/assets/ISP1Verifier.txt rename to recursion/gnark-ffi/assets/ISphinxVerifier.txt index 4298f4b8c..f9563b688 100644 --- a/recursion/gnark-ffi/assets/ISP1Verifier.txt +++ b/recursion/gnark-ffi/assets/ISphinxVerifier.txt @@ -1,11 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.25; -/// @title SP1 Verifier Interface -/// @author Succinct Labs -/// @notice This contract is the interface for the SP1 Verifier. -interface ISP1Verifier { - /// @notice Returns the version of the SP1 Verifier. +/// @title Sphinx Verifier Interface +/// @notice This contract is the interface for the Sphinx Verifier. +interface ISphinxVerifier { + /// @notice Returns the version of the Sphinx Verifier. function VERSION() external pure returns (string memory); /// @notice Verifies a proof with given public values and vkey. diff --git a/recursion/gnark-ffi/assets/SP1MockVerifier.txt b/recursion/gnark-ffi/assets/SphinxMockVerifier.txt similarity index 73% rename from recursion/gnark-ffi/assets/SP1MockVerifier.txt rename to recursion/gnark-ffi/assets/SphinxMockVerifier.txt index bf938718b..ccd597dc7 100644 --- a/recursion/gnark-ffi/assets/SP1MockVerifier.txt +++ b/recursion/gnark-ffi/assets/SphinxMockVerifier.txt @@ -1,18 +1,17 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.25; -import {ISP1Verifier} from "./ISP1Verifier.sol"; +import {ISphinxVerifier} from "./ISphinxVerifier.sol"; -/// @title SP1 Mock Verifier -/// @author Succinct Labs -/// @notice This contracts implements a Mock solidity verifier for SP1. -contract SP1MockVerifier is ISP1Verifier { +/// @title Sphinx Mock Verifier +/// @notice This contracts implements a Mock solidity verifier for Sphinx. +contract SphinxMockVerifier is ISphinxVerifier { function VERSION() external pure returns (string memory) { return "TODO"; } /// @notice Verifies a mock proof with given public values and vkey. - /// @param proofBytes The proof of the program execution the SP1 zkVM encoded as bytes. + /// @param proofBytes The proof of the program execution the Sphinx zkVM encoded as bytes. function verifyProof( bytes32, bytes memory, diff --git a/recursion/gnark-ffi/assets/SP1Verifier.txt b/recursion/gnark-ffi/assets/SphinxVerifier.txt similarity index 83% rename from recursion/gnark-ffi/assets/SP1Verifier.txt rename to recursion/gnark-ffi/assets/SphinxVerifier.txt index f7389163e..685cdee16 100644 --- a/recursion/gnark-ffi/assets/SP1Verifier.txt +++ b/recursion/gnark-ffi/assets/SphinxVerifier.txt @@ -1,13 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.25; -import {ISP1Verifier} from "./ISP1Verifier.sol"; +import {ISphinxVerifier} from "./ISphinxVerifier.sol"; import {PlonkVerifier} from "./PlonkVerifier.sol"; -/// @title SP1 Verifier -/// @author Succinct Labs -/// @notice This contracts implements a solidity verifier for SP1. -contract SP1Verifier is PlonkVerifier { +/// @title Sphinx Verifier +/// @notice This contracts implements a solidity verifier for Sphinx. +contract SphinxVerifier is PlonkVerifier { function VERSION() external pure returns (string memory) { return "TODO"; } @@ -23,7 +22,7 @@ contract SP1Verifier is PlonkVerifier { /// @notice Verifies a proof with given public values and vkey. /// @param vkey The verification key for the RISC-V program. /// @param publicValues The public values encoded as bytes. - /// @param proofBytes The proof of the program execution the SP1 zkVM encoded as bytes. + /// @param proofBytes The proof of the program execution the Sphinx zkVM encoded as bytes. function verifyProof( bytes32 vkey, bytes memory publicValues, diff --git a/recursion/gnark-ffi/src/plonk_bn254.rs b/recursion/gnark-ffi/src/plonk_bn254.rs index 723688c1f..26ba0fcba 100644 --- a/recursion/gnark-ffi/src/plonk_bn254.rs +++ b/recursion/gnark-ffi/src/plonk_bn254.rs @@ -69,22 +69,22 @@ impl PlonkBn254Prover { build_plonk_bn254(build_dir.to_str().unwrap()); // Write the corresponding asset files to the build dir. - let sphinx_mock_verifier_path = build_dir.join("SP1MockVerifier.sol"); - let sphinx_mock_verifier_str = include_str!("../assets/SP1MockVerifier.txt"); + let sphinx_mock_verifier_path = build_dir.join("SphinxMockVerifier.sol"); + let sphinx_mock_verifier_str = include_str!("../assets/SphinxMockVerifier.txt"); let mut mock_verifier_file = File::create(sphinx_mock_verifier_path).unwrap(); mock_verifier_file .write_all(sphinx_mock_verifier_str.as_bytes()) .unwrap(); - let sphinx_verifier_path = build_dir.join("SP1Verifier.sol"); - let sphinx_verifier_str = include_str!("../assets/SP1Verifier.txt"); + let sphinx_verifier_path = build_dir.join("SphinxVerifier.sol"); + let sphinx_verifier_str = include_str!("../assets/SphinxVerifier.txt"); let mut sphinx_verifier_file = File::create(sphinx_verifier_path).unwrap(); sphinx_verifier_file .write_all(sphinx_verifier_str.as_bytes()) .unwrap(); - let interface_sphinx_verifier_path = build_dir.join("ISP1Verifier.sol"); - let interface_sphinx_verifier_str = include_str!("../assets/ISP1Verifier.txt"); + let interface_sphinx_verifier_path = build_dir.join("ISphinxVerifier.sol"); + let interface_sphinx_verifier_str = include_str!("../assets/ISphinxVerifier.txt"); let mut interface_sphinx_verifier_file = File::create(interface_sphinx_verifier_path).unwrap(); interface_sphinx_verifier_file diff --git a/sdk/src/artifacts.rs b/sdk/src/artifacts.rs index 81c4376d0..a858d6267 100644 --- a/sdk/src/artifacts.rs +++ b/sdk/src/artifacts.rs @@ -19,7 +19,7 @@ pub fn export_solidity_plonk_bn254_verifier(output_dir: impl Into) -> R } else { try_install_plonk_bn254_artifacts(true) }; - let verifier_path = artifacts_dir.join("SP1Verifier.sol"); + let verifier_path = artifacts_dir.join("SphinxVerifier.sol"); if !verifier_path.exists() { return Err(anyhow::anyhow!( @@ -29,7 +29,7 @@ pub fn export_solidity_plonk_bn254_verifier(output_dir: impl Into) -> R } std::fs::create_dir_all(&output_dir).context("Failed to create output directory.")?; - let output_path = output_dir.join("SP1Verifier.sol"); + let output_path = output_dir.join("SphinxVerifier.sol"); std::fs::copy(&verifier_path, &output_path).context("Failed to copy verifier file.")?; tracing::info!( "exported verifier from {} to {}",