Skip to content

Commit

Permalink
fix: vkey hash (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwen01 authored Oct 19, 2024
1 parent 8902b2b commit 082cff4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,16 @@ run_verify_instruction(groth16_proof).await;
3. Using the [`solana-program-test`](https://docs.rs/solana-program-test/latest/solana_program_test/) framework, send the `SP1Groth16Proof` to the
[`fibonacci-verifier-contract`](./example/program). This smart contract will verify the proof using the `sp1-solana`
crate against the fibonacci SP1 program vkey and print out the public inputs. Here is a snippet that demonstrates
how to perform the verification and read the public inputs on chain.
crate against the fibonacci SP1 program vkey and print out the public inputs.
> [!NOTE]
> In this example, a Groth16 proof and public values are directly passed into the contract as transaction data.
> In real use cases, this may not be reasonable, since the upper limit for transaction data is 1232 bytes.
> Groth16 proofs themselves are already 260 bytes, and public inputs can potentially be very large.
> See [this article](https://solana.com/developers/courses/program-optimization/lookup-tables) for a discussion
> on how to handle this.
Here is a snippet that demonstrates how to perform the verification and read the public inputs on chain.
```rust
// Derived by running `vk.bytes32()` on the program's vkey.
Expand Down
2 changes: 1 addition & 1 deletion example/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ entrypoint!(process_instruction);
/// let vkey_hash = vk.bytes32();
/// ```
const FIBONACCI_VKEY_HASH: &str =
"0x0083e8e370d7f0d1c463337f76c9a60b62ad7cc54c89329107c92c1e62097872";
"0x0054c0e58911dd8b993c6d8f249aa50a2e523114ec4b7ef9dd355c5f6bfbf3ce";

/// The instruction data for the program.
#[derive(BorshDeserialize, BorshSerialize)]
Expand Down
Binary file modified proofs/fibonacci_proof.bin
Binary file not shown.

0 comments on commit 082cff4

Please sign in to comment.