@@ -4,7 +4,7 @@ use arbitrary::Arbitrary;
44use borsh:: { BorshDeserialize , BorshSerialize } ;
55use serde:: { Deserialize , Serialize } ;
66
7- use crate :: { ZkVmError , ZkVmResult } ;
7+ use crate :: { ZkVm , ZkVmError , ZkVmResult } ;
88
99/// Macro to define a newtype wrapper around `Vec<u8>` with common implementations.
1010macro_rules! define_byte_wrapper {
@@ -90,14 +90,17 @@ pub struct ProofReceipt {
9090 proof : Proof ,
9191 /// The public values associated with the proof.
9292 public_values : PublicValues ,
93+ /// ZKVM used to generate this proof
94+ zkvm : ZkVm ,
9395}
9496
9597impl ProofReceipt {
9698 /// Creates a new `ProofReceipt` from proof and it's associated public values
97- pub fn new ( proof : Proof , public_values : PublicValues ) -> Self {
99+ pub fn new ( proof : Proof , public_values : PublicValues , zkvm : ZkVm ) -> Self {
98100 Self {
99101 proof,
100102 public_values,
103+ zkvm,
101104 }
102105 }
103106
@@ -111,6 +114,11 @@ impl ProofReceipt {
111114 & self . public_values
112115 }
113116
117+ /// Returns the ZKVM used to generate the proof.
118+ pub fn zkvm ( & self ) -> & ZkVm {
119+ & self . zkvm
120+ }
121+
114122 /// Saves the proof to a path.
115123 pub fn save ( & self , path : impl AsRef < Path > ) -> ZkVmResult < ( ) > {
116124 bincode:: serialize_into ( File :: create ( path) . expect ( "failed to open file" ) , self )
@@ -181,9 +189,22 @@ impl VerifyingKeyCommitment {
181189}
182190
183191/// Enumeration of proof types supported by the system.
184- #[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
192+ #[ derive(
193+ Debug ,
194+ Clone ,
195+ Copy ,
196+ Default ,
197+ PartialEq ,
198+ Eq ,
199+ Serialize ,
200+ Deserialize ,
201+ BorshSerialize ,
202+ BorshDeserialize ,
203+ Arbitrary ,
204+ ) ]
185205pub enum ProofType {
186206 /// Represents a Groth16 proof.
207+ #[ default]
187208 Groth16 ,
188209 /// Represents a core proof.
189210 Core ,
0 commit comments