Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwen01 committed Oct 17, 2024
1 parent 440ef90 commit 849cdbe
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
19 changes: 19 additions & 0 deletions verifier/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
//! # Verifier
//!
//! This crate contains utilities for verifying SP1 Groth16 proofs on Solana.
//!
//! # Example
//! ```
//! use sp1_sdk::proof::SP1ProofWithPublicValues;
//! use sp1_solana::{verify_proof, GROTH16_VK_2_0_0_BYTES};
//!
//! let sp1_proof_with_public_values_file = "../proofs/fibonacci_proof.bin";
//! let sp1_proof_with_public_values =
//! SP1ProofWithPublicValues::load(&sp1_proof_with_public_values_file).unwrap();
//! let proof_bytes = sp1_proof_with_public_values.bytes();
//! let sp1_public_inputs = sp1_proof_with_public_values.public_values.to_vec();
//! let vkey_hash = "0x0083e8e370d7f0d1c463337f76c9a60b62ad7cc54c89329107c92c1e62097872";
//!
//! verify_proof(&proof_bytes, &sp1_public_inputs, &vkey_hash, &GROTH16_VK_2_0_0_BYTES).unwrap();
//! ```
use groth16_solana::groth16::Groth16Verifyingkey;
use sha2::{Digest, Sha256};

Expand Down
6 changes: 6 additions & 0 deletions verifier/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//! Utility functions for the SP1 Groth16 Solana verifier.
//!
//! This module contains functions for decompressing G1 and G2 points, as well as
//! for loading proofs into a form appropriate for verification. This is necessary to coerce
//! SP1 Groth16 proofs into the form expected by the `groth16_solana` crate.
use ark_bn254::{Fq, G1Affine};
use ark_ff::PrimeField;
use ark_serialize::CanonicalSerialize;
Expand Down

0 comments on commit 849cdbe

Please sign in to comment.