agglayer_types/aggchain_data/
aggchain_proof.rs1use agglayer_interop_types::aggchain_proof::Proof;
2use agglayer_primitives::Digest;
3use pessimistic_proof::core;
4use sp1_sdk::SP1VerifyingKey;
5use unified_bridge::AggchainProofPublicValues;
6
7use crate::aggchain_data::PayloadWithCtx;
8
9#[derive(Clone, Debug)]
12pub struct Payload {
13 pub proof: Proof,
15 pub aggchain_params: Digest,
17 pub public_values: Option<Box<AggchainProofPublicValues>>,
19}
20
21impl Payload {
22 pub fn aggchain_vkey_from_proof(&self) -> SP1VerifyingKey {
23 let Proof::SP1Stark(sp1_reduce_proof) = &self.proof;
24 sp1_reduce_proof.vkey.clone()
25 }
26}
27
28#[derive(Clone, Debug)]
30pub struct Context {
31 pub aggchain_vkey: [u32; 8],
32}
33
34impl From<PayloadWithCtx<Payload, Context>> for core::AggchainProof {
35 fn from(val: PayloadWithCtx<Payload, Context>) -> Self {
36 let PayloadWithCtx(
37 Payload {
38 aggchain_params, ..
39 },
40 Context { aggchain_vkey },
41 ) = val;
42
43 core::AggchainProof {
44 aggchain_params,
45 aggchain_vkey,
46 }
47 }
48}