pub struct PlonkVerifier;Expand description
A verifier for Plonk zero-knowledge proofs.
Implementations§
Source§impl PlonkVerifier
impl PlonkVerifier
Sourcepub fn verify(
proof: &[u8],
sp1_public_inputs: &[u8],
sp1_vkey_hash: &str,
plonk_vk: &[u8],
) -> Result<(), PlonkError>
pub fn verify( proof: &[u8], sp1_public_inputs: &[u8], sp1_vkey_hash: &str, plonk_vk: &[u8], ) -> Result<(), PlonkError>
Verifies an SP1 PLONK proof, as generated by the SP1 SDK.
§Arguments
proof- The proof bytes.public_inputs- The SP1 public inputs.sp1_vkey_hash- The SP1 vkey hash. This is generated in the following manner:
ⓘ
use sp1_sdk::ProverClient;
let client = ProverClient::new();
let (pk, vk) = client.setup(ELF);
let sp1_vkey_hash = vk.bytes32();plonk_vk- The Plonk verifying key bytes. Usually this will be the [static@crate::PLONK_VK_BYTES] constant.
§Returns
A success Result if verification succeeds, or a PlonkError if verification fails.
Sourcepub fn verify_gnark_proof(
proof: &[u8],
public_inputs: &[[u8; 32]],
plonk_vk: &[u8],
) -> Result<(), PlonkError>
pub fn verify_gnark_proof( proof: &[u8], public_inputs: &[[u8; 32]], plonk_vk: &[u8], ) -> Result<(), PlonkError>
Verifies a Gnark PLONK proof using raw byte inputs.
WARNING: if you’re verifying an SP1 proof, you should use [verify] instead.
This is a lower-level verification method that works directly with raw bytes rather than
the SP1 SDK’s data structures.
§Arguments
proof- The raw PLONK proof bytes (without the 4-byte vkey hash prefix)public_inputs- The public inputs to the circuitplonk_vk- The PLONK verifying key bytes
§Returns
A Result containing unit () if the proof is valid,
or a PlonkError if verification fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PlonkVerifier
impl RefUnwindSafe for PlonkVerifier
impl Send for PlonkVerifier
impl Sync for PlonkVerifier
impl Unpin for PlonkVerifier
impl UnwindSafe for PlonkVerifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more