-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zk verifier contract interface compatible with risczero, succinct, ot…
…her zk-coprocessors we may support in the future
- Loading branch information
1 parent
0dc5733
commit 17faa2d
Showing
10 changed files
with
222 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//SPDX-License-Identifier: MIT | ||
pragma solidity >=0.8.0; | ||
|
||
interface IZKVerifier { | ||
// 51abd95c | ||
error Unknown_Zk_Coprocessor(); | ||
|
||
/** | ||
* @param zkCoprocessorType 0 - RiscZero, 1 - Succinct... etc. | ||
* @return this is either the IMAGE_ID for RiscZero Guest Program or | ||
* Succiinct Program Verifying Key | ||
*/ | ||
function programIdentifier(uint8 zkCoprocessorType) external view returns (bytes32); | ||
|
||
/** | ||
* @notice get the contract verifier for the provided ZK Co-processor | ||
*/ | ||
function zkVerifier(uint8 zkCoprocessorType) external view returns (address); | ||
|
||
/** | ||
* @param output - The output of the Guest program, this includes: | ||
* - VerifiedOutput struct | ||
* - RootCA hash | ||
* - TCB Signing CA hash | ||
* - Root CRL hash | ||
* - Platform or Processor CRL hash | ||
* @param proofBytes - abi-encoded tuple of: | ||
* - The ZK Co-Processor Type | ||
* - The encoded cryptographic proof (i.e. SNARK)). | ||
*/ | ||
function verifyAndAttestWithZKProof(bytes calldata output, bytes calldata proofBytes) | ||
external | ||
returns (bool success, bytes memory verifiedOutput); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.