Skip to content

Commit 4f58684

Browse files
committed
docs: update docstring for each crate
1 parent 142f97d commit 4f58684

File tree

9 files changed

+42
-20
lines changed

9 files changed

+42
-20
lines changed

adapters/risc0/groth16-verifier/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
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+
25
use risc0_zkvm::{Groth16Receipt, MaybePruned, ReceiptClaim};
36
use sha2::Digest;
47
use zkaleido::{ProofReceipt, ZkVmResult};

adapters/risc0/guest/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
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+
26
mod env;
37
pub use env::Risc0ZkVmEnv;

adapters/risc0/host/src/lib.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
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+
127
mod host;
138
mod input;
149
mod proof;

adapters/sp1/groth16-verifier/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
//! FIXME: update here
1+
//! # zkaleido-sp1-groth16-verifier
2+
//!
3+
//! This crate integrates SP1-based Groth16 proof verification based on zkaleido traits.
4+
25
use sp1_verifier::{Groth16Verifier, GROTH16_VK_BYTES};
36
use zkaleido::{ProofReceipt, ZkVmError, ZkVmResult};
47

adapters/sp1/guest/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ sha2 = { workspace = true, optional = true }
2323

2424
[features]
2525
zkvm-verify = ["sp1-zkvm/verify", "sha2"]
26-
mock = []
26+
mock-verify = []

adapters/sp1/guest/src/env.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

adapters/sp1/guest/src/lib.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
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+
218
mod env;
319
pub use env::Sp1ZkVmEnv;

artifacts/sp1/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

artifacts/sp1/templates/Cargo.toml.tera

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ zkaleido-sp1-guest-env = { path = "../../../adapters/sp1/guest" }
1111
sp1-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]
1718
sha2-v0-10-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", branch = "patch-sha2-v0.10.8" }

0 commit comments

Comments
 (0)