This repository has been archived by the owner on Feb 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
105 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,31 @@ | ||
#![no_main] | ||
sp1_zkvm::entrypoint!(main); | ||
|
||
mod buffer; | ||
use buffer::Buffer; | ||
|
||
use sha2::{Digest, Sha256}; | ||
|
||
// Verification key of blevm-mock (Dec 22 2024) | ||
// 0x001a3232969a5caac2de9a566ceee00641853a058b1ce1004ab4869f75a8dc59 | ||
|
||
const BLEVM_MOCK_VERIFICATION_KEY: &[u8] = | ||
hex::decode("001a3232969a5caac2de9a566ceee00641853a058b1ce1004ab4869f75a8dc59").unwrap(); | ||
const BLEVM_MOCK_VERIFICATION_KEY: [u32; 8] = [ | ||
0x001a3232, 0x969a5caa, 0xc2de9a56, 0x6ceee006, 0x41853a05, 0x8b1ce100, 0x4ab4869f, 0x75a8dc59, | ||
]; | ||
|
||
pub fn main() { | ||
let public_values1: Vec<u8> = sp1_zkvm::io::read(); | ||
let public_values2: Vec<u8> = sp1_zkvm::io::read(); | ||
|
||
let proof1_values_hash = Sha256::digest(&public_values1); | ||
let proof2_values_hash = Sha256::digest(&public_values2); | ||
|
||
sp1_zkvm::lib::verify::verify_sp1_proof( | ||
&BLEVM_MOCK_VERIFICATION_KEY, | ||
&proof1_values_hash.into(), | ||
); | ||
sp1_zkvm::lib::verify::verify_sp1_proof( | ||
&BLEVM_MOCK_VERIFICATION_KEY, | ||
&proof2_values_hash.into(), | ||
); | ||
|
||
pub fn main() {} | ||
let buffer1 = Buffer::from(&public_values1); | ||
let buffer2 = Buffer::from(&public_values2); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
version = "0.1.0" | ||
name = "blevm-common" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
serde = { version = "1.0.200", default-features = false, features = ["derive"] } | ||
bincode = { workspace = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
pub struct BlevmOutput { | ||
pub blob_commitment: [u8; 32], | ||
pub header_hash: [u8; 32], | ||
pub prev_header_hash: [u8; 32], | ||
pub height: u64, | ||
pub gas_used: u64, | ||
pub beneficiary: [u8; 20], | ||
pub state_root: [u8; 32], | ||
pub celestia_header_hash: [u8; 32], | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
use sp1_helper::build_program_with_args; | ||
|
||
fn main() { | ||
build_program_with_args("../program", Default::default()) | ||
build_program_with_args("../blevm", Default::default()) | ||
} |