Skip to content

Commit

Permalink
feat(dummy-range): Add dummy-range to vkey script (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani authored Dec 17, 2024
1 parent a61a798 commit 1b516bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions book/advanced/verify-binaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ cd programs/range
# Build the range-elf
cargo prove build --elf-name range-elf --docker --tag "v3.0.0"

cd programs/dummy-range
# Build the dummy-range-elf
cargo prove build --elf-name dummy-range-elf --docker --tag "v3.0.0"

cd ../aggregation
# Build the aggregation-elf
cargo prove build --elf-name aggregation-elf --docker --tag "v3.0.0"
Expand Down
Binary file removed elf/fault-proof-elf
Binary file not shown.
9 changes: 9 additions & 0 deletions scripts/utils/bin/vkey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use sp1_sdk::{utils, HashableKey, ProverClient};

pub const AGG_ELF: &[u8] = include_bytes!("../../../elf/aggregation-elf");
pub const RANGE_ELF: &[u8] = include_bytes!("../../../elf/range-elf");
pub const DUMMY_RANGE_ELF: &[u8] = include_bytes!("../../../elf/dummy-range-elf");

// Get the verification keys for the ELFs and check them against the contract.
#[tokio::main]
Expand All @@ -14,6 +15,7 @@ async fn main() -> Result<()> {

let prover = ProverClient::new();

let (_, dummy_range_vk) = prover.setup(DUMMY_RANGE_ELF);
let (_, range_vk) = prover.setup(RANGE_ELF);

// Get the 32 byte commitment to the vkey from vkey.vk.hash_u32()
Expand All @@ -24,6 +26,13 @@ async fn main() -> Result<()> {
multi_block_vkey_b256
);

let dummy_range_vkey_u8 = u32_to_u8(dummy_range_vk.vk.hash_u32());
let dummy_range_vkey_b256 = B256::from(dummy_range_vkey_u8);
println!(
"Dummy Range ELF Verification Key Commitment: {}",
dummy_range_vkey_b256
);

let (_, agg_vk) = prover.setup(AGG_ELF);
println!("Aggregation ELF Verification Key: {}", agg_vk.bytes32());

Expand Down

0 comments on commit 1b516bb

Please sign in to comment.