File tree Expand file tree Collapse file tree 9 files changed +42
-20
lines changed
Expand file tree Collapse file tree 9 files changed +42
-20
lines changed Original file line number Diff line number Diff line change 1- //! FIXME: add docstring
1+ //! # zkaleido-risc0-groth16-verifier
2+ //!
3+ //! This crate integrates RISC Zero-based Groth16 proof verification based on zkaleido traits.
4+
25use risc0_zkvm:: { Groth16Receipt , MaybePruned , ReceiptClaim } ;
36use sha2:: Digest ;
47use zkaleido:: { ProofReceipt , ZkVmResult } ;
Original file line number Diff line number Diff line change 1- //! FIXME: update docstring
1+ //! # zkaleido-risc0-guest-env
2+ //!
3+ //! This crate serves as the RISC Zero implementation of `ZkVmEnv`, enabling guest applications to
4+ //! interact with the host environment seamlessly by receiving inputs and committing outputs.
5+
26mod env;
37pub use env:: Risc0ZkVmEnv ;
Original file line number Diff line number Diff line change 1- //! # zkaleido-risc0-adapter
1+ //! # zkaleido-risc0-host
22//!
3- //! This crate integrates the [RISC Zero](https://www.risczero.com/) zero-knowledge proof
4- //! framework with the zkVM environment provided by [zkaleido](https://github.com/novifinancial/zkaleido).
5- //! It enables both the generation of RISC0 proofs and the verification of RISC0-based Groth16
6- //! proofs within a zkVM context.
7- //!
8- //! ## Features
9- //!
10- //! - **`prover`**: Enables proof generation via the RISC0 host and proof input builder. If you only
11- //! need to perform verification, you can disable this feature.
3+ //! This crate integrates the [RISC Zero](https://www.risczero.com/) zeroframework
4+ //! with the zkVM traits defined by [zkaleido](https://github.com/alpenlabs/zkaleido)
5+ //! on the host side.
6+
127mod host;
138mod input;
149mod proof;
Original file line number Diff line number Diff line change 1- //! FIXME: update here
1+ //! # zkaleido-sp1-groth16-verifier
2+ //!
3+ //! This crate integrates SP1-based Groth16 proof verification based on zkaleido traits.
4+
25use sp1_verifier:: { Groth16Verifier , GROTH16_VK_BYTES } ;
36use zkaleido:: { ProofReceipt , ZkVmError , ZkVmResult } ;
47
Original file line number Diff line number Diff line change @@ -23,4 +23,4 @@ sha2 = { workspace = true, optional = true }
2323
2424[features ]
2525zkvm-verify = [" sp1-zkvm/verify" , " sha2" ]
26- mock = []
26+ mock-verify = []
Original file line number Diff line number Diff line change @@ -38,11 +38,11 @@ impl ZkVmEnv for Sp1ZkVmEnv {
3838 if #[ cfg( feature = "zkvm-verify" ) ] {
3939 let pv_digest = Sha256 :: digest( public_values) ;
4040 verify_sp1_proof( vk_digest, & pv_digest. into( ) ) ;
41- } else if #[ cfg( feature = "mock" ) ] { }
41+ } else if #[ cfg( feature = "mock-verify " ) ] { }
4242 else {
4343 panic!(
4444 "No verification feature enabled. \
45- Please enable either `zkvm-verify` or `mock`."
45+ Please enable either `zkvm-verify` or `mock-verify `."
4646 ) ;
4747 }
4848 }
Original file line number Diff line number Diff line change 1- //! FIXME: update here
1+ //! # zkaleido-risc0-guest-env
2+ //!
3+ //! This crate serves as the SP1 implementation of `ZkVmEnv`, enabling guest applications to
4+ //! interact with the host environment seamlessly by receiving inputs and committing outputs.
5+ //!
6+ //! ## Features
7+ //!
8+ //! - **zkvm-verify**: Activates the SP1 proof recursive verification logic using the
9+ //! `sp1-zkvm/verify` adapter along with the `sha2` crate for cryptographic verification. When
10+ //! enabled, `verify_native_proof` computes a SHA256 digest of the public values and verifies the
11+ //! SP1 proof against the provided verification key digest.
12+ //!
13+ //! - **mock-verify**: Provides a no-op verification stub for testing purposes. When enabled, this
14+ //! feature bypasses the actual cryptographic verification.
15+ //!
16+ //! If neither feature is enabled, calling `verify_native_proof` will panic.
17+
218mod env;
319pub use env:: Sp1ZkVmEnv ;
Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ fn main() {
2525 build_args. features = {
2626 #[ cfg( feature = "mock" ) ]
2727 {
28- vec ! [ "mock" . to_string( ) ]
28+ vec ! [ "mock-verify " . to_string( ) ]
2929 }
3030 #[ cfg( not( feature = "mock" ) ) ]
3131 {
32- vec ! [ ]
32+ vec ! [ "zkvm-verify" . to_string ( ) ]
3333 }
3434 } ;
3535
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ zkaleido-sp1-guest-env = { path = "../../../adapters/sp1/guest" }
1111sp1-zkvm = "4.1.0"
1212
1313[features]
14- mock = ["zkaleido-sp1-guest-env/mock"]
14+ mock-verify = ["zkaleido-sp1-guest-env/mock-verify"]
15+ zkvm-verify = ["zkaleido-sp1-guest-env/zkvm-verify"]
1516
1617[patch.crates-io]
1718sha2-v0-10-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", branch = "patch-sha2-v0.10.8" }
You can’t perform that action at this time.
0 commit comments