light_sdk/
proof.rs

1use anchor_lang::{AnchorDeserialize, AnchorSerialize};
2use light_indexed_merkle_tree::array::IndexedElement;
3use num_bigint::BigUint;
4use solana_program::pubkey::Pubkey;
5
6#[derive(Debug, Clone)]
7pub struct MerkleProof {
8    pub hash: [u8; 32],
9    pub leaf_index: u64,
10    pub merkle_tree: Pubkey,
11    pub proof: Vec<[u8; 32]>,
12    pub root_seq: u64,
13}
14
15// For consistency with the Photon API.
16#[derive(Clone, Default, Debug, PartialEq)]
17pub struct NewAddressProofWithContext {
18    pub merkle_tree: Pubkey,
19    pub root: [u8; 32],
20    pub root_seq: u64,
21    pub low_address_index: u64,
22    pub low_address_value: [u8; 32],
23    pub low_address_next_index: u64,
24    pub low_address_next_value: [u8; 32],
25    pub low_address_proof: [[u8; 32]; 16],
26    pub new_low_element: Option<IndexedElement<usize>>,
27    pub new_element: Option<IndexedElement<usize>>,
28    pub new_element_next_value: Option<BigUint>,
29}
30
31#[derive(Debug, Clone, PartialEq, Eq, AnchorDeserialize, AnchorSerialize)]
32pub struct CompressedProof {
33    pub a: [u8; 32],
34    pub b: [u8; 64],
35    pub c: [u8; 32],
36}
37
38#[derive(Debug)]
39pub struct ProofRpcResult {
40    pub proof: CompressedProof,
41    pub root_indices: Vec<u16>,
42    pub address_root_indices: Vec<u16>,
43}