Skip to content

Commit 2f47667

Browse files
committed
WIP
1 parent f7bfd11 commit 2f47667

File tree

9 files changed

+105
-88
lines changed

9 files changed

+105
-88
lines changed

Cargo.lock

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ hyper-util = { version = "0.1" }
6262
sha2 = { version = "=0.10.8", default-features = false }
6363
crypto-bigint = { version = "=0.5.5", features = ["rand_core"] }
6464
borsh = { version = "1.5.1", features = ["derive"] }
65-
k256 = { version = "=0.13.3", default-features = false }
65+
k256 = { version = "=0.13.4" }
6666
risc0-build = "1.2"
6767
risc0-zkvm = { version = "1.2" }
6868
ripemd = "0.1.3"

bridge-circuit-host/src/bridge_circuit_host.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ use bitcoin::{consensus::Decodable, hashes::Hash};
99
use borsh::{self, BorshDeserialize};
1010
use circuits_lib::bridge_circuit::groth16::CircuitGroth16Proof;
1111
use circuits_lib::bridge_circuit::structs::{BridgeCircuitInput, WorkOnlyCircuitInput};
12-
use circuits_lib::bridge_circuit::winternitz::verify_winternitz_signature;
1312
use circuits_lib::bridge_circuit::HEADER_CHAIN_METHOD_ID;
1413
use final_spv::merkle_tree::BitcoinMerkleTree;
1514
use final_spv::spv::SPV;
1615
use header_chain::header_chain::CircuitBlockHeader;
1716
use header_chain::mmr_native::MMRNative;
1817

1918
use risc0_zkvm::{compute_image_id, default_prover, ExecutorEnv, ProverOpts, Receipt};
20-
use sha2::{Digest, Sha256};
2119

2220
const _BRIDGE_CIRCUIT_ELF: &[u8] =
2321
include_bytes!("../../risc0-circuits/elfs/prod-testnet4-bridge-circuit-guest");
@@ -82,7 +80,6 @@ pub fn prove_bridge_circuit(
8280
// panic!("Light client proof receipt verification failed");
8381
// }
8482

85-
8683
// Header chain verification
8784
if header_chain_proof_output_serialized
8885
!= bridge_circuit_host_params.headerchain_receipt.journal.bytes
@@ -339,6 +336,7 @@ mod tests {
339336
include_bytes!("../../risc0-circuits/elfs/test-testnet4-bridge-circuit-guest");
340337
const WORK_ONLY_ELF: &[u8] =
341338
include_bytes!("../../risc0-circuits/elfs/testnet4-work-only-guest");
339+
342340
pub static WORK_ONLY_IMAGE_ID: [u8; 32] =
343341
hex_literal::hex!("1ff9f5b6d77bbd4296e1749049d4a841088fb72f7a324da71e31fa1576d4bc0b");
344342

@@ -433,13 +431,16 @@ mod tests {
433431
.try_into()
434432
.unwrap();
435433

436-
println!("commited_total_work: {:?}", commited_total_work);
437-
438434
let input: u64 = 1;
439435

440436
let compressed_proof_and_total_work: Vec<u8> =
441437
[compressed_proof.as_ref(), commited_total_work.as_ref()].concat();
442438

439+
println!(
440+
"Compressed proof and total work: {:?}",
441+
hex::encode(compressed_proof_and_total_work.clone())
442+
);
443+
443444
let len = compressed_proof_and_total_work.len();
444445
let n0 = u32::try_from(len).expect("Length exceeds u32 max value");
445446
let params = Parameters::new(n0, 8);

circuits-lib/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ itertools = { workspace = true }
4343
final-spv = { workspace = true }
4444
header-chain = { workspace = true }
4545

46-
47-
secp256k1 = { version = "=0.29.0", default-features = false }
46+
k256 = { workspace = true }
4847

4948
[features]
5049
not_patched = []

circuits-lib/src/bridge_circuit/mod.rs

+65-63
Large diffs are not rendered by default.

risc0-circuits/bridge-circuit/guest/Cargo.lock

+14-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

risc0-circuits/bridge-circuit/guest/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ hex-literal = "0.4.1"
1313
[patch.crates-io]
1414
sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.8-risczero.0" }
1515
crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag = "v0.5.5-risczero.0" }
16-
secp256k1 = { git = "https://github.com/Sovereign-Labs/rust-secp256k1.git", branch = "risc0-compatible-0-29-0" }
16+
k256 = { git = "https://github.com/risc0/RustCrypto-elliptic-curves", tag = "k256/v0.13.3-risczero.1" }

risc0-circuits/work-only/guest/Cargo.lock

+14-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

risc0-circuits/work-only/guest/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ edition = "2021"
77

88
[dependencies]
99
circuits-lib = { path = "../../../circuits-lib" }
10-
cc = { version = "=1.1.31" }
1110

1211
[patch.crates-io]
1312
sha2 = { git = "https://github.com/risc0/RustCrypto-hashes", tag = "sha2-v0.10.8-risczero.0" }
1413
crypto-bigint = { git = "https://github.com/risc0/RustCrypto-crypto-bigint", tag = "v0.5.5-risczero.0" }
15-
secp256k1 = { git = "https://github.com/Sovereign-Labs/rust-secp256k1.git", branch = "risc0-compatible-0-29-0" }
14+
k256 = { git = "https://github.com/risc0/RustCrypto-elliptic-curves", tag = "k256/v0.13.3-risczero.1" }

0 commit comments

Comments
 (0)