Skip to content

Commit

Permalink
chore: SP1 -> Sphinx renaming in Solidity assets
Browse files Browse the repository at this point in the history
  • Loading branch information
storojs72 committed Jun 20, 2024
1 parent 092e842 commit bd4fceb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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";
}
Expand All @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions recursion/gnark-ffi/src/plonk_bn254.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bd4fceb

Please sign in to comment.