Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: vkey hash #10

Merged
merged 10 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.