repo_id
stringclasses 563
values | file_path
stringlengths 40
166
| content
stringlengths 1
2.94M
| __index_level_0__
int64 0
0
|
|---|---|---|---|
solana_public_repos/Lightprotocol/light-protocol/xtask
|
solana_public_repos/Lightprotocol/light-protocol/xtask/src/zero_indexed_leaf.rs
|
use std::{fs::File, io::prelude::*, mem, path::PathBuf};
use clap::Parser;
use light_hasher::{Hasher, Keccak, Poseidon, Sha256};
use light_utils::rustfmt;
use quote::quote;
use crate::Hash;
#[derive(Debug, Parser)]
pub struct Options {
#[clap(value_enum, long, default_value_t = Hash::Sha256)]
hash: Hash,
#[clap(long)]
path: Option<PathBuf>,
}
pub fn generate_zero_indexed_leaf(opts: Options) -> anyhow::Result<()> {
match opts.hash {
Hash::Keccak => generate_zero_indexed_leaf_for_hasher::<Keccak>(opts),
Hash::Poseidon => generate_zero_indexed_leaf_for_hasher::<Poseidon>(opts),
Hash::Sha256 => generate_zero_indexed_leaf_for_hasher::<Sha256>(opts),
}
}
fn generate_zero_indexed_leaf_for_hasher<H>(opts: Options) -> anyhow::Result<()>
where
H: Hasher,
{
let zero_indexed_leaf =
H::hashv(&[&[0u8; 32], &[0u8; mem::size_of::<usize>()], &[0u8; 32]]).unwrap();
let code = quote! {
pub const ZERO_INDEXED_LEAF: [u8; 32] = [ #(#zero_indexed_leaf),* ];
};
println!(
"Zero indexded leaf (generated with {:?} hash): {:?}",
opts.hash, zero_indexed_leaf
);
if let Some(path) = opts.path {
let mut file = File::create(&path)?;
file.write_all(b"// This file is generated by xtask. Do not edit it manually.\n\n")?;
file.write_all(&rustfmt(code.to_string())?)?;
println!("First low leaf written to {:?}", path);
}
Ok(())
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/xtask
|
solana_public_repos/Lightprotocol/light-protocol/xtask/src/type_sizes.rs
|
use std::mem;
use account_compression::{
state::queue::QueueAccount,
utils::constants::{
ADDRESS_MERKLE_TREE_CANOPY_DEPTH, ADDRESS_MERKLE_TREE_CHANGELOG,
ADDRESS_MERKLE_TREE_HEIGHT, ADDRESS_MERKLE_TREE_INDEXED_CHANGELOG,
ADDRESS_MERKLE_TREE_ROOTS, ADDRESS_QUEUE_VALUES, STATE_MERKLE_TREE_CANOPY_DEPTH,
STATE_MERKLE_TREE_CHANGELOG, STATE_MERKLE_TREE_HEIGHT, STATE_MERKLE_TREE_ROOTS,
STATE_NULLIFIER_QUEUE_VALUES,
},
AddressMerkleTreeAccount, StateMerkleTreeAccount,
};
use light_concurrent_merkle_tree::{
changelog::ChangelogEntry26, event::RawIndexedElement, ConcurrentMerkleTree26,
};
use light_hasher::Poseidon;
use light_indexed_merkle_tree::IndexedMerkleTree26;
use tabled::{Table, Tabled};
#[derive(Tabled)]
struct Type {
name: String,
space: usize,
}
pub fn type_sizes() -> anyhow::Result<()> {
let accounts = vec![
Type {
name: "StateMerkleTreeAccount (with discriminator)".to_owned(),
space: mem::size_of::<StateMerkleTreeAccount>() + 8,
},
Type {
name: "StateMerkleTree".to_owned(),
space: mem::size_of::<ConcurrentMerkleTree26<Poseidon>>(),
},
Type {
name: "StateMerkleTree->filled_subtrees".to_owned(),
space: mem::size_of::<[u8; 32]>() * STATE_MERKLE_TREE_HEIGHT as usize,
},
Type {
name: "StateMerkleTree->changelog".to_owned(),
space: mem::size_of::<ChangelogEntry26>() * STATE_MERKLE_TREE_CHANGELOG as usize,
},
Type {
name: "StateMerkleTree->roots".to_owned(),
space: mem::size_of::<[u8; 32]>() * STATE_MERKLE_TREE_ROOTS as usize,
},
Type {
name: "StateMerkleTree->canopy".to_owned(),
space: mem::size_of::<[u8; 32]>()
* ConcurrentMerkleTree26::<Poseidon>::canopy_size(
STATE_MERKLE_TREE_CANOPY_DEPTH as usize,
),
},
Type {
name: "NullifierQueueAccount".to_owned(),
space: QueueAccount::size(STATE_NULLIFIER_QUEUE_VALUES as usize).unwrap(),
},
Type {
name: "AddressQueue".to_owned(),
space: QueueAccount::size(ADDRESS_QUEUE_VALUES as usize).unwrap(),
},
Type {
name: "AddressMerkleTreeAccount (with discriminator)".to_owned(),
space: mem::size_of::<AddressMerkleTreeAccount>() + 8,
},
Type {
name: "AddressMerkleTree".to_owned(),
space: mem::size_of::<IndexedMerkleTree26<Poseidon, u16>>(),
},
Type {
name: "AddressMerkleTree->filled_subtrees".to_owned(),
space: mem::size_of::<[u8; 32]>() * ADDRESS_MERKLE_TREE_HEIGHT as usize,
},
Type {
name: "AddressMerkleTree->changelog".to_owned(),
space: mem::size_of::<ChangelogEntry26>() * ADDRESS_MERKLE_TREE_CHANGELOG as usize,
},
Type {
name: "AddressMerkleTree->roots".to_owned(),
space: mem::size_of::<[u8; 32]>() * ADDRESS_MERKLE_TREE_ROOTS as usize,
},
Type {
name: "AddressMerkleTree->canopy".to_owned(),
space: mem::size_of::<[u8; 32]>()
* ConcurrentMerkleTree26::<Poseidon>::canopy_size(
ADDRESS_MERKLE_TREE_CANOPY_DEPTH as usize,
),
},
Type {
name: "AddressMerkleTree->changelog".to_owned(),
space: mem::size_of::<RawIndexedElement<usize>>()
* ADDRESS_MERKLE_TREE_INDEXED_CHANGELOG as usize,
},
];
let table = Table::new(accounts);
println!("{table}");
Ok(())
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/xtask
|
solana_public_repos/Lightprotocol/light-protocol/xtask/src/bench.rs
|
use clap::{ArgAction, Parser};
use std::collections::HashMap;
use std::io::{BufRead, BufReader};
use std::process::{Command, Stdio};
use std::{fs::File, io::prelude::*};
use tabled::{Table, Tabled};
pub const DESTINATION: &str = "target/";
#[derive(Debug, Parser)]
pub struct Options {
/// Select the test to run.
#[clap(long, action = clap::ArgAction::Append)]
t: Vec<String>,
/// Select to run compressed token program tests.
#[clap(long, action = ArgAction::SetTrue)]
compressed_token: bool,
/// Select to run compressed pda program tests.
#[clap(long, action = ArgAction::SetTrue)]
compressed_pda: bool,
/// Select to run account compression program tests.
#[clap(long, action = ArgAction::SetTrue)]
account_commpression: bool,
/// Builds all programs with the bench-sbf feature.
#[clap(long, action = ArgAction::SetTrue)]
build: bool,
/// Prints the test logs to the console.
#[clap(long, action = ArgAction::SetTrue)]
verbose: bool,
/// Skips all logs until the start_ix is found.
#[clap(long, action = clap::ArgAction::Append)]
start_ix: Option<String>,
}
/// cargo xtask bench --t test_8_transfer --compressed-token --build --start-ix Transfer --verbose
/// cargo xtask bench --t 1_mint_to --compressed-token --build
pub fn bench(opts: Options) -> anyhow::Result<()> {
let (program, program_id) = if opts.compressed_token {
(
"light-compressed-token",
"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",
)
} else if opts.compressed_pda {
(
"light-system-program",
"SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7",
)
} else if opts.account_commpression {
(
"account-compression",
"CbjvJc1SNx1aav8tU49dJGHu8EUdzQJSMtkjDmV8miqK",
)
} else {
Err(anyhow::anyhow!("No program selected"))?
};
if opts.build {
println!("Running anchor build");
Command::new("anchor")
.args(["build", "--", "--features", "bench-sbf"])
.stdout(Stdio::piped())
.output()?;
}
for test_name in opts.t {
println!("Running test: {}", test_name);
println!("program: {}", program);
let mut command_output = Command::new("cargo")
.args([
"test-sbf",
"-p",
program,
"--features",
"bench-sbf",
"--",
"--test",
test_name.as_str(),
])
// SVM logs are emitted via sdt err
.stderr(Stdio::piped())
.spawn()?;
let stdout = command_output
.stderr
.take()
.expect("Failed to capture stdout");
let reader = BufReader::new(stdout);
let output_lines = reader.lines().map(|line| line.unwrap()).collect();
println!("Creating report for: {}", test_name);
create_bench_report(
output_lines,
test_name,
program_id,
opts.verbose,
&opts.start_ix,
)?;
}
Ok(())
}
pub fn create_bench_report(
mut output_lines: Vec<String>,
report_name: String,
program_id: &str,
verbose: bool,
start_ix: &Option<String>,
) -> anyhow::Result<()> {
// HashMap to store the start and end benchmark details
let mut benchmarks = HashMap::<String, (u64, u64, u64, u64, u64)>::new();
let mut expect_sol_log = false;
let mut start = false;
let mut end = false;
let mut found_start = start_ix.is_none();
let mut current_name = String::new();
let mut counter = 0;
for line in output_lines.iter() {
if verbose {
println!("{}", line);
}
if start_ix.is_some() && !found_start {
if line.contains(start_ix.as_ref().unwrap()) {
found_start = true;
} else {
continue;
}
}
let parts: Vec<&str> = line.split_whitespace().collect();
if expect_sol_log {
let mem_start_pos_minus_one = parts.iter().position(|&s| s == "remaining").unwrap();
let mem_start = parts
.get(mem_start_pos_minus_one - 2)
.unwrap()
.parse::<u64>()
.unwrap();
expect_sol_log = false;
if start {
benchmarks.get_mut(¤t_name).unwrap().0 = mem_start;
start = false;
}
if end {
benchmarks.get_mut(¤t_name).unwrap().2 = mem_start;
end = false;
}
}
if line.contains("_start_bench_cu:") {
let suffix = "_start_bench_cu:";
let name = parts
.iter()
.find(|&&s| s.ends_with(suffix))
.map(|s| &s[..s.len() - suffix.len()])
.unwrap();
let mem_start_pos_minus_one = parts.iter().position(|&s| s == "used:").unwrap();
let mem_start = parts
.get(mem_start_pos_minus_one + 1)
.unwrap()
.parse::<u64>()
.unwrap();
expect_sol_log = true;
start = true;
current_name = name.to_string();
benchmarks.insert(name.to_string(), (0, mem_start, 0, 0, counter));
counter += 1;
} else if line.contains("_end_bench_cu:") {
let suffix = "_end_bench_cu:";
let name = parts
.iter()
.find(|&&s| s.ends_with(suffix))
.map(|s| &s[..s.len() - suffix.len()])
.unwrap();
expect_sol_log = true;
end = true;
current_name = name.to_string();
let mem_end_pos_minus_one = parts.iter().position(|&s| s == "used:").unwrap();
let mem_end = parts
.get(mem_end_pos_minus_one + 1)
.unwrap()
.parse::<u64>()
.unwrap();
if let Some(value) = benchmarks.get_mut(name) {
value.3 = mem_end;
}
}
}
output_lines.reverse();
let total_cu = match find_total_compute_units(program_id, &output_lines) {
Some(val) => val,
None => {
println!("lines: {:?}", output_lines);
panic!("Error: Total compute units not found");
}
};
let mut rows = Vec::new();
rows.push(RowData {
name: "Total CU".into(),
cu_percentage: "".into(),
cu_pre: format_number_with_commas(total_cu),
cu_post: "".into(),
cu_used: "".into(),
memory_used: "".into(),
memory_start: "".into(),
memory_end: "".into(),
});
rows.push(RowData {
name: "Name".into(),
cu_percentage: "CU Percentage".into(),
cu_pre: "CU Pre".into(),
cu_post: "CU Post".into(),
cu_used: "CU Used".into(),
memory_used: "Memory Used".into(),
memory_start: "Memory Start".into(),
memory_end: "Memory End".into(),
});
#[allow(clippy::type_complexity)]
let mut sorted_benchmarks: Vec<(String, (u64, u64, u64, u64, u64))> = benchmarks
.iter()
.map(|(name, values)| (name.clone(), *values))
.collect();
#[allow(clippy::clone_on_copy)]
sorted_benchmarks.sort_by_key(|(_, (_, _, _, _, position))| position.clone());
for (name, (cu_pre, mem_start, cu_post, mem_end, _)) in benchmarks {
let cu_used = cu_pre - cu_post;
let memory_used = match mem_end.checked_sub(mem_start) {
Some(val) => val,
None => {
panic!("Error: Memory end is less than memory start for {}", name);
}
};
let cu_percentage = (cu_used as f64 / total_cu as f64) * 100.0;
rows.push(RowData {
name,
cu_percentage: format!("{:.2}", cu_percentage),
cu_pre: format_number_with_commas(cu_pre),
cu_post: format_number_with_commas(cu_post),
cu_used: format_number_with_commas(cu_used),
memory_used: format_number_with_commas(memory_used),
memory_start: format_number_with_commas(mem_start),
memory_end: format_number_with_commas(mem_end),
});
}
let path = DESTINATION.to_string() + report_name.as_str() + ".txt";
let mut file = File::create(path.clone())?;
let table = Table::new(rows);
write!(file, "{}", table)?;
println!("Writing report to: {}", path);
Ok(())
}
#[derive(Tabled)]
struct RowData {
name: String,
cu_percentage: String,
cu_pre: String,
cu_post: String,
cu_used: String,
memory_used: String,
memory_start: String,
memory_end: String,
}
fn format_number_with_commas(num: u64) -> String {
let num_str = num.to_string();
let mut result = String::new();
let digits = num_str.len();
num_str.chars().enumerate().for_each(|(i, c)| {
if (digits - i) % 3 == 0 && i != 0 {
result.push(',');
}
result.push(c);
});
result
}
fn find_total_compute_units(program_id: &str, logs: &Vec<String>) -> Option<u64> {
// Iterate through each log entry
for log in logs {
if log.contains(program_id) && log.contains("consumed") {
// Split the log line into parts
let parts: Vec<&str> = log.split_whitespace().collect();
// Find the position of "consumed" and get the next element which should be the number
if let Some(index) = parts.iter().position(|&x| x == "consumed") {
if let Some(consumed_units) = parts.get(index + 1) {
// Attempt to parse the number and return it
return consumed_units.parse::<u64>().ok();
}
}
}
}
// Return None if no matching log entry was found or if any part of the process failed
None
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/xtask
|
solana_public_repos/Lightprotocol/light-protocol/xtask/src/hash_set.rs
|
use ark_bn254::Fr;
use ark_ff::UniformRand;
use clap::Parser;
use light_hash_set::HashSet;
use light_utils::prime::find_next_prime_with_load_factor;
use num_bigint::BigUint;
use rand::thread_rng;
use tabled::{Table, Tabled};
#[derive(Parser)]
pub struct HashSetOptions {
#[clap(subcommand)]
command: Command,
}
#[derive(Parser)]
enum Command {
/// Benchmarks a hash set with given parameters.
Bench(BenchOptions),
}
#[derive(Parser)]
struct BenchOptions {
#[clap(long, default_value_t = 4800)]
expected_capacity: u32,
#[clap(long, default_value_t = 2800)]
sequence_threshold: usize,
#[clap(long, default_values_t = [0.7, 0.5])]
load_factors: Vec<f64>,
#[clap(long, default_value = "10")]
rounds: usize,
}
#[derive(Tabled)]
struct BenchData {
expected_capacity: u32,
load_factor: f64,
capacity_with_load_factor: usize,
sequence_threshold: usize,
round: usize,
successful_insertions: usize,
}
pub(crate) fn hash_set(opts: HashSetOptions) -> anyhow::Result<()> {
match opts.command {
Command::Bench(opts) => bench(opts),
}
}
fn bench(opts: BenchOptions) -> anyhow::Result<()> {
let BenchOptions {
expected_capacity,
sequence_threshold,
rounds,
..
} = opts;
let mut result = Vec::new();
for load_factor in opts.load_factors {
let capacity_with_load_factor =
find_next_prime_with_load_factor(opts.expected_capacity, load_factor) as usize;
let mut hs = HashSet::new(capacity_with_load_factor, opts.sequence_threshold)?;
let mut rng = thread_rng();
for round in 0..rounds {
let mut successful_insertions = capacity_with_load_factor;
let sequence_number = opts.sequence_threshold * round;
for element_i in 0..capacity_with_load_factor {
let value = BigUint::from(Fr::rand(&mut rng));
match hs.insert(&value, sequence_number) {
Ok(index) => hs.mark_with_sequence_number(index, sequence_number)?,
Err(_) => {
successful_insertions = element_i;
break;
}
}
}
let bench_data = BenchData {
expected_capacity,
load_factor,
capacity_with_load_factor,
sequence_threshold,
round,
successful_insertions,
};
result.push(bench_data);
}
}
let table = Table::new(result);
println!("{table}");
Ok(())
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol
|
solana_public_repos/Lightprotocol/light-protocol/forester-utils/Cargo.toml
|
[package]
name = "forester-utils"
version = "1.2.0"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/lightprotocol/light-protocol"
description = "Utility library for Light's Forester node implementation"
[dependencies]
# Light Protocol
account-compression = { workspace = true }
light-compressed-token = { workspace = true }
light-hash-set = { workspace=true }
light-hasher = { version = "1.1.0", path = "../merkle-tree/hasher" }
light-merkle-tree-reference = { version = "1.1.0", path = "../merkle-tree/reference" }
light-concurrent-merkle-tree = { version = "1.1.0", path = "../merkle-tree/concurrent" }
light-indexed-merkle-tree = { path = "../merkle-tree/indexed/", version = "1.1.0" }
light-prover-client = { path = "../circuit-lib/light-prover-client", version = "1.2.0" }
light-registry = { workspace = true }
light-system-program = { path = "../programs/system", version = "1.2.0", features = ["cpi"] }
light-utils = { path = "../utils", version = "1.1.0" }
photon-api = { workspace = true }
light-client = { workspace = true }
# Anchor
anchor-lang = { workspace = true }
anchor-spl = { workspace = true }
# Solana
spl-token = { workspace = true, features = ["no-entrypoint"] }
solana-program-test = { workspace = true }
solana-sdk = { workspace = true }
solana-client = { workspace = true }
solana-transaction-status = { workspace = true }
# Async ecosystem
tokio = { workspace = true }
async-trait = { workspace = true }
# Error handling
thiserror = "1.0"
# Logging
log = "0.4"
# Big numbers
num-bigint = { workspace = true }
num-traits = { workspace = true }
# HTTP client
reqwest = "0.11.26"
| 0
|
solana_public_repos/Lightprotocol/light-protocol/forester-utils
|
solana_public_repos/Lightprotocol/light-protocol/forester-utils/src/registry.rs
|
use crate::address_merkle_tree_config::{get_address_bundle_config, get_state_bundle_config};
use crate::create_account_instruction;
use account_compression::{
AddressMerkleTreeConfig, AddressQueueConfig, NullifierQueueConfig, QueueAccount,
StateMerkleTreeConfig,
};
use crate::indexer::{AddressMerkleTreeAccounts, StateMerkleTreeAccounts};
use light_client::rpc::{RpcConnection, RpcError};
use light_registry::account_compression_cpi::sdk::{
create_rollover_state_merkle_tree_instruction, CreateRolloverMerkleTreeInstructionInputs,
};
use light_registry::protocol_config::state::ProtocolConfig;
use light_registry::sdk::{
create_register_forester_instruction, create_update_forester_pda_instruction,
};
use light_registry::utils::get_forester_pda;
use light_registry::{ForesterConfig, ForesterPda};
use solana_sdk::{
instruction::Instruction,
pubkey::Pubkey,
signature::{Keypair, Signer},
};
/// Creates and asserts forester account creation.
pub async fn register_test_forester<R: RpcConnection>(
rpc: &mut R,
governance_authority: &Keypair,
forester_authority: &Pubkey,
config: ForesterConfig,
) -> Result<(), RpcError> {
let ix = create_register_forester_instruction(
&governance_authority.pubkey(),
&governance_authority.pubkey(),
forester_authority,
config,
);
rpc.create_and_send_transaction(
&[ix],
&governance_authority.pubkey(),
&[governance_authority],
)
.await?;
assert_registered_forester(
rpc,
forester_authority,
ForesterPda {
authority: *forester_authority,
config,
active_weight: 1,
..Default::default()
},
)
.await
}
pub async fn update_test_forester<R: RpcConnection>(
rpc: &mut R,
forester_authority: &Keypair,
derivation_key: &Pubkey,
new_forester_authority: Option<&Keypair>,
config: ForesterConfig,
) -> Result<(), RpcError> {
let mut pre_account_state = rpc
.get_anchor_account::<ForesterPda>(&get_forester_pda(derivation_key).0)
.await?
.unwrap();
let (signers, new_forester_authority) = if let Some(new_authority) = new_forester_authority {
pre_account_state.authority = new_authority.pubkey();
(
vec![forester_authority, &new_authority],
Some(new_authority.pubkey()),
)
} else {
(vec![forester_authority], None)
};
let ix = create_update_forester_pda_instruction(
&forester_authority.pubkey(),
derivation_key,
new_forester_authority,
Some(config),
);
rpc.create_and_send_transaction(&[ix], &forester_authority.pubkey(), &signers)
.await?;
pre_account_state.config = config;
assert_registered_forester(rpc, derivation_key, pre_account_state).await
}
pub async fn assert_registered_forester<R: RpcConnection>(
rpc: &mut R,
forester: &Pubkey,
expected_account: ForesterPda,
) -> Result<(), RpcError> {
let pda = get_forester_pda(forester).0;
let account_data = rpc.get_anchor_account::<ForesterPda>(&pda).await?.unwrap();
if account_data != expected_account {
return Err(RpcError::AssertRpcError(format!(
"Expected account data: {:?}, got: {:?}",
expected_account, account_data
)));
}
Ok(())
}
pub struct RentExemption {
pub size: usize,
pub lamports: u64,
}
pub async fn get_rent_exemption_for_address_merkle_tree_and_queue<R: RpcConnection>(
rpc: &mut R,
address_merkle_tree_config: &AddressMerkleTreeConfig,
address_queue_config: &AddressQueueConfig,
) -> (RentExemption, RentExemption) {
let queue_size = QueueAccount::size(address_queue_config.capacity as usize).unwrap();
let queue_rent_exempt_lamports = rpc
.get_minimum_balance_for_rent_exemption(queue_size)
.await
.unwrap();
let tree_size = account_compression::state::AddressMerkleTreeAccount::size(
address_merkle_tree_config.height as usize,
address_merkle_tree_config.changelog_size as usize,
address_merkle_tree_config.roots_size as usize,
address_merkle_tree_config.canopy_depth as usize,
address_merkle_tree_config.address_changelog_size as usize,
);
let merkle_tree_rent_exempt_lamports = rpc
.get_minimum_balance_for_rent_exemption(tree_size)
.await
.unwrap();
(
RentExemption {
lamports: merkle_tree_rent_exempt_lamports,
size: tree_size,
},
RentExemption {
lamports: queue_rent_exempt_lamports,
size: queue_size,
},
)
}
pub async fn get_rent_exemption_for_state_merkle_tree_and_queue<R: RpcConnection>(
rpc: &mut R,
merkle_tree_config: &StateMerkleTreeConfig,
queue_config: &NullifierQueueConfig,
) -> (RentExemption, RentExemption) {
let queue_size = QueueAccount::size(queue_config.capacity as usize).unwrap();
let queue_rent_exempt_lamports = rpc
.get_minimum_balance_for_rent_exemption(queue_size)
.await
.unwrap();
let tree_size = account_compression::state::StateMerkleTreeAccount::size(
merkle_tree_config.height as usize,
merkle_tree_config.changelog_size as usize,
merkle_tree_config.roots_size as usize,
merkle_tree_config.canopy_depth as usize,
);
let merkle_tree_rent_exempt_lamports = rpc
.get_minimum_balance_for_rent_exemption(tree_size)
.await
.unwrap();
(
RentExemption {
lamports: merkle_tree_rent_exempt_lamports,
size: tree_size,
},
RentExemption {
lamports: queue_rent_exempt_lamports,
size: queue_size,
},
)
}
#[allow(clippy::too_many_arguments)]
pub async fn create_rollover_address_merkle_tree_instructions<R: RpcConnection>(
rpc: &mut R,
authority: &Pubkey,
derivation: &Pubkey,
new_nullifier_queue_keypair: &Keypair,
new_address_merkle_tree_keypair: &Keypair,
merkle_tree_pubkey: &Pubkey,
nullifier_queue_pubkey: &Pubkey,
epoch: u64,
is_metadata_forester: bool,
) -> Vec<Instruction> {
let (merkle_tree_config, queue_config) = get_address_bundle_config(
rpc,
AddressMerkleTreeAccounts {
merkle_tree: *merkle_tree_pubkey,
queue: *nullifier_queue_pubkey,
},
)
.await;
let (merkle_tree_rent_exemption, queue_rent_exemption) =
get_rent_exemption_for_address_merkle_tree_and_queue(
rpc,
&merkle_tree_config,
&queue_config,
)
.await;
let create_nullifier_queue_instruction = create_account_instruction(
authority,
queue_rent_exemption.size,
queue_rent_exemption.lamports,
&account_compression::ID,
Some(new_nullifier_queue_keypair),
);
let create_state_merkle_tree_instruction = create_account_instruction(
authority,
merkle_tree_rent_exemption.size,
merkle_tree_rent_exemption.lamports,
&account_compression::ID,
Some(new_address_merkle_tree_keypair),
);
let instruction = light_registry::account_compression_cpi::sdk::create_rollover_address_merkle_tree_instruction(
CreateRolloverMerkleTreeInstructionInputs {
authority: *authority,
derivation: *derivation,
new_queue: new_nullifier_queue_keypair.pubkey(),
new_merkle_tree: new_address_merkle_tree_keypair.pubkey(),
old_queue: *nullifier_queue_pubkey,
old_merkle_tree: *merkle_tree_pubkey,
cpi_context_account: None,
is_metadata_forester,
},epoch
);
vec![
create_nullifier_queue_instruction,
create_state_merkle_tree_instruction,
instruction,
]
}
#[allow(clippy::too_many_arguments)]
pub async fn perform_state_merkle_tree_roll_over<R: RpcConnection>(
rpc: &mut R,
authority: &Keypair,
derivation: &Pubkey,
new_nullifier_queue_keypair: &Keypair,
new_state_merkle_tree_keypair: &Keypair,
merkle_tree_pubkey: &Pubkey,
nullifier_queue_pubkey: &Pubkey,
epoch: u64,
is_metadata_forester: bool,
) -> Result<(), RpcError> {
let instructions = create_rollover_address_merkle_tree_instructions(
rpc,
&authority.pubkey(),
derivation,
new_nullifier_queue_keypair,
new_state_merkle_tree_keypair,
merkle_tree_pubkey,
nullifier_queue_pubkey,
epoch,
is_metadata_forester,
)
.await;
rpc.create_and_send_transaction(
&instructions,
&authority.pubkey(),
&[
authority,
new_nullifier_queue_keypair,
new_state_merkle_tree_keypair,
],
)
.await?;
Ok(())
}
#[allow(clippy::too_many_arguments)]
pub async fn create_rollover_state_merkle_tree_instructions<R: RpcConnection>(
rpc: &mut R,
authority: &Pubkey,
derivation: &Pubkey,
new_nullifier_queue_keypair: &Keypair,
new_state_merkle_tree_keypair: &Keypair,
new_cpi_context_keypair: &Keypair,
merkle_tree_pubkey: &Pubkey,
nullifier_queue_pubkey: &Pubkey,
epoch: u64,
is_metadata_forester: bool,
) -> Vec<Instruction> {
let (merkle_tree_config, queue_config) = get_state_bundle_config(
rpc,
StateMerkleTreeAccounts {
merkle_tree: *merkle_tree_pubkey,
nullifier_queue: *nullifier_queue_pubkey,
cpi_context: new_cpi_context_keypair.pubkey(),
},
)
.await;
let (state_merkle_tree_rent_exemption, queue_rent_exemption) =
get_rent_exemption_for_state_merkle_tree_and_queue(rpc, &merkle_tree_config, &queue_config)
.await;
let create_nullifier_queue_instruction = create_account_instruction(
authority,
queue_rent_exemption.size,
queue_rent_exemption.lamports,
&account_compression::ID,
Some(new_nullifier_queue_keypair),
);
let create_state_merkle_tree_instruction = create_account_instruction(
authority,
state_merkle_tree_rent_exemption.size,
state_merkle_tree_rent_exemption.lamports,
&account_compression::ID,
Some(new_state_merkle_tree_keypair),
);
let account_size: usize = ProtocolConfig::default().cpi_context_size as usize;
let create_cpi_context_account_instruction = create_account_instruction(
authority,
account_size,
rpc.get_minimum_balance_for_rent_exemption(account_size)
.await
.unwrap(),
&light_system_program::ID,
Some(new_cpi_context_keypair),
);
let instruction = create_rollover_state_merkle_tree_instruction(
CreateRolloverMerkleTreeInstructionInputs {
authority: *authority,
derivation: *derivation,
new_queue: new_nullifier_queue_keypair.pubkey(),
new_merkle_tree: new_state_merkle_tree_keypair.pubkey(),
old_queue: *nullifier_queue_pubkey,
old_merkle_tree: *merkle_tree_pubkey,
cpi_context_account: Some(new_cpi_context_keypair.pubkey()),
is_metadata_forester,
},
epoch,
);
vec![
create_nullifier_queue_instruction,
create_state_merkle_tree_instruction,
create_cpi_context_account_instruction,
instruction,
]
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/forester-utils
|
solana_public_repos/Lightprotocol/light-protocol/forester-utils/src/lib.rs
|
use account_compression::initialize_address_merkle_tree::Pubkey;
use anchor_lang::solana_program::instruction::Instruction;
use anchor_lang::solana_program::system_instruction;
use light_client::rpc::{RpcConnection, RpcError};
use light_concurrent_merkle_tree::copy::ConcurrentMerkleTreeCopy;
use light_hash_set::HashSet;
use light_hasher::Hasher;
use light_indexed_merkle_tree::copy::IndexedMerkleTreeCopy;
use num_traits::{CheckedAdd, CheckedSub, ToBytes, Unsigned};
use solana_sdk::account::Account;
use solana_sdk::signature::{Keypair, Signer};
use solana_sdk::transaction::Transaction;
use std::marker::PhantomData;
use std::pin::Pin;
use std::{fmt, mem};
pub mod address_merkle_tree_config;
pub mod forester_epoch;
pub mod indexer;
pub mod registry;
pub fn create_account_instruction(
payer: &Pubkey,
size: usize,
rent: u64,
id: &Pubkey,
keypair: Option<&Keypair>,
) -> Instruction {
let keypair = match keypair {
Some(keypair) => keypair.insecure_clone(),
None => Keypair::new(),
};
system_instruction::create_account(payer, &keypair.pubkey(), rent, size as u64, id)
}
#[derive(Debug, Clone)]
pub struct AccountZeroCopy<'a, T> {
pub account: Pin<Box<Account>>,
deserialized: *const T,
_phantom_data: PhantomData<&'a T>,
}
impl<'a, T> AccountZeroCopy<'a, T> {
pub async fn new<R: RpcConnection>(rpc: &mut R, address: Pubkey) -> AccountZeroCopy<'a, T> {
let account = Box::pin(rpc.get_account(address).await.unwrap().unwrap());
let deserialized = account.data[8..].as_ptr() as *const T;
Self {
account,
deserialized,
_phantom_data: PhantomData,
}
}
// Safe method to access `deserialized` ensuring the lifetime is respected
pub fn deserialized(&self) -> &'a T {
unsafe { &*self.deserialized }
}
}
/// Fetches the given account, then copies and serializes it as a `HashSet`.
///
/// # Safety
///
/// This is highly unsafe. Ensuring that:
///
/// * The correct account is used.
/// * The account has enough space to be treated as a HashSet with specified
/// parameters.
/// * The account data is aligned.
///
/// Is the caller's responsibility.
pub async unsafe fn get_hash_set<T, R: RpcConnection>(rpc: &mut R, pubkey: Pubkey) -> HashSet {
let mut account = rpc.get_account(pubkey).await.unwrap().unwrap();
HashSet::from_bytes_copy(&mut account.data[8 + mem::size_of::<T>()..]).unwrap()
}
/// Fetches the fiven account, then copies and serializes it as a
/// `ConcurrentMerkleTree`.
pub async fn get_concurrent_merkle_tree<T, R, H, const HEIGHT: usize>(
rpc: &mut R,
pubkey: Pubkey,
) -> ConcurrentMerkleTreeCopy<H, HEIGHT>
where
R: RpcConnection,
H: Hasher,
{
let account = rpc.get_account(pubkey).await.unwrap().unwrap();
ConcurrentMerkleTreeCopy::from_bytes_copy(&account.data[8 + mem::size_of::<T>()..]).unwrap()
}
// TODO: do discriminator check
/// Fetches the fiven account, then copies and serializes it as an
/// `IndexedMerkleTree`.
pub async fn get_indexed_merkle_tree<T, R, H, I, const HEIGHT: usize, const NET_HEIGHT: usize>(
rpc: &mut R,
pubkey: Pubkey,
) -> IndexedMerkleTreeCopy<H, I, HEIGHT, NET_HEIGHT>
where
R: RpcConnection,
H: Hasher,
I: CheckedAdd
+ CheckedSub
+ Copy
+ Clone
+ fmt::Debug
+ PartialOrd
+ ToBytes
+ TryFrom<usize>
+ Unsigned,
usize: From<I>,
{
let account = rpc.get_account(pubkey).await.unwrap().unwrap();
IndexedMerkleTreeCopy::from_bytes_copy(&account.data[8 + mem::size_of::<T>()..]).unwrap()
}
pub async fn airdrop_lamports<R: RpcConnection>(
rpc: &mut R,
destination_pubkey: &Pubkey,
lamports: u64,
) -> Result<(), RpcError> {
// Create a transfer instruction
let transfer_instruction =
system_instruction::transfer(&rpc.get_payer().pubkey(), destination_pubkey, lamports);
let latest_blockhash = rpc.get_latest_blockhash().await.unwrap();
// Create and sign a transaction
let transaction = Transaction::new_signed_with_payer(
&[transfer_instruction],
Some(&rpc.get_payer().pubkey()),
&vec![&rpc.get_payer()],
latest_blockhash,
);
// Send the transaction
rpc.process_transaction(transaction).await?;
Ok(())
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/forester-utils
|
solana_public_repos/Lightprotocol/light-protocol/forester-utils/src/forester_epoch.rs
|
use std::fmt::Display;
// TODO: move into separate forester utils crate
use anchor_lang::{
prelude::borsh, solana_program::pubkey::Pubkey, AnchorDeserialize, AnchorSerialize,
};
use light_client::rpc::{RpcConnection, RpcError};
use light_registry::{
protocol_config::state::{EpochState, ProtocolConfig},
sdk::{create_register_forester_epoch_pda_instruction, create_report_work_instruction},
utils::{get_epoch_pda_address, get_forester_epoch_pda_from_authority},
EpochPda, ForesterEpochPda,
};
use solana_sdk::signature::{Keypair, Signature, Signer};
// What does the forester need to know?
// What are my public keys (current epoch account, last epoch account, known Merkle trees)
// 1. The current epoch
// 2. When does the next registration start
// 3. When is my turn.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ForesterSlot {
pub slot: u64,
pub start_solana_slot: u64,
pub end_solana_slot: u64,
pub forester_index: u64,
}
#[derive(Debug, Default, Clone, PartialEq, Eq)]
pub struct Forester {
pub registration: Epoch,
pub active: Epoch,
pub report_work: Epoch,
}
impl Forester {
pub fn switch_to_report_work(&mut self) {
self.report_work = self.active.clone();
self.active = self.registration.clone();
}
pub async fn report_work(
&mut self,
rpc: &mut impl RpcConnection,
forester_keypair: &Keypair,
derivation: &Pubkey,
) -> Result<Signature, RpcError> {
let ix = create_report_work_instruction(
&forester_keypair.pubkey(),
derivation,
self.report_work.epoch,
);
rpc.create_and_send_transaction(&[ix], &forester_keypair.pubkey(), &[forester_keypair])
.await
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct TreeAccounts {
pub merkle_tree: Pubkey,
pub queue: Pubkey,
// TODO: evaluate whether we need
pub is_rolledover: bool,
pub tree_type: TreeType,
}
impl TreeAccounts {
pub fn new(
merkle_tree: Pubkey,
queue: Pubkey,
tree_type: TreeType,
is_rolledover: bool,
) -> Self {
Self {
merkle_tree,
queue,
tree_type,
is_rolledover,
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Copy)]
pub enum TreeType {
Address,
State,
}
impl Display for TreeType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
TreeType::Address => write!(f, "address"),
TreeType::State => write!(f, "state"),
}
}
}
pub fn get_schedule_for_queue(
mut start_solana_slot: u64,
queue_pubkey: &Pubkey,
protocol_config: &ProtocolConfig,
total_epoch_weight: u64,
epoch: u64,
) -> Vec<Option<ForesterSlot>> {
let mut vec = Vec::new();
let start_slot = 0;
// TODO: enforce that active_phase_length is a multiple of slot_length
let end_slot = start_slot + (protocol_config.active_phase_length / protocol_config.slot_length);
for light_slot in start_slot..end_slot {
let forester_index = ForesterEpochPda::get_eligible_forester_index(
light_slot,
queue_pubkey,
total_epoch_weight,
epoch,
)
.unwrap();
vec.push(Some(ForesterSlot {
slot: light_slot,
start_solana_slot,
end_solana_slot: start_solana_slot + protocol_config.slot_length,
forester_index,
}));
start_solana_slot += protocol_config.slot_length;
}
vec
}
pub fn get_schedule_for_forester_in_queue(
start_solana_slot: u64,
queue_pubkey: &Pubkey,
total_epoch_weight: u64,
forester_epoch_pda: &ForesterEpochPda,
) -> Vec<Option<ForesterSlot>> {
let mut slots = get_schedule_for_queue(
start_solana_slot,
queue_pubkey,
&forester_epoch_pda.protocol_config,
total_epoch_weight,
forester_epoch_pda.epoch,
);
slots.iter_mut().for_each(|x| {
// TODO: remove unwrap
if forester_epoch_pda.is_eligible(x.as_ref().unwrap().forester_index) {
} else {
*x = None;
}
});
slots
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct TreeForesterSchedule {
pub tree_accounts: TreeAccounts,
/// Vec with the slots that the forester is eligible to perform work.
/// Non-eligible slots are None.
pub slots: Vec<Option<ForesterSlot>>,
}
impl TreeForesterSchedule {
pub fn new(tree_accounts: TreeAccounts) -> Self {
Self {
tree_accounts,
slots: Vec::new(),
}
}
pub fn new_with_schedule(
tree_accounts: &TreeAccounts,
solana_slot: u64,
forester_epoch_pda: &ForesterEpochPda,
epoch_pda: &EpochPda,
) -> Self {
let mut _self = Self {
tree_accounts: *tree_accounts,
slots: Vec::new(),
};
_self.slots = get_schedule_for_forester_in_queue(
solana_slot,
&_self.tree_accounts.queue,
epoch_pda.registered_weight,
forester_epoch_pda,
);
_self
}
pub fn is_eligible(&self, forester_slot: u64) -> bool {
self.slots[forester_slot as usize].is_some()
}
}
#[derive(Debug, Clone, AnchorSerialize, AnchorDeserialize, Default, PartialEq, Eq)]
pub struct EpochPhases {
pub registration: Phase,
pub active: Phase,
pub report_work: Phase,
pub post: Phase,
}
impl EpochPhases {
pub fn get_current_phase(&self, current_slot: u64) -> Phase {
if current_slot >= self.registration.start && current_slot <= self.registration.end {
self.registration.clone()
} else if current_slot >= self.active.start && current_slot <= self.active.end {
self.active.clone()
} else if current_slot >= self.report_work.start && current_slot <= self.report_work.end {
self.report_work.clone()
} else {
self.post.clone()
}
}
pub fn get_current_epoch_state(&self, current_slot: u64) -> EpochState {
if current_slot >= self.registration.start && current_slot <= self.registration.end {
EpochState::Registration
} else if current_slot >= self.active.start && current_slot <= self.active.end {
EpochState::Active
} else if current_slot >= self.report_work.start && current_slot <= self.report_work.end {
EpochState::ReportWork
} else {
EpochState::Post
}
}
}
#[derive(Debug, Clone, AnchorSerialize, AnchorDeserialize, Default, PartialEq, Eq)]
pub struct Phase {
pub start: u64,
pub end: u64,
}
pub fn get_epoch_phases(protocol_config: &ProtocolConfig, epoch: u64) -> EpochPhases {
let epoch_start_slot = protocol_config
.genesis_slot
.saturating_add(epoch.saturating_mul(protocol_config.active_phase_length));
let registration_start = epoch_start_slot;
let registration_end = registration_start
.saturating_add(protocol_config.registration_phase_length)
.saturating_sub(1);
let active_start = registration_end.saturating_add(1);
let active_end = active_start
.saturating_add(protocol_config.active_phase_length)
.saturating_sub(1);
let report_work_start = active_end.saturating_add(1);
let report_work_end = report_work_start
.saturating_add(protocol_config.report_work_phase_length)
.saturating_sub(1);
let post_start = report_work_end.saturating_add(1);
let post_end = u64::MAX;
EpochPhases {
registration: Phase {
start: registration_start,
end: registration_end,
},
active: Phase {
start: active_start,
end: active_end,
},
report_work: Phase {
start: report_work_start,
end: report_work_end,
},
post: Phase {
start: post_start,
end: post_end,
},
}
}
#[derive(Debug, Clone, Default, PartialEq, Eq)]
pub struct Epoch {
pub epoch: u64,
pub epoch_pda: Pubkey,
pub forester_epoch_pda: Pubkey,
pub phases: EpochPhases,
pub state: EpochState,
pub merkle_trees: Vec<TreeForesterSchedule>,
}
#[derive(Debug, Clone, AnchorSerialize, AnchorDeserialize, Default, PartialEq, Eq)]
pub struct EpochRegistration {
pub epoch: u64,
pub slots_until_registration_starts: u64,
pub slots_until_registration_ends: u64,
}
impl Epoch {
/// returns slots until next epoch and that epoch
/// registration is open if
pub async fn slots_until_next_epoch_registration<R: RpcConnection>(
rpc: &mut R,
protocol_config: &ProtocolConfig,
) -> Result<EpochRegistration, RpcError> {
let current_solana_slot = rpc.get_slot().await?;
let mut epoch = protocol_config
.get_latest_register_epoch(current_solana_slot)
.unwrap();
let registration_start_slot =
protocol_config.genesis_slot + epoch * protocol_config.active_phase_length;
let registration_end_slot =
registration_start_slot + protocol_config.registration_phase_length;
if current_solana_slot > registration_end_slot {
epoch += 1;
}
let next_registration_start_slot =
protocol_config.genesis_slot + epoch * protocol_config.active_phase_length;
let next_registration_end_slot =
next_registration_start_slot + protocol_config.registration_phase_length;
let slots_until_registration_ends =
next_registration_end_slot.saturating_sub(current_solana_slot);
let slots_until_registration_starts =
next_registration_start_slot.saturating_sub(current_solana_slot);
Ok(EpochRegistration {
epoch,
slots_until_registration_starts,
slots_until_registration_ends,
})
}
/// creates forester account and fetches epoch account
pub async fn register<R: RpcConnection>(
rpc: &mut R,
protocol_config: &ProtocolConfig,
authority: &Keypair,
derivation: &Pubkey,
) -> Result<Option<Epoch>, RpcError> {
let epoch_registration =
Self::slots_until_next_epoch_registration(rpc, protocol_config).await?;
if epoch_registration.slots_until_registration_starts > 0
|| epoch_registration.slots_until_registration_ends == 0
{
return Ok(None);
}
let instruction = create_register_forester_epoch_pda_instruction(
&authority.pubkey(),
derivation,
epoch_registration.epoch,
);
let signature = rpc
.create_and_send_transaction(&[instruction], &authority.pubkey(), &[authority])
.await?;
rpc.confirm_transaction(signature).await?;
let epoch_pda_pubkey = get_epoch_pda_address(epoch_registration.epoch);
let epoch_pda = rpc
.get_anchor_account::<EpochPda>(&epoch_pda_pubkey)
.await?
.unwrap();
let forester_epoch_pda_pubkey =
get_forester_epoch_pda_from_authority(derivation, epoch_registration.epoch).0;
let phases = get_epoch_phases(protocol_config, epoch_pda.epoch);
Ok(Some(Self {
// epoch: epoch_registration.epoch,
epoch_pda: epoch_pda_pubkey,
forester_epoch_pda: forester_epoch_pda_pubkey,
merkle_trees: Vec::new(),
epoch: epoch_pda.epoch,
state: phases.get_current_epoch_state(rpc.get_slot().await?),
phases,
}))
}
// TODO: implement
/// forester account and epoch account already exist
/// -> fetch accounts and init
pub fn fetch_registered() {}
pub async fn fetch_account_and_add_trees_with_schedule<R: RpcConnection>(
&mut self,
rpc: &mut R,
trees: &[TreeAccounts],
) -> Result<(), RpcError> {
let current_solana_slot = rpc.get_slot().await?;
if self.phases.active.end < current_solana_slot
|| self.phases.active.start > current_solana_slot
{
println!("current_solana_slot {:?}", current_solana_slot);
println!("registration phase {:?}", self.phases.registration);
println!("active phase {:?}", self.phases.active);
// return Err(RpcError::EpochNotActive);
panic!("TODO: throw epoch not active error");
}
let epoch_pda = rpc
.get_anchor_account::<EpochPda>(&self.epoch_pda)
.await?
.unwrap();
let mut forester_epoch_pda = rpc
.get_anchor_account::<ForesterEpochPda>(&self.forester_epoch_pda)
.await?
.unwrap();
// IF active phase has started and total_epoch_weight is not set, set it now to
if forester_epoch_pda.total_epoch_weight.is_none() {
forester_epoch_pda.total_epoch_weight = Some(epoch_pda.registered_weight);
}
self.add_trees_with_schedule(&forester_epoch_pda, &epoch_pda, trees, current_solana_slot);
Ok(())
}
/// Internal function to init Epoch struct with registered account
/// 1. calculate epoch phases
/// 2. set current epoch state
/// 3. derive tree schedule for all input trees
pub fn add_trees_with_schedule(
&mut self,
forester_epoch_pda: &ForesterEpochPda,
epoch_pda: &EpochPda,
trees: &[TreeAccounts],
current_solana_slot: u64,
) {
// let state = self.phases.get_current_epoch_state(current_solana_slot);
// TODO: add epoch state to sync schedule
for tree in trees {
let tree_schedule = TreeForesterSchedule::new_with_schedule(
tree,
current_solana_slot,
forester_epoch_pda,
epoch_pda,
);
self.merkle_trees.push(tree_schedule);
}
}
pub fn update_state(&mut self, current_solana_slot: u64) -> EpochState {
let current_state = self.phases.get_current_epoch_state(current_solana_slot);
if current_state != self.state {
self.state = current_state.clone();
}
current_state
}
/// execute active phase test:
/// (multi thread)
/// - iterate over all trees, check whether eligible and empty queues
///
/// forester:
/// - start a new thread per tree
/// - this thread will sleep when it is not elibile and wake up with
/// some buffer time prior to the start of the slot
/// - threads shut down when the active phase ends
pub fn execute_active_phase() {}
/// report work phase:
/// (single thread)
/// - free Merkle tree memory
/// - execute report work tx (single thread)
pub fn execute_report_work_phase() {}
/// post phase:
/// (single thread)
/// - claim rewards
/// - close forester epoch account
pub fn execute_post_phase() {}
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn test_epoch_phases() {
let config = ProtocolConfig {
genesis_slot: 200,
min_weight: 0,
slot_length: 10,
registration_phase_length: 100,
active_phase_length: 1000,
report_work_phase_length: 100,
network_fee: 5000,
..Default::default()
};
let epoch = 1;
let phases = get_epoch_phases(&config, epoch);
assert_eq!(phases.registration.start, 1200);
assert_eq!(phases.registration.end, 1299);
assert_eq!(phases.active.start, 1300);
assert_eq!(phases.active.end, 2299);
assert_eq!(phases.report_work.start, 2300);
assert_eq!(phases.report_work.end, 2399);
assert_eq!(phases.post.start, 2400);
assert_eq!(phases.post.end, u64::MAX);
}
#[test]
fn test_get_schedule_for_queue() {
let protocol_config = ProtocolConfig {
genesis_slot: 0,
min_weight: 100,
slot_length: 10,
registration_phase_length: 100,
active_phase_length: 1000,
report_work_phase_length: 100,
network_fee: 5000,
..Default::default()
};
let total_epoch_weight = 500;
let queue_pubkey = Pubkey::new_unique();
let start_solana_slot = 0;
let epoch = 0;
let schedule = get_schedule_for_queue(
start_solana_slot,
&queue_pubkey,
&protocol_config,
total_epoch_weight,
epoch,
);
assert_eq!(
schedule.len(),
(protocol_config.active_phase_length / protocol_config.slot_length) as usize
);
for (i, slot_option) in schedule.iter().enumerate() {
let slot = slot_option.as_ref().unwrap();
assert_eq!(slot.slot, i as u64);
assert_eq!(
slot.start_solana_slot,
start_solana_slot + (i as u64 * protocol_config.slot_length)
);
assert_eq!(
slot.end_solana_slot,
slot.start_solana_slot + protocol_config.slot_length
);
assert!(slot.forester_index < total_epoch_weight);
}
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/forester-utils
|
solana_public_repos/Lightprotocol/light-protocol/forester-utils/src/address_merkle_tree_config.rs
|
use crate::{
get_concurrent_merkle_tree, get_hash_set, get_indexed_merkle_tree,
indexer::{AddressMerkleTreeAccounts, StateMerkleTreeAccounts},
AccountZeroCopy,
};
use account_compression::{
AddressMerkleTreeAccount, AddressMerkleTreeConfig, AddressQueueConfig, NullifierQueueConfig,
QueueAccount, StateMerkleTreeAccount, StateMerkleTreeConfig,
};
use light_client::rpc::RpcConnection;
use light_hasher::Poseidon;
use num_traits::Zero;
use solana_sdk::pubkey::Pubkey;
pub async fn get_address_bundle_config<R: RpcConnection>(
rpc: &mut R,
address_bundle: AddressMerkleTreeAccounts,
) -> (AddressMerkleTreeConfig, AddressQueueConfig) {
let address_queue_meta_data =
AccountZeroCopy::<account_compression::QueueAccount>::new(rpc, address_bundle.queue)
.await
.deserialized()
.metadata;
let address_queue = unsafe { get_hash_set::<QueueAccount, R>(rpc, address_bundle.queue).await };
let queue_config = AddressQueueConfig {
network_fee: Some(address_queue_meta_data.rollover_metadata.network_fee),
// rollover_threshold: address_queue_meta_data.rollover_threshold,
capacity: address_queue.get_capacity() as u16,
sequence_threshold: address_queue.sequence_threshold as u64,
};
let address_tree_meta_data =
AccountZeroCopy::<account_compression::AddressMerkleTreeAccount>::new(
rpc,
address_bundle.merkle_tree,
)
.await
.deserialized()
.metadata;
let address_tree =
get_indexed_merkle_tree::<AddressMerkleTreeAccount, R, Poseidon, usize, 26, 16>(
rpc,
address_bundle.merkle_tree,
)
.await;
let address_merkle_tree_config = AddressMerkleTreeConfig {
height: address_tree.height as u32,
changelog_size: address_tree.merkle_tree.changelog.capacity() as u64,
roots_size: address_tree.merkle_tree.roots.capacity() as u64,
canopy_depth: address_tree.canopy_depth as u64,
address_changelog_size: address_tree.indexed_changelog.capacity() as u64,
rollover_threshold: if address_tree_meta_data
.rollover_metadata
.rollover_threshold
.is_zero()
{
None
} else {
Some(address_tree_meta_data.rollover_metadata.rollover_threshold)
},
network_fee: Some(address_tree_meta_data.rollover_metadata.network_fee),
close_threshold: None,
};
(address_merkle_tree_config, queue_config)
}
pub async fn get_state_bundle_config<R: RpcConnection>(
rpc: &mut R,
state_tree_bundle: StateMerkleTreeAccounts,
) -> (StateMerkleTreeConfig, NullifierQueueConfig) {
let address_queue_meta_data = AccountZeroCopy::<account_compression::QueueAccount>::new(
rpc,
state_tree_bundle.nullifier_queue,
)
.await
.deserialized()
.metadata;
let address_queue =
unsafe { get_hash_set::<QueueAccount, R>(rpc, state_tree_bundle.nullifier_queue).await };
let queue_config = NullifierQueueConfig {
network_fee: Some(address_queue_meta_data.rollover_metadata.network_fee),
capacity: address_queue.get_capacity() as u16,
sequence_threshold: address_queue.sequence_threshold as u64,
};
let address_tree_meta_data =
AccountZeroCopy::<account_compression::StateMerkleTreeAccount>::new(
rpc,
state_tree_bundle.merkle_tree,
)
.await
.deserialized()
.metadata;
let address_tree = get_concurrent_merkle_tree::<StateMerkleTreeAccount, R, Poseidon, 26>(
rpc,
state_tree_bundle.merkle_tree,
)
.await;
let address_merkle_tree_config = StateMerkleTreeConfig {
height: address_tree.height as u32,
changelog_size: address_tree.changelog.capacity() as u64,
roots_size: address_tree.roots.capacity() as u64,
canopy_depth: address_tree.canopy_depth as u64,
rollover_threshold: if address_tree_meta_data
.rollover_metadata
.rollover_threshold
.is_zero()
{
None
} else {
Some(address_tree_meta_data.rollover_metadata.rollover_threshold)
},
network_fee: Some(address_tree_meta_data.rollover_metadata.network_fee),
close_threshold: None,
};
(address_merkle_tree_config, queue_config)
}
pub async fn address_tree_ready_for_rollover<R: RpcConnection>(
rpc: &mut R,
merkle_tree: Pubkey,
) -> bool {
let account =
AccountZeroCopy::<account_compression::AddressMerkleTreeAccount>::new(rpc, merkle_tree)
.await;
let rent_exemption = rpc
.get_minimum_balance_for_rent_exemption(account.account.data.len())
.await
.unwrap();
let address_tree_meta_data = account.deserialized().metadata;
let address_tree =
get_indexed_merkle_tree::<AddressMerkleTreeAccount, R, Poseidon, usize, 26, 16>(
rpc,
merkle_tree,
)
.await;
// rollover threshold is reached
address_tree.next_index()
>= ((1 << address_tree.merkle_tree.height)
* address_tree_meta_data.rollover_metadata.rollover_threshold
/ 100) as usize
// hash sufficient funds for rollover
&& account.account.lamports >= rent_exemption * 2
// has not been rolled over
&& address_tree_meta_data.rollover_metadata.rolledover_slot == u64::MAX
}
pub async fn state_tree_ready_for_rollover<R: RpcConnection>(
rpc: &mut R,
merkle_tree: Pubkey,
) -> bool {
let account = AccountZeroCopy::<StateMerkleTreeAccount>::new(rpc, merkle_tree).await;
let rent_exemption = rpc
.get_minimum_balance_for_rent_exemption(account.account.data.len())
.await
.unwrap();
let tree_meta_data = account.deserialized().metadata;
let tree =
get_concurrent_merkle_tree::<StateMerkleTreeAccount, R, Poseidon, 26>(rpc, merkle_tree)
.await;
// rollover threshold is reached
tree.next_index()
>= ((1 << tree.height) * tree_meta_data.rollover_metadata.rollover_threshold / 100) as usize
// hash sufficient funds for rollover
&& account.account.lamports >= rent_exemption * 2
// has not been rolled over
&& tree_meta_data.rollover_metadata.rolledover_slot == u64::MAX
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/forester-utils/src
|
solana_public_repos/Lightprotocol/light-protocol/forester-utils/src/indexer/mod.rs
|
use num_bigint::BigUint;
use solana_sdk::signature::Keypair;
use std::fmt::Debug;
use account_compression::initialize_address_merkle_tree::{
Error as AccountCompressionError, Pubkey,
};
use light_client::rpc::RpcConnection;
use light_compressed_token::TokenData;
use light_hash_set::HashSetError;
use light_hasher::Poseidon;
use light_indexed_merkle_tree::array::{IndexedArray, IndexedElement};
use light_indexed_merkle_tree::reference::IndexedMerkleTree;
use light_merkle_tree_reference::MerkleTree;
use light_system_program::invoke::processor::CompressedProof;
use light_system_program::sdk::compressed_account::CompressedAccountWithMerkleContext;
use light_system_program::sdk::event::PublicTransactionEvent;
use photon_api::apis::{default_api::GetCompressedAccountProofPostError, Error as PhotonApiError};
use thiserror::Error;
#[derive(Debug, Clone)]
pub struct TokenDataWithContext {
pub token_data: TokenData,
pub compressed_account: CompressedAccountWithMerkleContext,
}
#[derive(Debug)]
pub struct ProofRpcResult {
pub proof: CompressedProof,
pub root_indices: Vec<u16>,
pub address_root_indices: Vec<u16>,
}
#[derive(Debug, Clone, Copy, Ord, PartialOrd, Eq, PartialEq)]
pub struct StateMerkleTreeAccounts {
pub merkle_tree: Pubkey,
pub nullifier_queue: Pubkey,
pub cpi_context: Pubkey,
}
#[derive(Debug, Clone, Copy)]
pub struct AddressMerkleTreeAccounts {
pub merkle_tree: Pubkey,
pub queue: Pubkey,
}
#[derive(Debug, Clone)]
pub struct StateMerkleTreeBundle {
pub rollover_fee: i64,
pub merkle_tree: Box<MerkleTree<Poseidon>>,
pub accounts: StateMerkleTreeAccounts,
}
#[derive(Debug, Clone)]
pub struct AddressMerkleTreeBundle {
pub rollover_fee: i64,
pub merkle_tree: Box<IndexedMerkleTree<Poseidon, usize>>,
pub indexed_array: Box<IndexedArray<Poseidon, usize>>,
pub accounts: AddressMerkleTreeAccounts,
}
pub trait Indexer<R: RpcConnection>: Sync + Send + Debug + 'static {
fn get_multiple_compressed_account_proofs(
&self,
hashes: Vec<String>,
) -> impl std::future::Future<Output = Result<Vec<MerkleProof>, IndexerError>> + Send + Sync;
fn get_rpc_compressed_accounts_by_owner(
&self,
owner: &Pubkey,
) -> impl std::future::Future<Output = Result<Vec<String>, IndexerError>> + Send + Sync;
fn get_multiple_new_address_proofs(
&self,
merkle_tree_pubkey: [u8; 32],
addresses: Vec<[u8; 32]>,
) -> impl std::future::Future<Output = Result<Vec<NewAddressProofWithContext>, IndexerError>>
+ Send
+ Sync;
fn account_nullified(&mut self, _merkle_tree_pubkey: Pubkey, _account_hash: &str) {}
fn address_tree_updated(
&mut self,
_merkle_tree_pubkey: Pubkey,
_context: &NewAddressProofWithContext,
) {
}
fn get_state_merkle_tree_accounts(&self, _pubkeys: &[Pubkey]) -> Vec<StateMerkleTreeAccounts> {
unimplemented!()
}
fn add_event_and_compressed_accounts(
&mut self,
_event: &PublicTransactionEvent,
) -> (
Vec<CompressedAccountWithMerkleContext>,
Vec<TokenDataWithContext>,
) {
unimplemented!()
}
fn get_state_merkle_trees(&self) -> &Vec<StateMerkleTreeBundle> {
unimplemented!()
}
fn get_state_merkle_trees_mut(&mut self) -> &mut Vec<StateMerkleTreeBundle> {
unimplemented!()
}
fn get_address_merkle_trees(&self) -> &Vec<AddressMerkleTreeBundle> {
unimplemented!()
}
fn get_address_merkle_trees_mut(&mut self) -> &mut Vec<AddressMerkleTreeBundle> {
unimplemented!()
}
fn get_token_compressed_accounts(&self) -> &Vec<TokenDataWithContext> {
unimplemented!()
}
fn get_payer(&self) -> &Keypair {
unimplemented!()
}
fn get_group_pda(&self) -> &Pubkey {
unimplemented!()
}
#[allow(async_fn_in_trait)]
async fn create_proof_for_compressed_accounts(
&mut self,
_compressed_accounts: Option<&[[u8; 32]]>,
_state_merkle_tree_pubkeys: Option<&[Pubkey]>,
_new_addresses: Option<&[[u8; 32]]>,
_address_merkle_tree_pubkeys: Option<Vec<Pubkey>>,
_rpc: &mut R,
) -> ProofRpcResult {
unimplemented!()
}
fn add_address_merkle_tree_accounts(
&mut self,
_merkle_tree_keypair: &Keypair,
_queue_keypair: &Keypair,
_owning_program_id: Option<Pubkey>,
) -> AddressMerkleTreeAccounts {
unimplemented!()
}
fn get_compressed_accounts_by_owner(
&self,
_owner: &Pubkey,
) -> Vec<CompressedAccountWithMerkleContext> {
unimplemented!()
}
fn get_compressed_token_accounts_by_owner(&self, _owner: &Pubkey) -> Vec<TokenDataWithContext> {
unimplemented!()
}
fn add_state_bundle(&mut self, _state_bundle: StateMerkleTreeBundle) {
unimplemented!()
}
}
#[derive(Debug, Clone)]
pub struct MerkleProof {
pub hash: String,
pub leaf_index: u64,
pub merkle_tree: String,
pub proof: Vec<[u8; 32]>,
pub root_seq: u64,
}
// For consistency with the Photon API.
#[derive(Clone, Default, Debug, PartialEq)]
pub struct NewAddressProofWithContext {
pub merkle_tree: [u8; 32],
pub root: [u8; 32],
pub root_seq: u64,
pub low_address_index: u64,
pub low_address_value: [u8; 32],
pub low_address_next_index: u64,
pub low_address_next_value: [u8; 32],
pub low_address_proof: [[u8; 32]; 16],
pub new_low_element: Option<IndexedElement<usize>>,
pub new_element: Option<IndexedElement<usize>>,
pub new_element_next_value: Option<BigUint>,
}
#[derive(Error, Debug)]
pub enum IndexerError {
#[error("RPC Error: {0}")]
RpcError(#[from] solana_client::client_error::ClientError),
#[error("failed to deserialize account data")]
DeserializeError(#[from] solana_sdk::program_error::ProgramError),
#[error("failed to copy merkle tree")]
CopyMerkleTreeError(#[from] std::io::Error),
#[error(transparent)]
AccountCompressionError(#[from] AccountCompressionError),
#[error(transparent)]
HashSetError(#[from] HashSetError),
#[error(transparent)]
PhotonApiError(PhotonApiErrorWrapper),
#[error("error: {0:?}")]
Custom(String),
#[error("unknown error")]
Unknown,
}
#[derive(Error, Debug)]
pub enum PhotonApiErrorWrapper {
#[error(transparent)]
GetCompressedAccountProofPostError(#[from] PhotonApiError<GetCompressedAccountProofPostError>),
}
impl From<PhotonApiError<GetCompressedAccountProofPostError>> for IndexerError {
fn from(err: PhotonApiError<GetCompressedAccountProofPostError>) -> Self {
IndexerError::PhotonApiError(PhotonApiErrorWrapper::GetCompressedAccountProofPostError(
err,
))
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol
|
solana_public_repos/Lightprotocol/light-protocol/assets/logo.svg
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="153.5"
height="153.5"
viewBox="0 0 153.5 153.5"
fill="none"
version="1.1"
id="svg68"
sodipodi:docname="logo.svg"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs72" />
<sodipodi:namedview
id="namedview70"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="3.3562092"
inkscape:cx="25.922103"
inkscape:cy="76.872444"
inkscape:window-width="2560"
inkscape:window-height="1371"
inkscape:window-x="0"
inkscape:window-y="32"
inkscape:window-maximized="1"
inkscape:current-layer="svg68"
showguides="false" />
<rect
width="153"
height="153"
rx="15"
fill="#0066ff"
id="rect54"
x="0.25"
y="0.25"
style="stroke-width:0.5" />
<path
d="M 84.6445,36.72955 70.666,87.534 c -0.6435,2.3385 -4.1825,1.8855 -4.1825,-0.5355 V 34.40475 c 0,-4.96445 4.136,-8.989 9.238,-8.989 6.073,0 10.494,5.6051 8.923,11.3138 z"
fill="#ffffff"
id="path56"
style="stroke-width:0.5" />
<path
d="M 109.9075,62.6705 77.136,93.2355 c -1.7115,1.596 -4.3425,-0.4495 -3.1795,-2.4725 l 22.264,-38.7335 c 2.662,-4.63065 8.8515,-5.8499 13.0845,-2.5776 4.249,3.2846 4.5345,9.5511 0.6025,13.2186 z"
fill="#ffffff"
id="path58"
style="stroke-width:0.5" />
<path
d="m 105.7575,101.3905 h -24.869 c -2.197,0 -2.8965,-3.057 -0.931,-4.071 l 22.2435,-11.479 c 5.288,-2.729 11.5095,1.24 11.5095,7.3415 0,4.5335 -3.5605,8.2085 -7.953,8.2085 z"
fill="#ffffff"
id="path60"
style="stroke-width:0.5" />
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="m 46.9758,25.41575 c 3.9692,0 7.1867,3.21765 7.1867,7.1868 v 88.29495 c 0,3.969 -3.2175,7.187 -7.1867,7.187 -3.96915,0 -7.1868,-3.218 -7.1868,-7.187 V 32.60255 c 0,-3.96915 3.21765,-7.1868 7.1868,-7.1868 z"
fill="#ffffff"
id="path62"
style="stroke-width:0.5" />
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="m 113.711,120.8975 c 0,3.9695 -3.2175,7.187 -7.187,7.187 H 46.97635 c -3.96915,0 -7.1868,-3.2175 -7.1868,-7.187 0,-3.969 3.21765,-7.1865 7.1868,-7.1865 H 106.524 c 3.9695,0 7.187,3.2175 7.187,7.1865 z"
fill="#ffffff"
id="path64"
style="stroke-width:0.5" />
<rect
width="153"
height="153"
rx="15"
stroke="#ffffff"
id="rect66"
x="0.25"
y="0.25"
style="stroke-width:0.5" />
</svg>
| 0
|
solana_public_repos/Lightprotocol/light-protocol
|
solana_public_repos/Lightprotocol/light-protocol/client/Cargo.toml
|
[package]
name = "light-client"
version = "0.9.1"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/lightprotocol/light-protocol"
description = "Client library for Light Protocol"
[features]
devenv = []
[dependencies]
# Solana
solana-banks-client = { workspace = true }
solana-client = { workspace = true }
solana-program = { workspace = true }
solana-program-test = { workspace = true }
solana-sdk = { workspace = true }
solana-transaction-status = { workspace = true }
photon-api = { workspace = true }
# Anchor compatibility
borsh = { workspace = true }
# Async ecosystem
tokio = { workspace = true }
async-trait = { workspace = true }
bb8 = { workspace = true }
# Logging
log = { workspace = true }
# Error handling
thiserror = { workspace = true }
# Light Protocol
light-concurrent-merkle-tree = { workspace = true }
light-indexed-merkle-tree = { workspace = true }
light-merkle-tree-reference = { workspace = true }
light-prover-client = { workspace = true }
light-sdk = { workspace = true }
light-hasher = { workspace = true }
# Math and crypto
num-bigint = { workspace = true }
num-traits = { workspace = true }
# HTTP client
reqwest = { workspace = true }
[dev-dependencies]
light-test-utils = { version = "1.2.0", path = "../test-utils", features=["devenv"]}
light-program-test = { workspace = true }
light-system-program = { workspace = true }
light-compressed-token = { workspace = true }
spl-token = { workspace = true }
rand = "0.8.5"
light-utils = { workspace = true }
[profile.test]
overflow-checks = true
debug = true
debug-assertions = true
| 0
|
solana_public_repos/Lightprotocol/light-protocol/client
|
solana_public_repos/Lightprotocol/light-protocol/client/tests/rpc_client.rs
|
use light_client::photon_rpc::Base58Conversions;
use light_client::photon_rpc::Hash;
use light_client::{
photon_rpc::{AddressWithTree, PhotonClient},
rpc::SolanaRpcConnection,
};
use light_compressed_token::mint_sdk::{
create_create_token_pool_instruction, create_mint_to_instruction,
};
use light_program_test::test_env::EnvAccounts;
use light_prover_client::gnark::helpers::{
spawn_validator, LightValidatorConfig, ProofType, ProverConfig,
};
use light_system_program::sdk::{
compressed_account::CompressedAccount, invoke::create_invoke_instruction,
};
use light_test_utils::RpcConnection;
use light_utils::hash_to_bn254_field_size_be;
use num_traits::ToPrimitive;
use solana_sdk::{
native_token::LAMPORTS_PER_SOL, signature::Keypair, signer::Signer, system_instruction,
transaction::Transaction,
};
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
async fn test_all_endpoints() {
// Endpoints tested:
// 1. get_rpc_compressed_accounts_by_owner
// 2. get_multiple_compressed_accounts
// 3. get_validity_proof
// 4. get_compressed_account
// 5. get_compressed_account_balance
// 6. get_compression_signatures_for_account
// 7. get_compressed_token_accounts_by_owner
// 8. get_compressed_token_account_balance
// 9. get_compressed_token_balances_by_owner
// 10. get_multiple_compressed_account_proofs
// 11. get_multiple_new_address_proofs
let config = LightValidatorConfig {
enable_indexer: true,
prover_config: Some(ProverConfig {
run_mode: None,
circuits: vec![ProofType::Combined],
}),
wait_time: 20,
};
spawn_validator(config).await;
let env_accounts = EnvAccounts::get_local_test_validator_accounts();
let mut rpc: SolanaRpcConnection =
SolanaRpcConnection::new("http://127.0.0.1:8899".to_string(), None);
let client = PhotonClient::new("http://127.0.0.1:8784".to_string());
let payer_pubkey = rpc.get_payer().pubkey();
rpc.airdrop_lamports(&payer_pubkey, LAMPORTS_PER_SOL)
.await
.unwrap();
// create compressed account
let lamports = LAMPORTS_PER_SOL / 2;
let output_account = CompressedAccount {
lamports,
owner: rpc.get_payer().pubkey(),
data: None,
address: None,
};
let ix = create_invoke_instruction(
&rpc.get_payer().pubkey(),
&rpc.get_payer().pubkey(),
&[],
&[output_account],
&[],
&[env_accounts.merkle_tree_pubkey],
&[],
&[],
None,
Some(lamports),
true,
None,
true,
);
let tx_create_compressed_account = Transaction::new_signed_with_payer(
&[ix],
Some(&payer_pubkey),
&[&rpc.get_payer()],
rpc.client.get_latest_blockhash().unwrap(),
);
rpc.client
.send_and_confirm_transaction(&tx_create_compressed_account)
.unwrap();
tokio::time::sleep(std::time::Duration::from_secs(2)).await;
let mint = Keypair::new();
// Setup mint and create compressed token account
let mint_rent = rpc
.client
.get_minimum_balance_for_rent_exemption(82)
.unwrap();
let create_mint_ix = system_instruction::create_account(
&payer_pubkey,
&mint.pubkey(),
mint_rent,
82,
&spl_token::id(),
);
let init_mint_ix = spl_token::instruction::initialize_mint(
&spl_token::id(),
&mint.pubkey(),
&payer_pubkey,
None,
9,
)
.unwrap();
// Create token pool for compression
let create_pool_ix = create_create_token_pool_instruction(&payer_pubkey, &mint.pubkey(), false);
let tx = Transaction::new_signed_with_payer(
&[create_mint_ix, init_mint_ix, create_pool_ix],
Some(&payer_pubkey),
&[rpc.get_payer(), &mint],
rpc.client.get_latest_blockhash().unwrap(),
);
rpc.client.send_and_confirm_transaction(&tx).unwrap();
let amount = 1_000_000;
let mint_ix = create_mint_to_instruction(
&payer_pubkey,
&payer_pubkey,
&mint.pubkey(),
&env_accounts.merkle_tree_pubkey,
vec![amount],
vec![payer_pubkey],
None,
false,
);
let tx = Transaction::new_signed_with_payer(
&[mint_ix],
Some(&payer_pubkey),
&[&rpc.get_payer()],
rpc.client.get_latest_blockhash().unwrap(),
);
rpc.client.send_and_confirm_transaction(&tx).unwrap();
let pubkey = payer_pubkey;
let hashes = client
.get_rpc_compressed_accounts_by_owner(&pubkey)
.await
.unwrap();
assert!(!hashes.is_empty());
let first_hash = hashes[0];
let seed = rand::random::<[u8; 32]>();
let new_addresses = vec![AddressWithTree {
address: hash_to_bn254_field_size_be(&seed).unwrap().0,
tree: env_accounts.address_merkle_tree_pubkey,
}];
let accounts = client
.get_multiple_compressed_accounts(None, Some(hashes.clone()))
.await
.unwrap();
assert!(!accounts.value.is_empty());
assert_eq!(accounts.value[0].hash, first_hash);
let result = client
.get_validity_proof(hashes.clone(), new_addresses)
.await
.unwrap();
assert_eq!(
Hash::from_base58(result.value.leaves[0].as_ref()).unwrap(),
hashes[0]
);
let account = client
.get_compressed_account(None, Some(first_hash))
.await
.unwrap();
assert_eq!(account.value.lamports, lamports);
assert_eq!(account.value.owner, rpc.get_payer().pubkey().to_string());
let balance = client
.get_compressed_account_balance(None, Some(first_hash))
.await
.unwrap();
assert_eq!(balance.value.lamports, lamports);
let signatures = client
.get_compression_signatures_for_account(first_hash)
.await
.unwrap();
assert_eq!(
signatures.value.items[0].signature,
tx_create_compressed_account.signatures[0].to_string()
);
let token_account = &client
.get_compressed_token_accounts_by_owner(&pubkey, None)
.await
.unwrap()
.value
.items[0];
assert_eq!(token_account.token_data.mint, mint.pubkey().to_string());
assert_eq!(token_account.token_data.owner, payer_pubkey.to_string());
let balance = client
.get_compressed_token_account_balance(
None,
Some(
Hash::from_base58(token_account.account.hash.as_ref())
.unwrap()
.to_bytes(),
),
)
.await
.unwrap();
assert_eq!(balance.value.amount, amount.to_string());
let balances = client
.get_compressed_token_balances_by_owner(&pubkey, None)
.await
.unwrap();
assert_eq!(
balances.value.token_balances[0].balance,
amount.to_i32().unwrap()
);
let proofs = client
.get_multiple_compressed_account_proofs(hashes.clone())
.await
.unwrap();
assert!(!proofs.is_empty());
assert_eq!(proofs[0].hash, hashes[0].to_base58());
let addresses = vec![hash_to_bn254_field_size_be(&seed).unwrap().0];
let new_address_proofs = client
.get_multiple_new_address_proofs(env_accounts.merkle_tree_pubkey, addresses)
.await
.unwrap();
assert!(!new_address_proofs.is_empty());
assert_eq!(
new_address_proofs[0].merkle_tree.to_bytes(),
env_accounts.merkle_tree_pubkey.to_bytes()
);
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/client
|
solana_public_repos/Lightprotocol/light-protocol/client/src/lib.rs
|
pub mod indexer;
pub mod photon_rpc;
pub mod rpc;
pub mod rpc_pool;
pub mod transaction_params;
| 0
|
solana_public_repos/Lightprotocol/light-protocol/client
|
solana_public_repos/Lightprotocol/light-protocol/client/src/rpc_pool.rs
|
use async_trait::async_trait;
use bb8::{Pool, PooledConnection};
use solana_sdk::commitment_config::CommitmentConfig;
use std::time::Duration;
use thiserror::Error;
use tokio::time::sleep;
use crate::rpc::{RpcConnection, RpcError};
#[derive(Error, Debug)]
pub enum PoolError {
#[error("Failed to create RPC client: {0}")]
ClientCreation(String),
#[error("RPC request failed: {0}")]
RpcRequest(#[from] RpcError),
#[error("Pool error: {0}")]
Pool(String),
}
pub struct SolanaConnectionManager<R: RpcConnection> {
url: String,
commitment: CommitmentConfig,
_phantom: std::marker::PhantomData<R>,
}
impl<R: RpcConnection> SolanaConnectionManager<R> {
pub fn new(url: String, commitment: CommitmentConfig) -> Self {
Self {
url,
commitment,
_phantom: std::marker::PhantomData,
}
}
}
#[async_trait]
impl<R: RpcConnection> bb8::ManageConnection for SolanaConnectionManager<R> {
type Connection = R;
type Error = PoolError;
async fn connect(&self) -> Result<Self::Connection, Self::Error> {
Ok(R::new(&self.url, Some(self.commitment)))
}
async fn is_valid(&self, conn: &mut Self::Connection) -> Result<(), Self::Error> {
conn.health().await.map_err(PoolError::RpcRequest)
}
fn has_broken(&self, _conn: &mut Self::Connection) -> bool {
false
}
}
#[derive(Debug)]
pub struct SolanaRpcPool<R: RpcConnection> {
pool: Pool<SolanaConnectionManager<R>>,
}
impl<R: RpcConnection> SolanaRpcPool<R> {
pub async fn new(
url: String,
commitment: CommitmentConfig,
max_size: u32,
) -> Result<Self, PoolError> {
let manager = SolanaConnectionManager::new(url, commitment);
let pool = Pool::builder()
.max_size(max_size)
.connection_timeout(Duration::from_secs(15))
.idle_timeout(Some(Duration::from_secs(60 * 5)))
.build(manager)
.await
.map_err(|e| PoolError::Pool(e.to_string()))?;
Ok(Self { pool })
}
pub async fn get_connection(
&self,
) -> Result<PooledConnection<'_, SolanaConnectionManager<R>>, PoolError> {
self.pool
.get()
.await
.map_err(|e| PoolError::Pool(e.to_string()))
}
pub async fn get_connection_with_retry(
&self,
max_retries: u32,
delay: Duration,
) -> Result<PooledConnection<'_, SolanaConnectionManager<R>>, PoolError> {
let mut retries = 0;
loop {
match self.pool.get().await {
Ok(conn) => return Ok(conn),
Err(e) if retries < max_retries => {
retries += 1;
eprintln!("Failed to get connection (attempt {}): {:?}", retries, e);
sleep(delay).await;
}
Err(e) => return Err(PoolError::Pool(e.to_string())),
}
}
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/client
|
solana_public_repos/Lightprotocol/light-protocol/client/src/transaction_params.rs
|
#[derive(Debug, Clone, PartialEq)]
pub struct TransactionParams {
pub num_input_compressed_accounts: u8,
pub num_output_compressed_accounts: u8,
pub num_new_addresses: u8,
pub compress: i64,
pub fee_config: FeeConfig,
}
#[derive(Debug, Clone, PartialEq)]
pub struct FeeConfig {
pub state_merkle_tree_rollover: u64,
pub address_queue_rollover: u64,
// TODO: refactor to allow multiple state and address tree configs
// pub state_tree_configs: Vec<StateMerkleTreeConfig>,
// pub address_tree_configs: Vec<AddressMerkleTreeConfig>,
pub network_fee: u64,
pub address_network_fee: u64,
pub solana_network_fee: i64,
}
impl Default for FeeConfig {
fn default() -> Self {
Self {
// rollover fee plus additonal lamports for the cpi account
state_merkle_tree_rollover: 300,
address_queue_rollover: 392,
// TODO: refactor to allow multiple state and address tree configs
// state_tree_configs: vec![StateMerkleTreeConfig::default()],
// address_tree_configs: vec![AddressMerkleTreeConfig::default()],
network_fee: 5000,
address_network_fee: 5000,
solana_network_fee: 5000,
}
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/client/src
|
solana_public_repos/Lightprotocol/light-protocol/client/src/photon_rpc/types.rs
|
use solana_sdk::{bs58, pubkey::Pubkey};
use super::PhotonClientError;
pub type Address = [u8; 32];
pub type Hash = [u8; 32];
pub struct AddressWithTree {
pub address: Address,
pub tree: Pubkey,
}
pub trait Base58Conversions {
fn to_base58(&self) -> String;
fn from_base58(s: &str) -> Result<Self, PhotonClientError>
where
Self: Sized;
fn to_bytes(&self) -> [u8; 32];
fn from_bytes(bytes: &[u8]) -> Result<Self, PhotonClientError>
where
Self: Sized;
}
impl Base58Conversions for [u8; 32] {
fn to_base58(&self) -> String {
bs58::encode(self).into_string()
}
fn from_base58(s: &str) -> Result<Self, PhotonClientError> {
let bytes = bs58::decode(s)
.into_vec()
.map_err(|e| PhotonClientError::DecodeError(e.to_string()))?;
let mut arr = [0u8; 32];
arr.copy_from_slice(&bytes);
Ok(arr)
}
fn to_bytes(&self) -> [u8; 32] {
*self
}
fn from_bytes(bytes: &[u8]) -> Result<Self, PhotonClientError> {
let mut arr = [0u8; 32];
arr.copy_from_slice(bytes);
Ok(arr)
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/client/src
|
solana_public_repos/Lightprotocol/light-protocol/client/src/photon_rpc/error.rs
|
use photon_api::{
apis::{
default_api::{
GetCompressedAccountPostError, GetCompressedAccountProofPostError,
GetLatestCompressionSignaturesPostError, GetMultipleCompressedAccountProofsPostError,
GetMultipleNewAddressProofsV2PostError, GetTransactionWithCompressionInfoPostError,
},
Error as PhotonError,
},
models::GetCompressedAccountPost429Response,
};
use thiserror::Error;
#[derive(Debug, Error)]
pub enum PhotonClientError {
#[error(transparent)]
GetMultipleCompressedAccountProofsError(
#[from] PhotonError<GetMultipleCompressedAccountProofsPostError>,
),
#[error(transparent)]
GetCompressedAccountsByOwnerError(#[from] PhotonError<GetCompressedAccountPost429Response>),
#[error(transparent)]
GetMultipleNewAddressProofsError(#[from] PhotonError<GetMultipleNewAddressProofsV2PostError>),
#[error(transparent)]
GetCompressedAccountError(#[from] PhotonError<GetCompressedAccountPostError>),
#[error(transparent)]
GetCompressedAccountProofError(#[from] PhotonError<GetCompressedAccountProofPostError>),
#[error(transparent)]
GetTransactionWithCompressionInfoError(
#[from] PhotonError<GetTransactionWithCompressionInfoPostError>,
),
#[error(transparent)]
GetLatestCompressionSignaturesError(
#[from] PhotonError<GetLatestCompressionSignaturesPostError>,
),
#[error("Decode error: {0}")]
DecodeError(String),
#[error("Invalid parameter: {0}")]
InvalidParameter(String),
#[error("Network error: {0}")]
NetworkError(#[from] reqwest::Error),
#[error("Rate limit exceeded")]
RateLimitExceeded,
#[error("Missing required field: {0}")]
MissingField(String),
#[error("Invalid response format: {0}")]
InvalidResponse(String),
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/client/src
|
solana_public_repos/Lightprotocol/light-protocol/client/src/photon_rpc/models.rs
|
use crate::photon_rpc::types::{Base58Conversions, Hash};
#[derive(Debug)]
pub struct CompressedAccount {
pub hash: Hash,
pub data: String,
pub owner: String,
pub lamports: u64,
pub executable: bool,
pub rent_epoch: u64,
}
#[derive(Debug)]
pub struct TokenAccountBalance {
pub amount: String,
}
#[derive(Debug)]
pub struct AccountBalance {
pub lamports: u64,
}
#[derive(Debug)]
pub struct CompressedAccountResponse {
pub context: ResponseContext,
pub value: CompressedAccount,
}
#[derive(Debug)]
pub struct CompressedAccountsResponse {
pub context: ResponseContext,
pub value: Vec<CompressedAccount>,
}
#[derive(Debug)]
pub struct TokenAccountBalanceResponse {
pub context: ResponseContext,
pub value: TokenAccountBalance,
}
#[derive(Debug)]
pub struct AccountBalanceResponse {
pub context: ResponseContext,
pub value: AccountBalance,
}
#[derive(Debug)]
pub struct ResponseContext {
pub slot: u64,
}
impl From<photon_api::models::Context> for ResponseContext {
fn from(ctx: photon_api::models::Context) -> Self {
ResponseContext {
slot: ctx.slot as u64,
}
}
}
impl From<photon_api::models::GetCompressedAccountPost200ResponseResult>
for CompressedAccountResponse
{
fn from(result: photon_api::models::GetCompressedAccountPost200ResponseResult) -> Self {
let account = result.value.as_ref().unwrap();
CompressedAccountResponse {
context: ResponseContext::from(*result.context),
value: CompressedAccount {
hash: Hash::from_base58(&account.hash).unwrap(),
data: account
.data
.as_ref()
.map_or(String::new(), |d| d.data.clone()),
owner: account.owner.clone(),
lamports: account.lamports as u64,
executable: false,
rent_epoch: account.slot_created as u64,
},
}
}
}
impl From<photon_api::models::GetCompressedTokenAccountBalancePost200ResponseResult>
for TokenAccountBalanceResponse
{
fn from(
result: photon_api::models::GetCompressedTokenAccountBalancePost200ResponseResult,
) -> Self {
TokenAccountBalanceResponse {
context: ResponseContext::from(*result.context),
value: TokenAccountBalance {
amount: result.value.amount.to_string(),
},
}
}
}
impl From<photon_api::models::GetCompressedAccountBalancePost200ResponseResult>
for AccountBalanceResponse
{
fn from(result: photon_api::models::GetCompressedAccountBalancePost200ResponseResult) -> Self {
AccountBalanceResponse {
context: ResponseContext::from(*result.context),
value: AccountBalance {
lamports: result.value as u64,
},
}
}
}
impl From<photon_api::models::GetMultipleCompressedAccountsPost200ResponseResult>
for CompressedAccountsResponse
{
fn from(
result: photon_api::models::GetMultipleCompressedAccountsPost200ResponseResult,
) -> Self {
CompressedAccountsResponse {
context: ResponseContext::from(*result.context),
value: result
.value
.items
.iter()
.map(|acc| CompressedAccount {
hash: Hash::from_base58(&acc.hash).unwrap(),
data: acc.data.as_ref().map_or(String::new(), |d| d.data.clone()),
owner: acc.owner.clone(),
lamports: acc.lamports as u64,
executable: false,
rent_epoch: acc.slot_created as u64,
})
.collect(),
}
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/client/src
|
solana_public_repos/Lightprotocol/light-protocol/client/src/photon_rpc/photon_client.rs
|
use crate::indexer::{MerkleProof, NewAddressProofWithContext};
use photon_api::{
apis::configuration::{ApiKey, Configuration},
models::GetCompressedAccountsByOwnerPostRequestParams,
};
use solana_sdk::{bs58, pubkey::Pubkey};
use super::types::AddressWithTree;
use super::{
models::{AccountBalanceResponse, CompressedAccountsResponse},
Address, Base58Conversions, CompressedAccountResponse, Hash, PhotonClientError,
TokenAccountBalanceResponse,
};
#[derive(Debug)]
pub struct PhotonClient {
config: Configuration,
}
impl PhotonClient {
pub fn new(url: String) -> Self {
let mut config = Configuration::new();
config.base_path = url;
PhotonClient { config }
}
pub fn new_with_auth(url: String, api_key: String) -> Self {
let mut config = Configuration::new();
config.base_path = url;
config.api_key = Some(ApiKey {
key: api_key,
prefix: None,
});
PhotonClient { config }
}
pub async fn get_multiple_compressed_account_proofs(
&self,
hashes: Vec<Hash>,
) -> Result<Vec<MerkleProof>, PhotonClientError> {
let request = photon_api::models::GetMultipleCompressedAccountProofsPostRequest {
params: hashes.iter().map(|h| h.to_base58()).collect(),
..Default::default()
};
let result = photon_api::apis::default_api::get_multiple_compressed_account_proofs_post(
&self.config,
request,
)
.await?;
match result.result {
Some(result) => {
let proofs = result
.value
.iter()
.map(|x| {
let mut proof_result_value = x.proof.clone();
proof_result_value.truncate(proof_result_value.len() - 10);
let proof = proof_result_value
.iter()
.map(|x| Hash::from_base58(x).unwrap())
.collect();
MerkleProof {
hash: x.hash.clone(),
leaf_index: x.leaf_index,
merkle_tree: x.merkle_tree.clone(),
proof,
root_seq: x.root_seq,
}
})
.collect();
Ok(proofs)
}
None => Err(PhotonClientError::DecodeError("Missing result".to_string())),
}
}
pub async fn get_rpc_compressed_accounts_by_owner(
&self,
owner: &Pubkey,
) -> Result<Vec<Hash>, PhotonClientError> {
let request = photon_api::models::GetCompressedAccountsByOwnerPostRequest {
params: Box::from(GetCompressedAccountsByOwnerPostRequestParams {
cursor: None,
data_slice: None,
filters: None,
limit: None,
owner: owner.to_string(),
}),
..Default::default()
};
let result = photon_api::apis::default_api::get_compressed_accounts_by_owner_post(
&self.config,
request,
)
.await
.unwrap();
let accs = result.result.unwrap().value;
let mut hashes = Vec::new();
for acc in accs.items {
hashes.push(acc.hash);
}
Ok(hashes
.iter()
.map(|x| Hash::from_base58(x).unwrap())
.collect())
}
pub async fn get_multiple_new_address_proofs(
&self,
merkle_tree_pubkey: Pubkey,
addresses: Vec<Address>,
) -> Result<Vec<NewAddressProofWithContext>, PhotonClientError> {
let params: Vec<photon_api::models::AddressWithTree> = addresses
.iter()
.map(|x| photon_api::models::AddressWithTree {
address: bs58::encode(x).into_string(),
tree: bs58::encode(&merkle_tree_pubkey).into_string(),
})
.collect();
let request = photon_api::models::GetMultipleNewAddressProofsV2PostRequest {
params,
..Default::default()
};
let result = photon_api::apis::default_api::get_multiple_new_address_proofs_v2_post(
&self.config,
request,
)
.await;
if result.is_err() {
return Err(PhotonClientError::GetMultipleNewAddressProofsError(
result.err().unwrap(),
));
}
let photon_proofs = result.unwrap().result.unwrap().value;
let mut proofs: Vec<NewAddressProofWithContext> = Vec::new();
for photon_proof in photon_proofs {
let tree_pubkey = Hash::from_base58(&photon_proof.merkle_tree).unwrap();
let low_address_value = Hash::from_base58(&photon_proof.lower_range_address).unwrap();
let next_address_value = Hash::from_base58(&photon_proof.higher_range_address).unwrap();
let proof = NewAddressProofWithContext {
merkle_tree: tree_pubkey,
low_address_index: photon_proof.low_element_leaf_index as u64,
low_address_value,
low_address_next_index: photon_proof.next_index as u64,
low_address_next_value: next_address_value,
low_address_proof: {
let mut proof_vec: Vec<[u8; 32]> = photon_proof
.proof
.iter()
.map(|x: &String| Hash::from_base58(x).unwrap())
.collect();
proof_vec.truncate(proof_vec.len() - 10); // Remove canopy
let mut proof_arr = [[0u8; 32]; 16];
proof_arr.copy_from_slice(&proof_vec);
proof_arr
},
root: Hash::from_base58(&photon_proof.root).unwrap(),
root_seq: photon_proof.root_seq,
new_low_element: None,
new_element: None,
new_element_next_value: None,
};
proofs.push(proof);
}
Ok(proofs)
}
pub async fn get_validity_proof(
&self,
hashes: Vec<Hash>,
new_addresses_with_trees: Vec<AddressWithTree>,
) -> Result<photon_api::models::GetValidityProofPost200ResponseResult, PhotonClientError> {
let request = photon_api::models::GetValidityProofPostRequest {
params: Box::new(photon_api::models::GetValidityProofPostRequestParams {
hashes: Some(hashes.iter().map(|x| x.to_base58()).collect()),
new_addresses: None,
new_addresses_with_trees: Some(
new_addresses_with_trees
.iter()
.map(|x| photon_api::models::AddressWithTree {
address: x.address.to_base58(),
tree: x.tree.to_string(),
})
.collect(),
),
}),
..Default::default()
};
let result = photon_api::apis::default_api::get_validity_proof_post(&self.config, request)
.await
.map_err(|e| PhotonClientError::DecodeError(e.to_string()))?;
match result.result {
Some(result) => Ok(*result),
None => Err(PhotonClientError::DecodeError("Missing result".to_string())),
}
}
pub async fn get_compressed_account(
&self,
address: Option<Address>,
hash: Option<Hash>,
) -> Result<CompressedAccountResponse, PhotonClientError> {
let params = self.build_account_params(address, hash)?;
let request = photon_api::models::GetCompressedAccountPostRequest {
params: Box::new(params),
..Default::default()
};
let result =
photon_api::apis::default_api::get_compressed_account_post(&self.config, request)
.await
.map_err(|e| PhotonClientError::DecodeError(e.to_string()))?;
Self::handle_result(result.result).map(|r| CompressedAccountResponse::from(*r))
}
pub async fn get_compressed_token_accounts_by_owner(
&self,
owner: &Pubkey,
mint: Option<Pubkey>,
) -> Result<
photon_api::models::GetCompressedTokenAccountsByDelegatePost200ResponseResult,
PhotonClientError,
> {
let request = photon_api::models::GetCompressedTokenAccountsByOwnerPostRequest {
params: Box::new(
photon_api::models::GetCompressedTokenAccountsByOwnerPostRequestParams {
owner: owner.to_string(),
mint: mint.map(|x| Some(x.to_string())),
cursor: None,
limit: None,
},
),
..Default::default()
};
let result = photon_api::apis::default_api::get_compressed_token_accounts_by_owner_post(
&self.config,
request,
)
.await
.map_err(|e| PhotonClientError::DecodeError(e.to_string()))?;
Self::handle_result(result.result).map(|r| *r)
}
pub async fn get_compressed_account_balance(
&self,
address: Option<Address>,
hash: Option<Hash>,
) -> Result<AccountBalanceResponse, PhotonClientError> {
let params = self.build_account_params(address, hash)?;
let request = photon_api::models::GetCompressedAccountBalancePostRequest {
params: Box::new(params),
..Default::default()
};
let result = photon_api::apis::default_api::get_compressed_account_balance_post(
&self.config,
request,
)
.await
.map_err(|e| PhotonClientError::DecodeError(e.to_string()))?;
Self::handle_result(result.result).map(|r| AccountBalanceResponse::from(*r))
}
pub async fn get_compressed_token_account_balance(
&self,
address: Option<Address>,
hash: Option<Hash>,
) -> Result<TokenAccountBalanceResponse, PhotonClientError> {
let request = photon_api::models::GetCompressedTokenAccountBalancePostRequest {
params: Box::new(photon_api::models::GetCompressedAccountPostRequestParams {
address: address.map(|x| Some(x.to_base58())),
hash: hash.map(|x| Some(x.to_base58())),
}),
..Default::default()
};
let result = photon_api::apis::default_api::get_compressed_token_account_balance_post(
&self.config,
request,
)
.await
.map_err(|e| PhotonClientError::DecodeError(e.to_string()))?;
Self::handle_result(result.result).map(|r| TokenAccountBalanceResponse::from(*r))
}
pub async fn get_compressed_token_balances_by_owner(
&self,
owner: &Pubkey,
mint: Option<Pubkey>,
) -> Result<
photon_api::models::GetCompressedTokenBalancesByOwnerPost200ResponseResult,
PhotonClientError,
> {
let request = photon_api::models::GetCompressedTokenBalancesByOwnerPostRequest {
params: Box::new(
photon_api::models::GetCompressedTokenAccountsByOwnerPostRequestParams {
owner: owner.to_string(),
mint: mint.map(|x| Some(x.to_string())),
cursor: None,
limit: None,
},
),
..Default::default()
};
let result = photon_api::apis::default_api::get_compressed_token_balances_by_owner_post(
&self.config,
request,
)
.await
.map_err(|e| PhotonClientError::DecodeError(e.to_string()))?;
Self::handle_result(result.result).map(|r| *r)
}
pub async fn get_compression_signatures_for_account(
&self,
hash: Hash,
) -> Result<
photon_api::models::GetCompressionSignaturesForAccountPost200ResponseResult,
PhotonClientError,
> {
let request = photon_api::models::GetCompressionSignaturesForAccountPostRequest {
params: Box::new(
photon_api::models::GetCompressedAccountProofPostRequestParams {
hash: hash.to_base58(),
},
),
..Default::default()
};
let result = photon_api::apis::default_api::get_compression_signatures_for_account_post(
&self.config,
request,
)
.await
.map_err(|e| PhotonClientError::DecodeError(e.to_string()))?;
Self::handle_result(result.result).map(|r| *r)
}
pub async fn get_multiple_compressed_accounts(
&self,
addresses: Option<Vec<Address>>,
hashes: Option<Vec<Hash>>,
) -> Result<CompressedAccountsResponse, PhotonClientError> {
let request = photon_api::models::GetMultipleCompressedAccountsPostRequest {
params: Box::new(
photon_api::models::GetMultipleCompressedAccountsPostRequestParams {
addresses: addresses.map(|x| Some(x.iter().map(|x| x.to_base58()).collect())),
hashes: hashes.map(|x| Some(x.iter().map(|x| x.to_base58()).collect())),
},
),
..Default::default()
};
let result = photon_api::apis::default_api::get_multiple_compressed_accounts_post(
&self.config,
request,
)
.await
.map_err(|e| PhotonClientError::DecodeError(e.to_string()))?;
Self::handle_result(result.result).map(|r| CompressedAccountsResponse::from(*r))
}
fn handle_result<T>(result: Option<T>) -> Result<T, PhotonClientError> {
match result {
Some(result) => Ok(result),
None => Err(PhotonClientError::DecodeError("Missing result".to_string())),
}
}
fn build_account_params(
&self,
address: Option<Address>,
hash: Option<Hash>,
) -> Result<photon_api::models::GetCompressedAccountPostRequestParams, PhotonClientError> {
if address.is_none() && hash.is_none() {
return Err(PhotonClientError::DecodeError(
"Either address or hash must be provided".to_string(),
));
}
if address.is_some() && hash.is_some() {
return Err(PhotonClientError::DecodeError(
"Only one of address or hash must be provided".to_string(),
));
}
Ok(photon_api::models::GetCompressedAccountPostRequestParams {
address: address.map(|x| Some(x.to_base58())),
hash: hash.map(|x| Some(x.to_base58())),
})
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/client/src
|
solana_public_repos/Lightprotocol/light-protocol/client/src/photon_rpc/mod.rs
|
mod error;
mod models;
mod photon_client;
mod types;
pub use error::PhotonClientError;
pub use models::{AccountBalance, CompressedAccount, CompressedAccountResponse};
pub use models::{TokenAccountBalance, TokenAccountBalanceResponse};
pub use photon_client::PhotonClient;
pub use types::{Address, AddressWithTree, Base58Conversions, Hash};
| 0
|
solana_public_repos/Lightprotocol/light-protocol/client/src
|
solana_public_repos/Lightprotocol/light-protocol/client/src/rpc/solana_rpc.rs
|
use crate::rpc::errors::RpcError;
use crate::rpc::rpc_connection::RpcConnection;
use crate::transaction_params::TransactionParams;
use async_trait::async_trait;
use borsh::BorshDeserialize;
use log::warn;
use solana_client::rpc_client::RpcClient;
use solana_client::rpc_config::{RpcSendTransactionConfig, RpcTransactionConfig};
use solana_program::clock::Slot;
use solana_program::hash::Hash;
use solana_program::pubkey::Pubkey;
use solana_sdk::account::{Account, AccountSharedData};
use solana_sdk::bs58;
use solana_sdk::clock::UnixTimestamp;
use solana_sdk::commitment_config::CommitmentConfig;
use solana_sdk::epoch_info::EpochInfo;
use solana_sdk::instruction::Instruction;
use solana_sdk::signature::{Keypair, Signature};
use solana_sdk::transaction::Transaction;
use solana_transaction_status::option_serializer::OptionSerializer;
use solana_transaction_status::{UiInstruction, UiTransactionEncoding};
use std::fmt::{Debug, Display, Formatter};
use std::time::Duration;
use tokio::time::{sleep, Instant};
pub enum SolanaRpcUrl {
Testnet,
Devnet,
Localnet,
ZKTestnet,
Custom(String),
}
impl Display for SolanaRpcUrl {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let str = match self {
SolanaRpcUrl::Testnet => "https://api.testnet.solana.com".to_string(),
SolanaRpcUrl::Devnet => "https://api.devnet.solana.com".to_string(),
SolanaRpcUrl::Localnet => "http://localhost:8899".to_string(),
SolanaRpcUrl::ZKTestnet => "https://zk-testnet.helius.dev:8899".to_string(),
SolanaRpcUrl::Custom(url) => url.clone(),
};
write!(f, "{}", str)
}
}
#[derive(Clone, Debug, Copy)]
pub struct RetryConfig {
pub max_retries: u32,
pub retry_delay: Duration,
pub timeout: Duration,
}
impl Default for RetryConfig {
fn default() -> Self {
RetryConfig {
max_retries: 20,
retry_delay: Duration::from_secs(1),
timeout: Duration::from_secs(60),
}
}
}
#[allow(dead_code)]
pub struct SolanaRpcConnection {
pub client: RpcClient,
pub payer: Keypair,
retry_config: RetryConfig,
}
impl Debug for SolanaRpcConnection {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(
f,
"SolanaRpcConnection {{ client: {:?} }}",
self.client.url()
)
}
}
impl SolanaRpcConnection {
pub fn new_with_retry<U: ToString>(
url: U,
commitment_config: Option<CommitmentConfig>,
retry_config: Option<RetryConfig>,
) -> Self {
let payer = Keypair::new();
let commitment_config = commitment_config.unwrap_or(CommitmentConfig::confirmed());
let client = RpcClient::new_with_commitment(url.to_string(), commitment_config);
let retry_config = retry_config.unwrap_or_default();
Self {
client,
payer,
retry_config,
}
}
async fn retry<F, Fut, T>(&self, operation: F) -> Result<T, RpcError>
where
F: Fn() -> Fut,
Fut: std::future::Future<Output = Result<T, RpcError>>,
{
let mut attempts = 0;
let start_time = Instant::now();
loop {
match operation().await {
Ok(result) => return Ok(result),
Err(e) => {
attempts += 1;
if attempts >= self.retry_config.max_retries
|| start_time.elapsed() >= self.retry_config.timeout
{
return Err(e);
}
warn!(
"Operation failed, retrying in {:?} (attempt {}/{}): {:?}",
self.retry_config.retry_delay, attempts, self.retry_config.max_retries, e
);
sleep(self.retry_config.retry_delay).await;
}
}
}
}
}
impl SolanaRpcConnection {
fn parse_inner_instructions<T: BorshDeserialize>(
&self,
signature: Signature,
) -> Result<T, RpcError> {
let rpc_transaction_config = RpcTransactionConfig {
encoding: Some(UiTransactionEncoding::Base64),
commitment: Some(self.client.commitment()),
..Default::default()
};
let transaction = self
.client
.get_transaction_with_config(&signature, rpc_transaction_config)
.map_err(|e| RpcError::CustomError(e.to_string()))?;
let meta = transaction.transaction.meta.as_ref().ok_or_else(|| {
RpcError::CustomError("Transaction missing metadata information".to_string())
})?;
if meta.status.is_err() {
return Err(RpcError::CustomError(
"Transaction status indicates an error".to_string(),
));
}
let inner_instructions = match &meta.inner_instructions {
OptionSerializer::Some(i) => i,
OptionSerializer::None => {
return Err(RpcError::CustomError(
"No inner instructions found".to_string(),
));
}
OptionSerializer::Skip => {
return Err(RpcError::CustomError(
"No inner instructions found".to_string(),
));
}
};
for ix in inner_instructions.iter() {
for ui_instruction in ix.instructions.iter() {
match ui_instruction {
UiInstruction::Compiled(ui_compiled_instruction) => {
let data = bs58::decode(&ui_compiled_instruction.data)
.into_vec()
.map_err(|_| {
RpcError::CustomError(
"Failed to decode instruction data".to_string(),
)
})?;
if let Ok(parsed_data) = T::try_from_slice(data.as_slice()) {
return Ok(parsed_data);
}
}
UiInstruction::Parsed(_) => {
println!("Parsed instructions are not implemented yet");
}
}
}
}
Err(RpcError::CustomError(
"Failed to find any parseable inner instructions".to_string(),
))
}
}
#[async_trait]
impl RpcConnection for SolanaRpcConnection {
fn new<U: ToString>(url: U, commitment_config: Option<CommitmentConfig>) -> Self
where
Self: Sized,
{
Self::new_with_retry(url, commitment_config, None)
}
fn get_payer(&self) -> &Keypair {
&self.payer
}
fn get_url(&self) -> String {
self.client.url()
}
async fn health(&self) -> Result<(), RpcError> {
self.retry(|| async { self.client.get_health().map_err(RpcError::from) })
.await
}
async fn get_block_time(&self, slot: u64) -> Result<UnixTimestamp, RpcError> {
self.retry(|| async { self.client.get_block_time(slot).map_err(RpcError::from) })
.await
}
async fn get_epoch_info(&self) -> Result<EpochInfo, RpcError> {
self.retry(|| async { self.client.get_epoch_info().map_err(RpcError::from) })
.await
}
async fn get_program_accounts(
&self,
program_id: &Pubkey,
) -> Result<Vec<(Pubkey, Account)>, RpcError> {
self.retry(|| async {
self.client
.get_program_accounts(program_id)
.map_err(RpcError::from)
})
.await
}
async fn process_transaction(
&mut self,
transaction: Transaction,
) -> Result<Signature, RpcError> {
self.retry(|| async {
self.client
.send_and_confirm_transaction(&transaction)
.map_err(RpcError::from)
})
.await
}
async fn process_transaction_with_context(
&mut self,
transaction: Transaction,
) -> Result<(Signature, Slot), RpcError> {
self.retry(|| async {
let signature = self.client.send_and_confirm_transaction(&transaction)?;
let sig_info = self.client.get_signature_statuses(&[signature])?;
let slot = sig_info
.value
.first()
.and_then(|s| s.as_ref())
.map(|s| s.slot)
.ok_or_else(|| RpcError::CustomError("Failed to get slot".into()))?;
Ok((signature, slot))
})
.await
}
async fn create_and_send_transaction_with_event<T>(
&mut self,
instructions: &[Instruction],
payer: &Pubkey,
signers: &[&Keypair],
transaction_params: Option<TransactionParams>,
) -> Result<Option<(T, Signature, u64)>, RpcError>
where
T: BorshDeserialize + Send + Debug,
{
let pre_balance = self.client.get_balance(payer)?;
let latest_blockhash = self.client.get_latest_blockhash()?;
let mut instructions_vec = vec![
solana_sdk::compute_budget::ComputeBudgetInstruction::set_compute_unit_limit(1_000_000),
];
instructions_vec.extend_from_slice(instructions);
let transaction = Transaction::new_signed_with_payer(
instructions_vec.as_slice(),
Some(payer),
signers,
latest_blockhash,
);
let (signature, slot) = self
.process_transaction_with_context(transaction.clone())
.await?;
let mut parsed_event = None;
for instruction in &transaction.message.instructions {
if let Ok(e) = T::deserialize(&mut &instruction.data[..]) {
parsed_event = Some(e);
break;
}
}
if parsed_event.is_none() {
parsed_event = self.parse_inner_instructions::<T>(signature).ok();
}
if let Some(transaction_params) = transaction_params {
let mut deduped_signers = signers.to_vec();
deduped_signers.dedup();
let post_balance = self.get_account(*payer).await?.unwrap().lamports;
// a network_fee is charged if there are input compressed accounts or new addresses
let mut network_fee: i64 = 0;
if transaction_params.num_input_compressed_accounts != 0 {
network_fee += transaction_params.fee_config.network_fee as i64;
}
if transaction_params.num_new_addresses != 0 {
network_fee += transaction_params.fee_config.address_network_fee as i64;
}
let expected_post_balance = pre_balance as i64
- i64::from(transaction_params.num_new_addresses)
* transaction_params.fee_config.address_queue_rollover as i64
- i64::from(transaction_params.num_output_compressed_accounts)
* transaction_params.fee_config.state_merkle_tree_rollover as i64
- transaction_params.compress
- 5000 * deduped_signers.len() as i64
- network_fee;
if post_balance as i64 != expected_post_balance {
return Err(RpcError::AssertRpcError(format!("unexpected balance after transaction: expected {expected_post_balance}, got {post_balance}")));
}
}
let result = parsed_event.map(|e| (e, signature, slot));
Ok(result)
}
async fn confirm_transaction(&self, signature: Signature) -> Result<bool, RpcError> {
self.retry(|| async {
self.client
.confirm_transaction(&signature)
.map_err(RpcError::from)
})
.await
}
async fn get_account(&mut self, address: Pubkey) -> Result<Option<Account>, RpcError> {
self.retry(|| async {
self.client
.get_account_with_commitment(&address, self.client.commitment())
.map(|response| response.value)
.map_err(RpcError::from)
})
.await
}
fn set_account(&mut self, _address: &Pubkey, _account: &AccountSharedData) {
unimplemented!()
}
async fn get_minimum_balance_for_rent_exemption(
&mut self,
data_len: usize,
) -> Result<u64, RpcError> {
self.retry(|| async {
self.client
.get_minimum_balance_for_rent_exemption(data_len)
.map_err(RpcError::from)
})
.await
}
async fn airdrop_lamports(
&mut self,
to: &Pubkey,
lamports: u64,
) -> Result<Signature, RpcError> {
self.retry(|| async {
let signature = self
.client
.request_airdrop(to, lamports)
.map_err(RpcError::ClientError)?;
self.retry(|| async {
if self
.client
.confirm_transaction_with_commitment(&signature, self.client.commitment())?
.value
{
Ok(())
} else {
Err(RpcError::CustomError("Airdrop not confirmed".into()))
}
})
.await?;
Ok(signature)
})
.await
}
async fn get_balance(&mut self, pubkey: &Pubkey) -> Result<u64, RpcError> {
self.retry(|| async { self.client.get_balance(pubkey).map_err(RpcError::from) })
.await
}
async fn get_latest_blockhash(&mut self) -> Result<Hash, RpcError> {
self.retry(|| async { self.client.get_latest_blockhash().map_err(RpcError::from) })
.await
}
async fn get_slot(&mut self) -> Result<u64, RpcError> {
self.retry(|| async { self.client.get_slot().map_err(RpcError::from) })
.await
}
async fn warp_to_slot(&mut self, _slot: Slot) -> Result<(), RpcError> {
Err(RpcError::CustomError(
"Warp to slot is not supported in SolanaRpcConnection".to_string(),
))
}
async fn send_transaction(&self, transaction: &Transaction) -> Result<Signature, RpcError> {
self.retry(|| async {
self.client
.send_transaction_with_config(
transaction,
RpcSendTransactionConfig {
skip_preflight: true,
max_retries: Some(self.retry_config.max_retries as usize),
..Default::default()
},
)
.map_err(RpcError::from)
})
.await
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/client/src
|
solana_public_repos/Lightprotocol/light-protocol/client/src/rpc/mod.rs
|
pub mod errors;
pub mod merkle_tree;
pub mod rpc_connection;
pub mod solana_rpc;
pub use errors::{assert_rpc_error, RpcError};
pub use rpc_connection::RpcConnection;
pub use solana_rpc::{RetryConfig, SolanaRpcConnection};
| 0
|
solana_public_repos/Lightprotocol/light-protocol/client/src
|
solana_public_repos/Lightprotocol/light-protocol/client/src/rpc/rpc_connection.rs
|
use crate::rpc::errors::RpcError;
use crate::transaction_params::TransactionParams;
use async_trait::async_trait;
use borsh::BorshDeserialize;
use solana_program::clock::Slot;
use solana_program::instruction::Instruction;
use solana_sdk::account::{Account, AccountSharedData};
use solana_sdk::commitment_config::CommitmentConfig;
use solana_sdk::epoch_info::EpochInfo;
use solana_sdk::hash::Hash;
use solana_sdk::pubkey::Pubkey;
use solana_sdk::signature::{Keypair, Signature};
use solana_sdk::transaction::Transaction;
use std::fmt::Debug;
#[async_trait]
pub trait RpcConnection: Send + Sync + Debug + 'static {
fn new<U: ToString>(url: U, commitment_config: Option<CommitmentConfig>) -> Self
where
Self: Sized;
fn get_payer(&self) -> &Keypair;
fn get_url(&self) -> String;
async fn health(&self) -> Result<(), RpcError>;
async fn get_block_time(&self, slot: u64) -> Result<i64, RpcError>;
async fn get_epoch_info(&self) -> Result<EpochInfo, RpcError>;
async fn get_program_accounts(
&self,
program_id: &Pubkey,
) -> Result<Vec<(Pubkey, Account)>, RpcError>;
async fn process_transaction(
&mut self,
transaction: Transaction,
) -> Result<Signature, RpcError>;
async fn process_transaction_with_context(
&mut self,
transaction: Transaction,
) -> Result<(Signature, Slot), RpcError>;
async fn create_and_send_transaction_with_event<T>(
&mut self,
instructions: &[Instruction],
authority: &Pubkey,
signers: &[&Keypair],
transaction_params: Option<TransactionParams>,
) -> Result<Option<(T, Signature, Slot)>, RpcError>
where
T: BorshDeserialize + Send + Debug;
async fn create_and_send_transaction<'a>(
&'a mut self,
instructions: &'a [Instruction],
payer: &'a Pubkey,
signers: &'a [&'a Keypair],
) -> Result<Signature, RpcError> {
let blockhash = self.get_latest_blockhash().await?;
let transaction =
Transaction::new_signed_with_payer(instructions, Some(payer), signers, blockhash);
self.process_transaction(transaction).await
}
async fn confirm_transaction(&self, signature: Signature) -> Result<bool, RpcError>;
async fn get_account(&mut self, address: Pubkey) -> Result<Option<Account>, RpcError>;
fn set_account(&mut self, address: &Pubkey, account: &AccountSharedData);
async fn get_minimum_balance_for_rent_exemption(
&mut self,
data_len: usize,
) -> Result<u64, RpcError>;
async fn airdrop_lamports(&mut self, to: &Pubkey, lamports: u64)
-> Result<Signature, RpcError>;
async fn get_anchor_account<T: BorshDeserialize>(
&mut self,
pubkey: &Pubkey,
) -> Result<Option<T>, RpcError> {
match self.get_account(*pubkey).await? {
Some(account) => {
let data = T::deserialize(&mut &account.data[8..]).map_err(RpcError::from)?;
Ok(Some(data))
}
None => Ok(None),
}
}
async fn get_balance(&mut self, pubkey: &Pubkey) -> Result<u64, RpcError>;
async fn get_latest_blockhash(&mut self) -> Result<Hash, RpcError>;
async fn get_slot(&mut self) -> Result<u64, RpcError>;
async fn warp_to_slot(&mut self, slot: Slot) -> Result<(), RpcError>;
async fn send_transaction(&self, transaction: &Transaction) -> Result<Signature, RpcError>;
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/client/src
|
solana_public_repos/Lightprotocol/light-protocol/client/src/rpc/errors.rs
|
use solana_banks_client::BanksClientError;
use solana_client::client_error::ClientError;
use solana_program::instruction::InstructionError;
use solana_sdk::transaction::TransactionError;
use std::io;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum RpcError {
#[error("BanksError: {0}")]
BanksError(#[from] BanksClientError),
#[error("TransactionError: {0}")]
TransactionError(#[from] TransactionError),
#[error("ClientError: {0}")]
ClientError(#[from] ClientError),
#[error("IoError: {0}")]
IoError(#[from] io::Error),
#[error("Error: `{0}`")]
CustomError(String),
#[error("Assert Rpc Error: {0}")]
AssertRpcError(String),
/// The chosen warp slot is not in the future, so warp is not performed
#[error("Warp slot not in the future")]
InvalidWarpSlot,
}
pub fn assert_rpc_error<T>(
result: Result<T, RpcError>,
i: u8,
expected_error_code: u32,
) -> Result<(), RpcError> {
match result {
Err(RpcError::TransactionError(TransactionError::InstructionError(
index,
InstructionError::Custom(error_code),
))) if index != i => Err(RpcError::AssertRpcError(
format!(
"Expected error code: {}, got: {} error: {}",
expected_error_code,
error_code,
unsafe { result.unwrap_err_unchecked() }
)
.to_string(),
)),
Err(RpcError::TransactionError(TransactionError::InstructionError(
index,
InstructionError::Custom(error_code),
))) if index == i && error_code == expected_error_code => Ok(()),
Err(RpcError::TransactionError(TransactionError::InstructionError(
0,
InstructionError::ProgramFailedToComplete,
))) => Ok(()),
Err(e) => Err(RpcError::AssertRpcError(format!(
"Unexpected error type: {:?}",
e
))),
_ => Err(RpcError::AssertRpcError(String::from(
"Unexpected error type",
))),
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/client/src
|
solana_public_repos/Lightprotocol/light-protocol/client/src/rpc/merkle_tree.rs
|
use std::mem;
use async_trait::async_trait;
use light_concurrent_merkle_tree::{
copy::ConcurrentMerkleTreeCopy, errors::ConcurrentMerkleTreeError, light_hasher::Poseidon,
};
use light_indexed_merkle_tree::{copy::IndexedMerkleTreeCopy, errors::IndexedMerkleTreeError};
use light_sdk::state::MerkleTreeMetadata;
use solana_sdk::pubkey::Pubkey;
use thiserror::Error;
use super::{RpcConnection, RpcError};
#[derive(Error, Debug)]
pub enum MerkleTreeExtError {
#[error(transparent)]
Rpc(#[from] RpcError),
#[error(transparent)]
ConcurrentMerkleTree(#[from] ConcurrentMerkleTreeError),
#[error(transparent)]
IndexedMerkleTree(#[from] IndexedMerkleTreeError),
}
/// Extension to the RPC connection which provides convenience utilities for
/// fetching Merkle trees.
#[async_trait]
pub trait MerkleTreeExt: RpcConnection {
async fn get_state_merkle_tree(
&mut self,
pubkey: Pubkey,
) -> Result<ConcurrentMerkleTreeCopy<Poseidon, 26>, MerkleTreeExtError> {
let account = self.get_account(pubkey).await?.unwrap();
let tree = ConcurrentMerkleTreeCopy::from_bytes_copy(
&account.data[8 + mem::size_of::<MerkleTreeMetadata>()..],
)?;
Ok(tree)
}
async fn get_address_merkle_tree(
&mut self,
pubkey: Pubkey,
) -> Result<IndexedMerkleTreeCopy<Poseidon, usize, 26, 16>, MerkleTreeExtError> {
let account = self.get_account(pubkey).await?.unwrap();
let tree = IndexedMerkleTreeCopy::from_bytes_copy(
&account.data[8 + mem::size_of::<MerkleTreeMetadata>()..],
)?;
Ok(tree)
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/client/src
|
solana_public_repos/Lightprotocol/light-protocol/client/src/indexer/mod.rs
|
use std::{fmt::Debug, future::Future};
use light_concurrent_merkle_tree::light_hasher::Poseidon;
use light_indexed_merkle_tree::{
array::{IndexedArray, IndexedElement},
reference::IndexedMerkleTree,
};
use light_merkle_tree_reference::MerkleTree;
use light_sdk::{
compressed_account::CompressedAccountWithMerkleContext, event::PublicTransactionEvent,
proof::ProofRpcResult, token::TokenDataWithMerkleContext,
};
use num_bigint::BigUint;
use solana_sdk::pubkey::Pubkey;
use thiserror::Error;
use crate::rpc::RpcConnection;
#[derive(Error, Debug)]
pub enum IndexerError {
#[error("RPC Error: {0}")]
RpcError(#[from] solana_client::client_error::ClientError),
#[error("failed to deserialize account data")]
DeserializeError(#[from] solana_sdk::program_error::ProgramError),
#[error("failed to copy merkle tree")]
CopyMerkleTreeError(#[from] std::io::Error),
#[error("error: {0:?}")]
Custom(String),
#[error("unknown error")]
Unknown,
}
pub trait Indexer<R: RpcConnection>: Sync + Send + Debug + 'static {
fn add_event_and_compressed_accounts(
&mut self,
event: &PublicTransactionEvent,
) -> (
Vec<CompressedAccountWithMerkleContext>,
Vec<TokenDataWithMerkleContext>,
);
fn create_proof_for_compressed_accounts(
&mut self,
compressed_accounts: Option<&[[u8; 32]]>,
state_merkle_tree_pubkeys: Option<&[Pubkey]>,
new_addresses: Option<&[[u8; 32]]>,
address_merkle_tree_pubkeys: Option<Vec<Pubkey>>,
rpc: &mut R,
) -> impl Future<Output = ProofRpcResult>;
fn get_compressed_accounts_by_owner(
&self,
owner: &Pubkey,
) -> Vec<CompressedAccountWithMerkleContext>;
}
#[derive(Debug, Clone)]
pub struct MerkleProof {
pub hash: String,
pub leaf_index: u64,
pub merkle_tree: String,
pub proof: Vec<[u8; 32]>,
pub root_seq: u64,
}
// For consistency with the Photon API.
#[derive(Clone, Default, Debug, PartialEq)]
pub struct NewAddressProofWithContext {
pub merkle_tree: [u8; 32],
pub root: [u8; 32],
pub root_seq: u64,
pub low_address_index: u64,
pub low_address_value: [u8; 32],
pub low_address_next_index: u64,
pub low_address_next_value: [u8; 32],
pub low_address_proof: [[u8; 32]; 16],
pub new_low_element: Option<IndexedElement<usize>>,
pub new_element: Option<IndexedElement<usize>>,
pub new_element_next_value: Option<BigUint>,
}
#[derive(Debug, Clone, Copy, Ord, PartialOrd, Eq, PartialEq)]
pub struct StateMerkleTreeAccounts {
pub merkle_tree: Pubkey,
pub nullifier_queue: Pubkey,
pub cpi_context: Pubkey,
}
#[derive(Debug, Clone, Copy)]
pub struct AddressMerkleTreeAccounts {
pub merkle_tree: Pubkey,
pub queue: Pubkey,
}
#[derive(Debug, Clone)]
pub struct StateMerkleTreeBundle {
pub rollover_fee: u64,
pub merkle_tree: Box<MerkleTree<Poseidon>>,
pub accounts: StateMerkleTreeAccounts,
}
#[derive(Debug, Clone)]
pub struct AddressMerkleTreeBundle {
pub rollover_fee: u64,
pub merkle_tree: Box<IndexedMerkleTree<Poseidon, usize>>,
pub indexed_array: Box<IndexedArray<Poseidon, usize>>,
pub accounts: AddressMerkleTreeAccounts,
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/bench.sh
|
#!/usr/bin/env sh
DEPTH="26"
URL="http://localhost:3001/prove"
gnark() {
local args=("$@")
./light-prover "${args[@]}"
}
generate_and_test() {
local compressedAccounts=$1
mkdir -p circuits
CIRCUIT_FILE="/tmp/circuit_${DEPTH}_${compressedAccounts}.key"
TEST_FILE="/tmp/inputs_${DEPTH}_${compressedAccounts}.json"
if [ ! -f "${CIRCUIT_FILE}" ]; then
echo "Prover setup..."
gnark setup --circuit inclusion --compressedAccounts "$compressedAccounts" --tree-depth "$DEPTH" --output "${CIRCUIT_FILE}"
fi
if [ ! -f "${TEST_FILE}" ]; then
echo "Generating test inputs..."
gnark gen-test-params --compressedAccounts "$compressedAccounts" --tree-depth "$DEPTH" > "${TEST_FILE}"
fi
}
run_benchmark() {
local compressedAccounts=$1
echo "Benchmarking with $compressedAccounts compressedAccounts..."
TEST_FILE="/tmp/inputs_${DEPTH}_${compressedAccounts}.json"
curl -s -S -X POST -d @"${TEST_FILE}" "$URL" -o /dev/null
sleep 1
}
start_server() {
compressedAccounts_arr=$1
for compressedAccounts in "${compressedAccounts_arr[@]}"
do
keys_file+="--keys-file /tmp/circuit_${DEPTH}_${compressedAccounts}.key "
done
echo "Starting server with keys: $keys_file"
gnark start \
$keys_file \
--json-logging \
>> log.txt \
&
sleep 10
}
# Define an array containing the desired values
declare -a compressedAccounts_arr=("1" "2" "3" "4" "8")
# Kill the server
killall light-prover
# Generate keys and test inputs
for compressedAccounts in "${compressedAccounts_arr[@]}"
do
generate_and_test $compressedAccounts
done
# Start the server
start_server "${compressedAccounts_arr[@]}"
# Run the benchmarks
for compressedAccounts in "${compressedAccounts_arr[@]}"
do
run_benchmark $compressedAccounts
done
echo "Done. Benchmarking results are in log.txt."
# Kill the server
killall light-prover
| 0
|
solana_public_repos/Lightprotocol/light-protocol
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/go.mod
|
module light/light-prover
go 1.21
require (
github.com/consensys/gnark v0.8.0
github.com/gorilla/handlers v1.5.2
github.com/iden3/go-iden3-crypto v0.0.13
github.com/reilabs/gnark-lean-extractor/v2 v2.4.0-0.8.0
github.com/urfave/cli/v2 v2.10.2
)
require (
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/pprof v0.0.0-20230309165930-d61513b1440d // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
require (
github.com/consensys/gnark-crypto v0.9.1
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fxamacker/cbor/v2 v2.4.0 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rs/zerolog v1.29.0
github.com/stretchr/testify v1.8.4 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/sys v0.20.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
| 0
|
solana_public_repos/Lightprotocol/light-protocol
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/LICENSE
|
MIT License
Copyright (c) 2023 Worldcoin Foundation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
| 0
|
solana_public_repos/Lightprotocol/light-protocol
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/Dockerfile
|
FROM golang:1.20.3-alpine as builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
ENV CGO_ENABLED=0
RUN go build -v -o /usr/local/bin/light-prover .
FROM gcr.io/distroless/base-debian11:nonroot
COPY --from=builder /usr/local/bin/light-prover /usr/local/bin/light-prover
COPY --from=builder /app/proving-keys/ /proving-keys/
ENTRYPOINT [ "light-prover" ]
CMD [ "start", "--inclusion", "--non-inclusion", "--keys-dir", "/proving-keys/" ]
| 0
|
solana_public_repos/Lightprotocol/light-protocol
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/go.sum
|
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ=
github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI=
github.com/consensys/gnark v0.8.0 h1:0bQ2MyDG4oNjMQpNyL8HjrrUSSL3yYJg0Elzo6LzmcU=
github.com/consensys/gnark v0.8.0/go.mod h1:aKmA7dIiLbTm0OV37xTq0z+Bpe4xER8EhRLi6necrm8=
github.com/consensys/gnark-crypto v0.9.1 h1:mru55qKdWl3E035hAoh1jj9d7hVnYY5pfb6tmovSmII=
github.com/consensys/gnark-crypto v0.9.1/go.mod h1:a2DQL4+5ywF6safEeZFEPGRiiGbjzGFRUN2sg06VuU4=
github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dchest/blake512 v1.0.0/go.mod h1:FV1x7xPPLWukZlpDpWQ88rF/SFwZ5qbskrzhLMB92JI=
github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk=
github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/fxamacker/cbor/v2 v2.4.0 h1:ri0ArlOR+5XunOP8CRUowT0pSJOwhW098ZCUyskZD88=
github.com/fxamacker/cbor/v2 v2.4.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/pprof v0.0.0-20230309165930-d61513b1440d h1:um9/pc7tKMINFfP1eE7Wv6PRGXlcCSJkVajF7KJw3uQ=
github.com/google/pprof v0.0.0-20230309165930-d61513b1440d/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk=
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE=
github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w=
github.com/iden3/go-iden3-crypto v0.0.13 h1:ixWRiaqDULNyIDdOWz2QQJG5t4PpNHkQk2P6GV94cok=
github.com/iden3/go-iden3-crypto v0.0.13/go.mod h1:swXIv0HFbJKobbQBtsB50G7IHr6PbTowutSew/iBEoo=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c=
github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8=
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY=
github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU=
github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/reilabs/gnark-lean-extractor/v2 v2.4.0-0.8.0 h1:9TuGGdxGU/RetuPUpmdR7q2Lvd7oLtgfC6wpISxy1sQ=
github.com/reilabs/gnark-lean-extractor/v2 v2.4.0-0.8.0/go.mod h1:kSqrDOzPVw4WJdWBoiPlHbyuVDx39p6ksejwHydRDLY=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w=
github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y=
github.com/urfave/cli/v2 v2.10.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU=
rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA=
| 0
|
solana_public_repos/Lightprotocol/light-protocol
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/integration_test.go
|
package main_test
import (
"bytes"
"io"
"light/light-prover/logging"
"light/light-prover/prover"
"light/light-prover/server"
"math/big"
"net/http"
"os"
"strings"
"testing"
"time"
gnarkLogger "github.com/consensys/gnark/logger"
)
var isLightweightMode bool
const ProverAddress = "localhost:8081"
const MetricsAddress = "localhost:9999"
var instance server.RunningJob
func proveEndpoint() string {
return "http://" + ProverAddress + "/prove"
}
func StartServer(isLightweight bool) {
logging.Logger().Info().Msg("Setting up the prover")
var keys []string
if isLightweight {
keys = prover.GetKeys("./proving-keys/", prover.FullTest, []string{})
} else {
keys = prover.GetKeys("./proving-keys/", prover.Full, []string{})
}
var pssv1 []*prover.ProvingSystemV1
var pssv2 []*prover.ProvingSystemV2
missingKeys := []string{}
for _, key := range keys {
system, err := prover.ReadSystemFromFile(key)
if err != nil {
if os.IsNotExist(err) {
logging.Logger().Warn().Msgf("Key file not found: %s. Skipping this key.", key)
missingKeys = append(missingKeys, key)
continue
}
logging.Logger().Error().Msgf("Error reading proving system from file: %s. Error: %v", key, err)
continue
}
switch s := system.(type) {
case *prover.ProvingSystemV1:
pssv1 = append(pssv1, s)
case *prover.ProvingSystemV2:
pssv2 = append(pssv2, s)
default:
logging.Logger().Info().Msgf("Unknown proving system type for file: %s", key)
panic("Unknown proving system type")
}
}
if len(missingKeys) > 0 {
logging.Logger().Warn().Msgf("Some key files are missing. To download %s keys, run: ./scripts/download_keys.sh %s",
map[bool]string{true: "lightweight", false: "full"}[isLightweight],
map[bool]string{true: "lightweight", false: "full"}[isLightweight])
}
if len(pssv1) == 0 && len(pssv2) == 0 {
logging.Logger().Fatal().Msg("No valid proving systems found. Cannot start the server. Please ensure you have downloaded the necessary key files.")
return
}
serverCfg := server.Config{
ProverAddress: ProverAddress,
MetricsAddress: MetricsAddress,
}
logging.Logger().Info().Msg("Starting the server")
instance = server.Run(&serverCfg, pssv1, pssv2)
// sleep for 1 sec to ensure that the server is up and running before running the tests
time.Sleep(1 * time.Second)
logging.Logger().Info().Msg("Running the tests")
}
func StopServer() {
instance.RequestStop()
instance.AwaitStop()
}
func TestMain(m *testing.M) {
gnarkLogger.Set(*logging.Logger())
isLightweightMode = true
for _, arg := range os.Args {
if arg == "-test.run=TestFull" {
isLightweightMode = false
break
}
}
if isLightweightMode {
logging.Logger().Info().Msg("Running in lightweight mode")
logging.Logger().Info().Msg("If you encounter missing key errors, run: ./scripts/download_keys.sh lightweight")
} else {
logging.Logger().Info().Msg("Running in full mode")
logging.Logger().Info().Msg("If you encounter missing key errors, run: ./scripts/download_keys.sh full")
}
StartServer(isLightweightMode)
m.Run()
StopServer()
}
func TestLightweight(t *testing.T) {
if !isLightweightMode {
t.Skip("This test only runs in lightweight mode")
}
runCommonTests(t)
runLightweightOnlyTests(t)
}
func TestFull(t *testing.T) {
if isLightweightMode {
t.Skip("This test only runs in full mode")
}
runCommonTests(t)
runFullOnlyTests(t)
}
// runCommonTests contains all tests that should run in both modes
func runCommonTests(t *testing.T) {
t.Run("testWrongMethod", testWrongMethod)
t.Run("testInclusionHappyPath26_12348", testInclusionHappyPath26_12348)
t.Run("testInclusionHappyPath26_1_JSON", testInclusionHappyPath26_1_JSON)
t.Run("testInclusionWrongInPathIndices", testInclusionWrongInPathIndices)
t.Run("testInclusionWrongInPathElements", testInclusionWrongInPathElements)
t.Run("testInclusionWrongRoot", testInclusionWrongRoot)
t.Run("testParsingEmptyTreeWithOneLeaf", testParsingEmptyTreeWithOneLeaf)
t.Run("testNonInclusionHappyPath26_1_JSON", testNonInclusionHappyPath26_1_JSON)
t.Run("testCombinedHappyPath_JSON", testCombinedHappyPath_JSON)
}
// runFullOnlyTests contains tests that should only run in full mode
func runFullOnlyTests(t *testing.T) {
t.Run("testBatchAppendWithSubtreesHappyPath26_1000", testBatchAppendWithSubtreesHappyPath26_1000)
t.Run("testBatchAppendWithSubtreesPreviousState26_100", testBatchAppendWithSubtreesPreviousState26_100)
t.Run("testBatchAppendWithProofsHappyPath26_1000", testBatchAppendWithProofsHappyPath26_1000)
t.Run("testBatchAppendWithProofsPreviousState26_100", testBatchAppendWithProofsPreviousState26_100)
t.Run("testBatchUpdateHappyPath26_100", testBatchUpdateHappyPath26_100)
t.Run("testBatchUpdateHappyPath26_500", testBatchUpdateHappyPath26_500)
t.Run("testBatchUpdateHappyPath26_1000", testBatchUpdateHappyPath26_1000)
t.Run("testBatchAddressAppendHappyPath40_100", testBatchAddressAppendHappyPath40_100)
t.Run("testBatchAddressAppendHappyPath40_500", testBatchAddressAppendHappyPath40_500)
t.Run("testBatchAddressAppendHappyPath40_250", testBatchAddressAppendHappyPath40_250)
t.Run("testBatchAddressAppendHappyPath40_1000", testBatchAddressAppendHappyPath40_1000)
t.Run("testBatchAddressAppendWithPreviousState40_100", testBatchAddressAppendWithPreviousState40_100)
}
func runLightweightOnlyTests(t *testing.T) {
t.Run("testBatchAppendWithSubtreesHappyPath26_10", testBatchAppendWithSubtreesHappyPath26_10)
t.Run("testBatchAppendWithSubtreesPreviousState26_10", testBatchAppendWithSubtreesPreviousState26_10)
t.Run("testBatchAppendWithProofsHappyPath26_10", testBatchAppendWithProofsHappyPath26_10)
t.Run("testBatchAppendWithProofsPreviousState26_10", testBatchAppendWithProofsPreviousState26_10)
t.Run("testBatchUpdateHappyPath26_10", testBatchUpdateHappyPath26_10)
t.Run("testBatchUpdateWithPreviousState26_10", testBatchUpdateWithPreviousState26_10)
t.Run("testBatchUpdateInvalidInput26_10", testBatchUpdateInvalidInput26_10)
t.Run("testBatchAddressAppendHappyPath40_10", testBatchAddressAppendHappyPath40_10)
t.Run("testBatchAddressAppendWithPreviousState40_10", testBatchAddressAppendWithPreviousState40_10)
t.Run("testBatchAddressAppendInvalidInput40_10", testBatchAddressAppendInvalidInput40_10)
}
func testWrongMethod(t *testing.T) {
response, err := http.Get(proveEndpoint())
if err != nil {
t.Fatal(err)
}
if response.StatusCode != http.StatusMethodNotAllowed {
t.Fatalf("Expected status code %d, got %d", http.StatusMethodNotAllowed, response.StatusCode)
}
}
func testInclusionHappyPath26_1(t *testing.T) {
tree := prover.BuildTestTree(26, 1, false)
// convert tree t to json
jsonBytes, _ := tree.MarshalJSON()
jsonString := string(jsonBytes)
response, err := http.Post(proveEndpoint(), "application/json", strings.NewReader(jsonString))
if err != nil {
t.Fatal(err)
}
if response.StatusCode != http.StatusOK {
t.Fatalf("Expected status code %d, got %d", http.StatusOK, response.StatusCode)
}
}
func testInclusionHappyPath26_12348(t *testing.T) {
for _, compressedAccounts := range []int{1, 2, 3, 4, 8} {
tree := prover.BuildTestTree(26, compressedAccounts, false)
jsonBytes, _ := tree.MarshalJSON()
jsonString := string(jsonBytes)
response, err := http.Post(proveEndpoint(), "application/json", strings.NewReader(jsonString))
if err != nil {
t.Fatal(err)
}
if response.StatusCode != http.StatusOK {
t.Fatalf("Expected status code %d, got %d", http.StatusOK, response.StatusCode)
}
}
}
func testInclusionHappyPath26_1_JSON(t *testing.T) {
testInput := `
{"input-compressed-accounts": [{"root":"0x1ebf5c4eb04bf878b46937be63d12308bb14841813441f041812ea54ecb7b2d5","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"}]}
`
response, err := http.Post(proveEndpoint(), "application/json", strings.NewReader(testInput))
if err != nil {
t.Fatal(err)
}
if response.StatusCode != http.StatusOK {
t.Fatalf("Expected status code %d, got %d", http.StatusOK, response.StatusCode)
}
}
func testInclusionWrongInPathIndices(t *testing.T) {
testInput := `
{"input-compressed-accounts": [{"root":"0x1ebf5c4eb04bf878b46937be63d12308bb14841813441f041812ea54ecb7b2d5","pathIndex":1,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"}]}
`
response, err := http.Post(proveEndpoint(), "application/json", strings.NewReader(testInput))
if err != nil {
t.Fatal(err)
}
if response.StatusCode != http.StatusBadRequest {
t.Fatalf("Expected status code %d, got %d", http.StatusBadRequest, response.StatusCode)
}
responseBody, err := io.ReadAll(response.Body)
if err != nil {
t.Fatal(err)
}
if !strings.Contains(string(responseBody), "proving_error") {
t.Fatalf("Expected error message to be tagged with 'proving_error', got %s", string(responseBody))
}
}
func testInclusionWrongInPathElements(t *testing.T) {
testInput := `
{"input-compressed-accounts": [{"root":"0x1ebf5c4eb04bf878b46937be63d12308bb14841813441f041812ea54ecb7b2d5","pathIndex":0,"pathElements":["0x1","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"}]}
`
response, err := http.Post(proveEndpoint(), "application/json", strings.NewReader(testInput))
if err != nil {
t.Fatal(err)
}
if response.StatusCode != http.StatusBadRequest {
t.Fatalf("Expected status code %d, got %d", http.StatusBadRequest, response.StatusCode)
}
responseBody, err := io.ReadAll(response.Body)
if err != nil {
t.Fatal(err)
}
if !strings.Contains(string(responseBody), "proving_error") {
t.Fatalf("Expected error message to be tagged with 'proving_error', got %s", string(responseBody))
}
}
func testInclusionWrongRoot(t *testing.T) {
testInput := `
{"input-compressed-accounts": [{"root":"0x0","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"}]}
`
response, err := http.Post(proveEndpoint(), "application/json", strings.NewReader(testInput))
if err != nil {
t.Fatal(err)
}
if response.StatusCode != http.StatusBadRequest {
t.Fatalf("Expected status code %d, got %d", http.StatusBadRequest, response.StatusCode)
}
responseBody, err := io.ReadAll(response.Body)
if err != nil {
t.Fatal(err)
}
if !strings.Contains(string(responseBody), "proving_error") {
t.Fatalf("Expected error message to be tagged with 'proving_error', got %s", string(responseBody))
}
}
func testParsingEmptyTreeWithOneLeaf(t *testing.T) {
testInput := `
{"input-compressed-accounts": [{"root":"0x1ebf5c4eb04bf878b46937be63d12308bb14841813441f041812ea54ecb7b2d5","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"}]}
`
proofData, err := prover.ParseInput(testInput)
if err != nil {
t.Errorf("error parsing input: %v", err)
}
tree := prover.BuildTestTree(26, 1, false)
if len(tree.Inputs) != len(proofData.Inputs) {
t.Errorf("Invalid shape: expected %d, got %d", len(tree.Inputs), len(proofData.Inputs))
}
for i, bi := range tree.Inputs {
if bi.Root.String() != proofData.Inputs[i].Root.String() {
t.Errorf("Invalid root: expected %s, got %s", bi.Root.String(), proofData.Inputs[i].Root.String())
}
if bi.Leaf.String() != proofData.Inputs[i].Leaf.String() {
t.Errorf("Invalid leaf: expected %s, got %s", bi.Leaf.String(), proofData.Inputs[i].Leaf.String())
}
if bi.PathIndex != proofData.Inputs[i].PathIndex {
t.Errorf("Invalid pathIndex: expected %d, got %d", bi.PathIndex, proofData.Inputs[i].PathIndex)
}
for j, bj := range bi.PathElements {
if bj.String() != proofData.Inputs[i].PathElements[j].String() {
t.Errorf("Invalid pathElements: expected %s, got %s", bj.String(), proofData.Inputs[i].PathElements[j].String())
}
}
}
}
func testNonInclusionHappyPath26_1_JSON(t *testing.T) {
testInput := `
{"new-addresses": [
{
"root": "0xbfe2d9e57ace69971b010340a2eb1d9f1c9b078c7b9b3c90063b83617a84ef9",
"value": "0x202",
"pathIndex": 17,
"pathElements": [
"0x0",
"0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864",
"0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1",
"0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238",
"0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a",
"0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55",
"0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78",
"0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d",
"0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61",
"0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747",
"0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2",
"0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636",
"0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a",
"0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0",
"0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c",
"0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92",
"0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323",
"0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992",
"0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f",
"0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca",
"0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e",
"0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1",
"0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b",
"0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d",
"0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540",
"0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"
],
"leafLowerRangeValue": "0x201",
"leafHigherRangeValue": "0x203",
"nextIndex": 46336290
}
]
}
`
response, err := http.Post(proveEndpoint(), "application/json", strings.NewReader(testInput))
if err != nil {
t.Fatal(err)
}
responseBody, err := io.ReadAll(response.Body)
if err != nil {
t.Fatal(err)
}
if response.StatusCode != http.StatusOK {
t.Fatalf("Expected status code %d, got %d %s", http.StatusOK, response.StatusCode, string(responseBody))
}
}
func testCombinedHappyPath_JSON(t *testing.T) {
testInput := `
{
"input-compressed-accounts": [
{
"root": "0x1ebf5c4eb04bf878b46937be63d12308bb14841813441f041812ea54ecb7b2d5",
"pathIndex": 0,
"pathElements": [
"0x0",
"0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864",
"0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1",
"0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238",
"0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a",
"0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55",
"0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78",
"0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d",
"0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61",
"0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747",
"0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2",
"0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636",
"0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a",
"0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0",
"0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c",
"0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92",
"0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323",
"0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992",
"0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f",
"0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca",
"0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e",
"0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1",
"0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b",
"0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d",
"0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540",
"0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"
],
"leaf": "0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"
}
],
"new-addresses": [
{
"root": "0xbfe2d9e57ace69971b010340a2eb1d9f1c9b078c7b9b3c90063b83617a84ef9",
"value": "0x202",
"pathIndex": 17,
"pathElements": [
"0x0",
"0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864",
"0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1",
"0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238",
"0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a",
"0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55",
"0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78",
"0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d",
"0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61",
"0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747",
"0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2",
"0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636",
"0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a",
"0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0",
"0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c",
"0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92",
"0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323",
"0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992",
"0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f",
"0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca",
"0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e",
"0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1",
"0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b",
"0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d",
"0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540",
"0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"
],
"leafLowerRangeValue": "0x201",
"leafHigherRangeValue": "0x203",
"nextIndex": 46336290
}
]
}
`
response, err := http.Post(proveEndpoint(), "application/json", strings.NewReader(testInput))
if err != nil {
t.Fatal(err)
}
responseBody, err := io.ReadAll(response.Body)
if err != nil {
t.Fatal(err)
}
if response.StatusCode != http.StatusOK {
t.Fatalf("Expected status code %d, got %d %s", http.StatusOK, response.StatusCode, string(responseBody))
}
}
func testBatchAppendWithSubtreesHappyPath26_1000(t *testing.T) {
treeDepth := uint32(26)
batchSize := uint32(1000)
startIndex := uint32(0)
params := prover.BuildAndUpdateBatchAppendWithSubtreesParameters(treeDepth, batchSize, startIndex, nil)
jsonBytes, _ := params.MarshalJSON()
response, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes))
if err != nil {
t.Fatal(err)
}
defer response.Body.Close()
if response.StatusCode != http.StatusOK {
body, _ := io.ReadAll(response.Body)
t.Fatalf("Expected status code %d, got %d. Response body: %s", http.StatusOK, response.StatusCode, string(body))
}
}
func testBatchAppendWithProofsHappyPath26_1000(t *testing.T) {
treeDepth := 26
batchSize := 1000
startIndex := 0
params := prover.BuildTestBatchAppendWithProofsTree(treeDepth, batchSize, nil, startIndex, true)
jsonBytes, _ := params.MarshalJSON()
response, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes))
if err != nil {
t.Fatal(err)
}
defer response.Body.Close()
if response.StatusCode != http.StatusOK {
body, _ := io.ReadAll(response.Body)
t.Fatalf("Expected status code %d, got %d. Response body: %s", http.StatusOK, response.StatusCode, string(body))
}
}
func testBatchAppendWithSubtreesHappyPath26_10(t *testing.T) {
treeDepth := uint32(26)
batchSize := uint32(10)
startIndex := uint32(0)
params := prover.BuildAndUpdateBatchAppendWithSubtreesParameters(treeDepth, batchSize, startIndex, nil)
jsonBytes, _ := params.MarshalJSON()
response, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes))
if err != nil {
t.Fatal(err)
}
defer response.Body.Close()
if response.StatusCode != http.StatusOK {
body, _ := io.ReadAll(response.Body)
t.Fatalf("Expected status code %d, got %d. Response body: %s", http.StatusOK, response.StatusCode, string(body))
}
}
func testBatchAppendWithProofsHappyPath26_10(t *testing.T) {
treeDepth := 26
batchSize := 10
startIndex := 0
params := prover.BuildTestBatchAppendWithProofsTree(treeDepth, batchSize, nil, startIndex, true)
jsonBytes, _ := params.MarshalJSON()
response, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes))
if err != nil {
t.Fatal(err)
}
defer response.Body.Close()
if response.StatusCode != http.StatusOK {
body, _ := io.ReadAll(response.Body)
t.Fatalf("Expected status code %d, got %d. Response body: %s", http.StatusOK, response.StatusCode, string(body))
}
}
func testBatchAppendWithSubtreesPreviousState26_100(t *testing.T) {
treeDepth := uint32(26)
batchSize := uint32(100)
startIndex := uint32(0)
// First batch
params1 := prover.BuildAndUpdateBatchAppendWithSubtreesParameters(treeDepth, batchSize, startIndex, nil)
jsonBytes1, _ := params1.MarshalJSON()
response1, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes1))
if err != nil {
t.Fatal(err)
}
if response1.StatusCode != http.StatusOK {
t.Fatalf("First batch: Expected status code %d, got %d", http.StatusOK, response1.StatusCode)
}
// Second batch
startIndex += batchSize
params2 := prover.BuildAndUpdateBatchAppendWithSubtreesParameters(treeDepth, batchSize, startIndex, ¶ms1)
jsonBytes2, _ := params2.MarshalJSON()
response2, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes2))
if err != nil {
t.Fatal(err)
}
if response2.StatusCode != http.StatusOK {
t.Fatalf("Second batch: Expected status code %d, got %d", http.StatusOK, response2.StatusCode)
}
}
func testBatchAppendWithSubtreesPreviousState26_10(t *testing.T) {
treeDepth := uint32(26)
batchSize := uint32(10)
startIndex := uint32(0)
// First batch
params1 := prover.BuildAndUpdateBatchAppendWithSubtreesParameters(treeDepth, batchSize, startIndex, nil)
jsonBytes1, _ := params1.MarshalJSON()
response1, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes1))
if err != nil {
t.Fatal(err)
}
if response1.StatusCode != http.StatusOK {
t.Fatalf("First batch: Expected status code %d, got %d", http.StatusOK, response1.StatusCode)
}
// Second batch
startIndex += batchSize
params2 := prover.BuildAndUpdateBatchAppendWithSubtreesParameters(treeDepth, batchSize, startIndex, ¶ms1)
jsonBytes2, _ := params2.MarshalJSON()
response2, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes2))
if err != nil {
t.Fatal(err)
}
if response2.StatusCode != http.StatusOK {
t.Fatalf("Second batch: Expected status code %d, got %d", http.StatusOK, response2.StatusCode)
}
}
func testBatchAppendWithProofsPreviousState26_100(t *testing.T) {
treeDepth := 26
batchSize := 100
startIndex := 0
// First batch
params1 := prover.BuildTestBatchAppendWithProofsTree(treeDepth, batchSize, nil, startIndex, true)
jsonBytes1, _ := params1.MarshalJSON()
response1, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes1))
if err != nil {
t.Fatal(err)
}
if response1.StatusCode != http.StatusOK {
t.Fatalf("First batch: Expected status code %d, got %d", http.StatusOK, response1.StatusCode)
}
// Second batch
startIndex += batchSize
params2 := prover.BuildTestBatchAppendWithProofsTree(treeDepth, batchSize, params1.Tree, startIndex, true)
jsonBytes2, _ := params2.MarshalJSON()
response2, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes2))
if err != nil {
t.Fatal(err)
}
if response2.StatusCode != http.StatusOK {
t.Fatalf("Second batch: Expected status code %d, got %d", http.StatusOK, response2.StatusCode)
}
}
func testBatchAppendWithProofsPreviousState26_10(t *testing.T) {
treeDepth := 26
batchSize := 10
startIndex := 0
// First batch
params1 := prover.BuildTestBatchAppendWithProofsTree(treeDepth, batchSize, nil, startIndex, true)
jsonBytes1, _ := params1.MarshalJSON()
response1, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes1))
if err != nil {
t.Fatal(err)
}
if response1.StatusCode != http.StatusOK {
t.Fatalf("First batch: Expected status code %d, got %d", http.StatusOK, response1.StatusCode)
}
// Second batch
startIndex += batchSize
params2 := prover.BuildTestBatchAppendWithProofsTree(treeDepth, batchSize, params1.Tree, startIndex, true)
jsonBytes2, _ := params2.MarshalJSON()
response2, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes2))
if err != nil {
t.Fatal(err)
}
if response2.StatusCode != http.StatusOK {
t.Fatalf("Second batch: Expected status code %d, got %d", http.StatusOK, response2.StatusCode)
}
}
func testBatchUpdateWithPreviousState26_10(t *testing.T) {
treeDepth := uint32(26)
batchSize := uint32(10)
// First batch
params1 := prover.BuildTestBatchUpdateTree(int(treeDepth), int(batchSize), nil, nil)
jsonBytes1, _ := params1.MarshalJSON()
response1, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes1))
if err != nil {
t.Fatal(err)
}
if response1.StatusCode != http.StatusOK {
t.Fatalf("First batch: Expected status code %d, got %d", http.StatusOK, response1.StatusCode)
}
// Second batch
params2 := prover.BuildTestBatchUpdateTree(int(treeDepth), int(batchSize), params1.Tree, nil)
jsonBytes2, _ := params2.MarshalJSON()
response2, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes2))
if err != nil {
t.Fatal(err)
}
if response2.StatusCode != http.StatusOK {
t.Fatalf("Second batch: Expected status code %d, got %d", http.StatusOK, response2.StatusCode)
}
// Verify that the new root is different from the old root
if params2.OldRoot.Cmp(params2.NewRoot) == 0 {
t.Errorf("Expected new root to be different from old root")
}
}
func testBatchUpdateInvalidInput26_10(t *testing.T) {
treeDepth := uint32(26)
batchSize := uint32(10)
params := prover.BuildTestBatchUpdateTree(int(treeDepth), int(batchSize), nil, nil)
// Invalidate the input by changing the old root
params.OldRoot = big.NewInt(0)
jsonBytes, _ := params.MarshalJSON()
response, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes))
if err != nil {
t.Fatal(err)
}
defer response.Body.Close()
if response.StatusCode != http.StatusBadRequest {
t.Fatalf("Expected status code %d, got %d", http.StatusBadRequest, response.StatusCode)
}
body, _ := io.ReadAll(response.Body)
if !strings.Contains(string(body), "proving_error") {
t.Fatalf("Expected error message to contain 'proving_error', got: %s", string(body))
}
}
func testBatchUpdateHappyPath26_10(t *testing.T) {
runBatchUpdateTest(t, 26, 10)
}
func testBatchUpdateHappyPath26_100(t *testing.T) {
runBatchUpdateTest(t, 26, 100)
}
func testBatchUpdateHappyPath26_500(t *testing.T) {
runBatchUpdateTest(t, 26, 500)
}
func testBatchUpdateHappyPath26_1000(t *testing.T) {
runBatchUpdateTest(t, 26, 1000)
}
func runBatchUpdateTest(t *testing.T, treeDepth uint32, batchSize uint32) {
params := prover.BuildTestBatchUpdateTree(int(treeDepth), int(batchSize), nil, nil)
jsonBytes, err := params.MarshalJSON()
if err != nil {
t.Fatalf("Failed to marshal JSON: %v", err)
}
response, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes))
if err != nil {
t.Fatalf("Failed to send POST request: %v", err)
}
defer response.Body.Close()
if response.StatusCode != http.StatusOK {
body, _ := io.ReadAll(response.Body)
t.Fatalf("Expected status code %d, got %d. Response body: %s", http.StatusOK, response.StatusCode, string(body))
}
if params.OldRoot.Cmp(params.NewRoot) == 0 {
t.Errorf("Expected new root to be different from old root")
}
t.Logf("Successfully ran batch update test with tree depth %d and batch size %d", treeDepth, batchSize)
}
func testBatchAddressAppendHappyPath40_10(t *testing.T) {
runBatchAddressAppendTest(t, 40, 10)
}
func testBatchAddressAppendHappyPath40_100(t *testing.T) {
runBatchAddressAppendTest(t, 40, 100)
}
func testBatchAddressAppendHappyPath40_500(t *testing.T) {
runBatchAddressAppendTest(t, 40, 500)
}
func testBatchAddressAppendHappyPath40_250(t *testing.T) {
runBatchAddressAppendTest(t, 40, 250)
}
func testBatchAddressAppendHappyPath40_1000(t *testing.T) {
runBatchAddressAppendTest(t, 40, 1000)
}
func runBatchAddressAppendTest(t *testing.T, treeHeight uint32, batchSize uint32) {
params, err := prover.BuildTestAddressTree(treeHeight, batchSize, nil, 2)
if err != nil {
t.Fatalf("Failed to build test tree: %v", err)
}
jsonBytes, err := params.MarshalJSON()
if err != nil {
t.Fatalf("Failed to marshal JSON: %v", err)
}
response, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes))
if err != nil {
t.Fatalf("Failed to send POST request: %v", err)
}
defer response.Body.Close()
if response.StatusCode != http.StatusOK {
body, _ := io.ReadAll(response.Body)
t.Fatalf("Expected status code %d, got %d. Response body: %s", http.StatusOK, response.StatusCode, string(body))
}
// Verify that the new root is different from the old root
if params.OldRoot.Cmp(params.NewRoot) == 0 {
t.Errorf("Expected new root to be different from old root")
}
t.Logf("Successfully ran batch address append test with tree height %d and batch size %d", treeHeight, batchSize)
}
func testBatchAddressAppendWithPreviousState40_10(t *testing.T) {
runBatchAddressAppendWithPreviousStateTest(t, 40, 10)
}
func testBatchAddressAppendWithPreviousState40_100(t *testing.T) {
runBatchAddressAppendWithPreviousStateTest(t, 40, 100)
}
func runBatchAddressAppendWithPreviousStateTest(t *testing.T, treeHeight uint32, batchSize uint32) {
startIndex := uint32(2)
params1, err := prover.BuildTestAddressTree(treeHeight, batchSize, nil, startIndex)
if err != nil {
t.Fatalf("Failed to build first test tree: %v", err)
}
jsonBytes1, err := params1.MarshalJSON()
if err != nil {
t.Fatalf("Failed to marshal first JSON: %v", err)
}
response1, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes1))
if err != nil {
t.Fatalf("Failed to send first POST request: %v", err)
}
if response1.StatusCode != http.StatusOK {
body, _ := io.ReadAll(response1.Body)
t.Fatalf("First batch: Expected status code %d, got %d. Response body: %s",
http.StatusOK, response1.StatusCode, string(body))
}
response1.Body.Close()
startIndex += batchSize
params2, err := prover.BuildTestAddressTree(treeHeight, batchSize, params1.Tree, startIndex)
if err != nil {
t.Fatalf("Failed to build second test tree: %v", err)
}
params2.OldRoot = params1.NewRoot
jsonBytes2, err := params2.MarshalJSON()
if err != nil {
t.Fatalf("Failed to marshal second JSON: %v", err)
}
response2, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes2))
if err != nil {
t.Fatalf("Failed to send second POST request: %v", err)
}
if response2.StatusCode != http.StatusOK {
body, _ := io.ReadAll(response2.Body)
t.Fatalf("Second batch: Expected status code %d, got %d. Response body: %s",
http.StatusOK, response2.StatusCode, string(body))
}
response2.Body.Close()
if params2.OldRoot.Cmp(params2.NewRoot) == 0 {
t.Errorf("Expected new root to be different from old root in second batch")
}
t.Logf("Successfully ran batch address append with previous state test with tree height %d and batch size %d",
treeHeight, batchSize)
}
func testBatchAddressAppendInvalidInput40_10(t *testing.T) {
treeHeight := uint32(40)
batchSize := uint32(10)
startIndex := uint32(0)
params, err := prover.BuildTestAddressTree(treeHeight, batchSize, nil, startIndex)
if err != nil {
t.Fatalf("Failed to build test tree: %v", err)
}
// Invalidate input by setting wrong old root
params.OldRoot = big.NewInt(0)
jsonBytes, err := params.MarshalJSON()
if err != nil {
t.Fatalf("Failed to marshal JSON: %v", err)
}
response, err := http.Post(proveEndpoint(), "application/json", bytes.NewBuffer(jsonBytes))
if err != nil {
t.Fatalf("Failed to send POST request: %v", err)
}
defer response.Body.Close()
if response.StatusCode != http.StatusBadRequest {
t.Fatalf("Expected status code %d, got %d", http.StatusBadRequest, response.StatusCode)
}
body, _ := io.ReadAll(response.Body)
if !strings.Contains(string(body), "proving_error") {
t.Fatalf("Expected error message to contain 'proving_error', got: %s", string(body))
}
t.Logf("Successfully ran invalid input test with tree height %d and batch size %d",
treeHeight, batchSize)
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/main.go
|
package main
import (
"bytes"
_ "embed"
"encoding/json"
"fmt"
"io"
"light/light-prover/logging"
"light/light-prover/prover"
"light/light-prover/server"
"os"
"os/signal"
"path/filepath"
"github.com/consensys/gnark/constraint"
gnarkLogger "github.com/consensys/gnark/logger"
"github.com/urfave/cli/v2"
)
func main() {
runCli()
}
func runCli() {
gnarkLogger.Set(*logging.Logger())
app := cli.App{
EnableBashCompletion: true,
Commands: []*cli.Command{
{
Name: "setup",
Flags: []cli.Flag{
&cli.StringFlag{Name: "circuit", Usage: "Type of circuit (\"inclusion\" / \"non-inclusion\" / \"combined\" / \"append\" / \"update\" / \"address-append\" )", Required: true},
&cli.StringFlag{Name: "output", Usage: "Output file", Required: true},
&cli.StringFlag{Name: "output-vkey", Usage: "Output file", Required: true},
&cli.UintFlag{Name: "inclusion-tree-height", Usage: "[Inclusion]: Merkle tree height", Required: false},
&cli.UintFlag{Name: "inclusion-compressed-accounts", Usage: "[Inclusion]: Number of compressed accounts", Required: false},
&cli.UintFlag{Name: "non-inclusion-tree-height", Usage: "[Non-inclusion]: merkle tree height", Required: false},
&cli.UintFlag{Name: "non-inclusion-compressed-accounts", Usage: "[Non-inclusion]: number of compressed accounts", Required: false},
&cli.UintFlag{Name: "append-tree-height", Usage: "[Batch append]: tree height", Required: false},
&cli.UintFlag{Name: "append-batch-size", Usage: "[Batch append]: batch size", Required: false},
&cli.UintFlag{Name: "update-tree-height", Usage: "[Batch update]: tree height", Required: false},
&cli.UintFlag{Name: "update-batch-size", Usage: "[Batch update]: batch size", Required: false},
&cli.UintFlag{Name: "address-append-tree-height", Usage: "[Batch address append]: tree height", Required: false},
&cli.UintFlag{Name: "address-append-batch-size", Usage: "[Batch address append]: batch size", Required: false},
},
Action: func(context *cli.Context) error {
circuit := prover.CircuitType(context.String("circuit"))
if circuit != prover.InclusionCircuitType && circuit != prover.NonInclusionCircuitType && circuit != prover.CombinedCircuitType && circuit != prover.BatchAppendWithSubtreesCircuitType && circuit != prover.BatchUpdateCircuitType && circuit != prover.BatchAppendWithProofsCircuitType && circuit != prover.BatchAddressAppendCircuitType {
return fmt.Errorf("invalid circuit type %s", circuit)
}
path := context.String("output")
pathVkey := context.String("output-vkey")
inclusionTreeHeight := uint32(context.Uint("inclusion-tree-height"))
inclusionNumberOfCompressedAccounts := uint32(context.Uint("inclusion-compressed-accounts"))
nonInclusionTreeHeight := uint32(context.Uint("non-inclusion-tree-height"))
nonInclusionNumberOfCompressedAccounts := uint32(context.Uint("non-inclusion-compressed-accounts"))
batchAppendTreeHeight := uint32(context.Uint("append-tree-height"))
batchAppendBatchSize := uint32(context.Uint("append-batch-size"))
batchUpdateTreeHeight := uint32(context.Uint("update-tree-height"))
batchUpdateBatchSize := uint32(context.Uint("update-batch-size"))
batchAddressAppendTreeHeight := uint32(context.Uint("address-append-tree-height"))
batchAddressAppendBatchSize := uint32(context.Uint("address-append-batch-size"))
if (inclusionTreeHeight == 0 || inclusionNumberOfCompressedAccounts == 0) && circuit == prover.InclusionCircuitType {
return fmt.Errorf("inclusion tree height and number of compressed accounts must be provided")
}
if (nonInclusionTreeHeight == 0 || nonInclusionNumberOfCompressedAccounts == 0) && circuit == prover.NonInclusionCircuitType {
return fmt.Errorf("non-inclusion tree height and number of compressed accounts must be provided")
}
if circuit == prover.CombinedCircuitType {
if inclusionTreeHeight == 0 || inclusionNumberOfCompressedAccounts == 0 {
return fmt.Errorf("inclusion tree height and number of compressed accounts must be provided")
}
if nonInclusionTreeHeight == 0 || nonInclusionNumberOfCompressedAccounts == 0 {
return fmt.Errorf("non-inclusion tree height and number of compressed accounts must be provided")
}
}
if (batchAppendTreeHeight == 0 || batchAppendBatchSize == 0) && circuit == prover.BatchAppendWithSubtreesCircuitType {
return fmt.Errorf("[Batch append]: tree height and batch size must be provided")
}
if (batchUpdateTreeHeight == 0 || batchUpdateBatchSize == 0) && circuit == prover.BatchUpdateCircuitType {
return fmt.Errorf("[Batch update]: tree height and batch size must be provided")
}
if (batchAddressAppendTreeHeight == 0 || batchAddressAppendBatchSize == 0) && circuit == prover.BatchAddressAppendCircuitType {
return fmt.Errorf("[Batch address append]: tree height and batch size must be provided")
}
logging.Logger().Info().Msg("Running setup")
var err error
if circuit == prover.BatchAppendWithSubtreesCircuitType {
var system *prover.ProvingSystemV2
system, err = prover.SetupCircuitV2(prover.BatchAppendWithSubtreesCircuitType, batchAppendTreeHeight, batchAppendBatchSize)
if err != nil {
return err
}
err = prover.WriteProvingSystem(system, path, pathVkey)
} else if circuit == prover.BatchAppendWithProofsCircuitType {
var system *prover.ProvingSystemV2
system, err = prover.SetupCircuitV2(prover.BatchAppendWithProofsCircuitType, batchAppendTreeHeight, batchAppendBatchSize)
if err != nil {
return err
}
err = prover.WriteProvingSystem(system, path, pathVkey)
} else if circuit == prover.BatchUpdateCircuitType {
var system *prover.ProvingSystemV2
system, err = prover.SetupCircuitV2(prover.BatchUpdateCircuitType, batchUpdateTreeHeight, batchUpdateBatchSize)
if err != nil {
return err
}
err = prover.WriteProvingSystem(system, path, pathVkey)
} else if circuit == prover.BatchAddressAppendCircuitType {
fmt.Println("Generating Address Append Circuit")
var system *prover.ProvingSystemV2
system, err = prover.SetupCircuitV2(prover.BatchAddressAppendCircuitType, batchAddressAppendTreeHeight, batchAddressAppendBatchSize)
if err != nil {
return err
}
err = prover.WriteProvingSystem(system, path, pathVkey)
} else {
var system *prover.ProvingSystemV1
system, err = prover.SetupCircuitV1(circuit, inclusionTreeHeight, inclusionNumberOfCompressedAccounts, nonInclusionTreeHeight, nonInclusionNumberOfCompressedAccounts)
if err != nil {
return err
}
err = prover.WriteProvingSystem(system, path, pathVkey)
}
if err != nil {
return err
}
logging.Logger().Info().Msg("Setup completed successfully")
return nil
},
},
{
Name: "r1cs",
Flags: []cli.Flag{
&cli.StringFlag{Name: "output", Usage: "Output file", Required: true},
&cli.StringFlag{Name: "circuit", Usage: "Type of circuit (\"inclusion\" / \"non-inclusion\" / \"combined\" / \"append\")", Required: true},
&cli.UintFlag{Name: "inclusion-tree-height", Usage: "[Inclusion]: merkle tree height", Required: false},
&cli.UintFlag{Name: "inclusion-compressed-accounts", Usage: "[Inclusion]: number of compressed accounts", Required: false},
&cli.UintFlag{Name: "non-inclusion-tree-height", Usage: "[Non-inclusion]: merkle tree height", Required: false},
&cli.UintFlag{Name: "non-inclusion-compressed-accounts", Usage: "[Non-inclusion]: number of compressed accounts", Required: false},
&cli.UintFlag{Name: "append-tree-height", Usage: "[Batch append]: merkle tree height", Required: false},
&cli.UintFlag{Name: "append-batch-size", Usage: "[Batch append]: batch size", Required: false},
&cli.UintFlag{Name: "update-tree-height", Usage: "[Batch update]: merkle tree height", Required: false},
&cli.UintFlag{Name: "update-batch-size", Usage: "[Batch update]: batch size", Required: false},
&cli.UintFlag{Name: "address-append-tree-height", Usage: "[Batch address append]: tree height", Required: false},
&cli.UintFlag{Name: "address-append-batch-size", Usage: "[Batch address append]: batch size", Required: false},
},
Action: func(context *cli.Context) error {
circuit := prover.CircuitType(context.String("circuit"))
if circuit != prover.InclusionCircuitType && circuit != prover.NonInclusionCircuitType && circuit != prover.CombinedCircuitType && circuit != prover.BatchAppendWithSubtreesCircuitType {
return fmt.Errorf("invalid circuit type %s", circuit)
}
path := context.String("output")
inclusionTreeHeight := uint32(context.Uint("inclusion-tree-height"))
inclusionNumberOfCompressedAccounts := uint32(context.Uint("inclusion-compressed-accounts"))
nonInclusionTreeHeight := uint32(context.Uint("non-inclusion-tree-height"))
nonInclusionNumberOfCompressedAccounts := uint32(context.Uint("non-inclusion-compressed-accounts"))
batchAppendTreeHeight := uint32(context.Uint("append-tree-height"))
batchAppendBatchSize := uint32(context.Uint("append-batch-size"))
batchUpdateTreeHeight := uint32(context.Uint("update-tree-height"))
batchUpdateBatchSize := uint32(context.Uint("update-batch-size"))
batchAddressAppendTreeHeight := uint32(context.Uint("address-append-tree-height"))
batchAddressAppendBatchSize := uint32(context.Uint("address-append-batch-size"))
if (inclusionTreeHeight == 0 || inclusionNumberOfCompressedAccounts == 0) && circuit == "inclusion" {
return fmt.Errorf("[Inclusion]: tree height and number of compressed accounts must be provided")
}
if (nonInclusionTreeHeight == 0 || nonInclusionNumberOfCompressedAccounts == 0) && circuit == "non-inclusion" {
return fmt.Errorf("[Non-inclusion]: tree height and number of compressed accounts must be provided")
}
if circuit == "combined" {
if inclusionTreeHeight == 0 || inclusionNumberOfCompressedAccounts == 0 {
return fmt.Errorf("[Combined]: tree height and number of compressed accounts must be provided")
}
if nonInclusionTreeHeight == 0 || nonInclusionNumberOfCompressedAccounts == 0 {
return fmt.Errorf("[Combined]: tree height and number of compressed accounts must be provided")
}
}
if (batchAppendTreeHeight == 0 || batchAppendBatchSize == 0) && circuit == prover.BatchAppendWithSubtreesCircuitType {
return fmt.Errorf("[Batch append]: tree height and batch size must be provided")
}
if (batchUpdateTreeHeight == 0 || batchUpdateBatchSize == 0) && circuit == prover.BatchUpdateCircuitType {
return fmt.Errorf("[Batch update]: tree height and batch size must be provided")
}
if (batchAddressAppendTreeHeight == 0 || batchAddressAppendBatchSize == 0) && circuit == prover.BatchAddressAppendCircuitType {
return fmt.Errorf("[Batch address append]: tree height and batch size must be provided")
}
logging.Logger().Info().Msg("Building R1CS")
var cs constraint.ConstraintSystem
var err error
if circuit == prover.InclusionCircuitType {
cs, err = prover.R1CSInclusion(inclusionTreeHeight, inclusionNumberOfCompressedAccounts)
} else if circuit == prover.NonInclusionCircuitType {
cs, err = prover.R1CSNonInclusion(nonInclusionTreeHeight, nonInclusionNumberOfCompressedAccounts)
} else if circuit == prover.CombinedCircuitType {
cs, err = prover.R1CSCombined(inclusionTreeHeight, inclusionNumberOfCompressedAccounts, nonInclusionTreeHeight, nonInclusionNumberOfCompressedAccounts)
} else if circuit == prover.BatchAppendWithSubtreesCircuitType {
cs, err = prover.R1CSBatchAppendWithSubtrees(batchAppendTreeHeight, batchAppendBatchSize)
} else if circuit == prover.BatchUpdateCircuitType {
cs, err = prover.R1CSBatchUpdate(batchUpdateTreeHeight, batchUpdateBatchSize)
} else if circuit == prover.BatchAddressAppendCircuitType {
cs, err = prover.R1CSBatchAddressAppend(batchAddressAppendTreeHeight, batchAddressAppendBatchSize)
} else {
return fmt.Errorf("invalid circuit type %s", circuit)
}
if err != nil {
return err
}
file, err := os.Create(path)
defer func(file *os.File) {
err := file.Close()
if err != nil {
logging.Logger().Error().Err(err).Msg("error closing file")
}
}(file)
if err != nil {
return err
}
written, err := cs.WriteTo(file)
if err != nil {
return err
}
logging.Logger().Info().Int64("bytesWritten", written).Msg("R1CS written to file")
return nil
},
},
{
Name: "import-setup",
Flags: []cli.Flag{
&cli.StringFlag{Name: "circuit", Usage: "Type of circuit (\"inclusion\" / \"non-inclusion\" / \"combined\")", Required: true},
&cli.StringFlag{Name: "output", Usage: "Output file", Required: true},
&cli.StringFlag{Name: "pk", Usage: "Proving key", Required: true},
&cli.StringFlag{Name: "vk", Usage: "Verifying key", Required: true},
&cli.UintFlag{Name: "inclusion-tree-height", Usage: "[Inclusion]: merkle tree height", Required: false},
&cli.UintFlag{Name: "inclusion-compressed-accounts", Usage: "[Inclusion]: number of compressed accounts", Required: false},
&cli.UintFlag{Name: "non-inclusion-tree-height", Usage: "[Non-inclusion]: merkle tree height", Required: false},
&cli.UintFlag{Name: "non-inclusion-compressed-accounts", Usage: "[Non-inclusion]: number of compressed accounts", Required: false},
&cli.UintFlag{Name: "append-tree-height", Usage: "[Batch append]: merkle tree height", Required: false},
&cli.UintFlag{Name: "append-batch-size", Usage: "[Batch append]: batch size", Required: false},
&cli.UintFlag{Name: "update-tree-height", Usage: "[Batch update]: merkle tree height", Required: false},
&cli.UintFlag{Name: "update-batch-size", Usage: "[Batch update]: batch size", Required: false},
&cli.UintFlag{Name: "address-append-tree-height", Usage: "[Batch address append]: tree height", Required: false},
&cli.UintFlag{Name: "address-append-batch-size", Usage: "[Batch address append]: batch size", Required: false},
},
Action: func(context *cli.Context) error {
circuit := context.String("circuit")
path := context.String("output")
pk := context.String("pk")
vk := context.String("vk")
inclusionTreeHeight := uint32(context.Uint("inclusion-tree-height"))
inclusionNumberOfCompressedAccounts := uint32(context.Uint("inclusion-compressed-accounts"))
nonInclusionTreeHeight := uint32(context.Uint("non-inclusion-tree-height"))
nonInclusionNumberOfCompressedAccounts := uint32(context.Uint("non-inclusion-compressed-accounts"))
batchAppendTreeHeight := uint32(context.Uint("append-tree-height"))
batchAppendBatchSize := uint32(context.Uint("append-batch-size"))
batchUpdateTreeHeight := uint32(context.Uint("update-tree-height"))
batchUpdateBatchSize := uint32(context.Uint("update-batch-size"))
batchAddressAppendTreeHeight := uint32(context.Uint("address-append-tree-height"))
batchAddressAppendBatchSize := uint32(context.Uint("address-append-batch-size"))
var err error
logging.Logger().Info().Msg("Importing setup")
if circuit == "append" {
if batchAppendTreeHeight == 0 || batchAppendBatchSize == 0 {
return fmt.Errorf("append tree height and batch size must be provided")
}
var system *prover.ProvingSystemV2
system, err = prover.ImportBatchAppendWithSubtreesSetup(batchAppendTreeHeight, batchAppendBatchSize, pk, vk)
if err != nil {
return err
}
err = prover.WriteProvingSystem(system, path, "")
} else if circuit == "update" {
if batchUpdateTreeHeight == 0 || batchUpdateBatchSize == 0 {
return fmt.Errorf("append tree height and batch size must be provided")
}
var system *prover.ProvingSystemV2
system, err = prover.ImportBatchUpdateSetup(batchUpdateTreeHeight, batchUpdateBatchSize, pk, vk)
if err != nil {
return err
}
err = prover.WriteProvingSystem(system, path, "")
} else if circuit == "address-append" {
if batchAddressAppendTreeHeight == 0 || batchAddressAppendBatchSize == 0 {
return fmt.Errorf("append tree height and batch size must be provided")
}
var system *prover.ProvingSystemV2
system, err = prover.ImportBatchAddressAppendSetup(batchAddressAppendTreeHeight, batchAddressAppendBatchSize, pk, vk)
if err != nil {
return err
}
err = prover.WriteProvingSystem(system, path, "")
} else {
if circuit == "inclusion" || circuit == "combined" {
if inclusionTreeHeight == 0 || inclusionNumberOfCompressedAccounts == 0 {
return fmt.Errorf("inclusion tree height and number of compressed accounts must be provided")
}
}
if circuit == "non-inclusion" || circuit == "combined" {
if nonInclusionTreeHeight == 0 || nonInclusionNumberOfCompressedAccounts == 0 {
return fmt.Errorf("non-inclusion tree height and number of compressed accounts must be provided")
}
}
var system *prover.ProvingSystemV1
switch circuit {
case "inclusion":
system, err = prover.ImportInclusionSetup(inclusionTreeHeight, inclusionNumberOfCompressedAccounts, pk, vk)
case "non-inclusion":
system, err = prover.ImportNonInclusionSetup(nonInclusionTreeHeight, nonInclusionNumberOfCompressedAccounts, pk, vk)
case "combined":
system, err = prover.ImportCombinedSetup(inclusionTreeHeight, inclusionNumberOfCompressedAccounts, nonInclusionTreeHeight, nonInclusionNumberOfCompressedAccounts, pk, vk)
}
if err != nil {
return err
}
err = prover.WriteProvingSystem(system, path, "")
}
if err != nil {
return err
}
logging.Logger().Info().Msg("Setup imported successfully")
return nil
},
},
{
Name: "export-vk",
Flags: []cli.Flag{
&cli.StringFlag{Name: "keys-file", Aliases: []string{"k"}, Usage: "proving system file", Required: true},
&cli.StringFlag{Name: "output", Usage: "output file", Required: true},
},
Action: func(context *cli.Context) error {
keysFile := context.String("keys-file")
outputFile := context.String("output")
system, err := prover.ReadSystemFromFile(keysFile)
if err != nil {
return fmt.Errorf("failed to read proving system: %v", err)
}
var vk interface{}
switch s := system.(type) {
case *prover.ProvingSystemV1:
vk = s.VerifyingKey
case *prover.ProvingSystemV2:
vk = s.VerifyingKey
default:
return fmt.Errorf("unknown proving system type")
}
var buf bytes.Buffer
_, err = vk.(io.WriterTo).WriteTo(&buf)
if err != nil {
return fmt.Errorf("failed to serialize verification key: %v", err)
}
err = os.MkdirAll(filepath.Dir(outputFile), 0755)
if err != nil {
return fmt.Errorf("failed to create output directory: %v", err)
}
var dataToWrite = buf.Bytes()
err = os.WriteFile(outputFile, dataToWrite, 0644)
if err != nil {
return fmt.Errorf("failed to write verification key to file: %v", err)
}
logging.Logger().Info().
Str("file", outputFile).
Int("bytes", len(dataToWrite)).
Msg("Verification key exported successfully")
return nil
},
},
{
Name: "gen-test-params",
Flags: []cli.Flag{
&cli.IntFlag{Name: "tree-height", Usage: "height of the mock tree", DefaultText: "26", Value: 26},
&cli.IntFlag{Name: "compressed-accounts", Usage: "Number of compressed accounts", DefaultText: "1", Value: 1},
},
Action: func(context *cli.Context) error {
treeHeight := context.Int("tree-height")
compressedAccounts := context.Int("compressed-accounts")
logging.Logger().Info().Msg("Generating test params for the inclusion circuit")
var r []byte
var err error
params := prover.BuildTestTree(treeHeight, compressedAccounts, false)
r, err = json.Marshal(¶ms)
if err != nil {
return err
}
fmt.Println(string(r))
return nil
},
},
{
Name: "start",
Flags: []cli.Flag{
&cli.BoolFlag{Name: "json-logging", Usage: "enable JSON logging", Required: false},
&cli.StringFlag{Name: "prover-address", Usage: "address for the prover server", Value: "0.0.0.0:3001", Required: false},
&cli.StringFlag{Name: "metrics-address", Usage: "address for the metrics server", Value: "0.0.0.0:9998", Required: false},
&cli.StringFlag{Name: "keys-dir", Usage: "Directory where key files are stored", Value: "./proving-keys/", Required: false},
&cli.StringSliceFlag{
Name: "circuit",
Usage: "Specify the circuits to enable (inclusion, non-inclusion, combined, append-with-subtrees, append-with-proofs, update, append-with-subtrees-test, append-with-proofs-test, update-test, address-append, address-append-test)",
},
&cli.StringFlag{
Name: "run-mode",
Usage: "Specify the running mode (rpc, forester, forester-test, full, or full-test)",
},
},
Action: func(context *cli.Context) error {
if context.Bool("json-logging") {
logging.SetJSONOutput()
}
circuits := context.StringSlice("circuit")
runMode, err := parseRunMode(context.String("run-mode"))
if err != nil {
if len(circuits) == 0 {
return err
}
}
var keysDirPath = context.String("keys-dir")
debugProvingSystemKeys(keysDirPath, runMode, circuits)
psv1, psv2, err := prover.LoadKeys(keysDirPath, runMode, circuits)
if err != nil {
return err
}
if len(psv1) == 0 && len(psv2) == 0 {
return fmt.Errorf("no proving systems loaded")
}
merkleConfig := server.Config{
ProverAddress: context.String("prover-address"),
MetricsAddress: context.String("metrics-address"),
}
instance := server.Run(&merkleConfig, psv1, psv2)
sigint := make(chan os.Signal, 1)
signal.Notify(sigint, os.Interrupt)
<-sigint
logging.Logger().Info().Msg("Received sigint, shutting down")
instance.RequestStop()
logging.Logger().Info().Msg("Waiting for server to close")
instance.AwaitStop()
return nil
},
},
{
Name: "prove",
Flags: []cli.Flag{
&cli.BoolFlag{Name: "inclusion", Usage: "Run inclusion circuit", Required: true},
&cli.BoolFlag{Name: "non-inclusion", Usage: "Run non-inclusion circuit", Required: false},
&cli.BoolFlag{Name: "append", Usage: "Run batch append circuit", Required: false},
&cli.BoolFlag{Name: "update", Usage: "Run batch update circuit", Required: false},
&cli.BoolFlag{Name: "address-append", Usage: "Run batch address append circuit", Required: false},
&cli.StringFlag{Name: "keys-dir", Usage: "Directory where circuit key files are stored", Value: "./proving-keys/", Required: false},
&cli.StringSliceFlag{Name: "keys-file", Aliases: []string{"k"}, Value: cli.NewStringSlice(), Usage: "Proving system file"},
&cli.StringSliceFlag{
Name: "circuit",
Usage: "Specify the circuits to enable (inclusion, non-inclusion, combined, append-with-proofs, append-with-subtrees, update, append-with-proofs-test, append-with-subtrees-test, update-test, address-append, address-append-test)",
Value: cli.NewStringSlice("inclusion", "non-inclusion", "combined", "append-with-proofs", "append-with-subtrees", "update", "append-with-proofs-test", "append-with-subtrees-test", "update-test", "address-append", "address-append-test"),
},
&cli.StringFlag{
Name: "run-mode",
Usage: "Specify the running mode (forester, forester-test, rpc, or full)",
},
},
Action: func(context *cli.Context) error {
circuits := context.StringSlice("circuit")
runMode, err := parseRunMode(context.String("run-mode"))
if err != nil {
if len(circuits) == 0 {
return err
}
}
var keysDirPath = context.String("keys-dir")
psv1, psv2, err := prover.LoadKeys(keysDirPath, runMode, circuits)
if err != nil {
return err
}
if len(psv1) == 0 && len(psv2) == 0 {
return fmt.Errorf("no proving systems loaded")
}
logging.Logger().Info().Msg("Reading params from stdin")
inputsBytes, err := io.ReadAll(os.Stdin)
if err != nil {
return err
}
var proof *prover.Proof
if context.Bool("inclusion") {
var params prover.InclusionParameters
err = json.Unmarshal(inputsBytes, ¶ms)
if err != nil {
return err
}
treeHeight := params.TreeHeight()
compressedAccounts := params.NumberOfCompressedAccounts()
for _, provingSystem := range psv1 {
if provingSystem.InclusionTreeHeight == treeHeight && provingSystem.InclusionNumberOfCompressedAccounts == compressedAccounts {
proof, err = provingSystem.ProveInclusion(¶ms)
if err != nil {
return err
}
r, _ := json.Marshal(&proof)
fmt.Println(string(r))
break
}
}
} else if context.Bool("non-inclusion") {
var params prover.NonInclusionParameters
err = json.Unmarshal(inputsBytes, ¶ms)
if err != nil {
return err
}
treeHeight := params.TreeHeight()
compressedAccounts := params.NumberOfCompressedAccounts()
for _, provingSystem := range psv1 {
if provingSystem.NonInclusionTreeHeight == treeHeight && provingSystem.NonInclusionNumberOfCompressedAccounts == compressedAccounts {
proof, err = provingSystem.ProveNonInclusion(¶ms)
if err != nil {
return err
}
r, _ := json.Marshal(&proof)
fmt.Println(string(r))
break
}
}
} else if context.Bool("inclusion") && context.Bool("non-inclusion") {
var params prover.CombinedParameters
err = json.Unmarshal(inputsBytes, ¶ms)
if err != nil {
return err
}
for _, provingSystem := range psv1 {
if provingSystem.InclusionTreeHeight == params.TreeHeight() && provingSystem.InclusionNumberOfCompressedAccounts == params.NumberOfCompressedAccounts() && provingSystem.NonInclusionTreeHeight == params.NonInclusionTreeHeight() && provingSystem.InclusionNumberOfCompressedAccounts == params.NonInclusionNumberOfCompressedAccounts() {
proof, err = provingSystem.ProveCombined(¶ms)
if err != nil {
return err
}
r, _ := json.Marshal(&proof)
fmt.Println(string(r))
break
}
}
} else if context.Bool("append") {
var params prover.BatchAppendWithSubtreesParameters
err = json.Unmarshal(inputsBytes, ¶ms)
if err != nil {
return err
}
for _, provingSystem := range psv2 {
if provingSystem.TreeHeight == params.TreeHeight && provingSystem.BatchSize == params.BatchSize() {
proof, err = provingSystem.ProveBatchAppendWithSubtrees(¶ms)
if err != nil {
return err
}
r, _ := json.Marshal(&proof)
fmt.Println(string(r))
break
}
}
} else if context.Bool("update") {
var params prover.BatchUpdateParameters
err = json.Unmarshal(inputsBytes, ¶ms)
if err != nil {
return err
}
for _, provingSystem := range psv2 {
if provingSystem.TreeHeight == params.Height && provingSystem.BatchSize == params.BatchSize {
proof, err = provingSystem.ProveBatchUpdate(¶ms)
if err != nil {
return err
}
r, _ := json.Marshal(&proof)
fmt.Println(string(r))
break
}
}
} else if context.Bool("address-append") {
var params prover.BatchAddressAppendParameters
err = json.Unmarshal(inputsBytes, ¶ms)
if err != nil {
return err
}
for _, provingSystem := range psv2 {
if provingSystem.TreeHeight == params.TreeHeight && provingSystem.BatchSize == params.BatchSize {
proof, err = provingSystem.ProveBatchAddressAppend(¶ms)
if err != nil {
return err
}
r, _ := json.Marshal(&proof)
fmt.Println(string(r))
break
}
}
}
return nil
},
},
{
Name: "verify",
Flags: []cli.Flag{
&cli.StringFlag{Name: "keys-file", Aliases: []string{"k"}, Usage: "proving system file", Required: true},
&cli.StringFlag{Name: "circuit", Usage: "Type of circuit (\"inclusion\" / \"non-inclusion\" / \"combined\" / \"append\")", Required: true},
&cli.StringFlag{Name: "roots", Usage: "Comma-separated list of root hashes (hex format)", Required: false},
&cli.StringFlag{Name: "leaves", Usage: "Comma-separated list of leaf hashes for inclusion (hex format)", Required: false},
&cli.StringFlag{Name: "values", Usage: "Comma-separated list of values for non-inclusion (hex format)", Required: false},
&cli.StringFlag{Name: "old-sub-tree-hash-chain", Usage: "Old sub-tree hash chain (hex format)", Required: false},
&cli.StringFlag{Name: "new-sub-tree-hash-chain", Usage: "New sub-tree hash chain (hex format)", Required: false},
&cli.StringFlag{Name: "new-root", Usage: "New root (hex format)", Required: false},
&cli.StringFlag{Name: "hashchain-hash", Usage: "Hashchain hash (hex format)", Required: false},
},
Action: func(context *cli.Context) error {
keys := context.String("keys-file")
circuit := context.String("circuit")
system, err := prover.ReadSystemFromFile(keys)
if err != nil {
return fmt.Errorf("failed to read proving system: %v", err)
}
logging.Logger().Info().Msg("Reading proof from stdin")
proofBytes, err := io.ReadAll(os.Stdin)
if err != nil {
return fmt.Errorf("failed to read proof from stdin: %v", err)
}
var proof prover.Proof
err = json.Unmarshal(proofBytes, &proof)
if err != nil {
return fmt.Errorf("failed to unmarshal proof: %v", err)
}
var verifyErr error
switch s := system.(type) {
case *prover.ProvingSystemV1:
rootsStr := context.String("roots")
roots, err := prover.ParseHexStringList(rootsStr)
if err != nil {
return fmt.Errorf("failed to parse roots: %v", err)
}
switch circuit {
case "inclusion":
leavesStr := context.String("leaves")
leaves, err := prover.ParseHexStringList(leavesStr)
if err != nil {
return fmt.Errorf("failed to parse leaves: %v", err)
}
verifyErr = s.VerifyInclusion(roots, leaves, &proof)
case "non-inclusion":
values, err := prover.ParseHexStringList(context.String("values"))
if err != nil {
return fmt.Errorf("failed to parse values: %v", err)
}
verifyErr = s.VerifyNonInclusion(roots, values, &proof)
case "combined":
leaves, err := prover.ParseHexStringList(context.String("leaves"))
if err != nil {
return fmt.Errorf("failed to parse leaves: %v", err)
}
values, err := prover.ParseHexStringList(context.String("values"))
if err != nil {
return fmt.Errorf("failed to parse values: %v", err)
}
verifyErr = s.VerifyCombined(roots, leaves, values, &proof)
default:
return fmt.Errorf("invalid circuit type for ProvingSystemV1: %s", circuit)
}
case *prover.ProvingSystemV2:
if circuit != "append" {
return fmt.Errorf("invalid circuit type for ProvingSystemV2: %s", circuit)
}
oldSubTreeHashChain, err := prover.ParseBigInt(context.String("old-sub-tree-hash-chain"))
if err != nil {
return fmt.Errorf("failed to parse old sub-tree hash chain: %v", err)
}
newSubTreeHashChain, err := prover.ParseBigInt(context.String("new-sub-tree-hash-chain"))
if err != nil {
return fmt.Errorf("failed to parse new sub-tree hash chain: %v", err)
}
newRoot, err := prover.ParseBigInt(context.String("new-root"))
if err != nil {
return fmt.Errorf("failed to parse new root: %v", err)
}
hashchainHash, err := prover.ParseBigInt(context.String("hashchain-hash"))
if err != nil {
return fmt.Errorf("failed to parse hashchain hash: %v", err)
}
verifyErr = s.VerifyBatchAppendWithSubtrees(oldSubTreeHashChain, newSubTreeHashChain, newRoot, hashchainHash, &proof)
default:
return fmt.Errorf("unknown proving system type")
}
if verifyErr != nil {
return fmt.Errorf("verification failed: %v", verifyErr)
}
logging.Logger().Info().Msg("Verification completed successfully")
return nil
},
},
{
Name: "extract-circuit",
Flags: []cli.Flag{
&cli.StringFlag{Name: "output", Usage: "Output file", Required: true},
&cli.UintFlag{Name: "tree-height", Usage: "Merkle tree height", Required: true},
&cli.UintFlag{Name: "compressed-accounts", Usage: "Number of compressed accounts", Required: true},
},
Action: func(context *cli.Context) error {
path := context.String("output")
treeHeight := uint32(context.Uint("tree-height"))
compressedAccounts := uint32(context.Uint("compressed-accounts"))
logging.Logger().Info().Msg("Extracting gnark circuit to Lean")
circuitString, err := prover.ExtractLean(treeHeight, compressedAccounts)
if err != nil {
return err
}
file, err := os.Create(path)
defer func(file *os.File) {
err := file.Close()
if err != nil {
logging.Logger().Error().Err(err).Msg("error closing file")
}
}(file)
if err != nil {
return err
}
written, err := file.WriteString(circuitString)
if err != nil {
return err
}
logging.Logger().Info().Int("bytesWritten", written).Msg("Lean circuit written to file")
return nil
},
},
},
}
if err := app.Run(os.Args); err != nil {
logging.Logger().Fatal().Err(err).Msg("App failed.")
}
}
func parseRunMode(runModeString string) (prover.RunMode, error) {
runMode := prover.Rpc
switch runModeString {
case "rpc":
logging.Logger().Info().Msg("Running in rpc mode")
runMode = prover.Rpc
case "forester":
logging.Logger().Info().Msg("Running in forester mode")
runMode = prover.Forester
case "forester-test":
logging.Logger().Info().Msg("Running in forester test mode")
runMode = prover.ForesterTest
case "full":
logging.Logger().Info().Msg("Running in full mode")
runMode = prover.Full
case "full-test":
logging.Logger().Info().Msg("Running in full mode")
runMode = prover.FullTest
default:
return "", fmt.Errorf("invalid run mode %s", runModeString)
}
return runMode, nil
}
func debugProvingSystemKeys(keysDirPath string, runMode prover.RunMode, circuits []string) {
logging.Logger().Info().
Str("keysDirPath", keysDirPath).
Str("runMode", string(runMode)).
Strs("circuits", circuits).
Msg("Debug: Loading proving system keys")
keys := prover.GetKeys(keysDirPath, runMode, circuits)
for _, key := range keys {
if _, err := os.Stat(key); err != nil {
if os.IsNotExist(err) {
logging.Logger().Error().
Str("key", key).
Msg("Key file does not exist")
} else {
logging.Logger().Error().
Str("key", key).
Err(err).
Msg("Error checking key file")
}
} else {
fileInfo, err := os.Stat(key)
if err != nil {
logging.Logger().Error().
Str("key", key).
Err(err).
Msg("Error getting key file info")
} else {
logging.Logger().Info().
Str("key", key).
Int64("size", fileInfo.Size()).
Str("mode", fileInfo.Mode().String()).
Msg("Key file exists")
}
}
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/merkle-tree/zero_bytes.go
|
package merkle_tree
var ZERO_BYTES = [33][32]byte{
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
},
{
32, 152, 245, 251, 158, 35, 158, 171, 60, 234, 195, 242, 123,
129, 228, 129, 220, 49, 36, 213, 95, 254, 213, 35, 168, 57,
238, 132, 70, 182, 72, 100,
},
{
16, 105, 103, 61, 205, 177, 34, 99, 223, 48, 26, 111, 245, 132,
167, 236, 38, 26, 68, 203, 157, 198, 141, 240, 103, 164, 119,
68, 96, 177, 241, 225,
},
{
24, 244, 51, 49, 83, 126, 226, 175, 46, 61, 117, 141, 80, 247,
33, 6, 70, 124, 110, 234, 80, 55, 29, 213, 40, 213, 126, 178,
184, 86, 210, 56,
},
{
7, 249, 216, 55, 203, 23, 176, 211, 99, 32, 255, 233, 59, 165,
35, 69, 241, 183, 40, 87, 26, 86, 130, 101, 202, 172, 151, 85,
157, 188, 149, 42,
},
{
43, 148, 207, 94, 135, 70, 179, 245, 201, 99, 31, 76, 93, 243,
41, 7, 166, 153, 197, 140, 148, 178, 173, 77, 123, 92, 236, 22,
57, 24, 63, 85,
},
{
45, 238, 147, 197, 166, 102, 69, 150, 70, 234, 125, 34, 204,
169, 225, 188, 254, 215, 30, 105, 81, 185, 83, 97, 29, 17, 221,
163, 46, 160, 157, 120,
},
{
7, 130, 149, 229, 162, 43, 132, 233, 130, 207, 96, 30, 182, 57,
89, 123, 139, 5, 21, 168, 140, 181, 172, 127, 168, 164, 170,
190, 60, 135, 52, 157,
},
{
47, 165, 229, 241, 143, 96, 39, 166, 80, 27, 236, 134, 69, 100,
71, 42, 97, 107, 46, 39, 74, 65, 33, 26, 68, 76, 190, 58,
153, 243, 204, 97,
},
{
14, 136, 67, 118, 208, 216, 253, 33, 236, 183, 128, 56, 158,
148, 31, 102, 228, 94, 122, 204, 227, 226, 40, 171, 62, 33, 86,
166, 20, 252, 215, 71,
},
{
27, 114, 1, 218, 114, 73, 79, 30, 40, 113, 122, 209, 165, 46,
180, 105, 249, 88, 146, 249, 87, 113, 53, 51, 222, 97, 117,
229, 218, 25, 10, 242,
},
{
31, 141, 136, 34, 114, 94, 54, 56, 82, 0, 192, 178, 1, 36,
152, 25, 166, 230, 225, 228, 101, 8, 8, 181, 190, 188, 107,
250, 206, 125, 118, 54,
},
{
44, 93, 130, 246, 108, 145, 75, 175, 185, 112, 21, 137, 186,
140, 252, 251, 97, 98, 176, 161, 42, 207, 136, 168, 208, 135,
154, 4, 113, 181, 248, 90,
},
{
20, 197, 65, 72, 160, 148, 11, 184, 32, 149, 127, 90, 223, 63,
161, 19, 78, 245, 196, 170, 161, 19, 244, 100, 100, 88, 242,
112, 224, 191, 191, 208,
},
{
25, 13, 51, 177, 47, 152, 111, 150, 30, 16, 192, 238, 68, 216,
185, 175, 17, 190, 37, 88, 140, 173, 137, 212, 22, 17, 142, 75,
244, 235, 232, 12,
},
{
34, 249, 138, 169, 206, 112, 65, 82, 172, 23, 53, 73, 20, 173,
115, 237, 17, 103, 174, 101, 150, 175, 81, 10, 165, 179, 100,
147, 37, 224, 108, 146,
},
{
42, 124, 124, 155, 108, 229, 136, 11, 159, 111, 34, 141, 114,
191, 106, 87, 90, 82, 111, 41, 198, 110, 204, 238, 248, 183,
83, 211, 139, 186, 115, 35,
},
{
46, 129, 134, 229, 88, 105, 142, 193, 198, 122, 249, 193, 77,
70, 63, 252, 71, 0, 67, 201, 194, 152, 139, 149, 77, 117, 221,
100, 63, 54, 185, 146,
},
{
15, 87, 197, 87, 30, 154, 78, 171, 73, 226, 200, 207, 5, 13,
174, 148, 138, 239, 110, 173, 100, 115, 146, 39, 53, 70, 36,
157, 28, 31, 241, 15,
},
{
24, 48, 238, 103, 181, 251, 85, 74, 213, 246, 61, 67, 136, 128,
14, 28, 254, 120, 227, 16, 105, 125, 70, 228, 60, 156, 227, 97,
52, 247, 44, 202,
},
{
33, 52, 231, 106, 197, 210, 26, 171, 24, 108, 43, 225, 221,
143, 132, 238, 136, 10, 30, 70, 234, 247, 18, 249, 211, 113,
182, 223, 34, 25, 31, 62,
},
{
25, 223, 144, 236, 132, 78, 188, 79, 254, 235, 216, 102, 243,
56, 89, 176, 192, 81, 216, 201, 88, 238, 58, 168, 143, 143,
141, 243, 219, 145, 165, 177,
},
{
24, 204, 162, 166, 107, 92, 7, 135, 152, 30, 105, 174, 253,
132, 133, 45, 116, 175, 14, 147, 239, 73, 18, 180, 100, 140, 5,
247, 34, 239, 229, 43,
},
{
35, 136, 144, 148, 21, 35, 13, 27, 77, 19, 4, 210, 213, 79,
71, 58, 98, 131, 56, 242, 239, 173, 131, 250, 223, 5, 100, 69,
73, 210, 83, 141,
},
{
39, 23, 31, 180, 169, 123, 108, 192, 233, 232, 245, 67, 181,
41, 77, 232, 102, 162, 175, 44, 156, 141, 11, 29, 150, 230,
115, 228, 82, 158, 213, 64,
},
{
47, 246, 101, 5, 64, 246, 41, 253, 87, 17, 160, 188, 116, 252,
13, 40, 220, 178, 48, 185, 57, 37, 131, 229, 248, 213, 150,
150, 221, 230, 174, 33,
},
{
18, 12, 88, 241, 67, 212, 145, 233, 89, 2, 247, 245, 39, 119,
120, 162, 224, 173, 81, 104, 246, 173, 215, 86, 105, 147, 38,
48, 206, 97, 21, 24,
},
{
31, 33, 254, 183, 13, 63, 33, 176, 123, 248, 83, 213, 229, 219,
3, 7, 30, 196, 149, 160, 165, 101, 162, 29, 162, 214, 101, 210,
121, 72, 55, 149,
},
{
36, 190, 144, 95, 167, 19, 53, 225, 76, 99, 140, 192, 246, 106,
134, 35, 168, 38, 231, 104, 6, 138, 158, 150, 139, 177, 161,
221, 225, 138, 114, 210,
},
{
15, 134, 102, 182, 46, 209, 116, 145, 197, 12, 234, 222, 173,
87, 212, 205, 89, 126, 243, 130, 29, 101, 195, 40, 116, 76,
116, 229, 83, 218, 194, 109,
},
{
9, 24, 212, 107, 245, 45, 152, 176, 52, 65, 63, 74, 26, 28,
65, 89, 78, 122, 122, 63, 106, 224, 140, 180, 61, 26, 42, 35,
14, 25, 89, 239,
},
{
27, 190, 176, 27, 76, 71, 158, 205, 231, 105, 23, 100, 94, 64,
77, 250, 46, 38, 249, 13, 10, 252, 90, 101, 18, 133, 19, 173,
55, 92, 95, 242,
},
{
47, 104, 161, 197, 142, 37, 126, 66, 161, 122, 108, 97, 223,
245, 85, 30, 213, 96, 185, 146, 42, 177, 25, 213, 172, 142, 24,
76, 151, 52, 234, 217,
},
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/merkle-tree/indexed_merkle_tree_test.go
|
package merkle_tree
import (
"fmt"
"math/big"
"testing"
"github.com/stretchr/testify/require"
)
func TestIndexedMerkleTreeInit(t *testing.T) {
expectedRoot := []byte{33, 133, 56, 184, 142, 166, 110, 161, 4, 140, 169, 247, 115, 33, 15, 181, 76, 89, 48, 126, 58, 86, 204, 81, 16, 121, 185, 77, 75, 152, 43, 15}
tree, err := NewIndexedMerkleTree(26)
require.NoError(t, err)
err = tree.Init()
require.NoError(t, err)
root := tree.Tree.Root.Bytes()
require.Equal(t, expectedRoot, root)
require.Equal(t, uint32(0), tree.IndexArray.Get(0).Index)
require.Equal(t, uint32(1), tree.IndexArray.Get(0).NextIndex)
require.Equal(t, "0", tree.IndexArray.Get(0).Value.String())
maxVal := new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 248), big.NewInt(1))
require.Equal(t, uint32(1), tree.IndexArray.Get(1).Index)
require.Equal(t, uint32(0), tree.IndexArray.Get(1).NextIndex)
require.Equal(t, maxVal, tree.IndexArray.Get(1).Value)
}
func TestIndexedMerkleTreeAppend(t *testing.T) {
/*
Reference (rust) implementation outpu
indexed mt inited root [33, 133, 56, 184, 142, 166, 110, 161, 4, 140, 169, 247, 115, 33, 15, 181, 76, 89, 48, 126, 58, 86, 204, 81, 16, 121, 185, 77, 75, 152, 43, 15]
non inclusion proof init NonInclusionProof { root: [33, 133, 56, 184, 142, 166, 110, 161, 4, 140, 169, 247, 115, 33, 15, 181, 76, 89, 48, 126, 58, 86, 204, 81, 16, 121, 185, 77, 75, 152, 43, 15], value: [0, 171, 159, 63, 33, 62, 94, 156, 27, 61, 216, 203, 164, 91, 229, 110, 16, 230, 124, 129, 133, 222, 159, 99, 235, 50, 181, 94, 203, 105, 23, 82], leaf_lower_range_value: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], leaf_higher_range_value: [0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], leaf_index: 0, next_index: 1, merkle_proof: [[30, 164, 22, 238, 180, 2, 24, 181, 64, 193, 207, 184, 219, 233, 31, 109, 84, 232, 162, 158, 220, 48, 163, 158, 50, 107, 64, 87, 167, 217, 99, 245], [32, 152, 245, 251, 158, 35, 158, 171, 60, 234, 195, 242, 123, 129, 228, 129, 220, 49, 36, 213, 95, 254, 213, 35, 168, 57, 238, 132, 70, 182, 72, 100], [16, 105, 103, 61, 205, 177, 34, 99, 223, 48, 26, 111, 245, 132, 167, 236, 38, 26, 68, 203, 157, 198, 141, 240, 103, 164, 119, 68, 96, 177, 241, 225], [24, 244, 51, 49, 83, 126, 226, 175, 46, 61, 117, 141, 80, 247, 33, 6, 70, 124, 110, 234, 80, 55, 29, 213, 40, 213, 126, 178, 184, 86, 210, 56], [7, 249, 216, 55, 203, 23, 176, 211, 99, 32, 255, 233, 59, 165, 35, 69, 241, 183, 40, 87, 26, 86, 130, 101, 202, 172, 151, 85, 157, 188, 149, 42], [43, 148, 207, 94, 135, 70, 179, 245, 201, 99, 31, 76, 93, 243, 41, 7, 166, 153, 197, 140, 148, 178, 173, 77, 123, 92, 236, 22, 57, 24, 63, 85], [45, 238, 147, 197, 166, 102, 69, 150, 70, 234, 125, 34, 204, 169, 225, 188, 254, 215, 30, 105, 81, 185, 83, 97, 29, 17, 221, 163, 46, 160, 157, 120], [7, 130, 149, 229, 162, 43, 132, 233, 130, 207, 96, 30, 182, 57, 89, 123, 139, 5, 21, 168, 140, 181, 172, 127, 168, 164, 170, 190, 60, 135, 52, 157], [47, 165, 229, 241, 143, 96, 39, 166, 80, 27, 236, 134, 69, 100, 71, 42, 97, 107, 46, 39, 74, 65, 33, 26, 68, 76, 190, 58, 153, 243, 204, 97], [14, 136, 67, 118, 208, 216, 253, 33, 236, 183, 128, 56, 158, 148, 31, 102, 228, 94, 122, 204, 227, 226, 40, 171, 62, 33, 86, 166, 20, 252, 215, 71], [27, 114, 1, 218, 114, 73, 79, 30, 40, 113, 122, 209, 165, 46, 180, 105, 249, 88, 146, 249, 87, 113, 53, 51, 222, 97, 117, 229, 218, 25, 10, 242], [31, 141, 136, 34, 114, 94, 54, 56, 82, 0, 192, 178, 1, 36, 152, 25, 166, 230, 225, 228, 101, 8, 8, 181, 190, 188, 107, 250, 206, 125, 118, 54], [44, 93, 130, 246, 108, 145, 75, 175, 185, 112, 21, 137, 186, 140, 252, 251, 97, 98, 176, 161, 42, 207, 136, 168, 208, 135, 154, 4, 113, 181, 248, 90], [20, 197, 65, 72, 160, 148, 11, 184, 32, 149, 127, 90, 223, 63, 161, 19, 78, 245, 196, 170, 161, 19, 244, 100, 100, 88, 242, 112, 224, 191, 191, 208], [25, 13, 51, 177, 47, 152, 111, 150, 30, 16, 192, 238, 68, 216, 185, 175, 17, 190, 37, 88, 140, 173, 137, 212, 22, 17, 142, 75, 244, 235, 232, 12], [34, 249, 138, 169, 206, 112, 65, 82, 172, 23, 53, 73, 20, 173, 115, 237, 17, 103, 174, 101, 150, 175, 81, 10, 165, 179, 100, 147, 37, 224, 108, 146], [42, 124, 124, 155, 108, 229, 136, 11, 159, 111, 34, 141, 114, 191, 106, 87, 90, 82, 111, 41, 198, 110, 204, 238, 248, 183, 83, 211, 139, 186, 115, 35], [46, 129, 134, 229, 88, 105, 142, 193, 198, 122, 249, 193, 77, 70, 63, 252, 71, 0, 67, 201, 194, 152, 139, 149, 77, 117, 221, 100, 63, 54, 185, 146], [15, 87, 197, 87, 30, 154, 78, 171, 73, 226, 200, 207, 5, 13, 174, 148, 138, 239, 110, 173, 100, 115, 146, 39, 53, 70, 36, 157, 28, 31, 241, 15], [24, 48, 238, 103, 181, 251, 85, 74, 213, 246, 61, 67, 136, 128, 14, 28, 254, 120, 227, 16, 105, 125, 70, 228, 60, 156, 227, 97, 52, 247, 44, 202], [33, 52, 231, 106, 197, 210, 26, 171, 24, 108, 43, 225, 221, 143, 132, 238, 136, 10, 30, 70, 234, 247, 18, 249, 211, 113, 182, 223, 34, 25, 31, 62], [25, 223, 144, 236, 132, 78, 188, 79, 254, 235, 216, 102, 243, 56, 89, 176, 192, 81, 216, 201, 88, 238, 58, 168, 143, 143, 141, 243, 219, 145, 165, 177], [24, 204, 162, 166, 107, 92, 7, 135, 152, 30, 105, 174, 253, 132, 133, 45, 116, 175, 14, 147, 239, 73, 18, 180, 100, 140, 5, 247, 34, 239, 229, 43], [35, 136, 144, 148, 21, 35, 13, 27, 77, 19, 4, 210, 213, 79, 71, 58, 98, 131, 56, 242, 239, 173, 131, 250, 223, 5, 100, 69, 73, 210, 83, 141], [39, 23, 31, 180, 169, 123, 108, 192, 233, 232, 245, 67, 181, 41, 77, 232, 102, 162, 175, 44, 156, 141, 11, 29, 150, 230, 115, 228, 82, 158, 213, 64], [47, 246, 101, 5, 64, 246, 41, 253, 87, 17, 160, 188, 116, 252, 13, 40, 220, 178, 48, 185, 57, 37, 131, 229, 248, 213, 150, 150, 221, 230, 174, 33]] }
indexed mt with one append [31, 159, 196, 171, 68, 16, 213, 28, 158, 200, 223, 91, 244, 193, 188, 162, 50, 68, 54, 244, 116, 44, 153, 65, 209, 9, 47, 98, 126, 89, 131, 158]
indexed array state element 0 IndexedElement { index: 0, value: 0, next_index: 2 }
indexed array state element 1 IndexedElement { index: 1, value: 452312848583266388373324160190187140051835877600158453279131187530910662655, next_index: 0 }
indexed array state element 2 IndexedElement { index: 2, value: 30, next_index: 1 }
non inclusion proof address 2 NonInclusionProof { root: [31, 159, 196, 171, 68, 16, 213, 28, 158, 200, 223, 91, 244, 193, 188, 162, 50, 68, 54, 244, 116, 44, 153, 65, 209, 9, 47, 98, 126, 89, 131, 158], value: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42], leaf_lower_range_value: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30], leaf_higher_range_value: [0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], leaf_index: 2, next_index: 1, merkle_proof: [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [18, 229, 201, 44, 165, 118, 84, 222, 209, 217, 57, 52, 169, 53, 5, 206, 20, 174, 62, 214, 23, 199, 249, 52, 103, 60, 29, 56, 48, 151, 87, 96], [16, 105, 103, 61, 205, 177, 34, 99, 223, 48, 26, 111, 245, 132, 167, 236, 38, 26, 68, 203, 157, 198, 141, 240, 103, 164, 119, 68, 96, 177, 241, 225], [24, 244, 51, 49, 83, 126, 226, 175, 46, 61, 117, 141, 80, 247, 33, 6, 70, 124, 110, 234, 80, 55, 29, 213, 40, 213, 126, 178, 184, 86, 210, 56], [7, 249, 216, 55, 203, 23, 176, 211, 99, 32, 255, 233, 59, 165, 35, 69, 241, 183, 40, 87, 26, 86, 130, 101, 202, 172, 151, 85, 157, 188, 149, 42], [43, 148, 207, 94, 135, 70, 179, 245, 201, 99, 31, 76, 93, 243, 41, 7, 166, 153, 197, 140, 148, 178, 173, 77, 123, 92, 236, 22, 57, 24, 63, 85], [45, 238, 147, 197, 166, 102, 69, 150, 70, 234, 125, 34, 204, 169, 225, 188, 254, 215, 30, 105, 81, 185, 83, 97, 29, 17, 221, 163, 46, 160, 157, 120], [7, 130, 149, 229, 162, 43, 132, 233, 130, 207, 96, 30, 182, 57, 89, 123, 139, 5, 21, 168, 140, 181, 172, 127, 168, 164, 170, 190, 60, 135, 52, 157], [47, 165, 229, 241, 143, 96, 39, 166, 80, 27, 236, 134, 69, 100, 71, 42, 97, 107, 46, 39, 74, 65, 33, 26, 68, 76, 190, 58, 153, 243, 204, 97], [14, 136, 67, 118, 208, 216, 253, 33, 236, 183, 128, 56, 158, 148, 31, 102, 228, 94, 122, 204, 227, 226, 40, 171, 62, 33, 86, 166, 20, 252, 215, 71], [27, 114, 1, 218, 114, 73, 79, 30, 40, 113, 122, 209, 165, 46, 180, 105, 249, 88, 146, 249, 87, 113, 53, 51, 222, 97, 117, 229, 218, 25, 10, 242], [31, 141, 136, 34, 114, 94, 54, 56, 82, 0, 192, 178, 1, 36, 152, 25, 166, 230, 225, 228, 101, 8, 8, 181, 190, 188, 107, 250, 206, 125, 118, 54], [44, 93, 130, 246, 108, 145, 75, 175, 185, 112, 21, 137, 186, 140, 252, 251, 97, 98, 176, 161, 42, 207, 136, 168, 208, 135, 154, 4, 113, 181, 248, 90], [20, 197, 65, 72, 160, 148, 11, 184, 32, 149, 127, 90, 223, 63, 161, 19, 78, 245, 196, 170, 161, 19, 244, 100, 100, 88, 242, 112, 224, 191, 191, 208], [25, 13, 51, 177, 47, 152, 111, 150, 30, 16, 192, 238, 68, 216, 185, 175, 17, 190, 37, 88, 140, 173, 137, 212, 22, 17, 142, 75, 244, 235, 232, 12], [34, 249, 138, 169, 206, 112, 65, 82, 172, 23, 53, 73, 20, 173, 115, 237, 17, 103, 174, 101, 150, 175, 81, 10, 165, 179, 100, 147, 37, 224, 108, 146], [42, 124, 124, 155, 108, 229, 136, 11, 159, 111, 34, 141, 114, 191, 106, 87, 90, 82, 111, 41, 198, 110, 204, 238, 248, 183, 83, 211, 139, 186, 115, 35], [46, 129, 134, 229, 88, 105, 142, 193, 198, 122, 249, 193, 77, 70, 63, 252, 71, 0, 67, 201, 194, 152, 139, 149, 77, 117, 221, 100, 63, 54, 185, 146], [15, 87, 197, 87, 30, 154, 78, 171, 73, 226, 200, 207, 5, 13, 174, 148, 138, 239, 110, 173, 100, 115, 146, 39, 53, 70, 36, 157, 28, 31, 241, 15], [24, 48, 238, 103, 181, 251, 85, 74, 213, 246, 61, 67, 136, 128, 14, 28, 254, 120, 227, 16, 105, 125, 70, 228, 60, 156, 227, 97, 52, 247, 44, 202], [33, 52, 231, 106, 197, 210, 26, 171, 24, 108, 43, 225, 221, 143, 132, 238, 136, 10, 30, 70, 234, 247, 18, 249, 211, 113, 182, 223, 34, 25, 31, 62], [25, 223, 144, 236, 132, 78, 188, 79, 254, 235, 216, 102, 243, 56, 89, 176, 192, 81, 216, 201, 88, 238, 58, 168, 143, 143, 141, 243, 219, 145, 165, 177], [24, 204, 162, 166, 107, 92, 7, 135, 152, 30, 105, 174, 253, 132, 133, 45, 116, 175, 14, 147, 239, 73, 18, 180, 100, 140, 5, 247, 34, 239, 229, 43], [35, 136, 144, 148, 21, 35, 13, 27, 77, 19, 4, 210, 213, 79, 71, 58, 98, 131, 56, 242, 239, 173, 131, 250, 223, 5, 100, 69, 73, 210, 83, 141], [39, 23, 31, 180, 169, 123, 108, 192, 233, 232, 245, 67, 181, 41, 77, 232, 102, 162, 175, 44, 156, 141, 11, 29, 150, 230, 115, 228, 82, 158, 213, 64], [47, 246, 101, 5, 64, 246, 41, 253, 87, 17, 160, 188, 116, 252, 13, 40, 220, 178, 48, 185, 57, 37, 131, 229, 248, 213, 150, 150, 221, 230, 174, 33]] }
indexed mt with two appends [1, 185, 99, 233, 59, 202, 51, 222, 224, 31, 119, 180, 76, 104, 72, 27, 152, 12, 236, 78, 81, 60, 87, 158, 237, 1, 176, 9, 155, 166, 108, 89]
indexed array state element 0 IndexedElement { index: 0, value: 0, next_index: 2 }
indexed array state element 1 IndexedElement { index: 1, value: 452312848583266388373324160190187140051835877600158453279131187530910662655, next_index: 0 }
indexed array state element 2 IndexedElement { index: 2, value: 30, next_index: 3 }
indexed array state element 3 IndexedElement { index: 3, value: 42, next_index: 1 }
indexed mt with three appends [41, 143, 181, 2, 66, 117, 37, 226, 134, 212, 45, 95, 114, 60, 189, 18, 44, 155, 132, 148, 41, 54, 131, 106, 61, 120, 237, 168, 118, 198, 63, 116]
non inclusion proof address 3 NonInclusionProof { root: [1, 185, 99, 233, 59, 202, 51, 222, 224, 31, 119, 180, 76, 104, 72, 27, 152, 12, 236, 78, 81, 60, 87, 158, 237, 1, 176, 9, 155, 166, 108, 89], value: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12], leaf_lower_range_value: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], leaf_higher_range_value: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30], leaf_index: 0, next_index: 2, merkle_proof: [[30, 164, 22, 238, 180, 2, 24, 181, 64, 193, 207, 184, 219, 233, 31, 109, 84, 232, 162, 158, 220, 48, 163, 158, 50, 107, 64, 87, 167, 217, 99, 245], [43, 152, 0, 169, 196, 194, 43, 216, 106, 218, 53, 230, 207, 92, 177, 234, 56, 87, 194, 42, 31, 53, 145, 250, 212, 51, 229, 176, 218, 21, 194, 77], [16, 105, 103, 61, 205, 177, 34, 99, 223, 48, 26, 111, 245, 132, 167, 236, 38, 26, 68, 203, 157, 198, 141, 240, 103, 164, 119, 68, 96, 177, 241, 225], [24, 244, 51, 49, 83, 126, 226, 175, 46, 61, 117, 141, 80, 247, 33, 6, 70, 124, 110, 234, 80, 55, 29, 213, 40, 213, 126, 178, 184, 86, 210, 56], [7, 249, 216, 55, 203, 23, 176, 211, 99, 32, 255, 233, 59, 165, 35, 69, 241, 183, 40, 87, 26, 86, 130, 101, 202, 172, 151, 85, 157, 188, 149, 42], [43, 148, 207, 94, 135, 70, 179, 245, 201, 99, 31, 76, 93, 243, 41, 7, 166, 153, 197, 140, 148, 178, 173, 77, 123, 92, 236, 22, 57, 24, 63, 85], [45, 238, 147, 197, 166, 102, 69, 150, 70, 234, 125, 34, 204, 169, 225, 188, 254, 215, 30, 105, 81, 185, 83, 97, 29, 17, 221, 163, 46, 160, 157, 120], [7, 130, 149, 229, 162, 43, 132, 233, 130, 207, 96, 30, 182, 57, 89, 123, 139, 5, 21, 168, 140, 181, 172, 127, 168, 164, 170, 190, 60, 135, 52, 157], [47, 165, 229, 241, 143, 96, 39, 166, 80, 27, 236, 134, 69, 100, 71, 42, 97, 107, 46, 39, 74, 65, 33, 26, 68, 76, 190, 58, 153, 243, 204, 97], [14, 136, 67, 118, 208, 216, 253, 33, 236, 183, 128, 56, 158, 148, 31, 102, 228, 94, 122, 204, 227, 226, 40, 171, 62, 33, 86, 166, 20, 252, 215, 71], [27, 114, 1, 218, 114, 73, 79, 30, 40, 113, 122, 209, 165, 46, 180, 105, 249, 88, 146, 249, 87, 113, 53, 51, 222, 97, 117, 229, 218, 25, 10, 242], [31, 141, 136, 34, 114, 94, 54, 56, 82, 0, 192, 178, 1, 36, 152, 25, 166, 230, 225, 228, 101, 8, 8, 181, 190, 188, 107, 250, 206, 125, 118, 54], [44, 93, 130, 246, 108, 145, 75, 175, 185, 112, 21, 137, 186, 140, 252, 251, 97, 98, 176, 161, 42, 207, 136, 168, 208, 135, 154, 4, 113, 181, 248, 90], [20, 197, 65, 72, 160, 148, 11, 184, 32, 149, 127, 90, 223, 63, 161, 19, 78, 245, 196, 170, 161, 19, 244, 100, 100, 88, 242, 112, 224, 191, 191, 208], [25, 13, 51, 177, 47, 152, 111, 150, 30, 16, 192, 238, 68, 216, 185, 175, 17, 190, 37, 88, 140, 173, 137, 212, 22, 17, 142, 75, 244, 235, 232, 12], [34, 249, 138, 169, 206, 112, 65, 82, 172, 23, 53, 73, 20, 173, 115, 237, 17, 103, 174, 101, 150, 175, 81, 10, 165, 179, 100, 147, 37, 224, 108, 146], [42, 124, 124, 155, 108, 229, 136, 11, 159, 111, 34, 141, 114, 191, 106, 87, 90, 82, 111, 41, 198, 110, 204, 238, 248, 183, 83, 211, 139, 186, 115, 35], [46, 129, 134, 229, 88, 105, 142, 193, 198, 122, 249, 193, 77, 70, 63, 252, 71, 0, 67, 201, 194, 152, 139, 149, 77, 117, 221, 100, 63, 54, 185, 146], [15, 87, 197, 87, 30, 154, 78, 171, 73, 226, 200, 207, 5, 13, 174, 148, 138, 239, 110, 173, 100, 115, 146, 39, 53, 70, 36, 157, 28, 31, 241, 15], [24, 48, 238, 103, 181, 251, 85, 74, 213, 246, 61, 67, 136, 128, 14, 28, 254, 120, 227, 16, 105, 125, 70, 228, 60, 156, 227, 97, 52, 247, 44, 202], [33, 52, 231, 106, 197, 210, 26, 171, 24, 108, 43, 225, 221, 143, 132, 238, 136, 10, 30, 70, 234, 247, 18, 249, 211, 113, 182, 223, 34, 25, 31, 62], [25, 223, 144, 236, 132, 78, 188, 79, 254, 235, 216, 102, 243, 56, 89, 176, 192, 81, 216, 201, 88, 238, 58, 168, 143, 143, 141, 243, 219, 145, 165, 177], [24, 204, 162, 166, 107, 92, 7, 135, 152, 30, 105, 174, 253, 132, 133, 45, 116, 175, 14, 147, 239, 73, 18, 180, 100, 140, 5, 247, 34, 239, 229, 43], [35, 136, 144, 148, 21, 35, 13, 27, 77, 19, 4, 210, 213, 79, 71, 58, 98, 131, 56, 242, 239, 173, 131, 250, 223, 5, 100, 69, 73, 210, 83, 141], [39, 23, 31, 180, 169, 123, 108, 192, 233, 232, 245, 67, 181, 41, 77, 232, 102, 162, 175, 44, 156, 141, 11, 29, 150, 230, 115, 228, 82, 158, 213, 64], [47, 246, 101, 5, 64, 246, 41, 253, 87, 17, 160, 188, 116, 252, 13, 40, 220, 178, 48, 185, 57, 37, 131, 229, 248, 213, 150, 150, 221, 230, 174, 33]] }
indexed array state element 0 IndexedElement { index: 0, value: 0, next_index: 4 }
indexed array state element 1 IndexedElement { index: 1, value: 452312848583266388373324160190187140051835877600158453279131187530910662655, next_index: 0 }
indexed array state element 2 IndexedElement { index: 2, value: 30, next_index: 3 }
indexed array state element 3 IndexedElement { index: 3, value: 42, next_index: 1 }
indexed array state element 4 IndexedElement { index: 4, value: 12, next_index: 2 }
*/
tree, err := NewIndexedMerkleTree(26)
require.NoError(t, err)
err = tree.Init()
require.NoError(t, err)
value := big.NewInt(30)
err = tree.Append(value)
require.NoError(t, err)
expectedRootFirstAppend := []byte{31, 159, 196, 171, 68, 16, 213, 28, 158, 200, 223, 91, 244, 193, 188, 162, 50, 68, 54, 244, 116, 44, 153, 65, 209, 9, 47, 98, 126, 89, 131, 158}
root := tree.Tree.Root.Bytes()
fmt.Println("indexed mt with one append", root)
require.Equal(t, expectedRootFirstAppend, root)
require.Equal(t, uint32(0), tree.IndexArray.Get(0).Index)
require.Equal(t, uint32(2), tree.IndexArray.Get(0).NextIndex)
require.Equal(t, "0", tree.IndexArray.Get(0).Value.String())
maxVal := new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 248), big.NewInt(1))
require.Equal(t, uint32(1), tree.IndexArray.Get(1).Index)
require.Equal(t, uint32(0), tree.IndexArray.Get(1).NextIndex)
require.Equal(t, maxVal, tree.IndexArray.Get(1).Value)
require.Equal(t, uint32(2), tree.IndexArray.Get(2).Index)
require.Equal(t, uint32(1), tree.IndexArray.Get(2).NextIndex)
require.Equal(t, "30", tree.IndexArray.Get(2).Value.String())
value = big.NewInt(42)
err = tree.Append(value)
require.NoError(t, err)
expectedRootSecondAppend := []byte{1, 185, 99, 233, 59, 202, 51, 222, 224, 31, 119, 180, 76, 104, 72, 27, 152, 12, 236, 78, 81, 60, 87, 158, 237, 1, 176, 9, 155, 166, 108, 89}
root = tree.Tree.Root.Bytes()
fmt.Println("indexed mt with two appends", root)
require.Equal(t, expectedRootSecondAppend, root)
value = big.NewInt(12)
err = tree.Append(value)
require.NoError(t, err)
expectedRootThirdAttempt := []byte{41, 143, 181, 2, 66, 117, 37, 226, 134, 212, 45, 95, 114, 60, 189, 18, 44, 155, 132, 148, 41, 54, 131, 106, 61, 120, 237, 168, 118, 198, 63, 116}
root = tree.Tree.Root.Bytes()
fmt.Println("indexed mt with three appends", root)
require.Equal(t, expectedRootThirdAttempt, root)
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/merkle-tree/merkle_tree_test.go
|
package merkle_tree
import (
"fmt"
"math/big"
"testing"
"github.com/consensys/gnark/test"
)
func TestSubtrees(t *testing.T) {
assert := test.NewAssert(t)
treeDepth := 4
tree := NewTree(int(treeDepth))
subtrees := tree.GetRightmostSubtrees(int(treeDepth))
fmt.Println("Initial subtrees:")
for i := 1; i < len(subtrees); i++ {
subtree := [32](byte)(subtrees[i].Bytes())
assert.Equal([32](byte)(subtree), EMPTY_TREE[i])
}
fmt.Println("Appending 1")
leaf_0 := new(big.Int).SetInt64(1)
tree.Update(0, *leaf_0)
tree.Update(1, *leaf_0)
subtrees = tree.GetRightmostSubtrees(int(treeDepth))
fmt.Println("0 Next subtrees:")
for i := 0; i < len(subtrees); i++ {
subtree := subtrees[i]
ref_subtree := new(big.Int).SetBytes(TREE_AFTER_1_UPDATE[i][:])
assert.Equal(subtree, ref_subtree)
}
leaf_1 := new(big.Int).SetInt64(2)
tree.Update(2, *leaf_1)
tree.Update(3, *leaf_1)
subtrees = tree.GetRightmostSubtrees(int(treeDepth))
fmt.Println("1 Next subtrees:")
for i := 0; i < len(subtrees); i++ {
subtree := subtrees[i]
ref_subtree := new(big.Int).SetBytes(TREE_AFTER_2_UPDATES[i][:])
assert.Equal(subtree, ref_subtree)
}
}
var EMPTY_TREE = [4][32]byte{
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{32, 152, 245, 251, 158, 35, 158, 171, 60, 234, 195, 242, 123, 129, 228, 129, 220, 49, 36, 213, 95, 254, 213, 35, 168, 57, 238, 132, 70, 182, 72, 100},
{16, 105, 103, 61, 205, 177, 34, 99, 223, 48, 26, 111, 245, 132, 167, 236, 38, 26, 68, 203, 157, 198, 141, 240, 103, 164, 119, 68, 96, 177, 241, 225},
{24, 244, 51, 49, 83, 126, 226, 175, 46, 61, 117, 141, 80, 247, 33, 6, 70, 124, 110, 234, 80, 55, 29, 213, 40, 213, 126, 178, 184, 86, 210, 56},
}
var TREE_AFTER_1_UPDATE = [4][32]byte{
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
{0, 122, 243, 70, 226, 211, 4, 39, 158, 121, 224, 169, 243, 2, 63, 119, 18, 148, 167, 138, 203, 112, 231, 63, 144, 175, 226, 124, 173, 64, 30, 129},
{4, 163, 62, 195, 162, 201, 237, 49, 131, 153, 66, 155, 106, 112, 192, 40, 76, 131, 230, 239, 224, 130, 106, 36, 128, 57, 172, 107, 60, 247, 103, 194},
{7, 118, 172, 114, 242, 52, 137, 62, 111, 106, 113, 139, 123, 161, 39, 255, 86, 13, 105, 167, 223, 52, 15, 29, 137, 37, 106, 178, 49, 44, 226, 75},
}
var TREE_AFTER_2_UPDATES = [4][32]byte{
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2},
{0, 122, 243, 70, 226, 211, 4, 39, 158, 121, 224, 169, 243, 2, 63, 119, 18, 148, 167, 138, 203, 112, 231, 63, 144, 175, 226, 124, 173, 64, 30, 129},
{18, 102, 129, 25, 152, 42, 192, 218, 100, 215, 169, 202, 77, 24, 100, 133, 45, 152, 17, 121, 103, 9, 187, 226, 182, 36, 35, 35, 126, 255, 244, 140},
{11, 230, 92, 56, 65, 91, 231, 137, 40, 92, 11, 193, 90, 225, 123, 79, 82, 17, 212, 147, 43, 41, 126, 223, 49, 2, 139, 211, 249, 138, 7, 12},
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/merkle-tree/merkle_tree.go
|
package merkle_tree
import (
"fmt"
"math/big"
"github.com/iden3/go-iden3-crypto/poseidon"
)
type PoseidonNode interface {
Depth() int
Value() big.Int
Bytes() []byte
withValue(index int, val big.Int) PoseidonNode
writeProof(index int, out []big.Int)
}
func (node *PoseidonFullNode) Depth() int {
return node.dep
}
func (node *PoseidonEmptyNode) Depth() int {
return node.dep
}
func (node *PoseidonFullNode) Value() big.Int {
return node.val
}
//func (node *PoseidonEmptyNode) Value() big.Int {
// return node.emptyTreeValues[node.Depth()]
//}
func (node *PoseidonFullNode) Bytes() []byte {
bytes := make([]byte, 32)
node.val.FillBytes(bytes)
return bytes
}
func (node *PoseidonEmptyNode) Bytes() []byte {
bytes := make([]byte, 32)
value := node.Value()
value.FillBytes(bytes)
return bytes
}
func (node *PoseidonEmptyNode) Value() big.Int {
return node.emptyTreeValues[node.Depth()]
}
func (node *PoseidonFullNode) writeProof(index int, out []big.Int) {
if node.Depth() == 0 {
return
}
if indexIsLeft(index, node.Depth()) {
out[node.Depth()-1] = node.Right.Value()
node.Left.writeProof(index, out)
} else {
out[node.Depth()-1] = node.Left.Value()
node.Right.writeProof(index, out)
}
}
func (node *PoseidonEmptyNode) writeProof(index int, out []big.Int) {
for i := 0; i < node.Depth(); i++ {
out[i] = *new(big.Int).Set(&node.emptyTreeValues[i])
}
}
type PoseidonFullNode struct {
dep int
val big.Int
Left PoseidonNode
Right PoseidonNode
}
func (node *PoseidonFullNode) initHash() {
leftVal := node.Left.Value()
rightVal := node.Right.Value()
newHash, _ := poseidon.Hash([]*big.Int{&leftVal, &rightVal})
node.val = *newHash
}
type PoseidonEmptyNode struct {
dep int
emptyTreeValues []big.Int
}
type PoseidonTree struct {
Root PoseidonNode
}
func (tree *PoseidonTree) Update(index int, value big.Int) []big.Int {
tree.Root = tree.Root.withValue(index, value)
proof := make([]big.Int, tree.Root.Depth())
tree.Root.writeProof(index, proof)
return proof
}
func (tree *PoseidonTree) GetProofByIndex(index int) []big.Int {
proof := make([]big.Int, tree.Root.Depth())
tree.Root.writeProof(index, proof)
return proof
}
func NewTree(depth int) PoseidonTree {
initHashes := make([]big.Int, depth+1)
for i := 1; i <= depth; i++ {
val, _ := poseidon.Hash([]*big.Int{&initHashes[i-1], &initHashes[i-1]})
initHashes[i] = *val
}
return PoseidonTree{
Root: &PoseidonEmptyNode{
dep: depth,
emptyTreeValues: initHashes,
},
}
}
func (tree *PoseidonTree) DeepCopy() *PoseidonTree {
if tree == nil {
return nil
}
return &PoseidonTree{
Root: deepCopyNode(tree.Root),
}
}
func deepCopyNode(node PoseidonNode) PoseidonNode {
if node == nil {
return nil
}
switch n := node.(type) {
case *PoseidonFullNode:
return deepCopyFullNode(n)
case *PoseidonEmptyNode:
return deepCopyEmptyNode(n)
default:
panic("Unknown node type")
}
}
func deepCopyFullNode(node *PoseidonFullNode) *PoseidonFullNode {
if node == nil {
return nil
}
return &PoseidonFullNode{
dep: node.dep,
val: *new(big.Int).Set(&node.val),
Left: deepCopyNode(node.Left),
Right: deepCopyNode(node.Right),
}
}
func deepCopyEmptyNode(node *PoseidonEmptyNode) *PoseidonEmptyNode {
if node == nil {
return nil
}
emptyTreeValues := make([]big.Int, len(node.emptyTreeValues))
for i, v := range node.emptyTreeValues {
emptyTreeValues[i] = *new(big.Int).Set(&v)
}
return &PoseidonEmptyNode{
dep: node.dep,
emptyTreeValues: emptyTreeValues,
}
}
func (tree *PoseidonTree) Bytes() []byte {
return tree.Root.Bytes()
}
func (tree *PoseidonTree) GetRightmostSubtrees(depth int) []*big.Int {
subtrees := make([]*big.Int, depth)
for i := 0; i < depth; i++ {
subtrees[i] = new(big.Int).SetBytes(ZERO_BYTES[i][:])
}
if fullNode, ok := tree.Root.(*PoseidonFullNode); ok {
current := fullNode
level := depth - 1
for current != nil && level >= 0 {
if fullLeft, ok := current.Left.(*PoseidonFullNode); ok {
value := fullLeft.Value()
subtrees[level] = &value
if fullRight, ok := current.Right.(*PoseidonFullNode); ok {
current = fullRight
} else {
current = fullLeft
}
} else {
fmt.Printf("WARNING: Left child is empty at level %d\n", level)
}
level--
}
}
return subtrees
}
func indexIsLeft(index int, depth int) bool {
return index&(1<<(depth-1)) == 0
}
func (node *PoseidonEmptyNode) withValue(index int, val big.Int) PoseidonNode {
result := PoseidonFullNode{
dep: node.Depth(),
}
if node.Depth() == 0 {
result.val = val
} else {
emptyChild := PoseidonEmptyNode{dep: node.Depth() - 1, emptyTreeValues: node.emptyTreeValues}
initializedChild := emptyChild.withValue(index, val)
if indexIsLeft(index, node.Depth()) {
result.Left = initializedChild
result.Right = &emptyChild
} else {
result.Left = &emptyChild
result.Right = initializedChild
}
result.initHash()
}
return &result
}
func (node *PoseidonFullNode) withValue(index int, val big.Int) PoseidonNode {
result := PoseidonFullNode{
dep: node.Depth(),
Left: node.Left,
Right: node.Right,
}
if node.Depth() == 0 {
result.val = val
} else {
if indexIsLeft(index, node.Depth()) {
result.Left = node.Left.withValue(index, val)
} else {
result.Right = node.Right.withValue(index, val)
}
result.initHash()
}
return &result
}
func (tree *PoseidonTree) GenerateProof(index int) []big.Int {
proof := make([]big.Int, tree.Root.Depth())
tree.Root.writeProof(index, proof)
return proof
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/merkle-tree/indexed_merkle_tree.go
|
package merkle_tree
import (
"encoding/binary"
"fmt"
"math/big"
"github.com/iden3/go-iden3-crypto/poseidon"
)
type IndexedArray struct {
Elements []IndexedElement
CurrentNodeIndex uint32
HighestNodeIndex uint32
}
type IndexedElement struct {
Value *big.Int
NextValue *big.Int
NextIndex uint32
Index uint32
}
type IndexedElementBundle struct {
NewLowElement IndexedElement
NewElement IndexedElement
NewElementNextValue *big.Int
}
type IndexedMerkleTree struct {
Tree *PoseidonTree
IndexArray *IndexedArray
}
func NewIndexedMerkleTree(height uint32) (*IndexedMerkleTree, error) {
tree := NewTree(int(height))
indexArray := &IndexedArray{
Elements: []IndexedElement{{
Value: big.NewInt(0),
NextValue: big.NewInt(0),
NextIndex: 0,
Index: 0,
}},
CurrentNodeIndex: 0,
HighestNodeIndex: 0,
}
return &IndexedMerkleTree{
Tree: &tree,
IndexArray: indexArray,
}, nil
}
func (ia *IndexedArray) Init() error {
maxAddr := new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 248), big.NewInt(1))
bundle := IndexedElementBundle{
NewLowElement: IndexedElement{
Value: big.NewInt(0),
NextValue: maxAddr,
NextIndex: 1,
Index: 0,
},
NewElement: IndexedElement{
Value: maxAddr,
NextValue: big.NewInt(0),
NextIndex: 0,
Index: 1,
},
NewElementNextValue: big.NewInt(0),
}
ia.Elements = []IndexedElement{bundle.NewLowElement, bundle.NewElement}
ia.CurrentNodeIndex = 1
ia.HighestNodeIndex = 1
return nil
}
func (ia *IndexedArray) Get(index uint32) *IndexedElement {
if int(index) >= len(ia.Elements) {
return nil
}
return &ia.Elements[index]
}
func (ia *IndexedArray) Append(value *big.Int) error {
lowElementIndex, _ := ia.FindLowElementIndex(value)
lowElement := ia.Elements[lowElementIndex]
if lowElement.NextIndex != 0 {
nextElement := ia.Elements[lowElement.NextIndex]
if value.Cmp(nextElement.Value) >= 0 {
return fmt.Errorf("new value must be less than next element value")
}
}
newElementIndex := uint32(len(ia.Elements))
newElement := IndexedElement{
Value: value,
NextValue: lowElement.NextValue,
NextIndex: lowElement.NextIndex,
Index: newElementIndex,
}
ia.Elements[lowElementIndex].NextIndex = newElementIndex
ia.Elements[lowElementIndex].NextValue = value
ia.Elements = append(ia.Elements, newElement)
ia.CurrentNodeIndex = newElementIndex
if lowElement.NextIndex == 0 {
ia.HighestNodeIndex = newElementIndex
}
return nil
}
func (ia *IndexedArray) FindLowElementIndex(value *big.Int) (uint32, error) {
maxAddr := new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 248), big.NewInt(1))
// If we only have initial elements (0 and maxAddr)
if len(ia.Elements) == 2 {
// Always return the first element (0) as low element
return 0, nil
}
for i, element := range ia.Elements {
// Skip the max element
if element.Value.Cmp(maxAddr) == 0 {
continue
}
nextElement := ia.Get(element.NextIndex)
if nextElement == nil {
continue
}
// Check if value falls between current and next
if element.Value.Cmp(value) < 0 && nextElement.Value.Cmp(value) > 0 {
return uint32(i), nil
}
}
return 0, fmt.Errorf("could not find low element index for value %v", value)
}
func (imt *IndexedMerkleTree) Append(value *big.Int) error {
lowElementIndex, _ := imt.IndexArray.FindLowElementIndex(value)
lowElement := imt.IndexArray.Get(lowElementIndex)
nextElement := imt.IndexArray.Get(lowElement.NextIndex)
if value.Cmp(nextElement.Value) >= 0 {
return fmt.Errorf("new value must be less than next element value")
}
newElementIndex := uint32(len(imt.IndexArray.Elements))
bundle := IndexedElementBundle{
NewLowElement: IndexedElement{
Value: lowElement.Value,
NextValue: value,
NextIndex: newElementIndex,
Index: lowElement.Index,
},
NewElement: IndexedElement{
Value: value,
NextValue: nextElement.Value,
NextIndex: lowElement.NextIndex,
Index: newElementIndex,
},
}
lowLeafHash, err := HashIndexedElement(&bundle.NewLowElement)
if err != nil {
return fmt.Errorf("failed to hash low leaf: %v", err)
}
imt.Tree.Update(int(lowElement.Index), *lowLeafHash)
newLeafHash, err := HashIndexedElement(&bundle.NewElement)
if err != nil {
return fmt.Errorf("failed to hash new leaf: %v", err)
}
imt.Tree.Update(int(newElementIndex), *newLeafHash)
imt.IndexArray.Elements[lowElement.Index] = bundle.NewLowElement
imt.IndexArray.Elements = append(imt.IndexArray.Elements, bundle.NewElement)
imt.IndexArray.CurrentNodeIndex = newElementIndex
if lowElement.NextIndex == 0 {
imt.IndexArray.HighestNodeIndex = newElementIndex
}
return nil
}
func (imt *IndexedMerkleTree) Init() error {
maxAddr := new(big.Int).Sub(new(big.Int).Lsh(big.NewInt(1), 248), big.NewInt(1))
bundle := IndexedElementBundle{
NewLowElement: IndexedElement{
Value: big.NewInt(0),
NextValue: maxAddr,
NextIndex: 1,
Index: 0,
},
NewElement: IndexedElement{
Value: maxAddr,
NextValue: big.NewInt(0),
NextIndex: 0,
Index: 1,
},
}
lowLeafHash, err := HashIndexedElement(&bundle.NewLowElement)
if err != nil {
return fmt.Errorf("failed to hash low leaf: %v", err)
}
imt.Tree.Update(0, *lowLeafHash)
maxLeafHash, err := HashIndexedElement(&bundle.NewElement)
if err != nil {
return fmt.Errorf("failed to hash max leaf: %v", err)
}
imt.Tree.Update(1, *maxLeafHash)
imt.IndexArray.Elements = []IndexedElement{bundle.NewLowElement, bundle.NewElement}
imt.IndexArray.CurrentNodeIndex = 1
imt.IndexArray.HighestNodeIndex = 1
return nil
}
func HashIndexedElement(element *IndexedElement) (*big.Int, error) {
indexBytes := make([]byte, 32)
binary.BigEndian.PutUint32(indexBytes[28:], element.NextIndex)
hash, err := poseidon.Hash([]*big.Int{
element.Value,
new(big.Int).SetBytes(indexBytes),
element.NextValue,
})
if err != nil {
return nil, err
}
return hash, nil
}
func (imt *IndexedMerkleTree) DeepCopy() *IndexedMerkleTree {
if imt == nil {
return nil
}
treeCopy := imt.Tree.DeepCopy()
elementsCopy := make([]IndexedElement, len(imt.IndexArray.Elements))
for i, element := range imt.IndexArray.Elements {
elementsCopy[i] = IndexedElement{
Value: new(big.Int).Set(element.Value),
NextValue: new(big.Int).Set(element.NextValue),
NextIndex: element.NextIndex,
Index: element.Index,
}
}
indexArrayCopy := &IndexedArray{
Elements: elementsCopy,
CurrentNodeIndex: imt.IndexArray.CurrentNodeIndex,
HighestNodeIndex: imt.IndexArray.HighestNodeIndex,
}
return &IndexedMerkleTree{
Tree: treeCopy,
IndexArray: indexArrayCopy,
}
}
func (imt *IndexedMerkleTree) GetProof(index int) ([]big.Int, error) {
if index >= len(imt.IndexArray.Elements) {
return nil, fmt.Errorf("index out of bounds: %d", index)
}
proof := imt.Tree.GenerateProof(index)
return proof, nil
}
func (imt *IndexedMerkleTree) Verify(index int, element *IndexedElement, proof []big.Int) (bool, error) {
leafHash, err := HashIndexedElement(element)
if err != nil {
return false, fmt.Errorf("failed to hash element: %v", err)
}
currentHash := leafHash
depth := len(proof)
for i := 0; i < depth; i++ {
var leftVal, rightVal *big.Int
if indexIsLeft(index, depth-i) {
leftVal = currentHash
rightVal = new(big.Int).Set(&proof[i])
} else {
leftVal = new(big.Int).Set(&proof[i])
rightVal = currentHash
}
var err error
currentHash, err = poseidon.Hash([]*big.Int{leftVal, rightVal})
if err != nil {
return false, fmt.Errorf("failed to hash proof element: %v", err)
}
}
rootValue := imt.Tree.Root.Value()
return currentHash.Cmp(&rootValue) == 0, nil
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/test-data/non_inclusion.csv
|
1;{"new-addresses":[{"root":"0x133ec861cbeb15d0ac67f868cddf1850f1d544846075c961b348a0d369871694","value":"0x179","pathIndex":3,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x178","leafHigherRangeValue":"0x17a","nextIndex":50176983}]}
0;{"new-addresses":[{"root":"0x3e7","value":"0x397","pathIndex":16,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x396","leafHigherRangeValue":"0x398","nextIndex":28610587}]}
0;{"new-addresses":[{"root":"0x3e7","value":"0x397","pathIndex":16,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x396","leafHigherRangeValue":"0x398","nextIndex":28610587}]}
0;{"new-addresses":[{"root":"0x198ca711c1e1c1e54db9075b900f4312973f48d61f9fc5b7b852469d619c7954","value":"0xb7","pathIndex":20,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0xb8","leafHigherRangeValue":"0xba","nextIndex":47015159}]}
0;{"new-addresses":[{"root":"0x181ffc2a71d4535665cd99aae561ba0be26dbc12013cafacad61e90c7c4145c6","value":"0x385","pathIndex":18,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x382","leafHigherRangeValue":"0x384","nextIndex":63071536}]}
0;{"new-addresses":[{"root":"0x8982d8e7b181b21fa087747a8959139509adb2b679a459129386019ad05b2e6","value":"0x149","pathIndex":20,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x148","leafHigherRangeValue":"0x14a","nextIndex":7406203}]}
0;{"new-addresses":[{"root":"0x3f3ab717162d948386ab12350eeb85a3928c370f76f45c4034d2b402a4057e5","value":"0x343","pathIndex":4,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x342","leafHigherRangeValue":"0x344","nextIndex":1528373}]}
0;{"new-addresses":[{"root":"0x1fcfce03b5fa35118b4f3198115b71affa4da17129e092922910003f39ec085","value":"0x3ce","pathIndex":18,"pathElements":["0x3e7","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x3cd","leafHigherRangeValue":"0x3cf","nextIndex":62370579}]}
1;{"new-addresses":[{"root":"0x4f956d5cb03a8275e23d0e04f17116ada15bc07ddb2d2a58304b54c958708bb","value":"0x2f3","pathIndex":11,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x2f2","leafHigherRangeValue":"0x2f4","nextIndex":62718450},{"root":"0x1d0ff33bee74efc17a490fdb09acb7a71a05a96f294143e4540bd7a7166e9b81","value":"0x74","pathIndex":25,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x6be83476b0a116e3c1db9be2aaaf7e453e08088c7bd1c4b3dc3e7aa02ff26e1","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x73","leafHigherRangeValue":"0x75","nextIndex":64049800}]}
0;{"new-addresses":[{"root":"0x3e7","value":"0x291","pathIndex":14,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x290","leafHigherRangeValue":"0x292","nextIndex":55321478},{"root":"0x23369b748ef90348d4bcc90559ee7a95781f58809512083dd36c4472c52717d0","value":"0x116","pathIndex":5,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x1b3760c2fdcff812096c6a5f207cf81c0b81e88366ee88dcc2bc398ec37a3ff0","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x115","leafHigherRangeValue":"0x117","nextIndex":537637}]}
0;{"new-addresses":[{"root":"0x3e7","value":"0x291","pathIndex":14,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x290","leafHigherRangeValue":"0x292","nextIndex":55321478},{"root":"0x23369b748ef90348d4bcc90559ee7a95781f58809512083dd36c4472c52717d0","value":"0x116","pathIndex":5,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x1b3760c2fdcff812096c6a5f207cf81c0b81e88366ee88dcc2bc398ec37a3ff0","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x115","leafHigherRangeValue":"0x117","nextIndex":537637}]}
0;{"new-addresses":[{"root":"0x3cca59d3e264a8489302d4528cc9aeac67f275bf302e330c26e4b11a952c820","value":"0x1f8","pathIndex":25,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x1f9","leafHigherRangeValue":"0x1fb","nextIndex":9311225},{"root":"0xa5ce108ea333150085d296b8d2f4b21bb8801a4121e75e0c4c6496a2bd2aaae","value":"0x1c3","pathIndex":2,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x2d4fc19399cf6a9dd2bc6735d2c33ce3359f83778e044bc192d443f2c4441719","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x1c4","leafHigherRangeValue":"0x1c6","nextIndex":10418182}]}
0;{"new-addresses":[{"root":"0x1ff381f28e5fff521d9f1aab2bb2c3f0386ecabfec5a7d4d2f9efe912b4c8249","value":"0x315","pathIndex":6,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x312","leafHigherRangeValue":"0x314","nextIndex":51685859},{"root":"0x1c2c37261b3fc8b0f097ad7cd7d7b8581390d16095a69f30a5678adb8277dd5e","value":"0x25e","pathIndex":15,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x106c01f94c28a53119269fdd5742db1b7c350a32597cf26a4b36427f232387b5","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x25b","leafHigherRangeValue":"0x25d","nextIndex":44558825}]}
0;{"new-addresses":[{"root":"0x199ec1ace4138b63538dc07fca7b3780baa548dec2abed324318c948b2b89db","value":"0x244","pathIndex":7,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x243","leafHigherRangeValue":"0x245","nextIndex":2921969},{"root":"0x2f157323df44c4e9fb18255d3446f057098cf3d4a270e1dcf2171afde62ded2e","value":"0x1d4","pathIndex":5,"pathElements":["0x0","0x2d18e48b08f3c3e7829880143214796ed02df4ce9ae375ad64de9622f41ef012","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x1d3","leafHigherRangeValue":"0x1d5","nextIndex":62512955}]}
0;{"new-addresses":[{"root":"0x1c3b7e6fd188eadf15a971db28a9a2a188dcfd5d3057ccdf8b6d5335d14dc05a","value":"0x2ef","pathIndex":21,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x2ee","leafHigherRangeValue":"0x2f0","nextIndex":49505705},{"root":"0x2d6fb44897cd59b0494f24aeb3a7101034a386412a0493dbe6664d2db11d68de","value":"0xa8","pathIndex":4,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x2ba36ef126555d82f4e44ca98d791e08c1aeb6f8f29c3febf081883b00d3d748","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0xa7","leafHigherRangeValue":"0xa9","nextIndex":20431046}]}
0;{"new-addresses":[{"root":"0x29414b098661493eff5ce369466d10edc786c1383d543a0b0ea5dda2135e4a4e","value":"0x3a2","pathIndex":17,"pathElements":["0x3e7","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x3a1","leafHigherRangeValue":"0x3a3","nextIndex":53792242},{"root":"0x13b09cffeddc3f6050ad3ca97eaead0d9e2e0a1d926511efa46c7fb8713ba8d3","value":"0x37a","pathIndex":14,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x15a3ab73968566697410b6a7439ea2da1c30543235fd357d5aa8337f938e84e8","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x379","leafHigherRangeValue":"0x37b","nextIndex":15259992}]}
1;{"new-addresses":[{"root":"0x11c32a324ae438133ba1aceefb1994e6d8faaf9ea6a8d92d0ea9c2dbcf3bba20","value":"0x2b3","pathIndex":22,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x2b2","leafHigherRangeValue":"0x2b4","nextIndex":54129371},{"root":"0x222bdab7e7c38d1b29603202771da21bf6a79ab2e3316982adec5181d849bb27","value":"0x34f","pathIndex":24,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x36966331b54c42f55a4df3dc20d5231e5a88ffc57c6a2dacced14c92db78e98","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x34e","leafHigherRangeValue":"0x350","nextIndex":27501991},{"root":"0x1d80591b812281c311d4e52a3d990be85bb399df5ee10d1c0959b3738f910b86","value":"0x208","pathIndex":9,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x1077aa7c3bebb0ee7035ebadfcb572568b61ca7a81fff1e3aaacedd81a8e4ac4","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x207","leafHigherRangeValue":"0x209","nextIndex":18910134}]}
0;{"new-addresses":[{"root":"0x3e7","value":"0x143","pathIndex":2,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x142","leafHigherRangeValue":"0x144","nextIndex":47291757},{"root":"0x13d5061239eb6621d625ef91cc467e961b5eeb9d7c30b0b7b70953080e3ac1a1","value":"0x332","pathIndex":19,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x1794b3462bd6e7cc55375f53ff418a6976fdaf7d0641a2d7d667ba71cf9c0109","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x331","leafHigherRangeValue":"0x333","nextIndex":12273201},{"root":"0x162714a819cb5fd0099768f8e19dde811b67af547c4600211a1775f33152f218","value":"0x13c","pathIndex":12,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0xc76e9a323243257aaa92d0d20edaaa91619dbba753abac37ab24d3b8a0d1832","0xdb45a912029fac9f49cd0d557acd3461994724fb70409090c739b9f9ddf473b","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x13b","leafHigherRangeValue":"0x13d","nextIndex":51307407}]}
0;{"new-addresses":[{"root":"0x3e7","value":"0x143","pathIndex":2,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x142","leafHigherRangeValue":"0x144","nextIndex":47291757},{"root":"0x13d5061239eb6621d625ef91cc467e961b5eeb9d7c30b0b7b70953080e3ac1a1","value":"0x332","pathIndex":19,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x1794b3462bd6e7cc55375f53ff418a6976fdaf7d0641a2d7d667ba71cf9c0109","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x331","leafHigherRangeValue":"0x333","nextIndex":12273201},{"root":"0x162714a819cb5fd0099768f8e19dde811b67af547c4600211a1775f33152f218","value":"0x13c","pathIndex":12,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0xc76e9a323243257aaa92d0d20edaaa91619dbba753abac37ab24d3b8a0d1832","0xdb45a912029fac9f49cd0d557acd3461994724fb70409090c739b9f9ddf473b","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x13b","leafHigherRangeValue":"0x13d","nextIndex":51307407}]}
0;{"new-addresses":[{"root":"0x113f637249a3fa1f1f77233e87a774c853ffe52a41e38944977834e7c362d8cd","value":"0x1ea","pathIndex":3,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x1eb","leafHigherRangeValue":"0x1ed","nextIndex":35585738},{"root":"0x1671d5d5d08e5696f57a27f446fb15bedde1f59b2305c4c50804cc07e7977a13","value":"0x3d4","pathIndex":9,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x2ac677d637b53b3d1fcbd138c9ae2a10c174b3b5a8bd03055436e8916b332611","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x3d5","leafHigherRangeValue":"0x3d7","nextIndex":56723232},{"root":"0x257a21a2b90f1cb016f4031ff696ecb5c9bc39d0be10eec413cd70ad964edd58","value":"0x84","pathIndex":18,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0xd2c7203bcb81564160427a5c0f67202960fce992aae97c8c8f8946b5781cc3b","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x85","leafHigherRangeValue":"0x87","nextIndex":21821914}]}
0;{"new-addresses":[{"root":"0x1f06eb8ba7dc1df6bfa139ace0f4db2abe8eb3ddcead5c7bf40da9044ca8fdf8","value":"0x3bc","pathIndex":13,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x3b9","leafHigherRangeValue":"0x3bb","nextIndex":64763563},{"root":"0xa1b01d5eb2fdc42b844c3db1bd2fb007b57a6f9a9ff017ab888a59f3a546ca6","value":"0x2f4","pathIndex":19,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x21b70f480b4782b917e6d593c3454697e5b34ac6503eed3de0ba86a0dd384680","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x2f1","leafHigherRangeValue":"0x2f3","nextIndex":5487614},{"root":"0x240209b5ba92271661382d806c3eb5543f8b8fa34268d8d7829ef6dd4f4cb4f","value":"0x33c","pathIndex":7,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x1eef2773b2cc119ecc5cc1f90eb2d39e54b0508e726ac71e91c33a5418d6d468","0x6fd6935f6520bce4c2a8be68829530de4f3d3bf69c91b1268cc22c1d9d36e82","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x339","leafHigherRangeValue":"0x33b","nextIndex":66075305}]}
0;{"new-addresses":[{"root":"0x16be8654ad2d092a3f20ab97874448c6d664a36935990a03b44b7ce2c309ba98","value":"0x1de","pathIndex":26,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x1dd","leafHigherRangeValue":"0x1df","nextIndex":47385000},{"root":"0x252a23bd2f1eb165dc49c5bb72f70c3f6f4e4dba22c8857133cdd0c08d01ae36","value":"0x232","pathIndex":5,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x1d79ba7490c4d315c8e9a083bb4d1688bffe0c3d296597b94a1c86d8d5f32b6c","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x231","leafHigherRangeValue":"0x233","nextIndex":10876133},{"root":"0x21a9660d2605cc6840612aedafd3f2f962b458d718687e9e929be4504a50952f","value":"0xbe","pathIndex":23,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0xce7a1393f9ae521aca8eb42f6f6a24daa12f1b82d8562b12e46978d8bbc6ede","0x11b217274fdae1381f6b89501134e6fe6fd53ad5696716518aad1c2c403ae102","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0xbd","leafHigherRangeValue":"0xbf","nextIndex":64009202}]}
0;{"new-addresses":[{"root":"0xfe2d3816a180471e76e5ba18e1781b3d0b80431d0976ecdf2329e65761fabcb","value":"0x338","pathIndex":22,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x337","leafHigherRangeValue":"0x339","nextIndex":42880327},{"root":"0x1026903a52e0a304e02ac606b34553a30238d8faf8a2736d50ff054c10ceeaba","value":"0x1db","pathIndex":23,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x1da","leafHigherRangeValue":"0x1dc","nextIndex":2190523},{"root":"0x1d23b94fb8bcfb8d6ee711703b4d6d594c4e7eefc005a71b3909781185e6590d","value":"0x293","pathIndex":5,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0xde10c1fbbeb6981de8ea65e886885ea99f2b2054928273b3b3720f9731b5457","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x292","leafHigherRangeValue":"0x294","nextIndex":19778725}]}
0;{"new-addresses":[{"root":"0x8b9cef9a05b2cd9806af5bfcdf68e391ab1fb608cf4a81231340e687f70d633","value":"0x29a","pathIndex":13,"pathElements":["0x3e7","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x299","leafHigherRangeValue":"0x29b","nextIndex":45941496},{"root":"0x1e88085b04a8d3cfd21624d5452a3fd894577f2df7dba4c451f82d07bf0553ea","value":"0x9","pathIndex":8,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x3d0fad8ef2bdfac1670491562aa1bf14c7111bd84a5870fa2e667b6b8e12b91","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x8","leafHigherRangeValue":"0xa","nextIndex":8528428},{"root":"0xc3d502083f329384322fbd122d62e0776687b1f4e9d6e1b849207a841d29135","value":"0x20a","pathIndex":17,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0xf379e8c834d50224612c796e9198b91f6cf73419d0ecd0532ff204b01fa7a4a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x209","leafHigherRangeValue":"0x20b","nextIndex":42052429}]}
1;{"new-addresses":[{"root":"0x25deaae3d484d97b24d62edf4cdfa978e24b2cc7957bea248cb2bd0da0f90a9","value":"0x50","pathIndex":10,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x4f","leafHigherRangeValue":"0x51","nextIndex":23742863},{"root":"0x23abbf01b261a5aeaf85dea82373ec703d2e6bc3dae13be59707158cfe063a52","value":"0x1e","pathIndex":24,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x1335e69a45965cdf58e05f190b511e2e6255e89e8fe676f97f4712feec2c62c9","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x1d","leafHigherRangeValue":"0x1f","nextIndex":11016052},{"root":"0x27bdb17a3deef3497a68fade504c8da5aeeab2a6f9fa153d106c209f9c2a1c0e","value":"0x3c0","pathIndex":4,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0xa74152c4b289257b446145a00e54beef1efa65ffbc4ef5eb064009e133a6671","0x178b28aa4100d397903ebe6c80588e660f26c2b1dadc7b7f8c46bba8b47c0ee4","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x3bf","leafHigherRangeValue":"0x3c1","nextIndex":33184385},{"root":"0x10db6bae6ff111f150fb9617875501496fd372ce3345d2f19064d751c9ff7095","value":"0x3df","pathIndex":17,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0xf25f49a18988dba7e723880d607727912f3e6a9218fa79aa93ad6812ee1731","0x25bf361814e4db5e1d675ce48a37fdd98ef15e7544070edc549ba784af93470d","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x3de","leafHigherRangeValue":"0x3e0","nextIndex":59112933}]}
0;{"new-addresses":[{"root":"0x3e7","value":"0x160","pathIndex":15,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x15f","leafHigherRangeValue":"0x161","nextIndex":20086464},{"root":"0x1c1a4b2abfb41982c70a056825ee899455bbb0bfa15d34149454bbcb0ad4f63b","value":"0x27d","pathIndex":21,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x11bcfb351855ec236750b1b9bb1d624970cdd8f12e5dd6e872024067150b4083","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x27c","leafHigherRangeValue":"0x27e","nextIndex":64985012},{"root":"0xf64dd2d297bbc7a6bec2e3971012910aa652393b87c6956e6b72b6d22d5b6ed","value":"0xfa","pathIndex":25,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x25d54499c413f6d2f8227c38a1d57f8588f3c87e05b5b8d4bfebb0b31a7d4e39","0x11bcfb351855ec236750b1b9bb1d624970cdd8f12e5dd6e872024067150b4083","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0xf9","leafHigherRangeValue":"0xfb","nextIndex":9684478},{"root":"0x2b9ecdbb80d1e51936adc52caa30264c633906237a69dde7993bb879f0f252f","value":"0x49","pathIndex":20,"pathElements":["0x138ca2fa247ab8a99f5137f1e46f6eedb9a8557f75981e81193658f0b70f13fb","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0xe03c0b29fb3ba34f72439035f7aa09322ae53d54804656c70be2bb72e5a7ded","0x11bcfb351855ec236750b1b9bb1d624970cdd8f12e5dd6e872024067150b4083","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x48","leafHigherRangeValue":"0x4a","nextIndex":48362078}]}
0;{"new-addresses":[{"root":"0x3e7","value":"0x160","pathIndex":15,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x15f","leafHigherRangeValue":"0x161","nextIndex":20086464},{"root":"0x1c1a4b2abfb41982c70a056825ee899455bbb0bfa15d34149454bbcb0ad4f63b","value":"0x27d","pathIndex":21,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x11bcfb351855ec236750b1b9bb1d624970cdd8f12e5dd6e872024067150b4083","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x27c","leafHigherRangeValue":"0x27e","nextIndex":64985012},{"root":"0xf64dd2d297bbc7a6bec2e3971012910aa652393b87c6956e6b72b6d22d5b6ed","value":"0xfa","pathIndex":25,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x25d54499c413f6d2f8227c38a1d57f8588f3c87e05b5b8d4bfebb0b31a7d4e39","0x11bcfb351855ec236750b1b9bb1d624970cdd8f12e5dd6e872024067150b4083","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0xf9","leafHigherRangeValue":"0xfb","nextIndex":9684478},{"root":"0x2b9ecdbb80d1e51936adc52caa30264c633906237a69dde7993bb879f0f252f","value":"0x49","pathIndex":20,"pathElements":["0x138ca2fa247ab8a99f5137f1e46f6eedb9a8557f75981e81193658f0b70f13fb","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0xe03c0b29fb3ba34f72439035f7aa09322ae53d54804656c70be2bb72e5a7ded","0x11bcfb351855ec236750b1b9bb1d624970cdd8f12e5dd6e872024067150b4083","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x48","leafHigherRangeValue":"0x4a","nextIndex":48362078}]}
0;{"new-addresses":[{"root":"0xcbfb32ad6a59f550ecd513859785ff020bb1b2a69ec7614ce7c341d5b9571a3","value":"0x88","pathIndex":19,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x89","leafHigherRangeValue":"0x8b","nextIndex":47679475},{"root":"0x3fc6104594e236f4893d6b208be2535676cdcad1edc5a2e0e121c3c303f5d62","value":"0x388","pathIndex":1,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x1aee94dc1f64c93f7224b4c28359fbef94e2bd3210d8a0a9e47d24c2e0003775","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x389","leafHigherRangeValue":"0x38b","nextIndex":36694017},{"root":"0x2fb14eef832da95dee36626195280533810381e69ccc7c0625e6951f89cb83f7","value":"0x283","pathIndex":12,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x22fe50eedd5d31d3da0292ddacee74e7bd2b15a7fb29fd94862ec9e3cab69c5","0x1aee94dc1f64c93f7224b4c28359fbef94e2bd3210d8a0a9e47d24c2e0003775","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x284","leafHigherRangeValue":"0x286","nextIndex":21029931},{"root":"0x109c830b3256dedd37f8f8f4f5b4ae0b9e59df7d953ccf0cd464c0c69e74f50d","value":"0x1e4","pathIndex":7,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1d6114cce19383765bbf24dc59a92b61a2d89cfa3da156f8461c0fc4f973de92","0x265212cd354db0ed9ac41780b53169d6c82f37a66f418d31da404537d454cf02","0x1aee94dc1f64c93f7224b4c28359fbef94e2bd3210d8a0a9e47d24c2e0003775","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x1e5","leafHigherRangeValue":"0x1e7","nextIndex":59195132}]}
0;{"new-addresses":[{"root":"0x2c9a1764e7f24c5252e3bc2e828370a68550a9ce0ceaf884bbb0a90c7cb4bb13","value":"0xd7","pathIndex":10,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0xd4","leafHigherRangeValue":"0xd6","nextIndex":54254971},{"root":"0x195b01a1df54084307c81af0a955e47e40143f9484b76f96e4286429d943691","value":"0x166","pathIndex":15,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1a1ead9913d00a2006d9410d0b98b082a41fb52394a2bcf54045d8a9d979a3cc","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x163","leafHigherRangeValue":"0x165","nextIndex":24942947},{"root":"0x14bbcdf0f1b2e7c18e5e7e668e0509dbee72519e201620a7abfc709c74d49cae","value":"0x6d","pathIndex":23,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x242b5034e362da0870facfa18a2f9529ecf7aa4be67d2a79023cc9589f5e3f67","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x6a","leafHigherRangeValue":"0x6c","nextIndex":63882173},{"root":"0x18feb14488a89c24a85f5a254544935fecc970a130e68e0db9599e15e36be1fc","value":"0xe0","pathIndex":12,"pathElements":["0x0","0x14a5c99a0a672836476f5b6a43627718c98917c5837658e3c291b056139f0425","0x1a1ead9913d00a2006d9410d0b98b082a41fb52394a2bcf54045d8a9d979a3cc","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0xcc23ef150d506dcaac6aa90c0c17bddc30cc434af2b0f952f383430e041b3a4","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0xdd","leafHigherRangeValue":"0xdf","nextIndex":62136662}]}
0;{"new-addresses":[{"root":"0x204f8d232914171d7ef4acb323778172246a52b12968b77d28a8e09b80740497","value":"0x1e2","pathIndex":21,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x1e1","leafHigherRangeValue":"0x1e3","nextIndex":3031566},{"root":"0xc1614c1d8ecb1f4b796671c7288f8d8b5a9f63e9f423caf80d9593c153be611","value":"0x99","pathIndex":12,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x2419c0efaf6dcfba904285ab78c0cd7d7b332ad88f2639c3c9450b2d22987737","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x98","leafHigherRangeValue":"0x9a","nextIndex":17607940},{"root":"0x2b325f112cf09b20378735f9c0ebf2e0c499476c364b1d617aabdc179d3afb73","value":"0x337","pathIndex":16,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1f38c82f71a8c8783c0846e9896c8093141bf7a39305fe2b0d352da0ba2ab491","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x277d9273ef50c324191438b04885fafb37ce50cdbe2659f88716dc1fb0ef710d","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x336","leafHigherRangeValue":"0x338","nextIndex":7873859},{"root":"0x8c21e91270e075d4998114073fc29e11c30ed8d1d95dd0f0ed2bee502e545bc","value":"0x10b","pathIndex":21,"pathElements":["0x169d0c1ed3a0cdff7d09aa92c49565f3283df289ed66524110b93b944e8c23a8","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x24d8eaca5300ca3402e78d5898a06719a5fb1741388435b1c30dd9c5757c7e6b","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x277d9273ef50c324191438b04885fafb37ce50cdbe2659f88716dc1fb0ef710d","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x10a","leafHigherRangeValue":"0x10c","nextIndex":49084886}]}
0;{"new-addresses":[{"root":"0x27facb2a4457cc13f1101e76bdd63edd4b9e017aa5facd28d84fa5ba722bbe2f","value":"0x63","pathIndex":8,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x62","leafHigherRangeValue":"0x64","nextIndex":18466646},{"root":"0x97a77de67353319c09526b2d4c7ffd6855606667d21138f0bc0135262cb279c","value":"0x1d6","pathIndex":11,"pathElements":["0x0","0x182d040b8c1a48100f17aef9e8b56ff98181dc170dad1643c8f72b9a1210f925","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x1d5","leafHigherRangeValue":"0x1d7","nextIndex":64038606},{"root":"0x280844a4eede7ad7c7ac9e422613702812c75e063112fb1c403df6f3b96cb","value":"0x37","pathIndex":21,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x1d20850879ab656546fc3f57b85b14949100ba826c1c874269afb507263b8b05","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x36","leafHigherRangeValue":"0x38","nextIndex":61747701},{"root":"0x2625189fd881281220497183ea457c7e19b40adddcbc46bf005976586e0928f8","value":"0x22a","pathIndex":13,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x76fd19cb78fdbdb02afcd722d2ffff07dec4edccd86886e97e247060e2e08b6","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x1d01a0066bddd2fa177ec8fdab508a5a812850a2d4c569b336223c9eb621cf0f","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x229","leafHigherRangeValue":"0x22b","nextIndex":22317115}]}
0;{"new-addresses":[{"root":"0x2c06d4dfc98ef7325ea3b8cb4c1e3f1231567386335969f0f7f659815b42d541","value":"0x270","pathIndex":3,"pathElements":["0x3e7","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x26f","leafHigherRangeValue":"0x271","nextIndex":50748448},{"root":"0x1671bb00bb4d65d1a77cb6e8dbe1743cbd91cc65999a0d97cbae7320a56ed312","value":"0xe1","pathIndex":13,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0xbbf5449d5c298aa9fff5e55d6886d7df152ee941581e903701cb901760449cf","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0xe0","leafHigherRangeValue":"0xe2","nextIndex":65932450},{"root":"0x5153710cae89eb522e92a316efef36a80f96d883e182c84a1188d4236ec0a28","value":"0x4f","pathIndex":7,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x2d7dc551d776152adb44f4d6dd44d8337f8818336fafddd9d3956e8ff05c12a0","0x23f7e0e23f9e798a66f80eaf4301f37f2312dd0d08b98e14441adbb91676da04","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x4e","leafHigherRangeValue":"0x50","nextIndex":16978766},{"root":"0x2afc91533c1baa8698016e76c6df555ddbef05d4c1b5494efc9be012b7ae18dd","value":"0x3bd","pathIndex":2,"pathElements":["0x2efd9c5401f521390eb5685b01278986aa51571475cf1723f55bae840c477b5e","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x265d75c46526b226d3afa5913e3e2b3d3940d4582b4474d142f85b08dac0bfe3","0x23f7e0e23f9e798a66f80eaf4301f37f2312dd0d08b98e14441adbb91676da04","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leafLowerRangeValue":"0x3bc","leafHigherRangeValue":"0x3be","nextIndex":65835751}]}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/test-data/inclusion.csv
|
1;{"input-compressed-accounts":[{"root":"0x1ebf5c4eb04bf878b46937be63d12308bb14841813441f041812ea54ecb7b2d5","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"}]}
0;{"input-compressed-accounts":[{"root":"0x3e7","pathIndex":16,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x2b5945ad0e0a66bea4e4dd5b000ebf32927ae6369a9835b19eb566535c0a8263"}]}
0;{"input-compressed-accounts":[{"root":"0x1afea3442067cf49efdb69acf7ad621a873c8c8a77fd8e027f9706906fc9bd91","pathIndex":1,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x3e7"}]}
0;{"input-compressed-accounts":[{"root":"0x20b276a353c8cb5d07d42e8eb49d198c174b3bf54995c5d27f8f0737e045a016","pathIndex":23,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x725d75419a01ce0274bda89f0754c241f7e848ecd007e73ab0637e091519e30"}]}
0;{"input-compressed-accounts":[{"root":"0x15967ea0ca475f3ea5a8fbac008d2fd900e25492d9c8a88bb48523b8381f380c","pathIndex":9,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1050be7a5d16c45c6563fe0f923f939293c109b2f241c2f740b3c1db550f72bd"}]}
0;{"input-compressed-accounts":[{"root":"0x28942354bbf7e4a5902649cbe2a062ab1f843482381453939ccbfee3cacad006","pathIndex":14,"pathElements":["0x3e7","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x188da4433dc338d2c6ef7fc2a13e31f7393352511bd09499f02698e7655ad78e"}]}
1;{"input-compressed-accounts":[{"root":"0x1ebf5c4eb04bf878b46937be63d12308bb14841813441f041812ea54ecb7b2d5","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"},{"root":"0x1ebf5c4eb04bf878b46937be63d12308bb14841813441f041812ea54ecb7b2d5","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"}]}
0;{"input-compressed-accounts":[{"root":"0x3e7","pathIndex":4,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1130c9a1adbe58fb40b227614076058962610a8edcdbe73e7bddeda3ff6bb500"},{"root":"0x12e80edd8a5710ea251a26edf9868ba52dbf3b79a5b56067829a48c47ae08f41","pathIndex":4,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1130c9a1adbe58fb40b227614076058962610a8edcdbe73e7bddeda3ff6bb500"}]}
0;{"input-compressed-accounts":[{"root":"0x1dcf33c543c385b7ef7cc08fec44130de4a3433d90d87bffc489673af6f8109b","pathIndex":5,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x3e7"},{"root":"0x1dcf33c543c385b7ef7cc08fec44130de4a3433d90d87bffc489673af6f8109b","pathIndex":5,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x95773a809560c29d089fd4e5f7a1ee40accb5d1af6d5fb9aa74eb6afe4f059"}]}
0;{"input-compressed-accounts":[{"root":"0x20cba7fe75b888c7b74e853f5b8a144f38b78b4e27ade0c3142f1dcf828762ab","pathIndex":21,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x15f71311451fdbabd1228a876a8e0f87a469ab4237bb1b360148a8facaa4569e"},{"root":"0x20cba7fe75b888c7b74e853f5b8a144f38b78b4e27ade0c3142f1dcf828762ab","pathIndex":20,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x15f71311451fdbabd1228a876a8e0f87a469ab4237bb1b360148a8facaa4569e"}]}
0;{"input-compressed-accounts":[{"root":"0x1578556349aed224450f87702c2f59a69cc8086fff6bf7b50fb2dc7894ad8963","pathIndex":10,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x2cb38948cf0e29e4f3d555387fbd5152707bf8f4704f5c6c24abb9b2761b3260"},{"root":"0x1578556349aed224450f87702c2f59a69cc8086fff6bf7b50fb2dc7894ad8963","pathIndex":11,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x2cb38948cf0e29e4f3d555387fbd5152707bf8f4704f5c6c24abb9b2761b3260"}]}
0;{"input-compressed-accounts":[{"root":"0x116b4af460f91cf2644eeaf4c2b5605a454be3deb9030e0abe96a8a0f8b2fd6f","pathIndex":5,"pathElements":["0x3e7","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x14bd6132ac31203f99cf830df9c24bc7daf4269d84e0fbed44f7e6a31ddf29b3"},{"root":"0x116b4af460f91cf2644eeaf4c2b5605a454be3deb9030e0abe96a8a0f8b2fd6f","pathIndex":5,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x14bd6132ac31203f99cf830df9c24bc7daf4269d84e0fbed44f7e6a31ddf29b3"}]}
1;{"input-compressed-accounts":[{"root":"0x1ebf5c4eb04bf878b46937be63d12308bb14841813441f041812ea54ecb7b2d5","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"},{"root":"0x1ebf5c4eb04bf878b46937be63d12308bb14841813441f041812ea54ecb7b2d5","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"},{"root":"0x1ebf5c4eb04bf878b46937be63d12308bb14841813441f041812ea54ecb7b2d5","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"}]}
0;{"input-compressed-accounts":[{"root":"0x3e7","pathIndex":8,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1055da64f1dda6bf50546de3c58414e7aa582a7bab7b7283276af405b621dad2"},{"root":"0x246a7ea1aa26b7336bf93cb1b4f01e0ef51abb63e8246a013d8c9b4434dc9a12","pathIndex":8,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1055da64f1dda6bf50546de3c58414e7aa582a7bab7b7283276af405b621dad2"},{"root":"0x246a7ea1aa26b7336bf93cb1b4f01e0ef51abb63e8246a013d8c9b4434dc9a12","pathIndex":8,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1055da64f1dda6bf50546de3c58414e7aa582a7bab7b7283276af405b621dad2"}]}
0;{"input-compressed-accounts":[{"root":"0x10829f971120400af64a1ed883c5c8f466e1cc8e2acbf1afdf1f32d210c9f55d","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x3e7"},{"root":"0x10829f971120400af64a1ed883c5c8f466e1cc8e2acbf1afdf1f32d210c9f55d","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x17773ac4f6a493f479601b1682d58e4eb3df00616d180d90e49b9ba8b5d164d4"},{"root":"0x10829f971120400af64a1ed883c5c8f466e1cc8e2acbf1afdf1f32d210c9f55d","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x17773ac4f6a493f479601b1682d58e4eb3df00616d180d90e49b9ba8b5d164d4"}]}
0;{"input-compressed-accounts":[{"root":"0xa604c32527b71df63befa3ce7b387274cd5be8d1ff47b48c178af2c1d110f03","pathIndex":16,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0xa74b864acd188f1eaac28030501697505da156f55a57a31a220e63053678e81"},{"root":"0xa604c32527b71df63befa3ce7b387274cd5be8d1ff47b48c178af2c1d110f03","pathIndex":15,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0xa74b864acd188f1eaac28030501697505da156f55a57a31a220e63053678e81"},{"root":"0xa604c32527b71df63befa3ce7b387274cd5be8d1ff47b48c178af2c1d110f03","pathIndex":15,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0xa74b864acd188f1eaac28030501697505da156f55a57a31a220e63053678e81"}]}
0;{"input-compressed-accounts":[{"root":"0xd9b168fe6266f23a2a5634d6b46a432dddbc665c1f7d75129b14bb892f87d0f","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0xbda0312d33bf6b5d580c758a555e5365332e71ec6f8c6c5b64007ffda800ea8"},{"root":"0xd9b168fe6266f23a2a5634d6b46a432dddbc665c1f7d75129b14bb892f87d0f","pathIndex":1,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0xbda0312d33bf6b5d580c758a555e5365332e71ec6f8c6c5b64007ffda800ea8"},{"root":"0xd9b168fe6266f23a2a5634d6b46a432dddbc665c1f7d75129b14bb892f87d0f","pathIndex":1,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0xbda0312d33bf6b5d580c758a555e5365332e71ec6f8c6c5b64007ffda800ea8"}]}
0;{"input-compressed-accounts":[{"root":"0x1089cbb2853a704804dbb8c8e4986c0daa97e5fdd7902bc28cb32ff759e12860","pathIndex":16,"pathElements":["0x3e7","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x2ef3475ae812df4415287037b5a77f27b640f2188a8fe7f3b103d8aeeef0e652"},{"root":"0x1089cbb2853a704804dbb8c8e4986c0daa97e5fdd7902bc28cb32ff759e12860","pathIndex":16,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x2ef3475ae812df4415287037b5a77f27b640f2188a8fe7f3b103d8aeeef0e652"},{"root":"0x1089cbb2853a704804dbb8c8e4986c0daa97e5fdd7902bc28cb32ff759e12860","pathIndex":16,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x2ef3475ae812df4415287037b5a77f27b640f2188a8fe7f3b103d8aeeef0e652"}]}
1;{"input-compressed-accounts":[{"root":"0x1ebf5c4eb04bf878b46937be63d12308bb14841813441f041812ea54ecb7b2d5","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"},{"root":"0x1ebf5c4eb04bf878b46937be63d12308bb14841813441f041812ea54ecb7b2d5","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"},{"root":"0x1ebf5c4eb04bf878b46937be63d12308bb14841813441f041812ea54ecb7b2d5","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"},{"root":"0x1ebf5c4eb04bf878b46937be63d12308bb14841813441f041812ea54ecb7b2d5","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"}]}
0;{"input-compressed-accounts":[{"root":"0x3e7","pathIndex":5,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x9a3be39ad718047f2cc08ed56a9390d715ed81595792c2b45f96a2b75e9f017"},{"root":"0x1ded8442889cf66356a1241a3e74d413b424e80e2c044d92431af4ea142414fe","pathIndex":5,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x9a3be39ad718047f2cc08ed56a9390d715ed81595792c2b45f96a2b75e9f017"},{"root":"0x1ded8442889cf66356a1241a3e74d413b424e80e2c044d92431af4ea142414fe","pathIndex":5,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x9a3be39ad718047f2cc08ed56a9390d715ed81595792c2b45f96a2b75e9f017"},{"root":"0x1ded8442889cf66356a1241a3e74d413b424e80e2c044d92431af4ea142414fe","pathIndex":5,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x9a3be39ad718047f2cc08ed56a9390d715ed81595792c2b45f96a2b75e9f017"}]}
0;{"input-compressed-accounts":[{"root":"0x244e9cf8d3440998bcf0b6e9750c6cb3069e6c7415731334907bbccb5abc9594","pathIndex":25,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x3e7"},{"root":"0x244e9cf8d3440998bcf0b6e9750c6cb3069e6c7415731334907bbccb5abc9594","pathIndex":25,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1b9c7334a1691a4409e6a9d05b6b3547e2519edcb26c7cfafb12a404b0dc03ab"},{"root":"0x244e9cf8d3440998bcf0b6e9750c6cb3069e6c7415731334907bbccb5abc9594","pathIndex":25,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1b9c7334a1691a4409e6a9d05b6b3547e2519edcb26c7cfafb12a404b0dc03ab"},{"root":"0x244e9cf8d3440998bcf0b6e9750c6cb3069e6c7415731334907bbccb5abc9594","pathIndex":25,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1b9c7334a1691a4409e6a9d05b6b3547e2519edcb26c7cfafb12a404b0dc03ab"}]}
0;{"input-compressed-accounts":[{"root":"0x13213318d72056dfd38e68accdcb1aad2169a7a045b611207cb42e78f538c942","pathIndex":11,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x2107a53609bb79e668682d879d950832a8ca6358129775b0d864ef0109bbd22f"},{"root":"0x13213318d72056dfd38e68accdcb1aad2169a7a045b611207cb42e78f538c942","pathIndex":10,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x2107a53609bb79e668682d879d950832a8ca6358129775b0d864ef0109bbd22f"},{"root":"0x13213318d72056dfd38e68accdcb1aad2169a7a045b611207cb42e78f538c942","pathIndex":10,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x2107a53609bb79e668682d879d950832a8ca6358129775b0d864ef0109bbd22f"},{"root":"0x13213318d72056dfd38e68accdcb1aad2169a7a045b611207cb42e78f538c942","pathIndex":10,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x2107a53609bb79e668682d879d950832a8ca6358129775b0d864ef0109bbd22f"}]}
0;{"input-compressed-accounts":[{"root":"0x3f6c2db1f8011640621fdcfcfb2db30ff39f4ebf2f20f0a641d0adb420ceb25","pathIndex":0,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1336514c98f942341402ead87adf5a9fac561d13f9bb42c636ec75acae909bf"},{"root":"0x3f6c2db1f8011640621fdcfcfb2db30ff39f4ebf2f20f0a641d0adb420ceb25","pathIndex":1,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1336514c98f942341402ead87adf5a9fac561d13f9bb42c636ec75acae909bf"},{"root":"0x3f6c2db1f8011640621fdcfcfb2db30ff39f4ebf2f20f0a641d0adb420ceb25","pathIndex":1,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1336514c98f942341402ead87adf5a9fac561d13f9bb42c636ec75acae909bf"},{"root":"0x3f6c2db1f8011640621fdcfcfb2db30ff39f4ebf2f20f0a641d0adb420ceb25","pathIndex":1,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1336514c98f942341402ead87adf5a9fac561d13f9bb42c636ec75acae909bf"}]}
0;{"input-compressed-accounts":[{"root":"0x2d47afd6077eebfe1a40e89531c833064f2cab18d532b1d3d93469235468006b","pathIndex":11,"pathElements":["0x3e7","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1e0c4d10bf759d004fd8ea3d6b166c5592392c758d5f424dfe42339af2ffe9aa"},{"root":"0x2d47afd6077eebfe1a40e89531c833064f2cab18d532b1d3d93469235468006b","pathIndex":11,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1e0c4d10bf759d004fd8ea3d6b166c5592392c758d5f424dfe42339af2ffe9aa"},{"root":"0x2d47afd6077eebfe1a40e89531c833064f2cab18d532b1d3d93469235468006b","pathIndex":11,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1e0c4d10bf759d004fd8ea3d6b166c5592392c758d5f424dfe42339af2ffe9aa"},{"root":"0x2d47afd6077eebfe1a40e89531c833064f2cab18d532b1d3d93469235468006b","pathIndex":11,"pathElements":["0x0","0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x7f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x78295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0xe884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0xf57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"],"leaf":"0x1e0c4d10bf759d004fd8ea3d6b166c5592392c758d5f424dfe42339af2ffe9aa"}]}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/server/server.go
|
package server
import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"light/light-prover/logging"
"light/light-prover/prover"
"net/http"
"github.com/gorilla/handlers"
//"github.com/prometheus/client_golang/prometheus/promhttp"
)
type Error struct {
StatusCode int
Code string
Message string
}
func malformedBodyError(err error) *Error {
return &Error{StatusCode: http.StatusBadRequest, Code: "malformed_body", Message: err.Error()}
}
func provingError(err error) *Error {
return &Error{StatusCode: http.StatusBadRequest, Code: "proving_error", Message: err.Error()}
}
func unexpectedError(err error) *Error {
return &Error{StatusCode: http.StatusInternalServerError, Code: "unexpected_error", Message: err.Error()}
}
func (error *Error) MarshalJSON() ([]byte, error) {
return json.Marshal(map[string]string{
"code": error.Code,
"message": error.Message,
})
}
func (error *Error) send(w http.ResponseWriter) {
w.WriteHeader(error.StatusCode)
jsonBytes, err := error.MarshalJSON()
if err != nil {
jsonBytes = []byte(`{"code": "unexpected_error", "message": "failed to marshal error"}`)
}
length, err := w.Write(jsonBytes)
if err != nil || length != len(jsonBytes) {
logging.Logger().Error().Err(err).Msg("error writing response")
}
}
type Config struct {
ProverAddress string
MetricsAddress string
}
func spawnServerJob(server *http.Server, label string) RunningJob {
start := func() {
err := server.ListenAndServe()
if err != nil && !errors.Is(err, http.ErrServerClosed) {
panic(fmt.Sprintf("%s failed: %s", label, err))
}
}
shutdown := func() {
logging.Logger().Info().Msgf("shutting down %s", label)
err := server.Shutdown(context.Background())
if err != nil {
logging.Logger().Error().Err(err).Msgf("error when shutting down %s", label)
}
logging.Logger().Info().Msgf("%s shut down", label)
}
return SpawnJob(start, shutdown)
}
func Run(config *Config, provingSystemsV1 []*prover.ProvingSystemV1, provingSystemsV2 []*prover.ProvingSystemV2) RunningJob {
metricsMux := http.NewServeMux()
// TODO: Add metrics
//metricsMux.Handle("/metrics", promhttp.Handler())
metricsServer := &http.Server{Addr: config.MetricsAddress, Handler: metricsMux}
metricsJob := spawnServerJob(metricsServer, "metrics server")
logging.Logger().Info().Str("addr", config.MetricsAddress).Msg("metrics server started")
proverMux := http.NewServeMux()
proverMux.Handle("/prove", proveHandler{
provingSystemsV1: provingSystemsV1,
provingSystemsV2: provingSystemsV2,
})
proverMux.Handle("/health", healthHandler{})
// Setup CORS
// TODO: Enforce strict CORS policy
corsHandler := handlers.CORS(
handlers.AllowedHeaders([]string{"X-Requested-With", "Content-Type", "Authorization"}),
handlers.AllowedOrigins([]string{"*"}),
handlers.AllowedMethods([]string{"GET", "POST", "PUT", "DELETE", "OPTIONS"}),
)
proverServer := &http.Server{Addr: config.ProverAddress, Handler: corsHandler(proverMux)}
proverJob := spawnServerJob(proverServer, "prover server")
logging.Logger().Info().Str("addr", config.ProverAddress).Msg("app server started")
return CombineJobs(metricsJob, proverJob)
}
type proveHandler struct {
provingSystemsV1 []*prover.ProvingSystemV1
provingSystemsV2 []*prover.ProvingSystemV2
}
type healthHandler struct {
}
func (handler proveHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost {
w.WriteHeader(http.StatusMethodNotAllowed)
return
}
logging.Logger().Info().Msg("received prove request")
buf, err := io.ReadAll(r.Body)
if err != nil {
logging.Logger().Info().Msg("error reading request body")
logging.Logger().Info().Msg(err.Error())
malformedBodyError(err).send(w)
return
}
var circuitType prover.CircuitType
var proof *prover.Proof
var proofError *Error
circuitType, err = prover.ParseCircuitType(buf)
if err != nil {
logging.Logger().Info().Msg("error parsing circuit type")
logging.Logger().Info().Msg(err.Error())
malformedBodyError(err).send(w)
return
}
switch circuitType {
case prover.InclusionCircuitType:
proof, proofError = handler.inclusionProof(buf)
case prover.NonInclusionCircuitType:
proof, proofError = handler.nonInclusionProof(buf)
case prover.CombinedCircuitType:
proof, proofError = handler.combinedProof(buf)
case prover.BatchAppendWithSubtreesCircuitType:
proof, proofError = handler.batchAppendWithSubtreesHandler(buf)
case prover.BatchUpdateCircuitType:
proof, proofError = handler.batchUpdateProof(buf)
case prover.BatchAppendWithProofsCircuitType:
proof, proofError = handler.batchAppendWithProofsHandler(buf)
case prover.BatchAddressAppendCircuitType:
proof, proofError = handler.batchAddressAppendProof(buf)
default:
proofError = malformedBodyError(fmt.Errorf("unknown circuit type"))
}
if proofError != nil {
println(proofError.Message)
logging.Logger().Err(err)
proofError.send(w)
return
}
responseBytes, err := json.Marshal(&proof)
if err != nil {
logging.Logger().Err(err)
unexpectedError(err).send(w)
return
}
w.WriteHeader(http.StatusOK)
_, err = w.Write(responseBytes)
if err != nil {
logging.Logger().Err(err)
}
}
func (handler proveHandler) batchAddressAppendProof(buf []byte) (*prover.Proof, *Error) {
var params prover.BatchAddressAppendParameters
err := json.Unmarshal(buf, ¶ms)
if err != nil {
logging.Logger().Info().Msg("error Unmarshal")
logging.Logger().Info().Msg(err.Error())
return nil, malformedBodyError(err)
}
treeHeight := params.TreeHeight
batchSize := params.BatchSize
var ps *prover.ProvingSystemV2
for _, provingSystem := range handler.provingSystemsV2 {
if provingSystem.CircuitType == prover.BatchAddressAppendCircuitType && provingSystem.TreeHeight == treeHeight && provingSystem.BatchSize == batchSize {
ps = provingSystem
break
}
}
if ps == nil {
return nil, provingError(fmt.Errorf("batch address append: no proving system for tree height %d and batch size %d", treeHeight, batchSize))
}
proof, err := ps.ProveBatchAddressAppend(¶ms)
if err != nil {
logging.Logger().Err(err)
return nil, provingError(err)
}
return proof, nil
}
func (handler proveHandler) batchAppendWithProofsHandler(buf []byte) (*prover.Proof, *Error) {
var params prover.BatchAppendWithProofsParameters
err := json.Unmarshal(buf, ¶ms)
if err != nil {
logging.Logger().Info().Msg("Error during JSON unmarshalling")
logging.Logger().Info().Msg(err.Error())
return nil, malformedBodyError(err)
}
treeHeight := params.Height
batchSize := params.BatchSize
var ps *prover.ProvingSystemV2
for _, provingSystem := range handler.provingSystemsV2 {
if provingSystem.CircuitType == prover.BatchAppendWithProofsCircuitType && provingSystem.TreeHeight == treeHeight && provingSystem.BatchSize == batchSize {
ps = provingSystem
break
}
}
if ps == nil {
return nil, provingError(fmt.Errorf("no proving system for tree height %d and batch size %d", treeHeight, batchSize))
}
proof, err := ps.ProveBatchAppendWithProofs(¶ms)
if err != nil {
logging.Logger().Err(err).Msg("Error during proof generation")
return nil, provingError(err)
}
return proof, nil
}
func (handler proveHandler) batchAppendWithSubtreesHandler(buf []byte) (*prover.Proof, *Error) {
var params prover.BatchAppendWithSubtreesParameters
err := json.Unmarshal(buf, ¶ms)
if err != nil {
logging.Logger().Info().Msg("error Unmarshal")
logging.Logger().Info().Msg(err.Error())
return nil, malformedBodyError(err)
}
batchSize := uint32(len(params.Leaves))
var ps *prover.ProvingSystemV2
for _, provingSystem := range handler.provingSystemsV2 {
if provingSystem.CircuitType == prover.BatchAppendWithSubtreesCircuitType && provingSystem.BatchSize == batchSize && provingSystem.TreeHeight == params.TreeHeight {
ps = provingSystem
break
}
}
if ps == nil {
return nil, provingError(fmt.Errorf("no proving system for batch size %d", batchSize))
}
proof, err := ps.ProveBatchAppendWithSubtrees(¶ms)
if err != nil {
logging.Logger().Err(err)
return nil, provingError(err)
}
return proof, nil
}
func (handler proveHandler) batchUpdateProof(buf []byte) (*prover.Proof, *Error) {
var params prover.BatchUpdateParameters
err := json.Unmarshal(buf, ¶ms)
if err != nil {
logging.Logger().Info().Msg("error Unmarshal")
logging.Logger().Info().Msg(err.Error())
return nil, malformedBodyError(err)
}
treeHeight := params.Height
batchSize := params.BatchSize
var ps *prover.ProvingSystemV2
for _, provingSystem := range handler.provingSystemsV2 {
if provingSystem.CircuitType == prover.BatchUpdateCircuitType && provingSystem.TreeHeight == treeHeight && provingSystem.BatchSize == batchSize {
ps = provingSystem
break
}
}
if ps == nil {
return nil, provingError(fmt.Errorf("no proving system for tree height %d and batch size %d", treeHeight, batchSize))
}
proof, err := ps.ProveBatchUpdate(¶ms)
if err != nil {
logging.Logger().Err(err)
return nil, provingError(err)
}
return proof, nil
}
func (handler proveHandler) inclusionProof(buf []byte) (*prover.Proof, *Error) {
var proof *prover.Proof
var params prover.InclusionParameters
var err = json.Unmarshal(buf, ¶ms)
if err != nil {
logging.Logger().Info().Msg("error Unmarshal")
logging.Logger().Info().Msg(err.Error())
return nil, malformedBodyError(err)
}
var numberOfCompressedAccounts = uint32(len(params.Inputs))
var ps *prover.ProvingSystemV1
for _, provingSystem := range handler.provingSystemsV1 {
if provingSystem.InclusionNumberOfCompressedAccounts == numberOfCompressedAccounts {
ps = provingSystem
break
}
}
if ps == nil {
return nil, provingError(fmt.Errorf("no proving system for %d compressedAccounts", numberOfCompressedAccounts))
}
proof, err = ps.ProveInclusion(¶ms)
if err != nil {
logging.Logger().Err(err)
return nil, provingError(err)
}
return proof, nil
}
func (handler proveHandler) nonInclusionProof(buf []byte) (*prover.Proof, *Error) {
var proof *prover.Proof
var params prover.NonInclusionParameters
var err = json.Unmarshal(buf, ¶ms)
if err != nil {
logging.Logger().Info().Msg("error Unmarshal")
logging.Logger().Info().Msg(err.Error())
return nil, malformedBodyError(err)
}
var numberOfCompressedAccounts = uint32(len(params.Inputs))
var ps *prover.ProvingSystemV1
for _, provingSystem := range handler.provingSystemsV1 {
if provingSystem.NonInclusionNumberOfCompressedAccounts == numberOfCompressedAccounts {
ps = provingSystem
break
}
}
if ps == nil {
return nil, provingError(fmt.Errorf("no proving system for %d compressedAccounts", numberOfCompressedAccounts))
}
proof, err = ps.ProveNonInclusion(¶ms)
if err != nil {
logging.Logger().Err(err)
return nil, provingError(err)
}
return proof, nil
}
func (handler proveHandler) combinedProof(buf []byte) (*prover.Proof, *Error) {
var proof *prover.Proof
var params prover.CombinedParameters
var err = json.Unmarshal(buf, ¶ms)
if err != nil {
logging.Logger().Info().Msg("error Unmarshal")
logging.Logger().Info().Msg(err.Error())
return nil, malformedBodyError(err)
}
var inclusionNumberOfCompressedAccounts = uint32(len(params.InclusionParameters.Inputs))
var nonInclusionNumberOfCompressedAccounts = uint32(len(params.NonInclusionParameters.Inputs))
var ps *prover.ProvingSystemV1
for _, provingSystem := range handler.provingSystemsV1 {
if provingSystem.InclusionNumberOfCompressedAccounts == inclusionNumberOfCompressedAccounts && provingSystem.NonInclusionNumberOfCompressedAccounts == nonInclusionNumberOfCompressedAccounts {
ps = provingSystem
break
}
}
if ps == nil {
return nil, provingError(fmt.Errorf("no proving system for %d inclusion compressedAccounts & %d non-inclusion", inclusionNumberOfCompressedAccounts, nonInclusionNumberOfCompressedAccounts))
}
proof, err = ps.ProveCombined(¶ms)
if err != nil {
logging.Logger().Err(err)
return nil, provingError(err)
}
return proof, nil
}
func (handler healthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet {
w.WriteHeader(http.StatusMethodNotAllowed)
return
}
logging.Logger().Info().Msg("received health check request")
responseBytes, err := json.Marshal(map[string]string{"status": "ok"})
w.WriteHeader(http.StatusOK)
_, err = w.Write(responseBytes)
if err != nil {
logging.Logger().Error().Err(err).Msg("error writing response")
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/server/job.go
|
package server
type RunningJob struct {
stop chan struct{}
closed chan struct{}
}
func (server *RunningJob) RequestStop() {
close(server.stop)
}
func (server *RunningJob) AwaitStop() {
<-server.closed
}
func SpawnJob(start func(), shutdown func()) RunningJob {
stop := make(chan struct{})
closed := make(chan struct{})
go func() {
<-stop
shutdown()
close(closed)
}()
go start()
return RunningJob{stop: stop, closed: closed}
}
func CombineJobs(jobs ...RunningJob) RunningJob {
start := func() {}
shutdown := func() {
for _, job := range jobs {
job.RequestStop()
}
for _, job := range jobs {
job.AwaitStop()
}
}
return SpawnJob(start, shutdown)
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/scripts/targets.txt
|
POST http://localhost:3001/inclusion
@inclusion_26_1.json
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/scripts/download_keys.sh
|
#!/usr/bin/env bash
set -e
command -v git >/dev/null 2>&1 || { echo >&2 "git is required but it's not installed. Aborting."; exit 1; }
command -v curl >/dev/null 2>&1 || { echo >&2 "curl is required but it's not installed. Aborting."; exit 1; }
command -v wc >/dev/null 2>&1 || { echo >&2 "wc is required but it's not installed. Aborting."; exit 1; }
ROOT_DIR="$(git rev-parse --show-toplevel)"
KEYS_DIR="${ROOT_DIR}/light-prover/proving-keys"
TEMP_DIR="${KEYS_DIR}/temp"
mkdir -p "$KEYS_DIR" "$TEMP_DIR"
download_file() {
local FILE="$1"
local BUCKET_URL
if [[ $FILE == append-with-proofs* ]]; then
BUCKET_URL="https://${APPEND_WITH_PROOFS_BUCKET}.ipfs.w3s.link/${FILE}"
elif [[ $FILE == append-with-subtrees* ]]; then
BUCKET_URL="https://${APPEND_WITH_SUBTREES_BUCKET}.ipfs.w3s.link/${FILE}"
elif [[ $FILE == update* ]]; then
BUCKET_URL="https://${UPDATE_BUCKET}.ipfs.w3s.link/${FILE}"
elif [[ $FILE == address-append* ]]; then
BUCKET_URL="https://${APPEND_ADDRESS_BUCKET}.ipfs.w3s.link/${FILE}"
else
BUCKET_URL="https://${BUCKET}.ipfs.w3s.link/${FILE}"
fi
local TEMP_FILE="${TEMP_DIR}/${FILE}.partial"
local FINAL_FILE="${KEYS_DIR}/${FILE}"
# Simple check if file exists
if [ -f "$FINAL_FILE" ]; then
echo "$FILE already exists. Skipping."
return 0
fi
echo "Downloading $FILE"
local MAX_RETRIES=100
local attempt=0
while (( attempt < MAX_RETRIES )); do
if curl -S -f --retry 3 --retry-delay 2 --connect-timeout 30 \
--max-time 3600 --tlsv1.2 --tls-max 1.2 \
-o "$TEMP_FILE" "$BUCKET_URL"; then
mv "$TEMP_FILE" "$FINAL_FILE"
echo "$FILE downloaded successfully"
return 0
fi
echo "Download failed for $FILE (attempt $((attempt + 1))). Retrying..."
sleep $((2 ** attempt))
((attempt++))
done
echo "Failed to download $FILE after $MAX_RETRIES attempts"
return 1
}
cleanup() {
echo "Cleaning up temporary files..."
rm -rf "$TEMP_DIR"
exit 1
}
# Set up trap for script interruption
trap cleanup INT TERM
download_files() {
local files=("$@")
local failed_files=()
for FILE in "${files[@]}"; do
if ! download_file "$FILE"; then
failed_files+=("$FILE")
echo "Failed to download: $FILE"
fi
done
if [ ${#failed_files[@]} -ne 0 ]; then
echo "The following files failed to download:"
printf '%s\n' "${failed_files[@]}"
exit 1
fi
}
# inclusion, non-inclusion and combined keys for merkle tree of height 26
BUCKET="bafybeiacecbc3hnlmgifpe6v3h3r3ord7ifedjj6zvdv7nxgkab4npts54"
# mt height 26, batch sizes {1, 10, 100, 500, 1000}
APPEND_WITH_PROOFS_BUCKET="bafybeicngrfui5cef2a4g67lxw3u42atyrfks35vx4hu6c4rme3knh6lby"
APPEND_WITH_SUBTREES_BUCKET="bafybeieyujtdrhp52unqkwvzn36o4hh4brsw52juaftceaki4gfypszbxa"
# mt height 40, batch sizes {1, 10, 100, 250, 500, 1000}
APPEND_ADDRESS_BUCKET="bafybeib2rajatndlpslpqhf4vrbekpyyehjt5byivfzxl36c5p67ypddvu"
# keys for update circuit for tree of height 26
UPDATE_BUCKET="bafybeievf2qdaex4cskdfk24uifq4244ne42w3dghwnnfp4ybsve6mw2pa"
LIGHTWEIGHT_FILES=(
"inclusion_26_1.key"
"inclusion_26_1.vkey"
"inclusion_26_2.key"
"inclusion_26_2.vkey"
"inclusion_26_3.key"
"inclusion_26_3.vkey"
"inclusion_26_4.key"
"inclusion_26_4.vkey"
"inclusion_26_8.key"
"inclusion_26_8.vkey"
"non-inclusion_26_1.key"
"non-inclusion_26_1.vkey"
"non-inclusion_26_2.key"
"non-inclusion_26_2.vkey"
"combined_26_1_1.key"
"combined_26_1_1.vkey"
"combined_26_1_2.key"
"combined_26_1_2.vkey"
"combined_26_2_1.key"
"combined_26_2_1.vkey"
"combined_26_2_2.key"
"combined_26_2_2.vkey"
"combined_26_3_1.key"
"combined_26_3_1.vkey"
"combined_26_3_2.key"
"combined_26_3_2.vkey"
"combined_26_4_1.key"
"combined_26_4_1.vkey"
"combined_26_4_2.key"
"combined_26_4_2.vkey"
"append-with-proofs_26_10.key"
"append-with-proofs_26_10.vkey"
"append-with-subtrees_26_10.key"
"append-with-subtrees_26_10.vkey"
"update_26_10.key"
"update_26_10.vkey"
"address-append_40_1.key"
"address-append_40_1.vkey"
"address-append_40_10.key"
"address-append_40_10.vkey"
)
FULL_FILES=(
"inclusion_26_1.key"
"inclusion_26_1.vkey"
"inclusion_26_2.key"
"inclusion_26_2.vkey"
"inclusion_26_3.key"
"inclusion_26_3.vkey"
"inclusion_26_4.key"
"inclusion_26_4.vkey"
"inclusion_26_8.key"
"inclusion_26_8.vkey"
"non-inclusion_26_1.key"
"non-inclusion_26_1.vkey"
"non-inclusion_26_2.key"
"non-inclusion_26_2.vkey"
"combined_26_1_1.key"
"combined_26_1_1.vkey"
"combined_26_1_2.key"
"combined_26_1_2.vkey"
"combined_26_2_1.key"
"combined_26_2_1.vkey"
"combined_26_2_2.key"
"combined_26_2_2.vkey"
"combined_26_3_1.key"
"combined_26_3_1.vkey"
"combined_26_3_2.key"
"combined_26_3_2.vkey"
"combined_26_4_1.key"
"combined_26_4_1.vkey"
"combined_26_4_2.key"
"combined_26_4_2.vkey"
"append-with-proofs_26_1.key"
"append-with-proofs_26_1.vkey"
"append-with-proofs_26_10.key"
"append-with-proofs_26_10.vkey"
"append-with-proofs_26_100.key"
"append-with-proofs_26_100.vkey"
"append-with-proofs_26_500.key"
"append-with-proofs_26_500.vkey"
"append-with-proofs_26_1000.key"
"append-with-proofs_26_1000.vkey"
"append-with-subtrees_26_1.key"
"append-with-subtrees_26_1.vkey"
"append-with-subtrees_26_10.key"
"append-with-subtrees_26_10.vkey"
"append-with-subtrees_26_100.key"
"append-with-subtrees_26_100.vkey"
"append-with-subtrees_26_500.key"
"append-with-subtrees_26_500.vkey"
"append-with-subtrees_26_1000.key"
"append-with-subtrees_26_1000.vkey"
"update_26_1.key"
"update_26_1.vkey"
"update_26_10.key"
"update_26_10.vkey"
"update_26_100.key"
"update_26_100.vkey"
"update_26_500.key"
"update_26_500.vkey"
"update_26_1000.key"
"update_26_1000.vkey"
"address-append_40_1.key"
"address-append_40_1.vkey"
"address-append_40_10.key"
"address-append_40_10.vkey"
"address-append_40_100.key"
"address-append_40_100.vkey"
"address-append_40_250.key"
"address-append_40_250.vkey"
"address-append_40_500.key"
"address-append_40_500.vkey"
"address-append_40_1000.key"
"address-append_40_1000.vkey"
)
if [ "$1" = "light" ]; then
download_files "${LIGHTWEIGHT_FILES[@]}"
elif [ "$1" = "full" ]; then
download_files "${FULL_FILES[@]}"
else
echo "Usage: $0 [light|full]"
exit 1
fi
rm -rf "$TEMP_DIR"
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/scripts/stress_load.sh
|
#!/usr/bin/env bash
PROVER_ADDRESS="localhost:3001"
DURATION="60s"
RATE="30/1s"
TARGETS_FILE="targets.txt"
BASE_OUTPUT_FILE="results_${DURATION}"
if [ -e "${BASE_OUTPUT_FILE}*" ]; then
rm ${BASE_OUTPUT_FILE}*
fi
echo "POST http://$PROVER_ADDRESS/inclusion" | vegeta attack -duration=$DURATION -rate $RATE -targets=$TARGETS_FILE | tee $BASE_OUTPUT_FILE.bin | vegeta report
vegeta report $BASE_OUTPUT_FILE.bin >> $BASE_OUTPUT_FILE.txt
vegeta report -type="hist[0,10ms,20ms,30ms,40ms,50ms,60ms,70ms,80ms,90ms,100ms,110ms,120ms,130ms,140ms,150ms,160ms,170ms,180ms,190ms,200ms]" $BASE_OUTPUT_FILE.bin >> $BASE_OUTPUT_FILE.txt
vegeta plot -title=Results $BASE_OUTPUT_FILE.bin > $BASE_OUTPUT_FILE.html
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/scripts/server.sh
|
# install goexec: go install github.com/shurcooL/goexec
goexec 'http.ListenAndServe(`:8080`, http.FileServer(http.Dir(`.`)))'
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/scripts/generate_keys.sh
|
#!/usr/bin/env bash
declare -a HEIGHTS=("40")
DEFAULT_HEIGHT="26"
PROVING_KEYS_DIR="./proving-keys"
VERIFIER_DIR="../circuit-lib/verifier/src/verifying_keys"
gnark() {
local args=("$@")
./light-prover "${args[@]}"
}
generate_circuit() {
local circuit_type=$1
local height=$2
local batch_size=$3
local inclusion_compressed_accounts=$4
local non_inclusion_compressed_accounts=$5
local compressed_accounts
local circuit_type_rs
if [ "$circuit_type" == "append-with-subtrees" ]; then
compressed_accounts=$batch_size
circuit_type_rs="append_with_subtrees"
elif [ "$circuit_type" == "append-with-proofs" ]; then
compressed_accounts=$batch_size
circuit_type_rs="append_with_proofs"
elif [ "$circuit_type" == "update" ]; then
compressed_accounts=$batch_size
circuit_type_rs="update"
elif [ "$circuit_type" == "address-append" ]; then
compressed_accounts=$batch_size
circuit_type_rs="address_append"
elif [ "$circuit_type" == "inclusion" ]; then
compressed_accounts=$inclusion_compressed_accounts
circuit_type_rs="inclusion"
elif [ "$circuit_type" == "non-inclusion" ]; then
compressed_accounts=$non_inclusion_compressed_accounts
circuit_type_rs="non_inclusion"
else
compressed_accounts="${inclusion_compressed_accounts}_${non_inclusion_compressed_accounts}"
circuit_type_rs="combined"
fi
local circuit_file="${PROVING_KEYS_DIR}/${circuit_type}_${height}_${compressed_accounts}.key"
local circuit_vkey_file="${PROVING_KEYS_DIR}/${circuit_type}_${height}_${compressed_accounts}.vkey"
local circuit_vkey_rs_file="${VERIFIER_DIR}/${circuit_type_rs}_${height}_${compressed_accounts}.rs"
echo "Generating ${circuit_type} circuit for ${compressed_accounts} COMPRESSED_ACCOUNTS with height ${height}..."
# Fixed variable references for batch sizes
gnark setup \
--circuit "${circuit_type}" \
--inclusion-compressed-accounts "$inclusion_compressed_accounts" \
--non-inclusion-compressed-accounts "$non_inclusion_compressed_accounts" \
--inclusion-tree-height "$height" \
--non-inclusion-tree-height "$height" \
--append-batch-size "${batch_size}" \
--append-tree-height "$height" \
--update-batch-size "${batch_size}" \
--update-tree-height "$height" \
--address-append-batch-size "${batch_size}" \
--address-append-tree-height "$height" \
--output "${circuit_file}" \
--output-vkey "${circuit_vkey_file}" || { echo "Error: gnark setup failed"; exit 1; }
cargo xtask generate-vkey-rs --input-path "${circuit_vkey_file}" --output-path "${circuit_vkey_rs_file}" || { echo "Error: cargo xtask generate-vkey-rs failed"; exit 1; }
}
main() {
declare -a append_batch_sizes_arr=("1" "10" "100" "250" "500" "1000")
echo "Generating proving keys..."
for height in "${HEIGHTS[@]}"; do
for batch_size in "${append_batch_sizes_arr[@]}"; do
echo "Generating address-append circuit for ${batch_size} COMPRESSED_ACCOUNTS with height ${height}..."
generate_circuit "address-append" "$height" "$batch_size" "0" "0"
done
done
for batch_size in "${append_batch_sizes_arr[@]}"; do
generate_circuit "append-with-proofs" "$DEFAULT_HEIGHT" "$batch_size" "0" "0"
done
declare -a append_batch_sizes_arr=("1" "10" "100" "500" "1000")
for batch_size in "${append_batch_sizes_arr[@]}"; do
generate_circuit "append-with-subtrees" "$DEFAULT_HEIGHT" "$batch_size" "0" "0"
done
declare -a update_batch_sizes_arr=("1" "10" "100" "500" "1000")
for batch_size in "${update_batch_sizes_arr[@]}"; do
generate_circuit "update" "$DEFAULT_HEIGHT" "$batch_size" "0" "0"
done
declare -a inclusion_compressed_accounts_arr=("1" "2" "3" "4" "8")
for compressed_accounts in "${inclusion_compressed_accounts_arr[@]}"; do
generate_circuit "inclusion" "$DEFAULT_HEIGHT" "0" "$compressed_accounts" "0"
done
declare -a non_inclusion_compressed_accounts_arr=("1" "2")
for compressed_accounts in "${non_inclusion_compressed_accounts_arr[@]}"; do
generate_circuit "non-inclusion" "$DEFAULT_HEIGHT" "0" "$compressed_accounts"
done
declare -a combined_inclusion_compressed_accounts_arr=("1" "2" "3" "4")
declare -a combined_non_inclusion_compressed_accounts_arr=("1" "2")
for i_compressed_accounts in "${combined_inclusion_compressed_accounts_arr[@]}"; do
for ni_compressed_accounts in "${combined_non_inclusion_compressed_accounts_arr[@]}"; do
generate_circuit "combined" "$DEFAULT_HEIGHT" "0" "$i_compressed_accounts" "$ni_compressed_accounts"
done
done
echo "Done."
}
main "$@"
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/scripts/rate_detection.sh
|
#!/usr/bin/env bash
PROVER_ADDRESS="localhost:3001"
DURATION="5s"
TARGETS_FILE="targets.txt"
MEAN_TIME_THRESHOLD=150 # in milliseconds
# Initial settings
rate=10 # Start with 10 requests per second
step=5 # Increment rate by 5 in each iteration
while true; do
BASE_OUTPUT_FILE="results_${DURATION}"
rm -f ${BASE_OUTPUT_FILE}*
echo "POST http://$PROVER_ADDRESS/inclusion" | vegeta attack -duration=$DURATION -rate "${rate}/1s" -targets=$TARGETS_FILE | tee $BASE_OUTPUT_FILE.bin | vegeta report
mean_time=$(vegeta report $BASE_OUTPUT_FILE.bin | grep 'min, mean' | awk '{print $10}' | sed 's/ms,//')
if (( $(echo "$mean_time > $MEAN_TIME_THRESHOLD" | bc -l) )); then
# Threshold exceeded, reduce the rate
rate=$((rate - step))
break # Exit the loop, we found an approximation
else
# Increase the rate
rate=$((rate + step))
fi
done
echo "Maximum sustainable rate (approx.): $rate requests/seconds"
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/batch_update_circuit_test.go
|
package prover
import (
"fmt"
merkletree "light/light-prover/merkle-tree"
"math/big"
"testing"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/test"
)
func TestBatchUpdateCircuit(t *testing.T) {
assert := test.NewAssert(t)
t.Run("Valid batch update - full HashchainHash", func(t *testing.T) {
treeDepth := 10
batchSize := 2
params := BuildTestBatchUpdateTree(treeDepth, batchSize, nil, nil)
circuit := BatchUpdateCircuit{
PublicInputHash: frontend.Variable(0),
OldRoot: frontend.Variable(0),
NewRoot: frontend.Variable(0),
LeavesHashchainHash: frontend.Variable(0),
TxHashes: make([]frontend.Variable, batchSize),
Leaves: make([]frontend.Variable, batchSize),
OldLeaves: make([]frontend.Variable, batchSize),
PathIndices: make([]frontend.Variable, batchSize),
MerkleProofs: make([][]frontend.Variable, batchSize),
Height: uint32(treeDepth),
BatchSize: uint32(batchSize),
}
for i := range circuit.MerkleProofs {
circuit.MerkleProofs[i] = make([]frontend.Variable, treeDepth)
}
witness := BatchUpdateCircuit{
PublicInputHash: frontend.Variable(params.PublicInputHash),
OldRoot: frontend.Variable(params.OldRoot),
NewRoot: frontend.Variable(params.NewRoot),
LeavesHashchainHash: frontend.Variable(params.LeavesHashchainHash),
TxHashes: make([]frontend.Variable, batchSize),
Leaves: make([]frontend.Variable, batchSize),
OldLeaves: make([]frontend.Variable, batchSize),
MerkleProofs: make([][]frontend.Variable, batchSize),
PathIndices: make([]frontend.Variable, batchSize),
Height: uint32(treeDepth),
BatchSize: uint32(batchSize),
}
for i := 0; i < batchSize; i++ {
witness.Leaves[i] = frontend.Variable(params.Leaves[i])
witness.OldLeaves[i] = frontend.Variable(params.OldLeaves[i])
witness.TxHashes[i] = frontend.Variable(params.TxHashes[i])
witness.PathIndices[i] = frontend.Variable(params.PathIndices[i])
witness.MerkleProofs[i] = make([]frontend.Variable, treeDepth)
for j := 0; j < treeDepth; j++ {
witness.MerkleProofs[i][j] = frontend.Variable(params.MerkleProofs[i][j])
}
}
err := test.IsSolved(&circuit, &witness, ecc.BN254.ScalarField())
assert.NoError(err)
})
t.Run("Fill up tree completely", func(t *testing.T) {
treeDepth := 8
batchSize := 4
totalLeaves := 1 << treeDepth
fmt.Println("totalLeaves", totalLeaves)
var tree = merkletree.NewTree(int(treeDepth))
for i := 0; i < totalLeaves/batchSize; i++ {
startIndex := uint32(i * batchSize)
params := BuildTestBatchUpdateTree(treeDepth, batchSize, &tree, &startIndex)
circuit := createBatchUpdateCircuit(treeDepth, batchSize)
witness := createBatchUpdateWitness(params, 0, batchSize)
err := test.IsSolved(&circuit, &witness, ecc.BN254.ScalarField())
assert.NoError(err)
tree = *params.Tree.DeepCopy()
}
})
t.Run("Different tree depths and batch sizes", func(t *testing.T) {
testCases := []struct {
treeDepth int
batchSize int
}{
{4, 1},
{10, 100},
{26, 10},
}
for _, tc := range testCases {
t.Run(fmt.Sprintf("Depth:%d_Batch:%d", tc.treeDepth, tc.batchSize), func(t *testing.T) {
params := BuildTestBatchUpdateTree(tc.treeDepth, tc.batchSize, nil, nil)
circuit := createBatchUpdateCircuit(tc.treeDepth, tc.batchSize)
witness := createBatchUpdateWitness(params, 0, tc.batchSize)
err := test.IsSolved(&circuit, &witness, ecc.BN254.ScalarField())
assert.NoError(err)
})
}
})
t.Run("Invalid NewRoot", func(t *testing.T) {
treeDepth := 10
batchSize := 5
params := BuildTestBatchUpdateTree(treeDepth, batchSize, nil, nil)
circuit := createBatchUpdateCircuit(treeDepth, batchSize)
witness := createBatchUpdateWitness(params, 0, batchSize)
// Modify NewRoot to make it invalid
witness.NewRoot = frontend.Variable(new(big.Int).Add(params.NewRoot, big.NewInt(1)))
err := test.IsSolved(&circuit, &witness, ecc.BN254.ScalarField())
assert.Error(err)
})
t.Run("Invalid LeavesHashchainHash", func(t *testing.T) {
treeDepth := 10
batchSize := 5
params := BuildTestBatchUpdateTree(treeDepth, batchSize, nil, nil)
circuit := createBatchUpdateCircuit(treeDepth, batchSize)
witness := createBatchUpdateWitness(params, 0, batchSize)
// Modify LeavesHashchainHash to make it invalid
witness.LeavesHashchainHash = frontend.Variable(new(big.Int).Add(params.LeavesHashchainHash, big.NewInt(1)))
err := test.IsSolved(&circuit, &witness, ecc.BN254.ScalarField())
assert.Error(err)
})
t.Run("Invalid leaf", func(t *testing.T) {
treeDepth := 10
batchSize := 5
params := BuildTestBatchUpdateTree(treeDepth, batchSize, nil, nil)
circuit := createBatchUpdateCircuit(treeDepth, batchSize)
witness := createBatchUpdateWitness(params, 0, batchSize)
// Modify one leaf to make it invalid
witness.Leaves[0] = frontend.Variable(new(big.Int).Add(params.Leaves[0], big.NewInt(1)))
err := test.IsSolved(&circuit, &witness, ecc.BN254.ScalarField())
assert.Error(err)
})
t.Run("Invalid order of leaves", func(t *testing.T) {
treeDepth := 10
batchSize := 5
params := BuildTestBatchUpdateTree(treeDepth, batchSize, nil, nil)
circuit := createBatchUpdateCircuit(treeDepth, batchSize)
witness := createBatchUpdateWitness(params, 0, batchSize)
// Swap two leaves to create an invalid order
witness.Leaves[0], witness.Leaves[1] = witness.Leaves[1], witness.Leaves[0]
err := test.IsSolved(&circuit, &witness, ecc.BN254.ScalarField())
assert.Error(err)
})
t.Run("Invalid tx hash", func(t *testing.T) {
treeDepth := 10
batchSize := 5
params := BuildTestBatchUpdateTree(treeDepth, batchSize, nil, nil)
circuit := createBatchUpdateCircuit(treeDepth, batchSize)
witness := createBatchUpdateWitness(params, 0, batchSize)
// Swap two tx hashes to create an invalid order
witness.TxHashes[0], witness.TxHashes[1] = witness.TxHashes[1], witness.TxHashes[0]
err := test.IsSolved(&circuit, &witness, ecc.BN254.ScalarField())
assert.Error(err)
})
}
func createBatchUpdateCircuit(treeDepth, batchSize int) BatchUpdateCircuit {
circuit := BatchUpdateCircuit{
PublicInputHash: frontend.Variable(0),
OldRoot: frontend.Variable(0),
NewRoot: frontend.Variable(0),
LeavesHashchainHash: frontend.Variable(0),
TxHashes: make([]frontend.Variable, batchSize),
Leaves: make([]frontend.Variable, batchSize),
OldLeaves: make([]frontend.Variable, batchSize),
MerkleProofs: make([][]frontend.Variable, batchSize),
PathIndices: make([]frontend.Variable, batchSize),
Height: uint32(treeDepth),
BatchSize: uint32(batchSize),
}
for i := range circuit.MerkleProofs {
circuit.MerkleProofs[i] = make([]frontend.Variable, treeDepth)
}
return circuit
}
func createBatchUpdateWitness(params *BatchUpdateParameters, startIndex, count int) BatchUpdateCircuit {
witness := BatchUpdateCircuit{
PublicInputHash: frontend.Variable(params.PublicInputHash),
OldRoot: frontend.Variable(params.OldRoot),
NewRoot: frontend.Variable(params.NewRoot),
LeavesHashchainHash: frontend.Variable(params.LeavesHashchainHash),
TxHashes: make([]frontend.Variable, count),
Leaves: make([]frontend.Variable, count),
OldLeaves: make([]frontend.Variable, count),
MerkleProofs: make([][]frontend.Variable, count),
PathIndices: make([]frontend.Variable, count),
Height: params.Height,
BatchSize: uint32(count),
}
for i := 0; i < count; i++ {
witness.TxHashes[i] = frontend.Variable(params.TxHashes[i])
witness.Leaves[i] = frontend.Variable(params.Leaves[i])
witness.OldLeaves[i] = frontend.Variable(params.OldLeaves[i])
witness.PathIndices[i] = frontend.Variable(params.PathIndices[i])
witness.MerkleProofs[i] = make([]frontend.Variable, int(params.Height))
for j := 0; j < int(params.Height); j++ {
witness.MerkleProofs[i][j] = frontend.Variable(params.MerkleProofs[i][j])
}
}
return witness
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/non_inclusion_test.go
|
package prover
import (
"bufio"
"encoding/json"
"fmt"
"os"
"strings"
"testing"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/test"
)
// Iterate over data from csv file "inclusion_test_data.tsv", which contains test data for the inclusion proof.
// The file has two columns, separated by a semicolon.
// First column is the expected result, second column is the input.
// For each row, run the test with the input and check if the result is as expected.
func TestNonInclusion(t *testing.T) {
assert := test.NewAssert(t)
file, err := os.Open("../test-data/non_inclusion.csv")
defer file.Close()
assert.Nil(err, "Error opening file: ", err)
scanner := bufio.NewScanner(file)
for scanner.Scan() {
line := scanner.Text()
if line == "" {
continue
}
splitLine := strings.Split(line, ";")
assert.Equal(len(splitLine), 2, "Invalid line: ", line)
var params NonInclusionParameters
err := json.Unmarshal([]byte(splitLine[1]), ¶ms)
assert.Nil(err, "Error unmarshalling inputs: ", err)
var numberOfCompressedAccounts = params.NumberOfCompressedAccounts()
var treeHeight = params.TreeHeight()
roots := make([]frontend.Variable, numberOfCompressedAccounts)
values := make([]frontend.Variable, numberOfCompressedAccounts)
leafLowerRangeValues := make([]frontend.Variable, numberOfCompressedAccounts)
leafHigherRangeValues := make([]frontend.Variable, numberOfCompressedAccounts)
leafIndices := make([]frontend.Variable, numberOfCompressedAccounts)
inPathIndices := make([]frontend.Variable, numberOfCompressedAccounts)
inPathElements := make([][]frontend.Variable, numberOfCompressedAccounts)
for i := 0; i < int(numberOfCompressedAccounts); i++ {
inPathElements[i] = make([]frontend.Variable, treeHeight)
}
for i, v := range params.Inputs {
roots[i] = v.Root
values[i] = v.Value
leafLowerRangeValues[i] = v.LeafLowerRangeValue
leafHigherRangeValues[i] = v.LeafHigherRangeValue
leafIndices[i] = v.NextIndex
inPathIndices[i] = v.PathIndex
for j, v2 := range v.PathElements {
inPathElements[i][j] = v2
}
}
var circuit NonInclusionCircuit
circuit.Roots = make([]frontend.Variable, numberOfCompressedAccounts)
circuit.Values = make([]frontend.Variable, numberOfCompressedAccounts)
circuit.LeafLowerRangeValues = make([]frontend.Variable, numberOfCompressedAccounts)
circuit.LeafHigherRangeValues = make([]frontend.Variable, numberOfCompressedAccounts)
circuit.NextIndices = make([]frontend.Variable, numberOfCompressedAccounts)
circuit.InPathIndices = make([]frontend.Variable, numberOfCompressedAccounts)
circuit.InPathElements = make([][]frontend.Variable, numberOfCompressedAccounts)
for i := 0; i < int(numberOfCompressedAccounts); i++ {
circuit.InPathElements[i] = make([]frontend.Variable, treeHeight)
}
circuit.NumberOfCompressedAccounts = numberOfCompressedAccounts
circuit.Height = treeHeight
// Check if the expected result is "true" or "false"
expectedResult := splitLine[0]
if expectedResult == "0" {
// Run the failing test
assert.ProverFailed(&circuit, &NonInclusionCircuit{
Roots: roots,
Values: values,
LeafLowerRangeValues: leafLowerRangeValues,
LeafHigherRangeValues: leafHigherRangeValues,
NextIndices: leafIndices,
InPathIndices: inPathIndices,
InPathElements: inPathElements,
NumberOfCompressedAccounts: numberOfCompressedAccounts,
Height: treeHeight,
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254), test.NoSerialization())
} else if expectedResult == "1" {
// Run the passing test
assert.ProverSucceeded(&circuit, &NonInclusionCircuit{
Roots: roots,
Values: values,
LeafLowerRangeValues: leafLowerRangeValues,
LeafHigherRangeValues: leafHigherRangeValues,
NextIndices: leafIndices,
InPathIndices: inPathIndices,
InPathElements: inPathElements,
NumberOfCompressedAccounts: numberOfCompressedAccounts,
Height: treeHeight,
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254), test.NoSerialization())
} else {
fmt.Println("Invalid expected result: ", expectedResult)
}
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/leaf_hash_gadget_test.go
|
package prover
import (
"math/big"
"testing"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/test"
)
type LeafHashGadgetCircuit struct {
LeafLowerRangeValue frontend.Variable `gnark:"private"`
LeafHigherRangeValue frontend.Variable `gnark:"private"`
Value frontend.Variable `gnark:"private"`
NextIndex frontend.Variable `gnark:"private"`
ExpectedHash frontend.Variable `gnark:"public"`
}
func (circuit *LeafHashGadgetCircuit) Define(api frontend.API) error {
input := LeafHashGadget{
LeafLowerRangeValue: circuit.LeafLowerRangeValue,
LeafHigherRangeValue: circuit.LeafHigherRangeValue,
Value: circuit.Value,
NextIndex: circuit.NextIndex,
}
output := LeafHashGadget(input).DefineGadget(api)
api.AssertIsEqual(circuit.ExpectedHash, output)
return nil
}
func TestLeafGadget(t *testing.T) {
// Test cases
leafHigherRangeValueStr := "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
nextIndexStr := 1
valueStr := "277f5629fdf020bb57ecbf7024ba4a9c26b9de1cda2ca25bfd3dc94275996e"
leafLowerRangeValue := big.NewInt(0)
leafHigherRangeValue := new(big.Int)
leafHigherRangeValue.SetString(leafHigherRangeValueStr, 16)
nextIndex := big.NewInt(int64(nextIndexStr))
value := big.NewInt(0)
value.SetString(valueStr, 16)
ExpectedHashStr := "18107977475760319057966144103673937810858686565134338371146286848755066863726"
ExpectedHash := new(big.Int)
ExpectedHash.SetString(ExpectedHashStr, 10)
invalid_value := new(big.Int)
invalid_value.SetString("18107977475760319057966144103673937810858686565134338371146286848755066863725", 10)
testCases := []struct {
LeafLowerRangeValue *big.Int
LeafHigherRangeValue *big.Int
Value *big.Int
NextIndex *big.Int
ExpectedHash *big.Int
expected bool
}{
{
leafLowerRangeValue,
leafHigherRangeValue,
value,
nextIndex,
ExpectedHash,
true,
},
{
leafLowerRangeValue,
leafHigherRangeValue,
value,
nextIndex,
invalid_value,
false,
},
}
for _, tc := range testCases {
var circuit LeafHashGadgetCircuit
if tc.expected {
assert := test.NewAssert(t)
assert.ProverSucceeded(&circuit, &LeafHashGadgetCircuit{
LeafLowerRangeValue: tc.LeafLowerRangeValue,
LeafHigherRangeValue: tc.LeafHigherRangeValue,
Value: tc.Value,
NextIndex: tc.NextIndex,
ExpectedHash: tc.ExpectedHash,
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254), test.NoSerialization())
} else {
assert := test.NewAssert(t)
assert.ProverFailed(&circuit, &LeafHashGadgetCircuit{
LeafLowerRangeValue: tc.LeafLowerRangeValue,
LeafHigherRangeValue: tc.LeafHigherRangeValue,
Value: tc.Value,
NextIndex: tc.NextIndex,
ExpectedHash: tc.ExpectedHash,
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254), test.NoSerialization())
}
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/marshal_batch_append_with_subtrees.go
|
package prover
import (
"encoding/json"
"fmt"
"math/big"
)
type BatchAppendWithSubtreesParametersJSON struct {
PublicInputHash string `json:"publicInputHash"`
OldSubTreeHashChain string `json:"oldSubTreeHashChain"`
NewSubTreeHashChain string `json:"newSubTreeHashChain"`
NewRoot string `json:"newRoot"`
HashchainHash string `json:"hashchainHash"`
StartIndex uint32 `json:"startIndex"`
Leaves []string `json:"leaves"`
Subtrees []string `json:"subtrees"`
TreeHeight uint32 `json:"treeHeight"`
}
func ParseBatchAppendInput(inputJSON string) (BatchAppendWithSubtreesParameters, error) {
var proofData BatchAppendWithSubtreesParameters
err := json.Unmarshal([]byte(inputJSON), &proofData)
if err != nil {
return BatchAppendWithSubtreesParameters{}, fmt.Errorf("error parsing JSON: %v", err)
}
return proofData, nil
}
func (p *BatchAppendWithSubtreesParameters) MarshalJSON() ([]byte, error) {
paramsJson := p.CreateBatchAppendWithSubtreesParametersJSON()
return json.Marshal(paramsJson)
}
func (p *BatchAppendWithSubtreesParameters) CreateBatchAppendWithSubtreesParametersJSON() BatchAppendWithSubtreesParametersJSON {
paramsJson := BatchAppendWithSubtreesParametersJSON{
PublicInputHash: toHex(p.PublicInputHash),
OldSubTreeHashChain: toHex(p.OldSubTreeHashChain),
NewSubTreeHashChain: toHex(p.NewSubTreeHashChain),
NewRoot: toHex(p.NewRoot),
HashchainHash: toHex(p.HashchainHash),
StartIndex: p.StartIndex,
TreeHeight: p.TreeHeight,
}
paramsJson.Leaves = make([]string, len(p.Leaves))
for i, leaf := range p.Leaves {
paramsJson.Leaves[i] = toHex(leaf)
}
paramsJson.Subtrees = make([]string, len(p.Subtrees))
for i, subtree := range p.Subtrees {
paramsJson.Subtrees[i] = toHex(subtree)
}
return paramsJson
}
func (p *BatchAppendWithSubtreesParameters) UnmarshalJSON(data []byte) error {
var params BatchAppendWithSubtreesParametersJSON
err := json.Unmarshal(data, ¶ms)
if err != nil {
return err
}
return p.UpdateWithJSON(params)
}
func (p *BatchAppendWithSubtreesParameters) UpdateWithJSON(params BatchAppendWithSubtreesParametersJSON) error {
var err error
p.TreeHeight = params.TreeHeight
p.PublicInputHash = new(big.Int)
err = fromHex(p.PublicInputHash, params.PublicInputHash)
if err != nil {
return err
}
p.OldSubTreeHashChain = new(big.Int)
err = fromHex(p.OldSubTreeHashChain, params.OldSubTreeHashChain)
if err != nil {
return err
}
p.NewSubTreeHashChain = new(big.Int)
err = fromHex(p.NewSubTreeHashChain, params.NewSubTreeHashChain)
if err != nil {
return err
}
p.NewRoot = new(big.Int)
err = fromHex(p.NewRoot, params.NewRoot)
if err != nil {
return err
}
p.HashchainHash = new(big.Int)
err = fromHex(p.HashchainHash, params.HashchainHash)
if err != nil {
return err
}
p.StartIndex = params.StartIndex
p.Leaves = make([]*big.Int, len(params.Leaves))
for i, leafStr := range params.Leaves {
p.Leaves[i] = new(big.Int)
err = fromHex(p.Leaves[i], leafStr)
if err != nil {
return err
}
}
p.Subtrees = make([]*big.Int, len(params.Subtrees))
for i, subtreeStr := range params.Subtrees {
p.Subtrees[i] = new(big.Int)
err = fromHex(p.Subtrees[i], subtreeStr)
if err != nil {
return err
}
}
return nil
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/test_data_helpers.go
|
package prover
import (
"fmt"
merkletree "light/light-prover/merkle-tree"
"math/big"
"math/rand"
"github.com/iden3/go-iden3-crypto/poseidon"
)
func rangeIn(low, hi int) int {
return low + rand.Intn(hi-low)
}
func BuildTestTree(depth int, numberOfCompressedAccounts int, random bool) InclusionParameters {
tree := merkletree.NewTree(depth)
var leaf *big.Int
var pathIndex int
if random {
leaf, _ = poseidon.Hash([]*big.Int{big.NewInt(rand.Int63())})
pathIndex = rand.Intn(depth)
} else {
leaf, _ = poseidon.Hash([]*big.Int{big.NewInt(1)})
pathIndex = 0
}
var inputs = make([]InclusionInputs, numberOfCompressedAccounts)
for i := 0; i < numberOfCompressedAccounts; i++ {
inputs[i].Leaf = *leaf
inputs[i].PathIndex = uint32(pathIndex)
inputs[i].PathElements = tree.Update(pathIndex, *leaf)
inputs[i].Root = tree.Root.Value()
}
return InclusionParameters{
Inputs: inputs,
}
}
func BuildValidTestNonInclusionTree(depth int, numberOfCompressedAccounts int, random bool) NonInclusionParameters {
return BuildTestNonInclusionTree(depth, numberOfCompressedAccounts, random, true, false)
}
func BuildTestNonInclusionTree(depth int, numberOfCompressedAccounts int, random bool, valid bool, lowValue bool) NonInclusionParameters {
tree := merkletree.NewTree(depth)
var inputs = make([]NonInclusionInputs, numberOfCompressedAccounts)
for i := 0; i < numberOfCompressedAccounts; i++ {
var value = big.NewInt(0)
var leafLower = big.NewInt(0)
var leafUpper = big.NewInt(2)
var pathIndex int
var nextIndex int
if random {
leafLower = big.NewInt(int64(rangeIn(0, 1000)))
leafUpper.Add(leafUpper, leafLower)
numberOfLeaves := 1 << depth
nextIndex = rand.Intn(numberOfLeaves)
if valid {
value.Add(leafLower, big.NewInt(1))
} else {
if lowValue {
value.Sub(leafLower, big.NewInt(1))
} else {
value.Add(leafUpper, big.NewInt(1))
}
}
pathIndex = rand.Intn(depth)
} else {
leafLower = big.NewInt(1)
leafUpper = big.NewInt(123)
nextIndex = 1
if valid {
value = big.NewInt(2)
} else {
value = big.NewInt(4)
}
pathIndex = 0
}
leaf, err := poseidon.Hash([]*big.Int{leafLower, big.NewInt(int64(nextIndex)), leafUpper})
if err != nil {
fmt.Println("error: ", err)
}
inputs[i].Value = *value
inputs[i].PathIndex = uint32(pathIndex)
inputs[i].PathElements = tree.Update(pathIndex, *leaf)
inputs[i].Root = tree.Root.Value()
inputs[i].LeafLowerRangeValue = *leafLower
inputs[i].LeafHigherRangeValue = *leafUpper
inputs[i].NextIndex = uint32(nextIndex)
}
return NonInclusionParameters{
Inputs: inputs,
}
}
func BuildAndUpdateBatchAppendWithSubtreesParameters(treeDepth uint32, batchSize uint32, startIndex uint32, previousParams *BatchAppendWithSubtreesParameters) BatchAppendWithSubtreesParameters {
var tree merkletree.PoseidonTree
var oldSubTreeHashChain *big.Int
var oldSubtrees []*big.Int
if previousParams == nil {
tree = merkletree.NewTree(int(treeDepth))
// Generate and insert initial leaves
for i := uint32(0); i < startIndex; i++ {
leaf, _ := poseidon.Hash([]*big.Int{big.NewInt(int64(i))})
tree.Update(int(i), *leaf)
}
oldSubtrees = tree.GetRightmostSubtrees(int(treeDepth))
oldSubTreeHashChain = calculateHashChain(oldSubtrees, int(treeDepth))
} else {
tree = *previousParams.tree.DeepCopy()
oldSubtrees = tree.GetRightmostSubtrees(int(treeDepth))
oldSubTreeHashChain = previousParams.NewSubTreeHashChain
}
// Generate new leaves for this batch
newLeaves := make([]*big.Int, batchSize)
for i := uint32(0); i < batchSize; i++ {
leaf, _ := poseidon.Hash([]*big.Int{big.NewInt(int64(startIndex + i))})
newLeaves[i] = leaf
tree.Update(int(startIndex)+int(i), *leaf)
}
newSubtrees := tree.GetRightmostSubtrees(int(treeDepth))
newSubTreeHashChain := calculateHashChain(newSubtrees, int(treeDepth))
newRoot := tree.Root.Value()
hashchainHash := calculateHashChain(newLeaves, int(batchSize))
publicInputHash := calculateHashChain([]*big.Int{
oldSubTreeHashChain,
newSubTreeHashChain,
&newRoot,
hashchainHash,
big.NewInt(int64(startIndex))},
5)
params := BatchAppendWithSubtreesParameters{
PublicInputHash: publicInputHash,
OldSubTreeHashChain: oldSubTreeHashChain,
NewSubTreeHashChain: newSubTreeHashChain,
NewRoot: &newRoot,
HashchainHash: hashchainHash,
StartIndex: startIndex,
Leaves: newLeaves,
Subtrees: oldSubtrees,
TreeHeight: treeDepth,
tree: &tree,
}
return params
}
func calculateHashChain(hashes []*big.Int, length int) *big.Int {
if len(hashes) == 0 {
return big.NewInt(0)
}
if len(hashes) == 1 {
return hashes[0]
}
hashChain := hashes[0]
for i := 1; i < length; i++ {
hashChain, _ = poseidon.Hash([]*big.Int{hashChain, hashes[i]})
}
return hashChain
}
func BuildTestBatchUpdateTree(treeDepth int, batchSize int, previousTree *merkletree.PoseidonTree, startIndex *uint32) *BatchUpdateParameters {
var tree merkletree.PoseidonTree
if previousTree == nil {
tree = merkletree.NewTree(treeDepth)
} else {
tree = *previousTree.DeepCopy()
}
leaves := make([]*big.Int, batchSize)
txHashes := make([]*big.Int, batchSize)
merkleProofs := make([][]big.Int, batchSize)
pathIndices := make([]uint32, batchSize)
oldLeaves := make([]*big.Int, batchSize)
usedIndices := make(map[uint32]bool)
for i := 0; i < batchSize; i++ {
leaf, _ := poseidon.Hash([]*big.Int{big.NewInt(int64(rand.Intn(1000000)))})
leaves[i] = leaf
if startIndex != nil {
// Sequential filling
pathIndices[i] = *startIndex + uint32(i)
} else {
// Random filling with uniqueness check
for {
index := uint32(rand.Intn(1 << uint(treeDepth)))
if !usedIndices[index] {
pathIndices[i] = index
usedIndices[index] = true
break
}
}
}
oldLeaf := big.NewInt(int64(0))
// TODO: add option for test data to test nullifying mixed inserted and
// uninserted leaves
// This sets the first leaf to 0 to test nullification
// of mixed inserted and uninserted leaves
if i == 0 {
oldLeaves[i] = oldLeaf
} else {
oldLeaves[i] = leaves[i]
}
tree.Update(int(pathIndices[i]), *oldLeaves[i])
}
oldRoot := tree.Root.Value()
nullifiers := make([]*big.Int, batchSize)
for i := 0; i < batchSize; i++ {
merkleProofs[i] = tree.GetProofByIndex(int(pathIndices[i]))
// mock tx hash (actual tx hash is the hash of all tx input and output
// hashes)
txHash, _ := poseidon.Hash([]*big.Int{big.NewInt(int64(rand.Intn(1000000)))})
nullifier, _ := poseidon.Hash([]*big.Int{leaves[i], big.NewInt(int64(pathIndices[i])), txHash})
txHashes[i] = txHash
nullifiers[i] = nullifier
tree.Update(int(pathIndices[i]), *nullifier)
}
leavesHashchainHash := calculateHashChain(nullifiers, batchSize)
newRoot := tree.Root.Value()
publicInputHash := calculateHashChain([]*big.Int{
&oldRoot,
&newRoot,
leavesHashchainHash},
3)
return &BatchUpdateParameters{
PublicInputHash: publicInputHash,
OldRoot: &oldRoot,
NewRoot: &newRoot,
LeavesHashchainHash: leavesHashchainHash,
TxHashes: txHashes,
OldLeaves: oldLeaves,
Leaves: leaves,
PathIndices: pathIndices,
MerkleProofs: merkleProofs,
Height: uint32(treeDepth),
BatchSize: uint32(batchSize),
Tree: &tree,
}
}
func BuildTestBatchAppendWithProofsTree(treeDepth int, batchSize int, previousTree *merkletree.PoseidonTree, startIndex int, enableRandom bool) *BatchAppendWithProofsParameters {
var tree merkletree.PoseidonTree
if previousTree == nil {
tree = merkletree.NewTree(treeDepth)
} else {
tree = *previousTree.DeepCopy()
}
leaves := make([]*big.Int, batchSize)
merkleProofs := make([][]big.Int, batchSize)
pathIndices := make([]uint32, batchSize)
oldLeaves := make([]*big.Int, batchSize)
usedIndices := make(map[uint32]bool)
for i := 0; i < batchSize; i++ {
leaf, _ := poseidon.Hash([]*big.Int{big.NewInt(int64(rand.Intn(1000000)))})
leaves[i] = leaf
// Sequential filling
pathIndices[i] = uint32(startIndex) + uint32(i)
// by default all old leaves are zero
oldLeaf := big.NewInt(int64(0))
oldLeaves[i] = oldLeaf
tree.Update(int(pathIndices[i]), *oldLeaves[i])
// If enabled add random already nullified leaves
if enableRandom && rand.Float32() < 0.5 {
// Random filling with uniqueness check
for {
index := uint32(rand.Intn(len(pathIndices)))
if !usedIndices[index] {
usedIndices[index] = true
leaf, _ := poseidon.Hash([]*big.Int{big.NewInt(int64(rand.Intn(1000000)))})
oldLeaves[i] = leaf
tree.Update(int(pathIndices[i]), *leaf)
break
}
}
}
}
oldRoot := tree.Root.Value()
for i := 0; i < batchSize; i++ {
merkleProofs[i] = tree.GetProofByIndex(int(pathIndices[i]))
// Only append if old leaf is zero
if oldLeaves[i].Cmp(big.NewInt(0)) == 0 {
tree.Update(int(pathIndices[i]), *leaves[i])
}
}
leavesHashchainHash := calculateHashChain(leaves, batchSize)
newRoot := tree.Root.Value()
publicInputHash := calculateHashChain([]*big.Int{
&oldRoot,
&newRoot,
leavesHashchainHash,
big.NewInt(int64(startIndex)),
},
4)
return &BatchAppendWithProofsParameters{
PublicInputHash: publicInputHash,
OldRoot: &oldRoot,
NewRoot: &newRoot,
LeavesHashchainHash: leavesHashchainHash,
OldLeaves: oldLeaves,
Leaves: leaves,
MerkleProofs: merkleProofs,
Height: uint32(treeDepth),
BatchSize: uint32(batchSize),
Tree: &tree,
StartIndex: uint32(startIndex),
}
}
func BuildTestAddressTree(treeHeight uint32, batchSize uint32, previousTree *merkletree.IndexedMerkleTree, startIndex uint32) (*BatchAddressAppendParameters, error) {
var tree *merkletree.IndexedMerkleTree
if previousTree == nil {
tree, _ = merkletree.NewIndexedMerkleTree(treeHeight)
err := tree.Init()
if err != nil {
return nil, fmt.Errorf("failed to initialize tree: %v", err)
}
} else {
tree = previousTree.DeepCopy()
}
params := &BatchAddressAppendParameters{
PublicInputHash: new(big.Int),
OldRoot: new(big.Int),
NewRoot: new(big.Int),
HashchainHash: new(big.Int),
StartIndex: startIndex,
TreeHeight: treeHeight,
BatchSize: batchSize,
Tree: tree,
LowElementValues: make([]big.Int, batchSize),
LowElementIndices: make([]big.Int, batchSize),
LowElementNextIndices: make([]big.Int, batchSize),
LowElementNextValues: make([]big.Int, batchSize),
NewElementValues: make([]big.Int, batchSize),
LowElementProofs: make([][]big.Int, batchSize),
NewElementProofs: make([][]big.Int, batchSize),
}
for i := uint32(0); i < batchSize; i++ {
params.LowElementProofs[i] = make([]big.Int, treeHeight)
params.NewElementProofs[i] = make([]big.Int, treeHeight)
}
oldRootValue := tree.Tree.Root.Value()
params.OldRoot = &oldRootValue
newValues := make([]*big.Int, batchSize)
for i := uint32(0); i < batchSize; i++ {
newValues[i] = new(big.Int).SetUint64(uint64(startIndex + i + 2))
lowElementIndex, _ := tree.IndexArray.FindLowElementIndex(newValues[i])
lowElement := tree.IndexArray.Get(lowElementIndex)
params.LowElementValues[i].Set(lowElement.Value)
params.LowElementIndices[i].SetUint64(uint64(lowElement.Index))
params.LowElementNextIndices[i].SetUint64(uint64(lowElement.NextIndex))
params.LowElementNextValues[i].Set(lowElement.NextValue)
params.NewElementValues[i].Set(newValues[i])
if proof, err := tree.GetProof(int(lowElement.Index)); err == nil {
params.LowElementProofs[i] = make([]big.Int, len(proof))
copy(params.LowElementProofs[i], proof)
} else {
return nil, fmt.Errorf("failed to get low element proof: %v", err)
}
newIndex := startIndex + i
if err := tree.Append(newValues[i]); err != nil {
return nil, fmt.Errorf("failed to append value: %v", err)
}
if proof, err := tree.GetProof(int(newIndex)); err == nil {
params.NewElementProofs[i] = make([]big.Int, len(proof))
copy(params.NewElementProofs[i], proof)
} else {
return nil, fmt.Errorf("failed to get new element proof: %v", err)
}
}
newRootValue := tree.Tree.Root.Value()
params.NewRoot = &newRootValue
params.HashchainHash = computeNewElementsHashChain(params.NewElementValues)
params.PublicInputHash = computePublicInputHash(params.OldRoot, params.NewRoot, params.HashchainHash, params.StartIndex)
return params, nil
}
func computeNewElementsHashChain(values []big.Int) *big.Int {
if len(values) == 0 {
return big.NewInt(0)
}
result := new(big.Int).Set(&values[0])
for i := 1; i < len(values); i++ {
hash, _ := poseidon.Hash([]*big.Int{result, &values[i]})
result = hash
}
return result
}
func computePublicInputHash(oldRoot *big.Int, newRoot *big.Int, hashchainHash *big.Int, startIndex uint32) *big.Int {
inputs := []*big.Int{
oldRoot,
newRoot,
hashchainHash,
big.NewInt(int64(startIndex)),
}
return calculateHashChain(inputs, 4)
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/is_less_test.go
|
package prover
import (
"github.com/reilabs/gnark-lean-extractor/v2/abstractor"
"math/big"
"testing"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/test"
)
type IsLessCircuit struct {
A frontend.Variable `gnark:"public"`
B frontend.Variable `gnark:"private"`
}
func (circuit *IsLessCircuit) Define(api frontend.API) error {
isLess := AssertIsLess{
A: circuit.A,
B: circuit.B,
N: 248,
}
abstractor.CallVoid(api, isLess)
return nil
}
func TestAssertIsLess(t *testing.T) {
fieldSizeStr := "21888242871839275222246405745257275088548364400416034343698204186575808495617"
fieldSizeSub1Str := "21888242871839275222246405745257275088548364400416034343698204186575808495616"
fieldSize := new(big.Int)
fieldSize.SetString(fieldSizeStr, 10)
fieldSizeSub1 := new(big.Int)
fieldSizeSub1.SetString(fieldSizeSub1Str, 10)
fieldSizeSub2 := new(big.Int).Sub(fieldSize, big.NewInt(2))
edgeValue249bit := new(big.Int).Lsh(big.NewInt(1), 248)
edgeValue248bit := new(big.Int).Sub(edgeValue249bit, big.NewInt(1))
edgeValue248bitSubOne := new(big.Int).Sub(edgeValue248bit, big.NewInt(1))
low_range := big.NewInt(0)
high_range := new(big.Int)
high_range.SetString("30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000000", 16)
value := new(big.Int)
value.SetString("69785880290080757662711965351793407854352282886293293941974851767353317742", 10)
// Test cases
testCases := []struct {
a *big.Int
b *big.Int
expected bool
}{
{big.NewInt(2), big.NewInt(5), true}, // 2 < 5
{big.NewInt(5), big.NewInt(2), false}, // 5 >= 2
{big.NewInt(3), big.NewInt(3), false}, // 3 == 3
{big.NewInt(0), big.NewInt(0), false}, // 0 == 0
{big.NewInt(1), big.NewInt(1), false}, // 1 == 1
{big.NewInt(0), big.NewInt(1), true}, // 0 < 1
{big.NewInt(100), big.NewInt(1000), true}, // 100 < 1000
{fieldSizeSub1, fieldSize, true}, // fieldSize - 1 < fieldSize
{fieldSize, fieldSizeSub1, false}, // fieldSize < fieldSize - 1
{fieldSize, fieldSizeSub2, false}, // fieldSize < fieldSize - 2
{edgeValue248bit, edgeValue249bit, true}, // 2^248 - 1 < 2^248
{edgeValue248bitSubOne, edgeValue248bit, true}, // 2^248 - 2 < 2^248 - 1
{low_range, value, true}, // 0 < value
{value, edgeValue248bit, true}, // value < high_range
}
for _, tc := range testCases {
var circuit IsLessCircuit
if tc.expected {
assert := test.NewAssert(t)
assert.ProverSucceeded(&circuit, &IsLessCircuit{
A: tc.a,
B: tc.b,
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254), test.NoSerialization())
} else {
assert := test.NewAssert(t)
assert.ProverFailed(&circuit, &IsLessCircuit{
A: tc.a,
B: tc.b,
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254), test.NoSerialization())
}
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/marshal.go
|
package prover
import (
"bytes"
"encoding/binary"
"encoding/json"
"fmt"
"io"
"math/big"
"os"
"strings"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend/groth16"
)
func fromHex(i *big.Int, s string) error {
s = strings.TrimPrefix(s, "0x")
_, ok := i.SetString(s, 16)
if !ok {
return fmt.Errorf("invalid number: %s", s)
}
return nil
}
func toHex(i *big.Int) string {
return fmt.Sprintf("0x%s", i.Text(16))
}
func fromDec(i *big.Int, s string) error {
_, ok := i.SetString(s, 10)
if !ok {
return fmt.Errorf("invalid number: %s", s)
}
return nil
}
func toDec(i *big.Int) string {
return fmt.Sprintf("%s", i.Text(10))
}
type ProofJSON struct {
Ar [2]string `json:"ar"`
Bs [2][2]string `json:"bs"`
Krs [2]string `json:"krs"`
}
func (p *Proof) MarshalJSON() ([]byte, error) {
const fpSize = 32
var buf bytes.Buffer
_, err := p.Proof.WriteRawTo(&buf)
if err != nil {
return nil, err
}
proofBytes := buf.Bytes()
proofJson := ProofJSON{}
proofHexNumbers := [8]string{}
for i := 0; i < 8; i++ {
proofHexNumbers[i] = toHex(new(big.Int).SetBytes(proofBytes[i*fpSize : (i+1)*fpSize]))
}
proofJson.Ar = [2]string{proofHexNumbers[0], proofHexNumbers[1]}
proofJson.Bs = [2][2]string{
{proofHexNumbers[2], proofHexNumbers[3]},
{proofHexNumbers[4], proofHexNumbers[5]},
}
proofJson.Krs = [2]string{proofHexNumbers[6], proofHexNumbers[7]}
return json.Marshal(proofJson)
}
func (p *Proof) UnmarshalJSON(data []byte) error {
var proofJson ProofJSON
err := json.Unmarshal(data, &proofJson)
if err != nil {
return err
}
proofHexNumbers := [8]string{
proofJson.Ar[0],
proofJson.Ar[1],
proofJson.Bs[0][0],
proofJson.Bs[0][1],
proofJson.Bs[1][0],
proofJson.Bs[1][1],
proofJson.Krs[0],
proofJson.Krs[1],
}
proofInts := [8]big.Int{}
for i := 0; i < 8; i++ {
err = fromHex(&proofInts[i], proofHexNumbers[i])
if err != nil {
return err
}
}
const fpSize = 32
proofBytes := make([]byte, 8*fpSize)
for i := 0; i < 8; i++ {
copy(proofBytes[i*fpSize:(i+1)*fpSize], proofInts[i].Bytes())
}
p.Proof = groth16.NewProof(ecc.BN254)
_, err = p.Proof.ReadFrom(bytes.NewReader(proofBytes))
if err != nil {
return err
}
return nil
}
func (ps *ProvingSystemV1) WriteTo(w io.Writer) (int64, error) {
var totalWritten int64 = 0
var intBuf [4]byte
fieldsToWrite := []uint32{
ps.InclusionTreeHeight,
ps.InclusionNumberOfCompressedAccounts,
ps.NonInclusionTreeHeight,
ps.NonInclusionNumberOfCompressedAccounts,
}
for _, field := range fieldsToWrite {
binary.BigEndian.PutUint32(intBuf[:], field)
written, err := w.Write(intBuf[:])
totalWritten += int64(written)
if err != nil {
return totalWritten, err
}
}
keyWritten, err := ps.ProvingKey.WriteTo(w)
totalWritten += keyWritten
if err != nil {
return totalWritten, err
}
keyWritten, err = ps.VerifyingKey.WriteTo(w)
totalWritten += keyWritten
if err != nil {
return totalWritten, err
}
keyWritten, err = ps.ConstraintSystem.WriteTo(w)
totalWritten += keyWritten
if err != nil {
return totalWritten, err
}
return totalWritten, nil
}
func (ps *ProvingSystemV1) UnsafeReadFrom(r io.Reader) (int64, error) {
var totalRead int64 = 0
var intBuf [4]byte
fieldsToRead := []*uint32{
&ps.InclusionTreeHeight,
&ps.InclusionNumberOfCompressedAccounts,
&ps.NonInclusionTreeHeight,
&ps.NonInclusionNumberOfCompressedAccounts,
}
for _, field := range fieldsToRead {
read, err := io.ReadFull(r, intBuf[:])
totalRead += int64(read)
if err != nil {
return totalRead, err
}
*field = binary.BigEndian.Uint32(intBuf[:])
}
ps.ProvingKey = groth16.NewProvingKey(ecc.BN254)
keyRead, err := ps.ProvingKey.UnsafeReadFrom(r)
totalRead += keyRead
if err != nil {
return totalRead, err
}
ps.VerifyingKey = groth16.NewVerifyingKey(ecc.BN254)
keyRead, err = ps.VerifyingKey.UnsafeReadFrom(r)
totalRead += keyRead
if err != nil {
return totalRead, err
}
ps.ConstraintSystem = groth16.NewCS(ecc.BN254)
keyRead, err = ps.ConstraintSystem.ReadFrom(r)
totalRead += keyRead
if err != nil {
return totalRead, err
}
return totalRead, nil
}
func ReadSystemFromFile(path string) (interface{}, error) {
if strings.Contains(strings.ToLower(path), "append-with-proofs") {
ps := new(ProvingSystemV2)
ps.CircuitType = BatchAppendWithProofsCircuitType
file, err := os.Open(path)
if err != nil {
return nil, err
}
defer file.Close()
_, err = ps.UnsafeReadFrom(file)
if err != nil {
return nil, err
}
return ps, nil
} else if strings.Contains(strings.ToLower(path), "append-with-subtrees") {
ps := new(ProvingSystemV2)
ps.CircuitType = BatchAppendWithSubtreesCircuitType
file, err := os.Open(path)
if err != nil {
return nil, err
}
defer file.Close()
_, err = ps.UnsafeReadFrom(file)
if err != nil {
return nil, err
}
return ps, nil
} else if strings.Contains(strings.ToLower(path), "update") {
ps := new(ProvingSystemV2)
ps.CircuitType = BatchUpdateCircuitType
file, err := os.Open(path)
if err != nil {
return nil, err
}
defer file.Close()
_, err = ps.UnsafeReadFrom(file)
if err != nil {
return nil, err
}
return ps, nil
} else if strings.Contains(strings.ToLower(path), "address-append") {
ps := new(ProvingSystemV2)
ps.CircuitType = BatchAddressAppendCircuitType
file, err := os.Open(path)
if err != nil {
return nil, err
}
defer file.Close()
_, err = ps.UnsafeReadFrom(file)
if err != nil {
return nil, err
}
return ps, nil
} else {
ps := new(ProvingSystemV1)
file, err := os.Open(path)
if err != nil {
return nil, err
}
defer file.Close()
_, err = ps.UnsafeReadFrom(file)
if err != nil {
return nil, err
}
return ps, nil
}
}
func (ps *ProvingSystemV2) WriteTo(w io.Writer) (int64, error) {
var totalWritten int64 = 0
var intBuf [4]byte
fieldsToWrite := []uint32{
ps.TreeHeight,
ps.BatchSize,
}
for _, field := range fieldsToWrite {
binary.BigEndian.PutUint32(intBuf[:], field)
written, err := w.Write(intBuf[:])
totalWritten += int64(written)
if err != nil {
return totalWritten, err
}
}
keyWritten, err := ps.ProvingKey.WriteTo(w)
totalWritten += keyWritten
if err != nil {
return totalWritten, err
}
keyWritten, err = ps.VerifyingKey.WriteTo(w)
totalWritten += keyWritten
if err != nil {
return totalWritten, err
}
keyWritten, err = ps.ConstraintSystem.WriteTo(w)
totalWritten += keyWritten
if err != nil {
return totalWritten, err
}
return totalWritten, nil
}
func (ps *ProvingSystemV2) UnsafeReadFrom(r io.Reader) (int64, error) {
var totalRead int64 = 0
var intBuf [4]byte
fieldsToRead := []*uint32{
&ps.TreeHeight,
&ps.BatchSize,
}
for _, field := range fieldsToRead {
read, err := io.ReadFull(r, intBuf[:])
totalRead += int64(read)
if err != nil {
return totalRead, err
}
*field = binary.BigEndian.Uint32(intBuf[:])
}
ps.ProvingKey = groth16.NewProvingKey(ecc.BN254)
keyRead, err := ps.ProvingKey.UnsafeReadFrom(r)
totalRead += keyRead
if err != nil {
return totalRead, err
}
ps.VerifyingKey = groth16.NewVerifyingKey(ecc.BN254)
keyRead, err = ps.VerifyingKey.UnsafeReadFrom(r)
totalRead += keyRead
if err != nil {
return totalRead, err
}
ps.ConstraintSystem = groth16.NewCS(ecc.BN254)
keyRead, err = ps.ConstraintSystem.ReadFrom(r)
totalRead += keyRead
if err != nil {
return totalRead, err
}
return totalRead, nil
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/batch_update_circuit.go
|
package prover
import (
"fmt"
merkle_tree "light/light-prover/merkle-tree"
"light/light-prover/prover/poseidon"
"math/big"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend/groth16"
"github.com/consensys/gnark/constraint"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/frontend/cs/r1cs"
"github.com/reilabs/gnark-lean-extractor/v2/abstractor"
)
type BatchUpdateCircuit struct {
PublicInputHash frontend.Variable `gnark:",public"`
OldRoot frontend.Variable `gnark:",private"`
NewRoot frontend.Variable `gnark:",private"`
LeavesHashchainHash frontend.Variable `gnark:",private"`
TxHashes []frontend.Variable `gnark:"private"`
Leaves []frontend.Variable `gnark:"private"`
OldLeaves []frontend.Variable `gnark:"private"`
MerkleProofs [][]frontend.Variable `gnark:"private"`
PathIndices []frontend.Variable `gnark:"private"`
Height uint32
BatchSize uint32
}
func (circuit *BatchUpdateCircuit) Define(api frontend.API) error {
hashChainInputs := make([]frontend.Variable, int(3))
hashChainInputs[0] = circuit.OldRoot
hashChainInputs[1] = circuit.NewRoot
hashChainInputs[2] = circuit.LeavesHashchainHash
publicInputsHashChain := createHashChain(api, hashChainInputs)
api.AssertIsEqual(publicInputsHashChain, circuit.PublicInputHash)
nullifiers := make([]frontend.Variable, int(circuit.BatchSize))
// We might nullify leaves which have not been appended yet. Hence we need
// to handle the case where the OldLeaf is 0 and not equal to leaves[i].
// Leaves[i] is checked as part of the nullifier hash
// path index is checked as part of the nullifier hash
// in case old leaf is 0 the checked path index
// ensures the correct leaf is nullified (leaf hash depends on the leaf index)
// old leaf is checked with the initial Merkle proof
// which is checked against the onchain root
for i := 0; i < int(circuit.BatchSize); i++ {
// - We need to include path index in the nullifier hash so
// that it is checked in case OldLeaf is 0 -> Leaves[i] is not inserted
// yet but has to be inserted into a specific index
nullifiers[i] = abstractor.Call(api, poseidon.Poseidon3{In1: circuit.Leaves[i], In2: circuit.PathIndices[i], In3: circuit.TxHashes[i]})
}
nullifierHashChainHash := createHashChain(api, nullifiers)
api.AssertIsEqual(nullifierHashChainHash, circuit.LeavesHashchainHash)
newRoot := circuit.OldRoot
for i := 0; i < int(circuit.BatchSize); i++ {
currentPath := api.ToBinary(circuit.PathIndices[i], int(circuit.Height))
newRoot = abstractor.Call(api, MerkleRootUpdateGadget{
OldRoot: newRoot,
OldLeaf: circuit.OldLeaves[i],
NewLeaf: nullifiers[i],
PathIndex: currentPath,
MerkleProof: circuit.MerkleProofs[i],
Height: int(circuit.Height),
})
}
api.AssertIsEqual(newRoot, circuit.NewRoot)
return nil
}
type BatchUpdateParameters struct {
PublicInputHash *big.Int
OldRoot *big.Int
NewRoot *big.Int
TxHashes []*big.Int
LeavesHashchainHash *big.Int
Leaves []*big.Int
OldLeaves []*big.Int
MerkleProofs [][]big.Int
PathIndices []uint32
Height uint32
BatchSize uint32
Tree *merkle_tree.PoseidonTree
}
func (p *BatchUpdateParameters) TreeDepth() uint32 {
if len(p.MerkleProofs) == 0 {
return 0
}
return uint32(len(p.MerkleProofs[0]))
}
func (p *BatchUpdateParameters) ValidateShape() error {
if len(p.Leaves) != int(p.BatchSize) {
return fmt.Errorf("wrong number of leaves: %d, expected: %d", len(p.Leaves), p.BatchSize)
}
if len(p.OldLeaves) != int(p.BatchSize) {
return fmt.Errorf("wrong number of old leaves: %d, expected: %d", len(p.OldLeaves), p.BatchSize)
}
if len(p.TxHashes) != int(p.BatchSize) {
return fmt.Errorf("wrong number of tx hashes: %d, expected: %d", len(p.TxHashes), p.BatchSize)
}
if len(p.MerkleProofs) != int(p.BatchSize) {
return fmt.Errorf("wrong number of merkle proofs: %d", len(p.MerkleProofs))
}
if len(p.PathIndices) != int(p.BatchSize) {
return fmt.Errorf("wrong number of path indices: %d", len(p.PathIndices))
}
for i, proof := range p.MerkleProofs {
if len(proof) != int(p.Height) {
return fmt.Errorf("wrong size of merkle proof for proof %d: %d", i, len(proof))
}
}
return nil
}
func SetupBatchUpdate(height uint32, batchSize uint32) (*ProvingSystemV2, error) {
fmt.Println("Setting up batch update")
ccs, err := R1CSBatchUpdate(height, batchSize)
if err != nil {
return nil, err
}
pk, vk, err := groth16.Setup(ccs)
if err != nil {
return nil, err
}
return &ProvingSystemV2{
CircuitType: BatchUpdateCircuitType,
TreeHeight: height,
BatchSize: batchSize,
ProvingKey: pk,
VerifyingKey: vk,
ConstraintSystem: ccs}, nil
}
func (ps *ProvingSystemV2) ProveBatchUpdate(params *BatchUpdateParameters) (*Proof, error) {
if err := params.ValidateShape(); err != nil {
return nil, err
}
publicInputHash := frontend.Variable(params.PublicInputHash)
oldRoot := frontend.Variable(params.OldRoot)
newRoot := frontend.Variable(params.NewRoot)
leavesHashchainHash := frontend.Variable(params.LeavesHashchainHash)
txHashes := make([]frontend.Variable, len(params.TxHashes))
leaves := make([]frontend.Variable, len(params.Leaves))
oldLeaves := make([]frontend.Variable, len(params.OldLeaves))
pathIndices := make([]frontend.Variable, len(params.PathIndices))
merkleProofs := make([][]frontend.Variable, len(params.MerkleProofs))
for i := 0; i < len(params.Leaves); i++ {
leaves[i] = frontend.Variable(params.Leaves[i])
oldLeaves[i] = frontend.Variable(params.OldLeaves[i])
txHashes[i] = frontend.Variable(params.TxHashes[i])
pathIndices[i] = frontend.Variable(params.PathIndices[i])
merkleProofs[i] = make([]frontend.Variable, len(params.MerkleProofs[i]))
for j := 0; j < len(params.MerkleProofs[i]); j++ {
merkleProofs[i][j] = frontend.Variable(params.MerkleProofs[i][j])
}
}
assignment := BatchUpdateCircuit{
PublicInputHash: publicInputHash,
OldRoot: oldRoot,
NewRoot: newRoot,
TxHashes: txHashes,
LeavesHashchainHash: leavesHashchainHash,
OldLeaves: oldLeaves,
Leaves: leaves,
PathIndices: pathIndices,
MerkleProofs: merkleProofs,
Height: ps.TreeHeight,
BatchSize: ps.BatchSize,
}
witness, err := frontend.NewWitness(&assignment, ecc.BN254.ScalarField())
if err != nil {
return nil, fmt.Errorf("error creating witness: %v", err)
}
proof, err := groth16.Prove(ps.ConstraintSystem, ps.ProvingKey, witness)
if err != nil {
return nil, fmt.Errorf("error proving: %v", err)
}
return &Proof{proof}, nil
}
func R1CSBatchUpdate(height uint32, batchSize uint32) (constraint.ConstraintSystem, error) {
leaves := make([]frontend.Variable, batchSize)
oldLeaves := make([]frontend.Variable, batchSize)
txHashes := make([]frontend.Variable, batchSize)
pathIndices := make([]frontend.Variable, batchSize)
merkleProofs := make([][]frontend.Variable, batchSize)
for i := 0; i < int(batchSize); i++ {
merkleProofs[i] = make([]frontend.Variable, height)
}
circuit := BatchUpdateCircuit{
PublicInputHash: frontend.Variable(0),
OldRoot: frontend.Variable(0),
NewRoot: frontend.Variable(0),
TxHashes: txHashes,
LeavesHashchainHash: frontend.Variable(0),
Leaves: leaves,
OldLeaves: oldLeaves,
PathIndices: pathIndices,
MerkleProofs: merkleProofs,
Height: height,
BatchSize: batchSize,
}
return frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)
}
func ImportBatchUpdateSetup(treeHeight uint32, batchSize uint32, pkPath string, vkPath string) (*ProvingSystemV2, error) {
leaves := make([]frontend.Variable, batchSize)
txHashes := make([]frontend.Variable, batchSize)
oldLeaves := make([]frontend.Variable, batchSize)
newMerkleProofs := make([][]frontend.Variable, batchSize)
for i := 0; i < int(batchSize); i++ {
newMerkleProofs[i] = make([]frontend.Variable, treeHeight)
}
circuit := BatchUpdateCircuit{
Height: treeHeight,
TxHashes: txHashes,
Leaves: leaves,
OldLeaves: oldLeaves,
MerkleProofs: newMerkleProofs,
PathIndices: make([]frontend.Variable, batchSize),
OldRoot: frontend.Variable(0),
NewRoot: frontend.Variable(0),
LeavesHashchainHash: frontend.Variable(0),
BatchSize: batchSize,
PublicInputHash: frontend.Variable(0),
}
fmt.Println("Compiling circuit")
ccs, err := frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)
if err != nil {
fmt.Println("Error compiling circuit")
return nil, err
} else {
fmt.Println("Compiled circuit successfully")
}
pk, err := LoadProvingKey(pkPath)
if err != nil {
return nil, err
}
vk, err := LoadVerifyingKey(vkPath)
if err != nil {
return nil, err
}
return &ProvingSystemV2{
TreeHeight: treeHeight,
BatchSize: batchSize,
ProvingKey: pk,
VerifyingKey: vk,
ConstraintSystem: ccs,
}, nil
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/marshal_inclusion.go
|
package prover
import (
"encoding/json"
"fmt"
"math/big"
)
type InclusionProofInputsJSON struct {
Root string `json:"root"`
PathIndex uint32 `json:"pathIndex"`
PathElements []string `json:"pathElements"`
Leaf string `json:"leaf"`
}
type InclusionParametersJSON struct {
Inputs []InclusionProofInputsJSON `json:"input-compressed-accounts"`
}
func ParseInput(inputJSON string) (InclusionParameters, error) {
var proofData InclusionParameters
err := json.Unmarshal([]byte(inputJSON), &proofData)
if err != nil {
return InclusionParameters{}, fmt.Errorf("error parsing JSON: %v", err)
}
return proofData, nil
}
func (p *InclusionParameters) MarshalJSON() ([]byte, error) {
paramsJson := p.CreateInclusionParametersJSON()
return json.Marshal(paramsJson)
}
func (p *InclusionParameters) CreateInclusionParametersJSON() InclusionParametersJSON {
paramsJson := InclusionParametersJSON{}
paramsJson.Inputs = make([]InclusionProofInputsJSON, p.NumberOfCompressedAccounts())
for i := 0; i < int(p.NumberOfCompressedAccounts()); i++ {
paramsJson.Inputs[i].Root = toHex(&p.Inputs[i].Root)
paramsJson.Inputs[i].Leaf = toHex(&p.Inputs[i].Leaf)
paramsJson.Inputs[i].PathIndex = p.Inputs[i].PathIndex
paramsJson.Inputs[i].PathElements = make([]string, len(p.Inputs[i].PathElements))
for j := 0; j < len(p.Inputs[i].PathElements); j++ {
paramsJson.Inputs[i].PathElements[j] = toHex(&p.Inputs[i].PathElements[j])
}
}
return paramsJson
}
func (p *InclusionParameters) UnmarshalJSON(data []byte) error {
var params InclusionParametersJSON
err := json.Unmarshal(data, ¶ms)
if err != nil {
return err
}
err = p.UpdateWithJSON(params)
if err != nil {
return err
}
return nil
}
func (p *InclusionParameters) UpdateWithJSON(params InclusionParametersJSON) error {
p.Inputs = make([]InclusionInputs, len(params.Inputs))
for i := 0; i < len(params.Inputs); i++ {
fmt.Println("Params.Root: ", params.Inputs[i].Root)
err := fromHex(&p.Inputs[i].Root, params.Inputs[i].Root)
if err != nil {
return err
}
err = fromHex(&p.Inputs[i].Leaf, params.Inputs[i].Leaf)
if err != nil {
return err
}
p.Inputs[i].PathIndex = params.Inputs[i].PathIndex
p.Inputs[i].PathElements = make([]big.Int, len(params.Inputs[i].PathElements))
for j := 0; j < len(params.Inputs[i].PathElements); j++ {
err = fromHex(&p.Inputs[i].PathElements[j], params.Inputs[i].PathElements[j])
if err != nil {
return err
}
}
}
return nil
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/marshal_batch_address_append.go
|
package prover
import (
"encoding/json"
"math/big"
)
type BatchAddressAppendParametersJSON struct {
PublicInputHash string `json:"PublicInputHash"`
OldRoot string `json:"OldRoot"`
NewRoot string `json:"NewRoot"`
HashchainHash string `json:"HashchainHash"`
StartIndex uint32 `json:"StartIndex"`
LowElementValues []string `json:"LowElementValues"`
LowElementIndices []string `json:"LowElementIndices"`
LowElementNextIndices []string `json:"LowElementNextIndices"`
LowElementNextValues []string `json:"LowElementNextValues"`
NewElementValues []string `json:"NewElementValues"`
LowElementProofs [][]string `json:"LowElementProofs"`
NewElementProofs [][]string `json:"NewElementProofs"`
TreeHeight uint32 `json:"TreeHeight"`
BatchSize uint32 `json:"BatchSize"`
}
func ParseBatchAddressAppendInput(inputJSON string) (BatchAddressAppendParameters, error) {
var params BatchAddressAppendParameters
err := json.Unmarshal([]byte(inputJSON), ¶ms)
if err != nil {
return BatchAddressAppendParameters{}, err
}
return params, nil
}
func (p *BatchAddressAppendParameters) MarshalJSON() ([]byte, error) {
paramsJson := p.CreateBatchAddressAppendParametersJSON()
return json.Marshal(paramsJson)
}
func (p *BatchAddressAppendParameters) UnmarshalJSON(data []byte) error {
var params BatchAddressAppendParametersJSON
err := json.Unmarshal(data, ¶ms)
if err != nil {
return err
}
return p.UpdateWithJSON(params)
}
func (p *BatchAddressAppendParameters) CreateBatchAddressAppendParametersJSON() BatchAddressAppendParametersJSON {
paramsJson := BatchAddressAppendParametersJSON{}
paramsJson.PublicInputHash = toHex(p.PublicInputHash)
paramsJson.OldRoot = toHex(p.OldRoot)
paramsJson.NewRoot = toHex(p.NewRoot)
paramsJson.HashchainHash = toHex(p.HashchainHash)
paramsJson.StartIndex = p.StartIndex
paramsJson.TreeHeight = p.TreeHeight
paramsJson.BatchSize = p.BatchSize
paramsJson.LowElementProofs = make([][]string, len(p.LowElementProofs))
for i := 0; i < len(p.LowElementProofs); i++ {
paramsJson.LowElementProofs[i] = make([]string, len(p.LowElementProofs[i]))
for j := 0; j < len(p.LowElementProofs[i]); j++ {
paramsJson.LowElementProofs[i][j] = toHex(&p.LowElementProofs[i][j])
}
}
paramsJson.NewElementProofs = make([][]string, len(p.NewElementProofs))
for i := 0; i < len(p.NewElementProofs); i++ {
paramsJson.NewElementProofs[i] = make([]string, len(p.NewElementProofs[i]))
for j := 0; j < len(p.NewElementProofs[i]); j++ {
paramsJson.NewElementProofs[i][j] = toHex(&p.NewElementProofs[i][j])
}
}
paramsJson.LowElementValues = make([]string, len(p.LowElementValues))
for i := 0; i < len(p.LowElementValues); i++ {
paramsJson.LowElementValues[i] = toHex(&p.LowElementValues[i])
}
paramsJson.LowElementIndices = make([]string, len(p.LowElementIndices))
for i := 0; i < len(p.LowElementIndices); i++ {
paramsJson.LowElementIndices[i] = toHex(&p.LowElementIndices[i])
}
paramsJson.LowElementNextIndices = make([]string, len(p.LowElementNextIndices))
for i := 0; i < len(p.LowElementNextIndices); i++ {
paramsJson.LowElementNextIndices[i] = toHex(&p.LowElementNextIndices[i])
}
paramsJson.LowElementNextValues = make([]string, len(p.LowElementNextValues))
for i := 0; i < len(p.LowElementNextValues); i++ {
paramsJson.LowElementNextValues[i] = toHex(&p.LowElementNextValues[i])
}
paramsJson.NewElementValues = make([]string, len(p.NewElementValues))
for i := 0; i < len(p.NewElementValues); i++ {
paramsJson.NewElementValues[i] = toHex(&p.NewElementValues[i])
}
return paramsJson
}
func (p *BatchAddressAppendParameters) UpdateWithJSON(params BatchAddressAppendParametersJSON) error {
var err error
p.TreeHeight = params.TreeHeight
p.BatchSize = params.BatchSize
p.StartIndex = params.StartIndex
p.OldRoot = new(big.Int)
err = fromHex(p.OldRoot, params.OldRoot)
if err != nil {
return err
}
p.NewRoot = new(big.Int)
err = fromHex(p.NewRoot, params.NewRoot)
if err != nil {
return err
}
p.HashchainHash = new(big.Int)
err = fromHex(p.HashchainHash, params.HashchainHash)
if err != nil {
return err
}
p.PublicInputHash = new(big.Int)
err = fromHex(p.PublicInputHash, params.PublicInputHash)
if err != nil {
return err
}
p.LowElementValues, err = convertStringSliceToBigIntSlice(params.LowElementValues)
if err != nil {
return err
}
p.LowElementIndices, err = convertStringSliceToBigIntSlice(params.LowElementIndices)
if err != nil {
return err
}
p.LowElementNextIndices, err = convertStringSliceToBigIntSlice(params.LowElementNextIndices)
if err != nil {
return err
}
p.LowElementNextValues, err = convertStringSliceToBigIntSlice(params.LowElementNextValues)
if err != nil {
return err
}
p.NewElementValues, err = convertStringSliceToBigIntSlice(params.NewElementValues)
if err != nil {
return err
}
p.LowElementProofs, err = convertNestedStringSliceToBigIntSlice(params.LowElementProofs)
if err != nil {
return err
}
p.NewElementProofs, err = convertNestedStringSliceToBigIntSlice(params.NewElementProofs)
if err != nil {
return err
}
return nil
}
func convertStringSliceToBigIntSlice(stringSlice []string) ([]big.Int, error) {
result := make([]big.Int, len(stringSlice))
for i, s := range stringSlice {
p := new(big.Int)
fromHex(p, s)
result[i] = *p
}
return result, nil
}
func convertNestedStringSliceToBigIntSlice(nestedStringSlice [][]string) ([][]big.Int, error) {
result := make([][]big.Int, len(nestedStringSlice))
for i, innerSlice := range nestedStringSlice {
innerResult := make([]big.Int, len(innerSlice))
for j, s := range innerSlice {
p := new(big.Int)
fromHex(p, s)
innerResult[j] = *p
}
result[i] = innerResult
}
return result, nil
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/test_data_generator.go
|
package prover
import (
"fmt"
"math/big"
"os"
"testing"
)
func TestInclusionParameters_TestTree(t *testing.T) {
file, err := os.OpenFile("../test-data/inclusion.csv", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
fmt.Println(err)
return
}
defer func(file *os.File) {
err := file.Close()
if err != nil {
t.Errorf("Error closing file: %v", err)
}
}(file)
var testTreeHeight = []int{26}
var testCompressedAccountCount = []int{1, 2, 3, 4}
for i := 0; i < len(testTreeHeight); i++ {
for j := 0; j < len(testCompressedAccountCount); j++ {
trees := MakeTestIncludedTrees(testTreeHeight[i], testCompressedAccountCount[j])
for _, tree := range trees {
var json, err = tree.Tree.MarshalJSON()
if err != nil {
t.Errorf("Error marshalling JSON: %v", err)
return
}
_, err = fmt.Fprintf(file, "%d;%s\n", flag(tree.Valid), json)
if err != nil {
t.Errorf("Error writing to file: %v", err)
return
}
}
}
}
}
func TestNonInclusionParameters_TestTree(t *testing.T) {
file, err := os.OpenFile("../test-data/non_inclusion.csv", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
t.Errorf("Error opening file: %v", err)
return
}
defer func(file *os.File) {
err := file.Close()
if err != nil {
t.Errorf("Error closing file: %v", err)
}
}(file)
var testTreeHeight = []int{26}
var testCompressedAccountCount = []int{1, 2, 3, 4}
for i := 0; i < len(testTreeHeight); i++ {
for j := 0; j < len(testCompressedAccountCount); j++ {
trees := MakeTestNonInclusionTrees(testTreeHeight[i], testCompressedAccountCount[j])
for _, tree := range trees {
var json, err = tree.Tree.MarshalJSON()
if err != nil {
t.Errorf("Error marshalling JSON: %v", err)
return
}
_, err = fmt.Fprintf(file, "%d;%s\n", flag(tree.Valid), json)
if err != nil {
t.Errorf("Error writing to file: %v", err)
return
}
}
}
}
}
func GenerateCombinedTestData(t *testing.T) {
file, err := os.OpenFile("../test-data/combined.csv", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
t.Errorf("Error opening file: %v", err)
return
}
defer func(file *os.File) {
err := file.Close()
if err != nil {
t.Errorf("Error closing file: %v", err)
}
}(file)
var testTreeHeight = []int{26}
var testCompressedAccountCount = []int{1, 2, 3, 4}
for i := 0; i < len(testTreeHeight); i++ {
for j := 0; j < len(testCompressedAccountCount); j++ {
trees1 := MakeTestIncludedTrees(testTreeHeight[i], testCompressedAccountCount[j])
trees2 := MakeTestNonInclusionTrees(testTreeHeight[i], testCompressedAccountCount[j])
for k, tree1 := range trees1 {
for l, tree2 := range trees2 {
var combinedParams = CombinedParameters{
InclusionParameters: tree1.Tree,
NonInclusionParameters: tree2.Tree,
}
var json, err = combinedParams.MarshalJSON()
if err != nil {
t.Errorf("Error marshalling JSON: %v", err)
return
}
valid := tree1.Valid && tree2.Valid
_, err = fmt.Fprintf(file, "%d;%s\n", flag(valid), json)
if err != nil {
t.Errorf("Error writing to file: %v", err)
return
}
fmt.Printf("Test %d: %d, %d\n", i, k, l)
}
}
}
}
}
func flag(valid bool) int {
if valid {
return 1
}
return 0
}
type InclusionTreeValidPair struct {
Tree InclusionParameters
Valid bool
}
// Function
//
// `MakeTestIncludedTrees`
//
// ```go
// func MakeTestIncludedTrees(height int, numberOfCompressedAccounts int) []InclusionTreeValidPair
// ```
//
// # Description
//
// The `MakeTestIncludedTrees` function creates an array of InclusionTreeValidPair instances for testing.
// The variation between valid and invalid trees helps simulate real-world scenarios and assists in better
// testing for robustness and error-handling.
//
// Parameters:
//
// - `height (int)`: Defines the depth of each included tree.
// - `numberOfCompressedAccounts (int)`: Number of unspent transaction outputs (CompressedAccounts) to include in each tree.
//
// Returns:
// - `[]InclusionTreeValidPair`: An array of `InclusionTreeValidPair` instances, each containing
// an `InclusionParameters` instance and a boolean value indicating whether the tree is valid.
//
// Pairs Explanation:
//
// - `validPair`: A valid tree constructed with input parameters. The Valid field is set to `true`.
// - `invalidRootPair`: A valid tree but the root value is invalidated by setting it to an integer 999. The Valid field is set to `false`.
// - `invalidLeafPair`: A valid tree where a leaf value is invalidated by setting it to an integer 999. The Valid field wis set to `false`.
// - `invalidInPathIndicesPair`: A valid tree but the InPathIndices value is invalidated by adding 1 to the index. The Valid field is set to `false`.
// - `invalidInPathIndicesPair`: A valid tree but the InPathIndices value is invalidated by subtracting 1 from the index. The Valid field is set to `false`.
// - `invalidInPathElementsPair`: A valid tree where the InPathElements is invalidated by setting a value to an integer 999. The Valid field is set to `false`.
//
// Example usage:
//
// ```go
// trees := MakeTestIncludedTrees(4, 2)
//
// for _, tree := range trees {
// // perform operations on tree
// }
//
// ```
func MakeTestIncludedTrees(height int, numberOfCompressedAccounts int) []InclusionTreeValidPair {
var trees []InclusionTreeValidPair
validTree := BuildTestTree(height, numberOfCompressedAccounts, false)
validPair := InclusionTreeValidPair{Tree: validTree, Valid: true}
invalidRootTree := BuildTestTree(height, numberOfCompressedAccounts, true)
invalidRootTree.Inputs[0].Root = *big.NewInt(999)
invalidRootPair := InclusionTreeValidPair{Tree: invalidRootTree, Valid: false}
invalidLeafTree := BuildTestTree(height, numberOfCompressedAccounts, true)
invalidLeafTree.Inputs[0].Leaf = *big.NewInt(999)
invalidLeafPair := InclusionTreeValidPair{Tree: invalidLeafTree, Valid: false}
invalidInPathIndicesTreeAddOne := BuildTestTree(height, numberOfCompressedAccounts, true)
invalidInPathIndicesTreeAddOne.Inputs[0].PathIndex = invalidInPathIndicesTreeAddOne.Inputs[0].PathIndex + 1
invalidInPathIndicesPairAddOne := InclusionTreeValidPair{Tree: invalidInPathIndicesTreeAddOne, Valid: false}
invalidInPathIndicesTreeSubOne := BuildTestTree(height, numberOfCompressedAccounts, true)
invalidInPathIndicesTreeSubOne.Inputs[0].PathIndex = invalidInPathIndicesTreeSubOne.Inputs[0].PathIndex - 1
invalidInPathIndicesPairSubOne := InclusionTreeValidPair{Tree: invalidInPathIndicesTreeSubOne, Valid: false}
invalidInPathElementsTree := BuildTestTree(height, numberOfCompressedAccounts, true)
invalidInPathElementsTree.Inputs[0].PathElements[0] = *big.NewInt(999)
invalidInPathElementsPair := InclusionTreeValidPair{Tree: invalidInPathElementsTree, Valid: false}
trees = append(trees, validPair)
trees = append(trees, invalidRootPair)
trees = append(trees, invalidLeafPair)
trees = append(trees, invalidInPathIndicesPairAddOne)
trees = append(trees, invalidInPathIndicesPairSubOne)
trees = append(trees, invalidInPathElementsPair)
return trees
}
type NonInclusionTreeValidPair struct {
Tree NonInclusionParameters
Valid bool
}
// Function
//
// `MakeTestNonInclusionTrees`
//
// ```go
// func MakeTestNonInclusionTrees(depth int, numberOfCompressedAccounts int) []NonInclusionTreeValidPair
// ```
//
// # Description
//
// The `MakeTestNonInclusionTrees` function creates an array of `NonInclusionTreeValidPair` instances for testing. These instances include various valid and invalid cases to simulate diverse scenarios and strengthen code robustness and error handling. This function helps in creating a testing environment that closely mimics a variety of real-world scenarios.
//
// # Parameters
//
// - `height (int)`: Defines the depth of each included tree.
// - `numberOfCompressedAccounts (int)`: Number of unspent transaction outputs (CompressedAccounts) to include in each tree.
//
// # Returns
//
// - `[]NonInclusionTreeValidPair`: An array of `NonInclusionTreeValidPair` instances, each containing an `InclusionParameters` instance and a boolean value indicating whether the tree is valid.
//
// # Pairs Explanation
//
// - `validPair`: A tree constructed with input parameters. The `Valid` field is set to `true`.
//
// - `invalidRootPair`: A valid tree but the root value is invalidated by setting it to an integer 999. The `Valid` field is set to `false`.
//
// - `invalidLowValuePair`: An invalid tree with a low value. The `Valid` field is set to `false`.
//
// - `invalidHighValuePair`: An invalid tree with a high value. The `Valid` field is set to `false`.
//
// - `invalidInPathIndicesPair`: A valid tree but the `InPathIndices` value is invalidated by setting it to an integer 999. The `Valid` field is set to `false`.
//
// - `invalidInPathElementsPair`: A valid tree where the `InPathElements` are invalidated by an integer 999. The `Valid` field is set to `false`.
//
// # Example Usage
//
// ```go
// trees := MakeTestNonInclusionTrees(4, 2)
//
// for _, tree := range trees {
// // perform operations on tree
// }
//
// ```
func MakeTestNonInclusionTrees(height int, numberOfCompressedAccounts int) []NonInclusionTreeValidPair {
var trees []NonInclusionTreeValidPair
validTree := BuildValidTestNonInclusionTree(height, numberOfCompressedAccounts, true)
validPair := NonInclusionTreeValidPair{Tree: validTree, Valid: true}
invalidRootTree := BuildValidTestNonInclusionTree(height, numberOfCompressedAccounts, true)
invalidRootTree.Inputs[0].Root = *big.NewInt(999)
invalidRootPair := NonInclusionTreeValidPair{Tree: invalidRootTree, Valid: false}
invalidNextIndex := BuildValidTestNonInclusionTree(height, numberOfCompressedAccounts, true)
invalidNextIndex.Inputs[0].NextIndex = 999
invalidNextIndexPair := NonInclusionTreeValidPair{Tree: invalidRootTree, Valid: false}
invalidLowValueTree := BuildTestNonInclusionTree(height, numberOfCompressedAccounts, true, false, true)
invalidLowValuePair := NonInclusionTreeValidPair{Tree: invalidLowValueTree, Valid: false}
invalidHighValueTree := BuildTestNonInclusionTree(height, numberOfCompressedAccounts, true, false, false)
invalidHighValuePair := NonInclusionTreeValidPair{Tree: invalidHighValueTree, Valid: false}
invalidInPathIndicesTreeAddOne := BuildValidTestNonInclusionTree(height, numberOfCompressedAccounts, true)
invalidInPathIndicesTreeAddOne.Inputs[0].PathIndex += 1
invalidInPathIndicesPairAddOne := NonInclusionTreeValidPair{Tree: invalidInPathIndicesTreeAddOne, Valid: false}
invalidInPathIndicesTreeSubOne := BuildValidTestNonInclusionTree(height, numberOfCompressedAccounts, true)
invalidInPathIndicesTreeSubOne.Inputs[0].PathIndex -= 1
invalidInPathIndicesPairSubOne := NonInclusionTreeValidPair{Tree: invalidInPathIndicesTreeSubOne, Valid: false}
invalidInPathElementsTree := BuildValidTestNonInclusionTree(height, numberOfCompressedAccounts, true)
invalidInPathElementsTree.Inputs[0].PathElements[0] = *big.NewInt(999)
invalidInPathElementsPair := NonInclusionTreeValidPair{Tree: invalidInPathElementsTree, Valid: false}
trees = append(trees, validPair)
trees = append(trees, invalidRootPair)
trees = append(trees, invalidNextIndexPair)
trees = append(trees, invalidLowValuePair)
trees = append(trees, invalidHighValuePair)
trees = append(trees, invalidInPathIndicesPairAddOne)
trees = append(trees, invalidInPathIndicesPairSubOne)
trees = append(trees, invalidInPathElementsPair)
return trees
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/batch_append_with_subtrees_circuit.go
|
package prover
import (
"fmt"
"light/light-prover/logging"
merkletree "light/light-prover/merkle-tree"
"math/big"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend/groth16"
"github.com/consensys/gnark/constraint"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/frontend/cs/r1cs"
"github.com/reilabs/gnark-lean-extractor/v2/abstractor"
)
type BatchAppendWithSubtreesCircuit struct {
// Public inputs
PublicInputHash frontend.Variable `gnark:",public"`
OldSubTreeHashChain frontend.Variable `gnark:",private"`
NewSubTreeHashChain frontend.Variable `gnark:",private"`
NewRoot frontend.Variable `gnark:",private"`
HashchainHash frontend.Variable `gnark:",private"`
StartIndex frontend.Variable `gnark:",private"`
// Private inputs
Leaves []frontend.Variable `gnark:",private"`
Subtrees []frontend.Variable `gnark:",private"`
BatchSize uint32
// TODO: rename to height
TreeHeight uint32
}
func (circuit *BatchAppendWithSubtreesCircuit) Define(api frontend.API) error {
if err := circuit.validateInputs(); err != nil {
return err
}
hashChainInputs := make([]frontend.Variable, int(5))
hashChainInputs[0] = circuit.OldSubTreeHashChain
hashChainInputs[1] = circuit.NewSubTreeHashChain
hashChainInputs[2] = circuit.NewRoot
hashChainInputs[3] = circuit.HashchainHash
hashChainInputs[4] = circuit.StartIndex
publicInputsHashChain := createHashChain(api, hashChainInputs)
api.AssertIsEqual(circuit.PublicInputHash, publicInputsHashChain)
oldSubtreesHashChain := createHashChain(api, circuit.Subtrees)
api.AssertIsEqual(oldSubtreesHashChain, circuit.OldSubTreeHashChain)
leavesHashChain := createHashChain(api, circuit.Leaves)
api.AssertIsEqual(leavesHashChain, circuit.HashchainHash)
newRoot, newSubtrees := circuit.batchAppend(api)
api.AssertIsEqual(newRoot, circuit.NewRoot)
newSubtreesHashChain := createHashChain(api, newSubtrees)
api.AssertIsEqual(newSubtreesHashChain, circuit.NewSubTreeHashChain)
return nil
}
func (circuit *BatchAppendWithSubtreesCircuit) validateInputs() error {
if len(circuit.Leaves) != int(circuit.BatchSize) {
return fmt.Errorf("leaves length (%d) does not match batch size (%d)", len(circuit.Leaves), circuit.BatchSize)
}
if len(circuit.Subtrees) != int(circuit.TreeHeight) {
return fmt.Errorf("subtrees length (%d) does not match depth (%d)", len(circuit.Subtrees), circuit.TreeHeight)
}
return nil
}
func (circuit *BatchAppendWithSubtreesCircuit) batchAppend(api frontend.API) (frontend.Variable, []frontend.Variable) {
currentSubtrees := make([]frontend.Variable, len(circuit.Subtrees))
copy(currentSubtrees, circuit.Subtrees)
// Convert StartIndex to binary representation for tree traversal
indexBits := api.ToBinary(circuit.StartIndex, int(circuit.TreeHeight))
newRoot := frontend.Variable(0)
for i := 0; i < int(circuit.BatchSize); i++ {
leaf := circuit.Leaves[i]
newRoot, currentSubtrees = circuit.append(api, leaf, currentSubtrees, indexBits)
// Increment the binary representation of the index
indexBits = incrementBits(api, indexBits)
}
return newRoot, currentSubtrees
}
// append inserts a new leaf into the Merkle tree and updates the tree structure accordingly.
// It traverses the tree from the bottom up, updating nodes and subtrees based on the binary
// representation of the insertion index.
//
// The function works as follows:
// 1. It starts with the new leaf as the current node.
// 2. For each level of the tree, from bottom to top:
// a. It uses the corresponding bit of the index to determine if we're inserting on the right or left.
// b. update subtrees:
// - if isRight then do not update subtrees
// - else update subtrees with current node
// c. If inserting on the right (isRight is true):
// - The current subtree at this level becomes the left sibling.
// - The current node becomes the right sibling and the new subtree for this level.
// d. If inserting on the left (isRight is false):
// - The current node becomes the left sibling.
// - zero value becomes the right sibling.
// e. It selects the appropriate left and right nodes based on the insertion direction.
// f. It hashes the left and right nodes together to create the new parent node.
// g. This new parent becomes the current node for the next level up.
// 3. The process repeats for each level, ultimately resulting in a new root hash.
//
// Parameters:
// - api: The frontend API for ZKP operations.
// - leaf: The new leaf to be inserted.
// - subtrees: The current state of subtrees in the Merkle tree.
// - indexBits: Binary representation of the insertion index.
//
// Returns:
// - The new root hash of the Merkle tree.
// - The updated subtrees after insertion.
func (circuit *BatchAppendWithSubtreesCircuit) append(api frontend.API, leaf frontend.Variable, subtrees []frontend.Variable, indexBits []frontend.Variable) (frontend.Variable, []frontend.Variable) {
currentNode := leaf
for i := 0; i < int(circuit.TreeHeight); i++ {
isRight := indexBits[i]
subtrees[i] = api.Select(isRight, subtrees[i], currentNode)
sibling := api.Select(isRight, subtrees[i], getZeroValue(i))
currentNode = abstractor.Call(api, MerkleRootGadget{
Hash: currentNode,
Index: []frontend.Variable{isRight},
Path: []frontend.Variable{sibling},
Height: 1,
})
}
return currentNode, subtrees
}
// incrementBits implements binary addition to increment a number represented as a list of bits.
// It uses XOR and AND operations to efficiently increment the binary number without using
// traditional arithmetic operations, which is beneficial in zero-knowledge proof circuits.
//
// The function works as follows:
// 1. It starts with a carry of 1 (equivalent to adding 1 to the number).
// 2. For each bit, from least to most significant:
// a. It XORs the current bit with the carry. This effectively adds the bit and carry
// without considering a new carry. (0⊕0=0, 0⊕1=1, 1⊕0=1, 1⊕1=0)
// b. It ANDs the original bit with the carry to determine if there should be a carry
// for the next bit. (0∧0=0, 0∧1=0, 1∧0=0, 1∧1=1)
// c. The result of XOR becomes the new value for the current bit.
// d. The result of AND becomes the new carry for the next iteration.
// 3. This process continues for all bits, resulting in the incremented binary number.
//
// Example: Incrementing 0111 (7 in decimal)
// Initial state: 0111, carry = 1
// i=0: 1⊕1=0, carry=1∧1=1 -> 0110, carry=1
// i=1: 1⊕1=0, carry=1∧1=1 -> 0010, carry=1
// i=2: 1⊕1=0, carry=1∧1=1 -> 1010, carry=1
// i=3: 0⊕1=1, carry=0∧1=0 -> 1000, carry=0
// Final result: 1000 (8 in decimal)
func incrementBits(api frontend.API, bits []frontend.Variable) []frontend.Variable {
carry := frontend.Variable(1)
for i := 0; i < len(bits); i++ {
// XOR operation implements binary addition without carry
newBit := api.Xor(bits[i], carry)
// AND operation determines if we need to carry to the next bit
carry = api.And(bits[i], carry)
bits[i] = newBit
}
return bits
}
func (circuit *BatchAppendWithSubtreesCircuit) getZeroValue(level int) frontend.Variable {
return frontend.Variable(new(big.Int).SetBytes(merkletree.ZERO_BYTES[level][:]))
}
type BatchAppendWithSubtreesParameters struct {
PublicInputHash *big.Int `json:"publicInputHash"`
OldSubTreeHashChain *big.Int `json:"oldSubTreeHashChain"`
NewSubTreeHashChain *big.Int `json:"newSubTreeHashChain"`
NewRoot *big.Int `json:"newRoot"`
HashchainHash *big.Int `json:"hashchainHash"`
StartIndex uint32 `json:"startIndex"`
Leaves []*big.Int `json:"leaves"`
Subtrees []*big.Int `json:"subtrees"`
TreeHeight uint32 `json:"treeHeight"`
tree *merkletree.PoseidonTree
}
func (p *BatchAppendWithSubtreesParameters) BatchSize() uint32 {
return uint32(len(p.Leaves))
}
func (p *BatchAppendWithSubtreesParameters) ValidateShape(treeHeight uint32, batchSize uint32) error {
if p.TreeHeight != treeHeight {
return fmt.Errorf("wrong tree height: expected %d, got %d", treeHeight, p.TreeHeight)
}
if p.BatchSize() != batchSize {
return fmt.Errorf("wrong batch size: expected %d, got %d", batchSize, p.BatchSize())
}
return nil
}
func SetupBatchAppendWithSubtrees(treeHeight uint32, batchSize uint32) (*ProvingSystemV2, error) {
ccs, err := R1CSBatchAppendWithSubtrees(treeHeight, batchSize)
if err != nil {
return nil, err
}
pk, vk, err := groth16.Setup(ccs)
if err != nil {
return nil, err
}
return &ProvingSystemV2{
TreeHeight: treeHeight,
BatchSize: batchSize,
ProvingKey: pk,
VerifyingKey: vk,
ConstraintSystem: ccs}, nil
}
func ImportBatchAppendWithSubtreesSetup(treeDepth uint32, batchSize uint32, pkPath string, vkPath string) (*ProvingSystemV2, error) {
circuit := BatchAppendWithSubtreesCircuit{
PublicInputHash: frontend.Variable(0),
OldSubTreeHashChain: frontend.Variable(0),
NewSubTreeHashChain: frontend.Variable(0),
NewRoot: frontend.Variable(0),
HashchainHash: frontend.Variable(0),
StartIndex: frontend.Variable(0),
Leaves: make([]frontend.Variable, batchSize),
Subtrees: make([]frontend.Variable, treeDepth),
}
ccs, err := frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)
if err != nil {
return nil, fmt.Errorf("error compiling circuit: %v", err)
}
pk, err := LoadProvingKey(pkPath)
if err != nil {
return nil, fmt.Errorf("error loading proving key: %v", err)
}
vk, err := LoadVerifyingKey(vkPath)
if err != nil {
return nil, fmt.Errorf("error loading verifying key: %v", err)
}
return &ProvingSystemV2{
TreeHeight: treeDepth,
BatchSize: batchSize,
ProvingKey: pk,
VerifyingKey: vk,
ConstraintSystem: ccs,
}, nil
}
func (ps *ProvingSystemV2) ProveBatchAppendWithSubtrees(params *BatchAppendWithSubtreesParameters) (*Proof, error) {
logging.Logger().Info().Msg("Starting batch-append-with-subtrees proof generation")
logging.Logger().Info().Msg("Validating parameters")
if err := params.ValidateShape(ps.TreeHeight, ps.BatchSize); err != nil {
return nil, err
}
circuit := BatchAppendWithSubtreesCircuit{
PublicInputHash: frontend.Variable(params.PublicInputHash),
OldSubTreeHashChain: frontend.Variable(params.OldSubTreeHashChain),
NewSubTreeHashChain: frontend.Variable(params.NewSubTreeHashChain),
NewRoot: frontend.Variable(params.NewRoot),
HashchainHash: frontend.Variable(params.HashchainHash),
StartIndex: frontend.Variable(params.StartIndex),
Leaves: make([]frontend.Variable, ps.BatchSize),
Subtrees: make([]frontend.Variable, ps.TreeHeight),
}
for i, leaf := range params.Leaves {
circuit.Leaves[i] = frontend.Variable(leaf)
}
for i, subtree := range params.Subtrees {
circuit.Subtrees[i] = frontend.Variable(subtree)
}
witness, err := frontend.NewWitness(&circuit, ecc.BN254.ScalarField())
if err != nil {
return nil, fmt.Errorf("error creating witness: %v", err)
}
logging.Logger().Info().Msg("Generating Batch Append proof")
proof, err := groth16.Prove(ps.ConstraintSystem, ps.ProvingKey, witness)
if err != nil {
return nil, fmt.Errorf("error generating proof: %v", err)
}
logging.Logger().Info().Msg("Batch Append proof generated successfully")
return &Proof{Proof: proof}, nil
}
func (ps *ProvingSystemV2) VerifyBatchAppendWithSubtrees(oldSubTreeHashChain, newSubTreeHashChain, newRoot, hashchainHash *big.Int, proof *Proof) error {
publicWitness := BatchAppendWithSubtreesCircuit{
OldSubTreeHashChain: frontend.Variable(oldSubTreeHashChain),
NewSubTreeHashChain: frontend.Variable(newSubTreeHashChain),
NewRoot: frontend.Variable(newRoot),
HashchainHash: frontend.Variable(hashchainHash),
}
witness, err := frontend.NewWitness(&publicWitness, ecc.BN254.ScalarField(), frontend.PublicOnly())
if err != nil {
return fmt.Errorf("error creating public witness: %v", err)
}
err = groth16.Verify(proof.Proof, ps.VerifyingKey, witness)
if err != nil {
return fmt.Errorf("batch append proof verification failed: %v", err)
}
return nil
}
func R1CSBatchAppendWithSubtrees(treeDepth uint32, batchSize uint32) (constraint.ConstraintSystem, error) {
circuit := BatchAppendWithSubtreesCircuit{
PublicInputHash: frontend.Variable(0),
OldSubTreeHashChain: frontend.Variable(0),
NewSubTreeHashChain: frontend.Variable(0),
NewRoot: frontend.Variable(0),
HashchainHash: frontend.Variable(0),
StartIndex: frontend.Variable(0),
Leaves: make([]frontend.Variable, batchSize),
Subtrees: make([]frontend.Variable, treeDepth),
TreeHeight: treeDepth,
BatchSize: batchSize,
}
for i := range circuit.Leaves {
circuit.Leaves[i] = frontend.Variable(0)
}
for i := range circuit.Subtrees {
circuit.Subtrees[i] = frontend.Variable(0)
}
ccs, err := frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)
if err != nil {
return nil, err
}
return ccs, nil
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/extractor.go
|
package prover
import (
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/frontend"
"github.com/reilabs/gnark-lean-extractor/v2/extractor"
)
func ExtractLean(treeHeight uint32, numberOfCompressedAccounts uint32) (string, error) {
// Not checking for numberOfCompressedAccounts === 0 or treeHeight === 0
// Initialising MerkleProofs slice with correct dimensions
inclusionInPathElements := make([][]frontend.Variable, numberOfCompressedAccounts)
nonInclusionInPathElements := make([][]frontend.Variable, numberOfCompressedAccounts)
for i := 0; i < int(numberOfCompressedAccounts); i++ {
inclusionInPathElements[i] = make([]frontend.Variable, treeHeight)
nonInclusionInPathElements[i] = make([]frontend.Variable, treeHeight)
}
inclusionCircuit := InclusionCircuit{
Height: treeHeight,
NumberOfCompressedAccounts: numberOfCompressedAccounts,
Roots: make([]frontend.Variable, numberOfCompressedAccounts),
Leaves: make([]frontend.Variable, numberOfCompressedAccounts),
InPathIndices: make([]frontend.Variable, numberOfCompressedAccounts),
InPathElements: inclusionInPathElements,
}
nonInclusionCircuit := NonInclusionCircuit{
Height: treeHeight,
NumberOfCompressedAccounts: numberOfCompressedAccounts,
Roots: make([]frontend.Variable, numberOfCompressedAccounts),
Values: make([]frontend.Variable, numberOfCompressedAccounts),
LeafLowerRangeValues: make([]frontend.Variable, numberOfCompressedAccounts),
LeafHigherRangeValues: make([]frontend.Variable, numberOfCompressedAccounts),
NextIndices: make([]frontend.Variable, numberOfCompressedAccounts),
InPathIndices: make([]frontend.Variable, numberOfCompressedAccounts),
InPathElements: nonInclusionInPathElements,
}
combinedCircuit := CombinedCircuit{
Inclusion: inclusionCircuit,
NonInclusion: nonInclusionCircuit,
}
return extractor.ExtractCircuits("LightProver", ecc.BN254, &inclusionCircuit, &nonInclusionCircuit, &combinedCircuit)
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/batch_circuit_helpers.go
|
package prover
import (
"github.com/reilabs/gnark-lean-extractor/v2/abstractor"
merkletree "light/light-prover/merkle-tree"
"light/light-prover/prover/poseidon"
"math/big"
"github.com/consensys/gnark/frontend"
)
func createHashChain(api frontend.API, hashes []frontend.Variable) frontend.Variable {
if len(hashes) == 0 {
return frontend.Variable(0)
}
initialHash := hashes[0]
return computeHashChain(api, initialHash, hashes)
}
func computeHashChain(api frontend.API, initialHash frontend.Variable, hashes []frontend.Variable) frontend.Variable {
hashChain := initialHash
for i := 1; i < len(hashes); i++ {
hashChain = abstractor.Call(api, poseidon.Poseidon2{In1: hashChain, In2: hashes[i]})
}
return hashChain
}
// getZeroValue returns the zero value for a given tree level
func getZeroValue(level int) frontend.Variable {
return frontend.Variable(new(big.Int).SetBytes(merkletree.ZERO_BYTES[level][:]))
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/circuit_builder.go
|
package prover
import (
"encoding/json"
"fmt"
"log"
)
type CircuitType string
const (
CombinedCircuitType CircuitType = "combined"
InclusionCircuitType CircuitType = "inclusion"
NonInclusionCircuitType CircuitType = "non-inclusion"
BatchAppendWithSubtreesCircuitType CircuitType = "append-with-subtrees"
BatchAppendWithProofsCircuitType CircuitType = "append-with-proofs"
BatchUpdateCircuitType CircuitType = "update"
BatchAddressAppendCircuitType CircuitType = "address-append"
)
func SetupCircuitV1(circuit CircuitType, inclusionTreeHeight uint32, inclusionNumberOfCompressedAccounts uint32, nonInclusionTreeHeight uint32, nonInclusionNumberOfCompressedAccounts uint32) (*ProvingSystemV1, error) {
switch circuit {
case InclusionCircuitType:
return SetupInclusion(inclusionTreeHeight, inclusionNumberOfCompressedAccounts)
case NonInclusionCircuitType:
return SetupNonInclusion(nonInclusionTreeHeight, nonInclusionNumberOfCompressedAccounts)
case CombinedCircuitType:
return SetupCombined(inclusionTreeHeight, inclusionNumberOfCompressedAccounts, nonInclusionTreeHeight, nonInclusionNumberOfCompressedAccounts)
default:
return nil, fmt.Errorf("invalid circuit: %s", circuit)
}
}
func SetupCircuitV2(circuit CircuitType, height uint32, batchSize uint32) (*ProvingSystemV2, error) {
switch circuit {
case BatchAppendWithSubtreesCircuitType:
return SetupBatchAppendWithSubtrees(height, batchSize)
case BatchAppendWithProofsCircuitType:
return SetupBatchAppendWithProofs(height, batchSize)
case BatchUpdateCircuitType:
return SetupBatchUpdate(height, batchSize)
case BatchAddressAppendCircuitType:
return SetupBatchAddressAppend(height, batchSize)
default:
return nil, fmt.Errorf("invalid circuit: %s", circuit)
}
}
func ParseCircuitType(data []byte) (CircuitType, error) {
var inputs map[string]*json.RawMessage
err := json.Unmarshal(data, &inputs)
if err != nil {
return "", err
}
_, hasInputCompressedAccounts := inputs["input-compressed-accounts"]
_, hasNewAddresses := inputs["new-addresses"]
_, hasOldSubTreeHashChain := inputs["oldSubTreeHashChain"]
_, hasNewSubTreeHashChain := inputs["newSubTreeHashChain"]
_, hasLeaves := inputs["leaves"]
_, hasNewMerkleProofs := inputs["newMerkleProofs"]
_, hasOldLeaves := inputs["oldLeaves"]
_, hasOldLowElements := inputs["LowElementValues"]
if hasInputCompressedAccounts && hasNewAddresses {
return CombinedCircuitType, nil
} else if hasInputCompressedAccounts {
return InclusionCircuitType, nil
} else if hasNewAddresses {
return NonInclusionCircuitType, nil
} else if hasOldSubTreeHashChain && hasNewSubTreeHashChain && hasLeaves {
return BatchAppendWithSubtreesCircuitType, nil
} else if hasNewMerkleProofs {
return BatchUpdateCircuitType, nil
} else if hasOldLeaves {
return BatchAppendWithProofsCircuitType, nil
} else if hasOldLowElements {
log.Println("BatchAddressAppendCircuitType parsed")
return BatchAddressAppendCircuitType, nil
}
return "", fmt.Errorf("unknown schema")
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/batch_append_with_proofs_circuit.go
|
package prover
import (
"fmt"
merkle_tree "light/light-prover/merkle-tree"
"math/big"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend/groth16"
"github.com/consensys/gnark/constraint"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/frontend/cs/r1cs"
"github.com/reilabs/gnark-lean-extractor/v2/abstractor"
)
type BatchAppendWithProofsCircuit struct {
PublicInputHash frontend.Variable `gnark:",public"`
OldRoot frontend.Variable `gnark:",private"`
NewRoot frontend.Variable `gnark:",private"`
LeavesHashchainHash frontend.Variable `gnark:",private"`
StartIndex frontend.Variable `gnark:",private"`
OldLeaves []frontend.Variable `gnark:",private"`
Leaves []frontend.Variable `gnark:",private"`
MerkleProofs [][]frontend.Variable `gnark:",private"`
Height uint32
BatchSize uint32
}
func (circuit *BatchAppendWithProofsCircuit) Define(api frontend.API) error {
hashChainInputs := make([]frontend.Variable, int(4))
hashChainInputs[0] = circuit.OldRoot
hashChainInputs[1] = circuit.NewRoot
hashChainInputs[2] = circuit.LeavesHashchainHash
hashChainInputs[3] = circuit.StartIndex
publicInputsHashChain := createHashChain(api, hashChainInputs)
api.AssertIsEqual(publicInputsHashChain, circuit.PublicInputHash)
newLeaves := make([]frontend.Variable, int(circuit.BatchSize))
for i := 0; i < int(circuit.BatchSize); i++ {
// old leaves is either 0 or a nullifier hash
// 1. 0 (zero value) means that the leaf has not been spent
// -> insert the new leaf
// 2. nullifier hash (non-zero) means that the leaf has been spent
// -> keep the old leaf don't insert the new leaf
selector := api.IsZero(circuit.OldLeaves[i])
newLeaves[i] = api.Select(selector, circuit.Leaves[i], circuit.OldLeaves[i])
}
leavesHashchainHash := createHashChain(api, circuit.Leaves)
api.AssertIsEqual(leavesHashchainHash, circuit.LeavesHashchainHash)
newRoot := circuit.OldRoot
indexBits := api.ToBinary(circuit.StartIndex, int(circuit.Height))
for i := 0; i < int(circuit.BatchSize); i++ {
newRoot = abstractor.Call(api, MerkleRootUpdateGadget{
OldRoot: newRoot,
OldLeaf: circuit.OldLeaves[i],
NewLeaf: newLeaves[i],
PathIndex: indexBits,
MerkleProof: circuit.MerkleProofs[i],
Height: int(circuit.Height),
})
indexBits = incrementBits(api, indexBits)
}
api.AssertIsEqual(newRoot, circuit.NewRoot)
return nil
}
type BatchAppendWithProofsParameters struct {
PublicInputHash *big.Int
OldRoot *big.Int
NewRoot *big.Int
OldLeaves []*big.Int
LeavesHashchainHash *big.Int
Leaves []*big.Int
MerkleProofs [][]big.Int
StartIndex uint32
Height uint32
BatchSize uint32
Tree *merkle_tree.PoseidonTree
}
func (p *BatchAppendWithProofsParameters) ValidateShape() error {
if len(p.Leaves) != int(p.BatchSize) {
return fmt.Errorf("wrong number of leaves: %d, expected: %d", len(p.Leaves), p.BatchSize)
}
if len(p.OldLeaves) != int(p.BatchSize) {
return fmt.Errorf("wrong number of tx hashes: %d, expected: %d", len(p.OldLeaves), p.BatchSize)
}
if len(p.MerkleProofs) != int(p.BatchSize) {
return fmt.Errorf("wrong number of merkle proofs: %d", len(p.MerkleProofs))
}
for i, proof := range p.MerkleProofs {
if len(proof) != int(p.Height) {
return fmt.Errorf("wrong size of merkle proof for proof %d: %d", i, len(proof))
}
}
return nil
}
func SetupBatchAppendWithProofs(height uint32, batchSize uint32) (*ProvingSystemV2, error) {
fmt.Println("Setting up batch update")
ccs, err := R1CSBatchAppendWithProof(height, batchSize)
if err != nil {
return nil, err
}
pk, vk, err := groth16.Setup(ccs)
if err != nil {
return nil, err
}
return &ProvingSystemV2{
TreeHeight: height,
BatchSize: batchSize,
ProvingKey: pk,
VerifyingKey: vk,
ConstraintSystem: ccs}, nil
}
func (ps *ProvingSystemV2) ProveBatchAppendWithProofs(params *BatchAppendWithProofsParameters) (*Proof, error) {
if err := params.ValidateShape(); err != nil {
return nil, err
}
publicInputHash := frontend.Variable(params.PublicInputHash)
oldRoot := frontend.Variable(params.OldRoot)
newRoot := frontend.Variable(params.NewRoot)
leavesHashchainHash := frontend.Variable(params.LeavesHashchainHash)
txHashes := make([]frontend.Variable, len(params.OldLeaves))
leaves := make([]frontend.Variable, len(params.Leaves))
merkleProofs := make([][]frontend.Variable, len(params.MerkleProofs))
startIndex := params.StartIndex
for i := 0; i < len(params.Leaves); i++ {
leaves[i] = frontend.Variable(params.Leaves[i])
txHashes[i] = frontend.Variable(params.OldLeaves[i])
merkleProofs[i] = make([]frontend.Variable, len(params.MerkleProofs[i]))
for j := 0; j < len(params.MerkleProofs[i]); j++ {
merkleProofs[i][j] = frontend.Variable(params.MerkleProofs[i][j])
}
}
assignment := BatchAppendWithProofsCircuit{
PublicInputHash: publicInputHash,
OldRoot: oldRoot,
NewRoot: newRoot,
OldLeaves: txHashes,
LeavesHashchainHash: leavesHashchainHash,
Leaves: leaves,
StartIndex: startIndex,
MerkleProofs: merkleProofs,
Height: ps.TreeHeight,
BatchSize: ps.BatchSize,
}
witness, err := frontend.NewWitness(&assignment, ecc.BN254.ScalarField())
if err != nil {
return nil, fmt.Errorf("error creating witness: %v", err)
}
proof, err := groth16.Prove(ps.ConstraintSystem, ps.ProvingKey, witness)
if err != nil {
return nil, fmt.Errorf("error proving: %v", err)
}
return &Proof{proof}, nil
}
func R1CSBatchAppendWithProof(height uint32, batchSize uint32) (constraint.ConstraintSystem, error) {
leaves := make([]frontend.Variable, batchSize)
txHashes := make([]frontend.Variable, batchSize)
pathIndices := make([]frontend.Variable, batchSize)
merkleProofs := make([][]frontend.Variable, batchSize)
for i := 0; i < int(batchSize); i++ {
merkleProofs[i] = make([]frontend.Variable, height)
}
circuit := BatchAppendWithProofsCircuit{
PublicInputHash: frontend.Variable(0),
OldRoot: frontend.Variable(0),
NewRoot: frontend.Variable(0),
OldLeaves: txHashes,
LeavesHashchainHash: frontend.Variable(0),
Leaves: leaves,
StartIndex: pathIndices,
MerkleProofs: merkleProofs,
Height: height,
BatchSize: batchSize,
}
return frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)
}
func ImportBatchAppendWithProofSetup(treeHeight uint32, batchSize uint32, pkPath string, vkPath string) (*ProvingSystemV2, error) {
leaves := make([]frontend.Variable, batchSize)
txHashes := make([]frontend.Variable, batchSize)
oldMerkleProofs := make([][]frontend.Variable, batchSize)
newMerkleProofs := make([][]frontend.Variable, batchSize)
for i := 0; i < int(batchSize); i++ {
oldMerkleProofs[i] = make([]frontend.Variable, treeHeight)
newMerkleProofs[i] = make([]frontend.Variable, treeHeight)
}
circuit := BatchAppendWithProofsCircuit{
Height: treeHeight,
OldLeaves: txHashes,
Leaves: leaves,
MerkleProofs: newMerkleProofs,
StartIndex: make([]frontend.Variable, batchSize),
OldRoot: frontend.Variable(0),
NewRoot: frontend.Variable(0),
LeavesHashchainHash: frontend.Variable(0),
BatchSize: batchSize,
PublicInputHash: frontend.Variable(0),
}
fmt.Println("Compiling circuit")
ccs, err := frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)
if err != nil {
fmt.Println("Error compiling circuit")
return nil, err
} else {
fmt.Println("Compiled circuit successfully")
}
pk, err := LoadProvingKey(pkPath)
if err != nil {
return nil, err
}
vk, err := LoadVerifyingKey(vkPath)
if err != nil {
return nil, err
}
return &ProvingSystemV2{
TreeHeight: treeHeight,
BatchSize: batchSize,
ProvingKey: pk,
VerifyingKey: vk,
ConstraintSystem: ccs,
}, nil
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/marshal_non_inclusion.go
|
package prover
import (
"encoding/json"
"fmt"
"math/big"
)
type NonInclusionProofInputsJSON struct {
Root string `json:"root"`
Value string `json:"value"`
PathIndex uint32 `json:"pathIndex"`
PathElements []string `json:"pathElements"`
LeafLowerRangeValue string `json:"leafLowerRangeValue"`
LeafHigherRangeValue string `json:"leafHigherRangeValue"`
NextIndex uint32 `json:"nextIndex"`
}
type NonInclusionParametersJSON struct {
Inputs []NonInclusionProofInputsJSON `json:"new-addresses"`
}
func ParseNonInclusion(inputJSON string) (NonInclusionParameters, error) {
var proofData NonInclusionParameters
err := json.Unmarshal([]byte(inputJSON), &proofData)
if err != nil {
return NonInclusionParameters{}, fmt.Errorf("error parsing JSON: %v", err)
}
return proofData, nil
}
func (p *NonInclusionParameters) MarshalJSON() ([]byte, error) {
paramsJson := p.CreateNonInclusionParametersJSON()
return json.Marshal(paramsJson)
}
func (p *NonInclusionParameters) CreateNonInclusionParametersJSON() NonInclusionParametersJSON {
paramsJson := NonInclusionParametersJSON{}
paramsJson.Inputs = make([]NonInclusionProofInputsJSON, p.NumberOfCompressedAccounts())
for i := 0; i < int(p.NumberOfCompressedAccounts()); i++ {
paramsJson.Inputs[i].Root = toHex(&p.Inputs[i].Root)
paramsJson.Inputs[i].Value = toHex(&p.Inputs[i].Value)
paramsJson.Inputs[i].PathIndex = p.Inputs[i].PathIndex
paramsJson.Inputs[i].PathElements = make([]string, len(p.Inputs[i].PathElements))
for j := 0; j < len(p.Inputs[i].PathElements); j++ {
paramsJson.Inputs[i].PathElements[j] = toHex(&p.Inputs[i].PathElements[j])
}
paramsJson.Inputs[i].LeafLowerRangeValue = toHex(&p.Inputs[i].LeafLowerRangeValue)
paramsJson.Inputs[i].LeafHigherRangeValue = toHex(&p.Inputs[i].LeafHigherRangeValue)
paramsJson.Inputs[i].NextIndex = p.Inputs[i].NextIndex
}
return paramsJson
}
func (p *NonInclusionParameters) UnmarshalJSON(data []byte) error {
var params NonInclusionParametersJSON
err := json.Unmarshal(data, ¶ms)
if err != nil {
return err
}
err = p.UpdateWithJSON(params, err)
if err != nil {
return err
}
return nil
}
func (p *NonInclusionParameters) UpdateWithJSON(params NonInclusionParametersJSON, err error) error {
p.Inputs = make([]NonInclusionInputs, len(params.Inputs))
for i := 0; i < len(params.Inputs); i++ {
err = fromHex(&p.Inputs[i].Root, params.Inputs[i].Root)
if err != nil {
return err
}
err = fromHex(&p.Inputs[i].Value, params.Inputs[i].Value)
if err != nil {
return err
}
p.Inputs[i].PathIndex = params.Inputs[i].PathIndex
p.Inputs[i].PathElements = make([]big.Int, len(params.Inputs[i].PathElements))
for j := 0; j < len(params.Inputs[i].PathElements); j++ {
err = fromHex(&p.Inputs[i].PathElements[j], params.Inputs[i].PathElements[j])
if err != nil {
return err
}
}
err = fromHex(&p.Inputs[i].LeafLowerRangeValue, params.Inputs[i].LeafLowerRangeValue)
if err != nil {
return err
}
err = fromHex(&p.Inputs[i].LeafHigherRangeValue, params.Inputs[i].LeafHigherRangeValue)
if err != nil {
return err
}
p.Inputs[i].NextIndex = params.Inputs[i].NextIndex
}
return nil
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/batch_address_append_circuit.go
|
package prover
import (
"fmt"
"light/light-prover/logging"
"light/light-prover/prover/poseidon"
"math/big"
merkletree "light/light-prover/merkle-tree"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend/groth16"
"github.com/consensys/gnark/constraint"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/frontend/cs/r1cs"
"github.com/reilabs/gnark-lean-extractor/v2/abstractor"
)
type BatchAddressTreeAppendCircuit struct {
PublicInputHash frontend.Variable `gnark:",public"`
OldRoot frontend.Variable `gnark:",private"`
NewRoot frontend.Variable `gnark:",private"`
HashchainHash frontend.Variable `gnark:",private"`
StartIndex frontend.Variable `gnark:",private"`
LowElementValues []frontend.Variable `gnark:",private"`
LowElementNextIndices []frontend.Variable `gnark:",private"`
LowElementNextValues []frontend.Variable `gnark:",private"`
LowElementIndices []frontend.Variable `gnark:",private"`
LowElementProofs [][]frontend.Variable `gnark:",private"`
NewElementValues []frontend.Variable `gnark:",private"`
NewElementProofs [][]frontend.Variable `gnark:",private"`
BatchSize uint32
TreeHeight uint32
}
func (circuit *BatchAddressTreeAppendCircuit) Define(api frontend.API) error {
currentRoot := circuit.OldRoot
indexBits := api.ToBinary(circuit.StartIndex, int(circuit.TreeHeight))
for i := uint32(0); i < circuit.BatchSize; i++ {
oldLowLeafHash := abstractor.Call(api, LeafHashGadget{
LeafLowerRangeValue: circuit.LowElementValues[i],
NextIndex: circuit.LowElementNextIndices[i],
LeafHigherRangeValue: circuit.LowElementNextValues[i],
Value: circuit.NewElementValues[i],
})
newLowLeafNextIndex := api.Add(circuit.StartIndex, i)
lowLeafHash := abstractor.Call(api, poseidon.Poseidon3{
In1: circuit.LowElementValues[i],
In2: newLowLeafNextIndex,
In3: circuit.NewElementValues[i],
})
pathIndexBits := api.ToBinary(circuit.LowElementIndices[i], int(circuit.TreeHeight))
currentRoot = abstractor.Call(api, MerkleRootUpdateGadget{
OldRoot: currentRoot,
OldLeaf: oldLowLeafHash,
NewLeaf: lowLeafHash,
PathIndex: pathIndexBits,
MerkleProof: circuit.LowElementProofs[i],
Height: int(circuit.TreeHeight),
})
// value = new value
// next value is low leaf next value
// next index is new value next index
newLeafHash := abstractor.Call(api, poseidon.Poseidon3{
In1: circuit.NewElementValues[i],
In2: circuit.LowElementNextIndices[i],
In3: circuit.LowElementNextValues[i],
})
currentRoot = abstractor.Call(api, MerkleRootUpdateGadget{
OldRoot: currentRoot,
OldLeaf: getZeroValue(0),
NewLeaf: newLeafHash,
PathIndex: indexBits,
MerkleProof: circuit.NewElementProofs[i],
Height: int(circuit.TreeHeight),
})
indexBits = incrementBits(
api,
indexBits,
)
}
api.AssertIsEqual(circuit.NewRoot, currentRoot)
leavesHashChain := createHashChain(api, circuit.NewElementValues)
api.AssertIsEqual(circuit.HashchainHash, leavesHashChain)
publicInputsHashChain := circuit.computePublicInputHash(api)
api.AssertIsEqual(circuit.PublicInputHash, publicInputsHashChain)
return nil
}
func (circuit *BatchAddressTreeAppendCircuit) computePublicInputHash(api frontend.API) frontend.Variable {
hashChainInputs := []frontend.Variable{
circuit.OldRoot,
circuit.NewRoot,
circuit.HashchainHash,
circuit.StartIndex,
}
return createHashChain(api, hashChainInputs)
}
func InitBatchAddressTreeAppendCircuit(treeHeight uint32, batchSize uint32) BatchAddressTreeAppendCircuit {
logging.Logger().Info().
Uint32("treeHeight", treeHeight).
Uint32("batchSize", batchSize).
Msg("Initializing batch address append circuit")
lowElementValues := make([]frontend.Variable, batchSize)
lowElementNextIndices := make([]frontend.Variable, batchSize)
lowElementNextValues := make([]frontend.Variable, batchSize)
lowElementIndices := make([]frontend.Variable, batchSize)
lowElementProofs := make([][]frontend.Variable, batchSize)
newElementValues := make([]frontend.Variable, batchSize)
newElementProofs := make([][]frontend.Variable, batchSize)
for i := uint32(0); i < batchSize; i++ {
lowElementProofs[i] = make([]frontend.Variable, treeHeight)
newElementProofs[i] = make([]frontend.Variable, treeHeight)
}
return BatchAddressTreeAppendCircuit{
BatchSize: batchSize,
TreeHeight: treeHeight,
PublicInputHash: frontend.Variable(0),
OldRoot: frontend.Variable(0),
NewRoot: frontend.Variable(0),
HashchainHash: frontend.Variable(0),
StartIndex: frontend.Variable(0),
LowElementValues: lowElementValues,
LowElementNextIndices: lowElementNextIndices,
LowElementNextValues: lowElementNextValues,
LowElementIndices: lowElementIndices,
LowElementProofs: lowElementProofs,
NewElementValues: newElementValues,
NewElementProofs: newElementProofs,
}
}
func (params *BatchAddressAppendParameters) CreateWitness() (*BatchAddressTreeAppendCircuit, error) {
if params.BatchSize == 0 {
return nil, fmt.Errorf("batch size cannot be 0")
}
if params.TreeHeight == 0 {
return nil, fmt.Errorf("tree height cannot be 0")
}
circuit := &BatchAddressTreeAppendCircuit{
BatchSize: params.BatchSize,
TreeHeight: params.TreeHeight,
PublicInputHash: frontend.Variable(params.PublicInputHash),
OldRoot: frontend.Variable(params.OldRoot),
NewRoot: frontend.Variable(params.NewRoot),
HashchainHash: frontend.Variable(params.HashchainHash),
StartIndex: frontend.Variable(params.StartIndex),
LowElementValues: make([]frontend.Variable, params.BatchSize),
LowElementNextIndices: make([]frontend.Variable, params.BatchSize),
LowElementNextValues: make([]frontend.Variable, params.BatchSize),
LowElementIndices: make([]frontend.Variable, params.BatchSize),
NewElementValues: make([]frontend.Variable, params.BatchSize),
LowElementProofs: make([][]frontend.Variable, params.BatchSize),
NewElementProofs: make([][]frontend.Variable, params.BatchSize),
}
for i := uint32(0); i < params.BatchSize; i++ {
circuit.LowElementProofs[i] = make([]frontend.Variable, params.TreeHeight)
circuit.NewElementProofs[i] = make([]frontend.Variable, params.TreeHeight)
}
for i := uint32(0); i < params.BatchSize; i++ {
circuit.LowElementValues[i] = frontend.Variable(¶ms.LowElementValues[i])
circuit.LowElementNextIndices[i] = frontend.Variable(¶ms.LowElementNextIndices[i])
circuit.LowElementNextValues[i] = frontend.Variable(¶ms.LowElementNextValues[i])
circuit.LowElementIndices[i] = frontend.Variable(¶ms.LowElementIndices[i])
circuit.NewElementValues[i] = frontend.Variable(¶ms.NewElementValues[i])
for j := uint32(0); j < params.TreeHeight; j++ {
circuit.LowElementProofs[i][j] = frontend.Variable(¶ms.LowElementProofs[i][j])
circuit.NewElementProofs[i][j] = frontend.Variable(¶ms.NewElementProofs[i][j])
}
}
return circuit, nil
}
func (p *BatchAddressAppendParameters) ValidateShape() error {
expectedArrayLen := int(p.BatchSize)
expectedProofLen := int(p.TreeHeight)
if len(p.LowElementValues) != expectedArrayLen {
return fmt.Errorf("wrong number of low element values: %d, expected: %d",
len(p.LowElementValues), expectedArrayLen)
}
if len(p.LowElementIndices) != expectedArrayLen {
return fmt.Errorf("wrong number of low element indices: %d, expected: %d",
len(p.LowElementIndices), expectedArrayLen)
}
if len(p.LowElementNextIndices) != expectedArrayLen {
return fmt.Errorf("wrong number of low element next indices: %d, expected: %d",
len(p.LowElementNextIndices), expectedArrayLen)
}
if len(p.LowElementNextValues) != expectedArrayLen {
return fmt.Errorf("wrong number of low element next values: %d, expected: %d",
len(p.LowElementNextValues), expectedArrayLen)
}
if len(p.NewElementValues) != expectedArrayLen {
return fmt.Errorf("wrong number of new element values: %d, expected: %d",
len(p.NewElementValues), expectedArrayLen)
}
if len(p.LowElementProofs) != expectedArrayLen {
return fmt.Errorf("wrong number of low element proofs: %d, expected: %d",
len(p.LowElementProofs), expectedArrayLen)
}
if len(p.NewElementProofs) != expectedArrayLen {
return fmt.Errorf("wrong number of new element proofs: %d, expected: %d",
len(p.NewElementProofs), expectedArrayLen)
}
for i, proof := range p.LowElementProofs {
if len(proof) != expectedProofLen {
return fmt.Errorf("wrong proof length for LowElementProofs[%d]: got %d, expected %d",
i, len(proof), expectedProofLen)
}
}
for i, proof := range p.NewElementProofs {
if len(proof) != expectedProofLen {
return fmt.Errorf("wrong proof length for NewElementProofs[%d]: got %d, expected %d",
i, len(proof), expectedProofLen)
}
}
return nil
}
type BatchAddressAppendParameters struct {
PublicInputHash *big.Int
OldRoot *big.Int
NewRoot *big.Int
HashchainHash *big.Int
StartIndex uint32
LowElementValues []big.Int
LowElementIndices []big.Int
LowElementNextIndices []big.Int
LowElementNextValues []big.Int
NewElementValues []big.Int
LowElementProofs [][]big.Int
NewElementProofs [][]big.Int
TreeHeight uint32
BatchSize uint32
Tree *merkletree.IndexedMerkleTree
}
func SetupBatchAddressAppend(height uint32, batchSize uint32) (*ProvingSystemV2, error) {
fmt.Println("Setting up address append batch update: height", height, "batch size", batchSize)
ccs, err := R1CSBatchAddressAppend(height, batchSize)
if err != nil {
return nil, err
}
pk, vk, err := groth16.Setup(ccs)
if err != nil {
return nil, err
}
return &ProvingSystemV2{
CircuitType: BatchAddressAppendCircuitType,
TreeHeight: height,
BatchSize: batchSize,
ProvingKey: pk,
VerifyingKey: vk,
ConstraintSystem: ccs}, nil
}
func R1CSBatchAddressAppend(height uint32, batchSize uint32) (constraint.ConstraintSystem, error) {
circuit := InitBatchAddressTreeAppendCircuit(height, batchSize)
return frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)
}
func (ps *ProvingSystemV2) ProveBatchAddressAppend(params *BatchAddressAppendParameters) (*Proof, error) {
if params == nil {
panic("params cannot be nil")
}
if err := params.ValidateShape(); err != nil {
return nil, err
}
assignment, err := params.CreateWitness()
if err != nil {
return nil, fmt.Errorf("error creating circuit: %v", err)
}
witness, err := frontend.NewWitness(assignment, ecc.BN254.ScalarField())
if err != nil {
return nil, fmt.Errorf("error creating witness: %v", err)
}
proof, err := groth16.Prove(ps.ConstraintSystem, ps.ProvingKey, witness)
if err != nil {
return nil, fmt.Errorf("error proving: %v", err)
}
return &Proof{proof}, nil
}
func ImportBatchAddressAppendSetup(treeHeight uint32, batchSize uint32, pkPath string, vkPath string) (*ProvingSystemV2, error) {
circuit := InitBatchAddressTreeAppendCircuit(batchSize, treeHeight)
fmt.Println("Compiling circuit")
ccs, err := frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)
if err != nil {
fmt.Println("Error compiling circuit")
return nil, err
} else {
fmt.Println("Compiled circuit successfully")
}
pk, err := LoadProvingKey(pkPath)
if err != nil {
return nil, err
}
vk, err := LoadVerifyingKey(vkPath)
if err != nil {
return nil, err
}
return &ProvingSystemV2{
CircuitType: BatchAddressAppendCircuitType,
TreeHeight: treeHeight,
BatchSize: batchSize,
ProvingKey: pk,
VerifyingKey: vk,
ConstraintSystem: ccs,
}, nil
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/circuit_utils.go
|
package prover
import (
"light/light-prover/prover/poseidon"
"math/big"
"github.com/consensys/gnark/backend/groth16"
"github.com/consensys/gnark/constraint"
"github.com/consensys/gnark/frontend"
"github.com/reilabs/gnark-lean-extractor/v2/abstractor"
)
type Proof struct {
Proof groth16.Proof
}
type ProvingSystemV1 struct {
InclusionTreeHeight uint32
InclusionNumberOfCompressedAccounts uint32
NonInclusionTreeHeight uint32
NonInclusionNumberOfCompressedAccounts uint32
ProvingKey groth16.ProvingKey
VerifyingKey groth16.VerifyingKey
ConstraintSystem constraint.ConstraintSystem
}
type ProvingSystemV2 struct {
CircuitType CircuitType
TreeHeight uint32
BatchSize uint32
ProvingKey groth16.ProvingKey
VerifyingKey groth16.VerifyingKey
ConstraintSystem constraint.ConstraintSystem
}
type ProveParentHash struct {
Bit frontend.Variable
Hash frontend.Variable
Sibling frontend.Variable
}
func (gadget ProveParentHash) DefineGadget(api frontend.API) interface{} {
api.AssertIsBoolean(gadget.Bit)
d1 := api.Select(gadget.Bit, gadget.Sibling, gadget.Hash)
d2 := api.Select(gadget.Bit, gadget.Hash, gadget.Sibling)
hash := abstractor.Call(api, poseidon.Poseidon2{In1: d1, In2: d2})
return hash
}
type InclusionProof struct {
Roots []frontend.Variable
Leaves []frontend.Variable
InPathIndices []frontend.Variable
InPathElements [][]frontend.Variable
NumberOfCompressedAccounts uint32
Height uint32
}
func (gadget InclusionProof) DefineGadget(api frontend.API) interface{} {
currentHash := make([]frontend.Variable, gadget.NumberOfCompressedAccounts)
for proofIndex := 0; proofIndex < int(gadget.NumberOfCompressedAccounts); proofIndex++ {
currentPath := api.ToBinary(gadget.InPathIndices[proofIndex], int(gadget.Height))
hash := MerkleRootGadget{
Hash: gadget.Leaves[proofIndex],
Index: currentPath,
Path: gadget.InPathElements[proofIndex],
Height: int(gadget.Height)}
currentHash[proofIndex] = abstractor.Call(api, hash)
api.AssertIsEqual(currentHash[proofIndex], gadget.Roots[proofIndex])
}
return currentHash
}
type NonInclusionProof struct {
Roots []frontend.Variable
Values []frontend.Variable
LeafLowerRangeValues []frontend.Variable
LeafHigherRangeValues []frontend.Variable
NextIndices []frontend.Variable
InPathIndices []frontend.Variable
InPathElements [][]frontend.Variable
NumberOfCompressedAccounts uint32
Height uint32
}
func (gadget NonInclusionProof) DefineGadget(api frontend.API) interface{} {
currentHash := make([]frontend.Variable, gadget.NumberOfCompressedAccounts)
for proofIndex := 0; proofIndex < int(gadget.NumberOfCompressedAccounts); proofIndex++ {
leaf := LeafHashGadget{
LeafLowerRangeValue: gadget.LeafLowerRangeValues[proofIndex],
NextIndex: gadget.NextIndices[proofIndex],
LeafHigherRangeValue: gadget.LeafHigherRangeValues[proofIndex],
Value: gadget.Values[proofIndex]}
currentHash[proofIndex] = abstractor.Call(api, leaf)
currentPath := api.ToBinary(gadget.InPathIndices[proofIndex], int(gadget.Height))
hash := MerkleRootGadget{
Hash: currentHash[proofIndex],
Index: currentPath,
Path: gadget.InPathElements[proofIndex],
Height: int(gadget.Height)}
currentHash[proofIndex] = abstractor.Call(api, hash)
api.AssertIsEqual(currentHash[proofIndex], gadget.Roots[proofIndex])
}
return currentHash
}
type CombinedProof struct {
InclusionProof InclusionProof
NonInclusionProof NonInclusionProof
}
func (gadget CombinedProof) DefineGadget(api frontend.API) interface{} {
abstractor.Call(api, gadget.InclusionProof)
abstractor.Call(api, gadget.NonInclusionProof)
return nil
}
type VerifyProof struct {
Leaf frontend.Variable
Path []frontend.Variable
Proof []frontend.Variable
}
func (gadget VerifyProof) DefineGadget(api frontend.API) interface{} {
currentHash := gadget.Leaf
for i := 0; i < len(gadget.Path); i++ {
currentHash = abstractor.Call(api, ProveParentHash{
Bit: gadget.Path[i],
Hash: currentHash,
Sibling: gadget.Proof[i],
})
}
return currentHash
}
type LeafHashGadget struct {
LeafLowerRangeValue frontend.Variable
NextIndex frontend.Variable
LeafHigherRangeValue frontend.Variable
Value frontend.Variable
}
// Limit the number of bits to 248 + 1,
// since we truncate address values to 31 bytes.
func (gadget LeafHashGadget) DefineGadget(api frontend.API) interface{} {
// Lower bound is less than value
abstractor.CallVoid(api, AssertIsLess{A: gadget.LeafLowerRangeValue, B: gadget.Value, N: 248})
// Value is less than upper bound
abstractor.CallVoid(api, AssertIsLess{A: gadget.Value, B: gadget.LeafHigherRangeValue, N: 248})
return abstractor.Call(api, poseidon.Poseidon3{In1: gadget.LeafLowerRangeValue, In2: gadget.NextIndex, In3: gadget.LeafHigherRangeValue})
}
// Assert A is less than B.
type AssertIsLess struct {
A frontend.Variable
B frontend.Variable
N int
}
// To prevent overflows N (the number of bits) must not be greater than 252 + 1,
// see https://github.com/zkopru-network/zkopru/issues/116
func (gadget AssertIsLess) DefineGadget(api frontend.API) interface{} {
// Add 2^N to B to ensure a positive number
oneShifted := new(big.Int).Lsh(big.NewInt(1), uint(gadget.N))
num := api.Add(gadget.A, api.Sub(*oneShifted, gadget.B))
api.ToBinary(num, gadget.N)
return []frontend.Variable{}
}
type MerkleRootGadget struct {
Hash frontend.Variable
Index []frontend.Variable
Path []frontend.Variable
Height int
}
func (gadget MerkleRootGadget) DefineGadget(api frontend.API) interface{} {
currentHash := gadget.Hash
for i := 0; i < gadget.Height; i++ {
currentHash = abstractor.Call(api, ProveParentHash{
Bit: gadget.Index[i],
Hash: currentHash,
Sibling: gadget.Path[i],
})
}
return currentHash
}
type MerkleRootUpdateGadget struct {
OldRoot frontend.Variable
OldLeaf frontend.Variable
NewLeaf frontend.Variable
PathIndex []frontend.Variable
MerkleProof []frontend.Variable
Height int
}
func (gadget MerkleRootUpdateGadget) DefineGadget(api frontend.API) interface{} {
oldRoot := abstractor.Call(api, MerkleRootGadget{
Hash: gadget.OldLeaf,
Index: gadget.PathIndex,
Path: gadget.MerkleProof,
Height: gadget.Height,
})
api.AssertIsEqual(oldRoot, gadget.OldRoot)
newRoot := abstractor.Call(api, MerkleRootGadget{
Hash: gadget.NewLeaf,
Index: gadget.PathIndex,
Path: gadget.MerkleProof,
Height: gadget.Height,
})
return newRoot
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/inclusion_circuit.go
|
package prover
import (
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/frontend/cs/r1cs"
"github.com/reilabs/gnark-lean-extractor/v2/abstractor"
)
type InclusionCircuit struct {
// public inputs
Roots []frontend.Variable `gnark:",public"`
Leaves []frontend.Variable `gnark:",public"`
// private inputs
InPathIndices []frontend.Variable `gnark:"input"`
InPathElements [][]frontend.Variable `gnark:"input"`
NumberOfCompressedAccounts uint32
Height uint32
}
func (circuit *InclusionCircuit) Define(api frontend.API) error {
abstractor.CallVoid(api, InclusionProof{
Roots: circuit.Roots,
Leaves: circuit.Leaves,
InPathElements: circuit.InPathElements,
InPathIndices: circuit.InPathIndices,
NumberOfCompressedAccounts: circuit.NumberOfCompressedAccounts,
Height: circuit.Height,
})
return nil
}
func ImportInclusionSetup(treeHeight uint32, numberOfCompressedAccounts uint32, pkPath string, vkPath string) (*ProvingSystemV1, error) {
roots := make([]frontend.Variable, numberOfCompressedAccounts)
leaves := make([]frontend.Variable, numberOfCompressedAccounts)
inPathIndices := make([]frontend.Variable, numberOfCompressedAccounts)
inPathElements := make([][]frontend.Variable, numberOfCompressedAccounts)
for i := 0; i < int(numberOfCompressedAccounts); i++ {
inPathElements[i] = make([]frontend.Variable, treeHeight)
}
circuit := InclusionCircuit{
Height: treeHeight,
NumberOfCompressedAccounts: numberOfCompressedAccounts,
Roots: roots,
Leaves: leaves,
InPathIndices: inPathIndices,
InPathElements: inPathElements,
}
ccs, err := frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)
if err != nil {
return nil, err
}
pk, err := LoadProvingKey(pkPath)
if err != nil {
return nil, err
}
vk, err := LoadVerifyingKey(vkPath)
if err != nil {
return nil, err
}
return &ProvingSystemV1{
InclusionTreeHeight: treeHeight,
InclusionNumberOfCompressedAccounts: numberOfCompressedAccounts,
ProvingKey: pk,
VerifyingKey: vk,
ConstraintSystem: ccs}, nil
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/batch_append_with_subtrees_circuit_test.go
|
package prover
import (
"math/big"
"testing"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/test"
)
func TestBatchAppendWithSubtreesCircuit(t *testing.T) {
assert := test.NewAssert(t)
t.Run("Successful proofs", func(t *testing.T) {
testCases := []struct {
name string
treeDepth uint32
batchSize uint32
startIndex uint32
}{
{"Small batch", 26, 10, 0},
{"Medium batch", 26, 100, 0},
{"Large batch", 26, 1000, 0},
{"Tree depth = 4", 4, 10, 0},
{"Non-zero start index", 26, 100, 500},
{"Start index near tree end", 10, 10, (1 << 10) - 15}, // 2^10 - 15 = 1009
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
params := BuildAndUpdateBatchAppendWithSubtreesParameters(tc.treeDepth, tc.batchSize, tc.startIndex, nil)
circuit := createCircuit(¶ms)
witness := createWitness(¶ms)
err := test.IsSolved(&circuit, witness, ecc.BN254.ScalarField())
assert.NoError(err)
})
}
})
t.Run("Append 20 leaves in 2 proofs", func(t *testing.T) {
treeDepth := uint32(26)
batchSize := uint32(10)
var params *BatchAppendWithSubtreesParameters
for i := uint32(0); i < 2; i++ {
startIndex := i * batchSize
newParams := BuildAndUpdateBatchAppendWithSubtreesParameters(treeDepth, batchSize, startIndex, params)
circuit := createCircuit(&newParams)
witness := createWitness(&newParams)
err := test.IsSolved(&circuit, witness, ecc.BN254.ScalarField())
assert.NoError(err)
params = &newParams
}
})
t.Run("Append 50 leaves in 5 proofs", func(t *testing.T) {
treeDepth := uint32(26)
batchSize := uint32(10)
var params *BatchAppendWithSubtreesParameters
for i := uint32(0); i < 5; i++ {
startIndex := i * batchSize
newParams := BuildAndUpdateBatchAppendWithSubtreesParameters(treeDepth, batchSize, startIndex, params)
circuit := createCircuit(&newParams)
witness := createWitness(&newParams)
err := test.IsSolved(&circuit, witness, ecc.BN254.ScalarField())
assert.NoError(err)
params = &newParams
}
})
t.Run("Test fill tree completely", func(t *testing.T) {
treeDepth := uint32(10)
batchSize := uint32(10)
totalLeaves := uint32(1 << treeDepth)
var params *BatchAppendWithSubtreesParameters
for startIndex := uint32(0); startIndex < totalLeaves; startIndex += batchSize {
remainingLeaves := totalLeaves - startIndex
if remainingLeaves < batchSize {
batchSize = remainingLeaves
}
newParams := BuildAndUpdateBatchAppendWithSubtreesParameters(treeDepth, batchSize, startIndex, params)
circuit := createCircuit(&newParams)
witness := createWitness(&newParams)
err := test.IsSolved(&circuit, witness, ecc.BN254.ScalarField())
assert.NoError(err)
params = &newParams
}
})
t.Run("Multiple appends", func(t *testing.T) {
treeDepth := uint32(26)
batchSize := uint32(100)
numAppends := 5
var params *BatchAppendWithSubtreesParameters
for i := 0; i < numAppends; i++ {
startIndex := uint32(i * int(batchSize))
newParams := BuildAndUpdateBatchAppendWithSubtreesParameters(treeDepth, batchSize, startIndex, params)
circuit := createCircuit(&newParams)
witness := createWitness(&newParams)
err := test.IsSolved(&circuit, witness, ecc.BN254.ScalarField())
assert.NoError(err)
params = &newParams
}
})
t.Run("Append at tree capacity", func(t *testing.T) {
treeDepth := uint32(10) // Small depth for quicker testing
batchSize := uint32(5)
startIndex := uint32((1 << treeDepth) - batchSize) // 2^10 - 5 = 1019
params := BuildAndUpdateBatchAppendWithSubtreesParameters(treeDepth, batchSize, startIndex, nil)
circuit := createCircuit(¶ms)
witness := createWitness(¶ms)
err := test.IsSolved(&circuit, witness, ecc.BN254.ScalarField())
assert.NoError(err)
})
t.Run("Failing cases", func(t *testing.T) {
params := BuildAndUpdateBatchAppendWithSubtreesParameters(26, 100, 0, nil)
testCases := []struct {
name string
modifyParams func(*BatchAppendWithSubtreesParameters)
}{
{
name: "Invalid OldSubTreeHashChain",
modifyParams: func(p *BatchAppendWithSubtreesParameters) {
p.OldSubTreeHashChain = big.NewInt(999)
},
},
{
name: "Invalid NewSubTreeHashChain",
modifyParams: func(p *BatchAppendWithSubtreesParameters) {
p.NewSubTreeHashChain = big.NewInt(999)
},
},
{
name: "Invalid NewRoot",
modifyParams: func(p *BatchAppendWithSubtreesParameters) {
p.NewRoot = big.NewInt(999)
},
},
{
name: "Invalid HashchainHash",
modifyParams: func(p *BatchAppendWithSubtreesParameters) {
p.HashchainHash = big.NewInt(999)
},
},
{
name: "Invalid Leaf",
modifyParams: func(p *BatchAppendWithSubtreesParameters) {
p.Leaves[0] = big.NewInt(999)
},
},
{
name: "Invalid Subtree",
modifyParams: func(p *BatchAppendWithSubtreesParameters) {
p.Subtrees[0] = big.NewInt(999)
},
},
{
name: "Mismatched BatchSize",
modifyParams: func(p *BatchAppendWithSubtreesParameters) {
p.Leaves = p.Leaves[:len(p.Leaves)-1] // Remove last leaf
},
},
{
name: "Start index exceeds tree capacity",
modifyParams: func(p *BatchAppendWithSubtreesParameters) {
p.StartIndex = 1 << p.TreeHeight // This should be invalid
},
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
invalidParams := params
tc.modifyParams(&invalidParams)
circuit := createCircuit(&invalidParams)
witness := createWitness(&invalidParams)
err := test.IsSolved(&circuit, witness, ecc.BN254.ScalarField())
assert.Error(err)
})
}
t.Run("Invalid order of valid leaves", func(t *testing.T) {
invalidParams := params
invalidParams.Leaves[0], invalidParams.Leaves[1] = invalidParams.Leaves[1], invalidParams.Leaves[0]
circuit := createCircuit(&invalidParams)
witness := createWitness(&invalidParams)
err := test.IsSolved(&circuit, witness, ecc.BN254.ScalarField())
assert.Error(err)
})
t.Run("Invalid order of valid subtree hashes", func(t *testing.T) {
invalidParams := params
// Swap two subtree hashes to create an invalid order
if len(invalidParams.Subtrees) >= 2 {
invalidParams.Subtrees[0], invalidParams.Subtrees[1] = invalidParams.Subtrees[1], invalidParams.Subtrees[0]
} else {
t.Skip("Not enough subtrees to perform this test")
}
circuit := createCircuit(&invalidParams)
witness := createWitness(&invalidParams)
err := test.IsSolved(&circuit, witness, ecc.BN254.ScalarField())
assert.Error(err, "Circuit should not be satisfied with invalid order of subtree hashes")
})
t.Run("Inconsistent subtree hashes", func(t *testing.T) {
invalidParams := params
// Change a subtree hash to an inconsistent value
if len(invalidParams.Subtrees) > 0 {
invalidParams.Subtrees[0] = new(big.Int).Add(invalidParams.Subtrees[0], big.NewInt(1))
} else {
t.Skip("No subtrees available to perform this test")
}
circuit := createCircuit(&invalidParams)
witness := createWitness(&invalidParams)
err := test.IsSolved(&circuit, witness, ecc.BN254.ScalarField())
assert.Error(err, "Circuit should not be satisfied with inconsistent subtree hashes")
})
})
}
func createCircuit(params *BatchAppendWithSubtreesParameters) BatchAppendWithSubtreesCircuit {
circuit := BatchAppendWithSubtreesCircuit{
PublicInputHash: frontend.Variable(0),
OldSubTreeHashChain: frontend.Variable(0),
NewSubTreeHashChain: frontend.Variable(0),
NewRoot: frontend.Variable(0),
HashchainHash: frontend.Variable(0),
StartIndex: frontend.Variable(0),
Leaves: make([]frontend.Variable, len(params.Leaves)),
Subtrees: make([]frontend.Variable, len(params.Subtrees)),
BatchSize: uint32(len(params.Leaves)),
TreeHeight: uint32(len(params.Subtrees)),
}
for i := range circuit.Leaves {
circuit.Leaves[i] = frontend.Variable(0)
}
for i := range circuit.Subtrees {
circuit.Subtrees[i] = frontend.Variable(0)
}
return circuit
}
func createWitness(params *BatchAppendWithSubtreesParameters) *BatchAppendWithSubtreesCircuit {
witness := &BatchAppendWithSubtreesCircuit{
PublicInputHash: frontend.Variable(params.PublicInputHash),
OldSubTreeHashChain: frontend.Variable(params.OldSubTreeHashChain),
NewSubTreeHashChain: frontend.Variable(params.NewSubTreeHashChain),
NewRoot: frontend.Variable(params.NewRoot),
HashchainHash: frontend.Variable(params.HashchainHash),
StartIndex: frontend.Variable(params.StartIndex),
Leaves: make([]frontend.Variable, len(params.Leaves)),
Subtrees: make([]frontend.Variable, len(params.Subtrees)),
BatchSize: uint32(len(params.Leaves)),
TreeHeight: uint32(len(params.Subtrees)),
}
for i, leaf := range params.Leaves {
witness.Leaves[i] = frontend.Variable(leaf)
}
for i, subtree := range params.Subtrees {
witness.Subtrees[i] = frontend.Variable(subtree)
}
return witness
}
func BenchmarkBatchAppendWithSubtreesCircuit(b *testing.B) {
params := BuildAndUpdateBatchAppendWithSubtreesParameters(26, 1000, 0, nil)
circuit := createCircuit(¶ms)
witness := createWitness(¶ms)
b.ResetTimer()
for i := 0; i < b.N; i++ {
_ = test.IsSolved(&circuit, witness, ecc.BN254.ScalarField())
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/marshal_batch_append_with_proofs.go
|
package prover
import (
"encoding/json"
"math/big"
)
type BatchAppendWithProofsInputsJSON struct {
PublicInputHash string `json:"publicInputHash"`
OldRoot string `json:"oldRoot"`
NewRoot string `json:"newRoot"`
LeavesHashchainHash string `json:"leavesHashchainHash"`
StartIndex uint32 `json:"startIndex"`
OldLeaves []string `json:"oldLeaves"`
Leaves []string `json:"leaves"`
MerkleProofs [][]string `json:"merkleProofs"`
Height uint32 `json:"height"`
BatchSize uint32 `json:"batchSize"`
}
func (p *BatchAppendWithProofsParameters) MarshalJSON() ([]byte, error) {
paramsJSON := p.createBatchAppendWithProofsParametersJSON()
return json.Marshal(paramsJSON)
}
func (p *BatchAppendWithProofsParameters) createBatchAppendWithProofsParametersJSON() BatchAppendWithProofsInputsJSON {
paramsJSON := BatchAppendWithProofsInputsJSON{
PublicInputHash: toHex(p.PublicInputHash),
OldRoot: toHex(p.OldRoot),
NewRoot: toHex(p.NewRoot),
LeavesHashchainHash: toHex(p.LeavesHashchainHash),
StartIndex: p.StartIndex,
Height: p.Height,
BatchSize: p.BatchSize,
}
paramsJSON.OldLeaves = make([]string, len(p.OldLeaves))
paramsJSON.Leaves = make([]string, len(p.Leaves))
paramsJSON.MerkleProofs = make([][]string, len(p.MerkleProofs))
for i := 0; i < len(p.Leaves); i++ {
paramsJSON.OldLeaves[i] = toHex(p.OldLeaves[i])
paramsJSON.Leaves[i] = toHex(p.Leaves[i])
paramsJSON.MerkleProofs[i] = make([]string, len(p.MerkleProofs[i]))
for j := 0; j < len(p.MerkleProofs[i]); j++ {
paramsJSON.MerkleProofs[i][j] = toHex(&p.MerkleProofs[i][j])
}
}
return paramsJSON
}
func (p *BatchAppendWithProofsParameters) UnmarshalJSON(data []byte) error {
var params BatchAppendWithProofsInputsJSON
err := json.Unmarshal(data, ¶ms)
if err != nil {
return err
}
return p.updateWithJSON(params)
}
func (p *BatchAppendWithProofsParameters) updateWithJSON(params BatchAppendWithProofsInputsJSON) error {
var err error
p.StartIndex = params.StartIndex
p.Height = params.Height
p.BatchSize = params.BatchSize
p.OldRoot = new(big.Int)
err = fromHex(p.OldRoot, params.OldRoot)
if err != nil {
return err
}
p.NewRoot = new(big.Int)
err = fromHex(p.NewRoot, params.NewRoot)
if err != nil {
return err
}
p.LeavesHashchainHash = new(big.Int)
err = fromHex(p.LeavesHashchainHash, params.LeavesHashchainHash)
if err != nil {
return err
}
p.OldLeaves = make([]*big.Int, len(params.OldLeaves))
p.Leaves = make([]*big.Int, len(params.Leaves))
for i := 0; i < len(params.Leaves); i++ {
p.OldLeaves[i] = new(big.Int)
err = fromHex(p.OldLeaves[i], params.OldLeaves[i])
if err != nil {
return err
}
p.Leaves[i] = new(big.Int)
err = fromHex(p.Leaves[i], params.Leaves[i])
if err != nil {
return err
}
}
p.MerkleProofs = make([][]big.Int, len(params.MerkleProofs))
for i := 0; i < len(params.MerkleProofs); i++ {
p.MerkleProofs[i] = make([]big.Int, len(params.MerkleProofs[i]))
for j := 0; j < len(params.MerkleProofs[i]); j++ {
err = fromHex(&p.MerkleProofs[i][j], params.MerkleProofs[i][j])
if err != nil {
return err
}
}
}
p.PublicInputHash = new(big.Int)
err = fromHex(p.PublicInputHash, params.PublicInputHash)
if err != nil {
return err
}
return nil
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/non_inclusion_circuit.go
|
package prover
import (
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/frontend/cs/r1cs"
"github.com/reilabs/gnark-lean-extractor/v2/abstractor"
)
type NonInclusionCircuit struct {
// public inputs
Roots []frontend.Variable `gnark:",public"`
Values []frontend.Variable `gnark:",public"`
// private inputs
LeafLowerRangeValues []frontend.Variable `gnark:"input"`
LeafHigherRangeValues []frontend.Variable `gnark:"input"`
NextIndices []frontend.Variable `gnark:"input"`
InPathIndices []frontend.Variable `gnark:"input"`
InPathElements [][]frontend.Variable `gnark:"input"`
NumberOfCompressedAccounts uint32
Height uint32
}
func (circuit *NonInclusionCircuit) Define(api frontend.API) error {
proof := NonInclusionProof{
Roots: circuit.Roots,
Values: circuit.Values,
LeafLowerRangeValues: circuit.LeafLowerRangeValues,
LeafHigherRangeValues: circuit.LeafHigherRangeValues,
NextIndices: circuit.NextIndices,
InPathElements: circuit.InPathElements,
InPathIndices: circuit.InPathIndices,
NumberOfCompressedAccounts: circuit.NumberOfCompressedAccounts,
Height: circuit.Height,
}
abstractor.Call1(api, proof)
return nil
}
func ImportNonInclusionSetup(treeHeight uint32, numberOfCompressedAccounts uint32, pkPath string, vkPath string) (*ProvingSystemV1, error) {
roots := make([]frontend.Variable, numberOfCompressedAccounts)
values := make([]frontend.Variable, numberOfCompressedAccounts)
leafLowerRangeValues := make([]frontend.Variable, numberOfCompressedAccounts)
leafHigherRangeValues := make([]frontend.Variable, numberOfCompressedAccounts)
leafIndices := make([]frontend.Variable, numberOfCompressedAccounts)
inPathIndices := make([]frontend.Variable, numberOfCompressedAccounts)
inPathElements := make([][]frontend.Variable, numberOfCompressedAccounts)
for i := 0; i < int(numberOfCompressedAccounts); i++ {
inPathElements[i] = make([]frontend.Variable, treeHeight)
}
circuit := NonInclusionCircuit{
Height: treeHeight,
NumberOfCompressedAccounts: numberOfCompressedAccounts,
Roots: roots,
Values: values,
LeafLowerRangeValues: leafLowerRangeValues,
LeafHigherRangeValues: leafHigherRangeValues,
NextIndices: leafIndices,
InPathIndices: inPathIndices,
InPathElements: inPathElements,
}
ccs, err := frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)
if err != nil {
return nil, err
}
pk, err := LoadProvingKey(pkPath)
if err != nil {
return nil, err
}
vk, err := LoadVerifyingKey(vkPath)
if err != nil {
return nil, err
}
return &ProvingSystemV1{
NonInclusionTreeHeight: treeHeight,
NonInclusionNumberOfCompressedAccounts: numberOfCompressedAccounts,
ProvingKey: pk,
VerifyingKey: vk,
ConstraintSystem: ccs}, nil
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/inclusion_test.go
|
package prover
import (
"bufio"
"fmt"
"os"
"strings"
"testing"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/test"
)
// Iterate over data from csv file "inclusion_test_data.tsv", which contains test data for the inclusion proof.
// The file has two columns, separated by a semicolon.
// First column is the expected result, second column is the input.
// For each row, run the test with the input and check if the result is as expected.
func TestInclusion(t *testing.T) {
assert := test.NewAssert(t)
file, err := os.Open("../test-data/inclusion.csv")
defer file.Close()
assert.Nil(err, "Error opening file: ", err)
scanner := bufio.NewScanner(file)
for scanner.Scan() {
line := scanner.Text()
if line == "" {
continue
}
splitLine := strings.Split(line, ";")
assert.Equal(len(splitLine), 2, "Invalid line: ", line)
var params InclusionParameters
err := params.UnmarshalJSON([]byte(splitLine[1]))
assert.Nil(err, "Error unmarshalling inputs: ", err)
var numberOfCompressedAccounts = params.NumberOfCompressedAccounts()
var treeHeight = params.TreeHeight()
roots := make([]frontend.Variable, numberOfCompressedAccounts)
leaves := make([]frontend.Variable, numberOfCompressedAccounts)
inPathIndices := make([]frontend.Variable, numberOfCompressedAccounts)
inPathElements := make([][]frontend.Variable, numberOfCompressedAccounts)
for i := 0; i < int(numberOfCompressedAccounts); i++ {
inPathElements[i] = make([]frontend.Variable, treeHeight)
}
for i, v := range params.Inputs {
roots[i] = v.Root
leaves[i] = v.Leaf
inPathIndices[i] = v.PathIndex
for j, v2 := range v.PathElements {
inPathElements[i][j] = v2
}
}
var circuit InclusionCircuit
circuit.Roots = make([]frontend.Variable, numberOfCompressedAccounts)
circuit.Leaves = make([]frontend.Variable, numberOfCompressedAccounts)
circuit.InPathIndices = make([]frontend.Variable, numberOfCompressedAccounts)
circuit.InPathElements = make([][]frontend.Variable, numberOfCompressedAccounts)
for i := 0; i < int(numberOfCompressedAccounts); i++ {
circuit.InPathElements[i] = make([]frontend.Variable, treeHeight)
}
circuit.NumberOfCompressedAccounts = numberOfCompressedAccounts
circuit.Height = treeHeight
// Check if the expected result is "true" or "false"
expectedResult := splitLine[0]
if expectedResult == "0" {
// Run the failing test
assert.ProverFailed(&circuit, &InclusionCircuit{
Roots: roots,
Leaves: leaves,
InPathIndices: inPathIndices,
InPathElements: inPathElements,
NumberOfCompressedAccounts: numberOfCompressedAccounts,
Height: treeHeight,
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254), test.NoSerialization())
} else if expectedResult == "1" {
// Run the passing test
assert.ProverSucceeded(&circuit, &InclusionCircuit{
Roots: roots,
Leaves: leaves,
InPathIndices: inPathIndices,
InPathElements: inPathElements,
NumberOfCompressedAccounts: numberOfCompressedAccounts,
Height: treeHeight,
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254), test.NoSerialization())
} else {
fmt.Println("Invalid expected result: ", expectedResult)
}
}
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/inclusion_proving_system.go
|
package prover
import (
"fmt"
"light/light-prover/logging"
"math/big"
"strconv"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend/groth16"
"github.com/consensys/gnark/constraint"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/frontend/cs/r1cs"
)
type InclusionInputs struct {
Root big.Int
PathIndex uint32
PathElements []big.Int
Leaf big.Int
}
type InclusionParameters struct {
Inputs []InclusionInputs
}
func (p *InclusionParameters) NumberOfCompressedAccounts() uint32 {
return uint32(len(p.Inputs))
}
func (p *InclusionParameters) TreeHeight() uint32 {
if len(p.Inputs) == 0 {
return 0
}
return uint32(len(p.Inputs[0].PathElements))
}
func (p *InclusionParameters) ValidateShape(treeHeight uint32, numOfCompressedAccounts uint32) error {
if p.NumberOfCompressedAccounts() != numOfCompressedAccounts {
return fmt.Errorf("wrong number of compressed accounts: %d", p.NumberOfCompressedAccounts())
}
if p.TreeHeight() != treeHeight {
return fmt.Errorf("wrong size of merkle proof for proof %d: %d", p.NumberOfCompressedAccounts(), p.TreeHeight())
}
return nil
}
func R1CSInclusion(treeHeight uint32, numberOfCompressedAccounts uint32) (constraint.ConstraintSystem, error) {
roots := make([]frontend.Variable, numberOfCompressedAccounts)
leaves := make([]frontend.Variable, numberOfCompressedAccounts)
inPathIndices := make([]frontend.Variable, numberOfCompressedAccounts)
inPathElements := make([][]frontend.Variable, numberOfCompressedAccounts)
for i := 0; i < int(numberOfCompressedAccounts); i++ {
inPathElements[i] = make([]frontend.Variable, treeHeight)
}
circuit := InclusionCircuit{
Height: treeHeight,
NumberOfCompressedAccounts: numberOfCompressedAccounts,
Roots: roots,
Leaves: leaves,
InPathIndices: inPathIndices,
InPathElements: inPathElements,
}
return frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)
}
func SetupInclusion(treeHeight uint32, numberOfCompressedAccounts uint32) (*ProvingSystemV1, error) {
ccs, err := R1CSInclusion(treeHeight, numberOfCompressedAccounts)
if err != nil {
return nil, err
}
pk, vk, err := groth16.Setup(ccs)
if err != nil {
return nil, err
}
return &ProvingSystemV1{
InclusionTreeHeight: treeHeight,
InclusionNumberOfCompressedAccounts: numberOfCompressedAccounts,
ProvingKey: pk,
VerifyingKey: vk,
ConstraintSystem: ccs}, nil
}
func (ps *ProvingSystemV1) ProveInclusion(params *InclusionParameters) (*Proof, error) {
if err := params.ValidateShape(ps.InclusionTreeHeight, ps.InclusionNumberOfCompressedAccounts); err != nil {
return nil, err
}
inPathIndices := make([]frontend.Variable, ps.InclusionNumberOfCompressedAccounts)
roots := make([]frontend.Variable, ps.InclusionNumberOfCompressedAccounts)
leaves := make([]frontend.Variable, ps.InclusionNumberOfCompressedAccounts)
inPathElements := make([][]frontend.Variable, ps.InclusionNumberOfCompressedAccounts)
for i := 0; i < int(ps.InclusionNumberOfCompressedAccounts); i++ {
roots[i] = params.Inputs[i].Root
leaves[i] = params.Inputs[i].Leaf
inPathIndices[i] = params.Inputs[i].PathIndex
inPathElements[i] = make([]frontend.Variable, ps.InclusionTreeHeight)
for j := 0; j < int(ps.InclusionTreeHeight); j++ {
inPathElements[i][j] = params.Inputs[i].PathElements[j]
}
}
assignment := InclusionCircuit{
Roots: roots,
Leaves: leaves,
InPathIndices: inPathIndices,
InPathElements: inPathElements,
}
witness, err := frontend.NewWitness(&assignment, ecc.BN254.ScalarField())
if err != nil {
return nil, err
}
logging.Logger().Info().Msg("Proof inclusion" + strconv.Itoa(int(ps.InclusionTreeHeight)) + " " + strconv.Itoa(int(ps.InclusionNumberOfCompressedAccounts)))
proof, err := groth16.Prove(ps.ConstraintSystem, ps.ProvingKey, witness)
if err != nil {
return nil, err
}
return &Proof{proof}, nil
}
func (ps *ProvingSystemV1) VerifyInclusion(root []big.Int, leaf []big.Int, proof *Proof) error {
leaves := make([]frontend.Variable, ps.InclusionNumberOfCompressedAccounts)
for i, v := range leaf {
leaves[i] = v
}
roots := make([]frontend.Variable, ps.InclusionNumberOfCompressedAccounts)
for i, v := range root {
roots[i] = v
}
publicAssignment := InclusionCircuit{
Roots: roots,
Leaves: leaves,
}
witness, err := frontend.NewWitness(&publicAssignment, ecc.BN254.ScalarField(), frontend.PublicOnly())
if err != nil {
return err
}
return groth16.Verify(proof.Proof, ps.VerifyingKey, witness)
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/string_utils.go
|
package prover
import (
"encoding/hex"
"fmt"
"math/big"
"strings"
)
func ParseHexStringList(input string) ([]big.Int, error) {
hexStrings := strings.Split(input, ",")
result := make([]big.Int, len(hexStrings))
for i, hexString := range hexStrings {
hexString = strings.TrimSpace(hexString)
hexString = strings.TrimPrefix(hexString, "0x")
bytes, err := hex.DecodeString(hexString)
if err != nil {
return nil, fmt.Errorf("invalid hex string: %s", hexString)
}
result[i].SetBytes(bytes)
}
return result, nil
}
func ParseBigInt(input string) (*big.Int, error) {
input = strings.TrimSpace(input)
input = strings.TrimPrefix(input, "0x")
bytes, err := hex.DecodeString(input)
if err != nil {
return nil, fmt.Errorf("invalid hex string: %s", input)
}
bigInt := new(big.Int).SetBytes(bytes)
return bigInt, nil
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/proving_keys_utils.go
|
package prover
import (
"bytes"
"fmt"
"io"
"light/light-prover/logging"
"os"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend/groth16"
gnarkio "github.com/consensys/gnark/io"
)
type RunMode string
const (
Forester RunMode = "forester"
ForesterTest RunMode = "forester-test"
Rpc RunMode = "rpc"
Full RunMode = "full"
FullTest RunMode = "full-test"
)
// Trusted setup utility functions
// Taken from: https://github.com/bnb-chain/zkbnb/blob/master/common/prove/proof_keys.go#L19
func LoadProvingKey(filepath string) (pk groth16.ProvingKey, err error) {
logging.Logger().Info().
Str("filepath", filepath).
Msg("start reading proving key")
pk = groth16.NewProvingKey(ecc.BN254)
f, err := os.Open(filepath)
if err != nil {
logging.Logger().Error().
Str("filepath", filepath).
Err(err).
Msg("error opening proving key file")
return pk, fmt.Errorf("error opening proving key file: %v", err)
}
defer f.Close()
fileInfo, err := f.Stat()
if err != nil {
logging.Logger().Error().
Str("filepath", filepath).
Err(err).
Msg("error getting proving key file info")
return pk, fmt.Errorf("error getting file info: %v", err)
}
logging.Logger().Info().
Str("filepath", filepath).
Int64("size", fileInfo.Size()).
Msg("proving key file stats")
n, err := pk.ReadFrom(f)
if err != nil {
logging.Logger().Error().
Str("filepath", filepath).
Int64("bytesRead", n).
Err(err).
Msg("error reading proving key file")
return pk, fmt.Errorf("error reading proving key: %v", err)
}
logging.Logger().Info().
Str("filepath", filepath).
Int64("bytesRead", n).
Msg("successfully read proving key")
return pk, nil
}
// Taken from: https://github.com/bnb-chain/zkbnb/blob/master/common/prove/proof_keys.go#L32
func LoadVerifyingKey(filepath string) (verifyingKey groth16.VerifyingKey, err error) {
logging.Logger().Info().Msg("start reading verifying key")
verifyingKey = groth16.NewVerifyingKey(ecc.BN254)
f, _ := os.Open(filepath)
_, err = verifyingKey.ReadFrom(f)
if err != nil {
return verifyingKey, fmt.Errorf("read file error")
}
err = f.Close()
if err != nil {
return nil, err
}
return verifyingKey, nil
}
func GetKeys(keysDir string, runMode RunMode, circuits []string) []string {
var keys []string
var inclusionKeys []string = []string{
keysDir + "inclusion_26_1.key",
keysDir + "inclusion_26_2.key",
keysDir + "inclusion_26_3.key",
keysDir + "inclusion_26_4.key",
keysDir + "inclusion_26_8.key",
}
var nonInclusionKeys []string = []string{
keysDir + "non-inclusion_26_1.key",
keysDir + "non-inclusion_26_2.key",
}
var combinedKeys []string = []string{
keysDir + "combined_26_1_1.key",
keysDir + "combined_26_1_2.key",
keysDir + "combined_26_2_1.key",
keysDir + "combined_26_2_2.key",
keysDir + "combined_26_3_1.key",
keysDir + "combined_26_3_2.key",
keysDir + "combined_26_4_1.key",
keysDir + "combined_26_4_2.key",
}
var appendWithSubtreesKeys []string = []string{
keysDir + "append-with-subtrees_26_1.key",
keysDir + "append-with-subtrees_26_10.key",
keysDir + "append-with-subtrees_26_100.key",
keysDir + "append-with-subtrees_26_500.key",
keysDir + "append-with-subtrees_26_1000.key",
}
var appendWithProofsKeys []string = []string{
keysDir + "append-with-proofs_26_1.key",
keysDir + "append-with-proofs_26_10.key",
keysDir + "append-with-proofs_26_100.key",
keysDir + "append-with-proofs_26_500.key",
keysDir + "append-with-proofs_26_1000.key",
}
var updateKeys []string = []string{
keysDir + "update_26_1.key",
keysDir + "update_26_10.key",
keysDir + "update_26_100.key",
keysDir + "update_26_500.key",
keysDir + "update_26_1000.key",
}
var appendWithSubtreesTestKeys []string = []string{
keysDir + "append-with-subtrees_26_10.key",
}
var appendWithProofsTestKeys []string = []string{
keysDir + "append-with-proofs_26_10.key",
}
var updateTestKeys []string = []string{
keysDir + "update_26_10.key",
}
var addressAppendKeys []string = []string{
keysDir + "address-append_40_1.key",
keysDir + "address-append_40_10.key",
keysDir + "address-append_40_100.key",
keysDir + "address-append_40_250.key",
keysDir + "address-append_40_500.key",
keysDir + "address-append_40_1000.key",
}
var addressAppendTestKeys []string = []string{
keysDir + "address-append_40_1.key",
keysDir + "address-append_40_10.key",
}
switch runMode {
case Forester: // inclusion + non-inclusion
keys = append(keys, inclusionKeys...)
keys = append(keys, nonInclusionKeys...)
case ForesterTest: // append-test + update-test + address-append-test
keys = append(keys, inclusionKeys...)
keys = append(keys, nonInclusionKeys...)
keys = append(keys, appendWithProofsTestKeys...)
keys = append(keys, updateTestKeys...)
keys = append(keys, addressAppendTestKeys...)
case Rpc: // inclusion + non-inclusion + combined
keys = append(keys, inclusionKeys...)
keys = append(keys, nonInclusionKeys...)
keys = append(keys, combinedKeys...)
case Full: // inclusion + non-inclusion + combined + append + update + address-append
keys = append(keys, inclusionKeys...)
keys = append(keys, nonInclusionKeys...)
keys = append(keys, combinedKeys...)
keys = append(keys, appendWithSubtreesKeys...)
keys = append(keys, updateKeys...)
keys = append(keys, addressAppendKeys...)
case FullTest: // inclusion + non-inclusion + combined + append-test + update-test + address-append-test
keys = append(keys, inclusionKeys...)
keys = append(keys, nonInclusionKeys...)
keys = append(keys, combinedKeys...)
keys = append(keys, appendWithSubtreesTestKeys...)
keys = append(keys, updateTestKeys...)
keys = append(keys, appendWithProofsTestKeys...)
keys = append(keys, addressAppendTestKeys...)
}
for _, circuit := range circuits {
switch circuit {
case "inclusion":
keys = append(keys, inclusionKeys...)
case "non-inclusion":
keys = append(keys, nonInclusionKeys...)
case "combined":
keys = append(keys, combinedKeys...)
case "append-with-subtrees":
keys = append(keys, appendWithSubtreesKeys...)
case "append-with-subtrees-test":
keys = append(keys, appendWithSubtreesTestKeys...)
case "append-with-proofs":
keys = append(keys, appendWithProofsKeys...)
case "append-with-proofs-test":
keys = append(keys, appendWithProofsTestKeys...)
case "update":
keys = append(keys, updateKeys...)
case "update-test":
keys = append(keys, updateTestKeys...)
case "address-append":
keys = append(keys, addressAppendKeys...)
case "address-append-test":
keys = append(keys, addressAppendTestKeys...)
}
}
seen := make(map[string]bool)
var uniqueKeys []string
for _, key := range keys {
if !seen[key] {
seen[key] = true
uniqueKeys = append(uniqueKeys, key)
}
}
logging.Logger().Info().
Strs("keys", uniqueKeys).
Msg("Loading proving system keys")
return uniqueKeys
}
func LoadKeys(keysDirPath string, runMode RunMode, circuits []string) ([]*ProvingSystemV1, []*ProvingSystemV2, error) {
var pssv1 []*ProvingSystemV1
var pssv2 []*ProvingSystemV2
keys := GetKeys(keysDirPath, runMode, circuits)
for _, key := range keys {
logging.Logger().Info().Msg("Reading proving system from file " + key + "...")
system, err := ReadSystemFromFile(key)
if err != nil {
return nil, nil, err
}
switch s := system.(type) {
case *ProvingSystemV1:
pssv1 = append(pssv1, s)
logging.Logger().Info().
Uint32("inclusionTreeHeight", s.InclusionTreeHeight).
Uint32("inclusionCompressedAccounts", s.InclusionNumberOfCompressedAccounts).
Uint32("nonInclusionTreeHeight", s.NonInclusionTreeHeight).
Uint32("nonInclusionCompressedAccounts", s.NonInclusionNumberOfCompressedAccounts).
Msg("Read ProvingSystem")
case *ProvingSystemV2:
pssv2 = append(pssv2, s)
logging.Logger().Info().
Uint32("treeHeight", s.TreeHeight).
Uint32("batchSize", s.BatchSize).
Msg("Read BatchAppendProvingSystem")
default:
return nil, nil, fmt.Errorf("unknown proving system type")
}
}
return pssv1, pssv2, nil
}
func createFileAndWriteBytes(filePath string, data []byte) error {
fmt.Println("Writing", len(data), "bytes to", filePath)
file, err := os.Create(filePath)
if err != nil {
return err
}
defer func(file *os.File) {
err := file.Close()
if err != nil {
return
}
}(file)
_, err = io.WriteString(file, fmt.Sprintf("%d", data))
if err != nil {
return err
}
fmt.Println("Wrote", len(data), "bytes to", filePath)
return nil
}
func WriteProvingSystem(system interface{}, path string, pathVkey string) error {
file, err := os.Create(path)
if err != nil {
return err
}
defer file.Close()
var written int64
switch s := system.(type) {
case *ProvingSystemV1:
written, err = s.WriteTo(file)
case *ProvingSystemV2:
written, err = s.WriteTo(file)
default:
return fmt.Errorf("unknown proving system type")
}
if err != nil {
return err
}
logging.Logger().Info().Int64("bytesWritten", written).Msg("Proving system written to file")
var vk interface{}
switch s := system.(type) {
case *ProvingSystemV1:
vk = s.VerifyingKey
case *ProvingSystemV2:
vk = s.VerifyingKey
}
var buf bytes.Buffer
_, err = vk.(gnarkio.WriterRawTo).WriteRawTo(&buf)
if err != nil {
return err
}
proofBytes := buf.Bytes()
err = createFileAndWriteBytes(pathVkey, proofBytes)
if err != nil {
return err
}
return nil
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/batch_address_append_circuit_test.go
|
package prover
import (
"math/big"
"testing"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/test"
)
func TestAddressAppendHardcoded4_1(t *testing.T) {
assert := test.NewAssert(t)
circuit := InitBatchAddressTreeAppendCircuit(4, 1)
params := get_test_data_1_insert()
witness, err := params.CreateWitness()
if err != nil {
t.Fatal(err)
}
err = test.IsSolved(&circuit, witness, ecc.BN254.ScalarField())
assert.NoError(err)
}
func TestAddressAppendHardcoded4_2(t *testing.T) {
assert := test.NewAssert(t)
circuit := InitBatchAddressTreeAppendCircuit(4, 2)
params := get_test_data_2_insert()
witness, err := params.CreateWitness()
if err != nil {
t.Fatal(err)
}
err = test.IsSolved(&circuit, witness, ecc.BN254.ScalarField())
assert.NoError(err)
}
func TestBatchAddressAppendCircuit(t *testing.T) {
assert := test.NewAssert(t)
t.Run("Basic operations", func(t *testing.T) {
testCases := []struct {
name string
treeHeight uint32
batchSize uint32
startIndex uint32
shouldPass bool
}{
{"Single insert height 4", 4, 1, 2, true},
{"Batch insert height 4", 4, 2, 2, true},
{"Single insert height 8", 8, 1, 2, true},
{"Large batch height 8", 8, 4, 2, true},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
circuit := InitBatchAddressTreeAppendCircuit(tc.treeHeight, tc.batchSize)
params, err := BuildTestAddressTree(tc.treeHeight, tc.batchSize, nil, tc.startIndex)
if err != nil {
t.Fatalf("Failed to build test tree: %v", err)
}
witness, err := params.CreateWitness()
if err != nil {
t.Fatalf("Failed to create witness: %v", err)
}
err = test.IsSolved(&circuit, witness, ecc.BN254.ScalarField())
if tc.shouldPass {
assert.NoError(err)
} else {
assert.Error(err)
}
})
}
})
t.Run("Invalid cases", func(t *testing.T) {
testCases := []struct {
name string
treeHeight uint32
batchSize uint32
startIndex uint32
modifyParams func(*BatchAddressAppendParameters)
}{
{
name: "Invalid OldRoot",
treeHeight: 4,
batchSize: 1,
startIndex: 0,
modifyParams: func(p *BatchAddressAppendParameters) {
p.OldRoot.Add(p.OldRoot, big.NewInt(1))
},
},
{
name: "Invalid NewRoot",
treeHeight: 4,
batchSize: 1,
startIndex: 0,
modifyParams: func(p *BatchAddressAppendParameters) {
p.NewRoot.Add(p.NewRoot, big.NewInt(1))
},
},
{
name: "Invalid HashchainHash",
treeHeight: 4,
batchSize: 1,
startIndex: 0,
modifyParams: func(p *BatchAddressAppendParameters) {
p.HashchainHash.Add(p.HashchainHash, big.NewInt(1))
},
},
{
name: "Invalid LowElementValue",
treeHeight: 4,
batchSize: 1,
startIndex: 0,
modifyParams: func(p *BatchAddressAppendParameters) {
p.LowElementValues[0].Add(&p.LowElementValues[0], big.NewInt(1))
},
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
circuit := InitBatchAddressTreeAppendCircuit(tc.treeHeight, tc.batchSize)
params, err := BuildTestAddressTree(tc.treeHeight, tc.batchSize, nil, tc.startIndex)
if err != nil {
t.Fatalf("Failed to build test tree: %v", err)
}
tc.modifyParams(params)
witness, err := params.CreateWitness()
if err != nil {
return
}
err = test.IsSolved(&circuit, witness, ecc.BN254.ScalarField())
assert.Error(err)
})
}
})
}
func get_test_data_1_insert() BatchAddressAppendParameters {
jsonData := `
{
"BatchSize": 1,
"HashchainHash": "0x1e",
"LowElementIndices": [
"0x0"
],
"LowElementNextIndices": [
"0x1"
],
"LowElementNextValues": [
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
],
"LowElementProofs": [
[
"0x1ea416eeb40218b540c1cfb8dbe91f6d54e8a29edc30a39e326b4057a7d963f5",
"0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864",
"0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1",
"0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238"
]
],
"LowElementValues": [
"0x0"
],
"NewElementProofs": [
[
"0x0",
"0x12e5c92ca57654ded1d93934a93505ce14ae3ed617c7f934673c1d3830975760",
"0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1",
"0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238"
]
],
"NewElementValues": [
"0x1e"
],
"NewRoot": "0x14b1bd68a7aaf8db72124dbdefd41c495565c5050b31c465f3407a6b1e3ef26d",
"OldRoot": "0x909e8762fb09c626001b19f6441a2cd2da21b1622c6970ec9c4863ec9c09855",
"PublicInputHash": "0x1686a526bc791be496f67a405f2c3cfc0f86b6c6dcec6e05dff5a6285c043fe",
"StartIndex": 2,
"TreeHeight": 4
}
`
params, err := ParseBatchAddressAppendInput(jsonData)
if err != nil {
panic(err)
}
return params
}
func get_test_data_2_insert() BatchAddressAppendParameters {
jsonData := `{
"BatchSize": 2,
"HashchainHash": "0x1e94e9fed8440d50ff872bedcc6a6c460f9c6688ac167f68e288057e63109410",
"LowElementIndices": [
"0x0",
"0x0"
],
"LowElementNextIndices": [
"0x1",
"0x2"
],
"LowElementNextValues": [
"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"0x1f"
],
"LowElementProofs": [
[
"0x1ea416eeb40218b540c1cfb8dbe91f6d54e8a29edc30a39e326b4057a7d963f5",
"0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864",
"0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1",
"0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238"
],
[
"0x1ea416eeb40218b540c1cfb8dbe91f6d54e8a29edc30a39e326b4057a7d963f5",
"0x864f3eb12bb83a5cdc9ff6fdc8b985aa4b87292c5eef49201065277170e8c51",
"0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1",
"0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238"
]
],
"LowElementValues": [
"0x0",
"0x0"
],
"NewElementProofs": [
[
"0x0",
"0x2cfd59ee6c304f7f1e82d9e7e857a380e991fb02728f09324baffef2807e74fa",
"0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1",
"0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238"
],
[
"0x29794d28dddbdb020ec3974ecc41bcf64fb695eb222bde71f2a130e92852c0eb",
"0x15920e98b921491171b9b2b0a8ac1545e10b58e9c058822b6de9f4179bbd2e7c",
"0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1",
"0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238"
]
],
"NewElementValues": [
"0x1f",
"0x1e"
],
"NewRoot": "0x2a62d5241a6d3659df612b996ad729abe32f425bfec249f060983013ba2cfdb8",
"OldRoot": "0x909e8762fb09c626001b19f6441a2cd2da21b1622c6970ec9c4863ec9c09855",
"PublicInputHash": "0x31a64ce5adc664d1092fd7353a76b4fe0a3e63ad0cf313d66a6bc89e5e4a840",
"StartIndex": 2,
"TreeHeight": 4
}`
params, err := ParseBatchAddressAppendInput(jsonData)
if err != nil {
panic(err)
}
return params
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/non_inclusion_proving_system.go
|
package prover
import (
"fmt"
"light/light-prover/logging"
"math/big"
"strconv"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend/groth16"
"github.com/consensys/gnark/constraint"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/frontend/cs/r1cs"
)
type NonInclusionInputs struct {
Root big.Int
Value big.Int
PathIndex uint32
PathElements []big.Int
LeafLowerRangeValue big.Int
LeafHigherRangeValue big.Int
NextIndex uint32
}
type NonInclusionParameters struct {
Inputs []NonInclusionInputs
}
func (p *NonInclusionParameters) NumberOfCompressedAccounts() uint32 {
return uint32(len(p.Inputs))
}
func (p *NonInclusionParameters) TreeHeight() uint32 {
if len(p.Inputs) == 0 {
return 0
}
return uint32(len(p.Inputs[0].PathElements))
}
func (p *NonInclusionParameters) ValidateShape(treeHeight uint32, numOfCompressedAccounts uint32) error {
if p.NumberOfCompressedAccounts() != numOfCompressedAccounts {
return fmt.Errorf("wrong number of compressed accounts, p.NumberOfCompressedAccounts: %d, numOfCompressedAccounts = %d", p.NumberOfCompressedAccounts(), numOfCompressedAccounts)
}
if p.TreeHeight() != treeHeight {
return fmt.Errorf("wrong size of merkle proof for proof %d: %d", p.NumberOfCompressedAccounts(), p.TreeHeight())
}
return nil
}
func R1CSNonInclusion(treeHeight uint32, numberOfCompressedAccounts uint32) (constraint.ConstraintSystem, error) {
roots := make([]frontend.Variable, numberOfCompressedAccounts)
values := make([]frontend.Variable, numberOfCompressedAccounts)
leafLowerRangeValues := make([]frontend.Variable, numberOfCompressedAccounts)
leafHigherRangeValues := make([]frontend.Variable, numberOfCompressedAccounts)
nextIndices := make([]frontend.Variable, numberOfCompressedAccounts)
inPathIndices := make([]frontend.Variable, numberOfCompressedAccounts)
inPathElements := make([][]frontend.Variable, numberOfCompressedAccounts)
for i := 0; i < int(numberOfCompressedAccounts); i++ {
inPathElements[i] = make([]frontend.Variable, treeHeight)
}
circuit := NonInclusionCircuit{
Height: treeHeight,
NumberOfCompressedAccounts: numberOfCompressedAccounts,
Roots: roots,
Values: values,
LeafLowerRangeValues: leafLowerRangeValues,
LeafHigherRangeValues: leafHigherRangeValues,
NextIndices: nextIndices,
InPathIndices: inPathIndices,
InPathElements: inPathElements,
}
return frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)
}
func SetupNonInclusion(treeHeight uint32, numberOfCompressedAccounts uint32) (*ProvingSystemV1, error) {
ccs, err := R1CSNonInclusion(treeHeight, numberOfCompressedAccounts)
if err != nil {
return nil, err
}
pk, vk, err := groth16.Setup(ccs)
if err != nil {
return nil, err
}
return &ProvingSystemV1{
NonInclusionTreeHeight: treeHeight,
NonInclusionNumberOfCompressedAccounts: numberOfCompressedAccounts,
ProvingKey: pk,
VerifyingKey: vk,
ConstraintSystem: ccs}, nil
}
func (ps *ProvingSystemV1) ProveNonInclusion(params *NonInclusionParameters) (*Proof, error) {
if err := params.ValidateShape(ps.NonInclusionTreeHeight, ps.NonInclusionNumberOfCompressedAccounts); err != nil {
return nil, err
}
roots := make([]frontend.Variable, ps.NonInclusionNumberOfCompressedAccounts)
values := make([]frontend.Variable, ps.NonInclusionNumberOfCompressedAccounts)
leafLowerRangeValues := make([]frontend.Variable, ps.NonInclusionNumberOfCompressedAccounts)
leafHigherRangeValues := make([]frontend.Variable, ps.NonInclusionNumberOfCompressedAccounts)
nextIndices := make([]frontend.Variable, ps.NonInclusionNumberOfCompressedAccounts)
inPathElements := make([][]frontend.Variable, ps.NonInclusionNumberOfCompressedAccounts)
inPathIndices := make([]frontend.Variable, ps.NonInclusionNumberOfCompressedAccounts)
for i := 0; i < int(ps.NonInclusionNumberOfCompressedAccounts); i++ {
roots[i] = params.Inputs[i].Root
values[i] = params.Inputs[i].Value
leafLowerRangeValues[i] = params.Inputs[i].LeafLowerRangeValue
leafHigherRangeValues[i] = params.Inputs[i].LeafHigherRangeValue
nextIndices[i] = params.Inputs[i].NextIndex
inPathIndices[i] = params.Inputs[i].PathIndex
inPathElements[i] = make([]frontend.Variable, ps.NonInclusionTreeHeight)
for j := 0; j < int(ps.NonInclusionTreeHeight); j++ {
inPathElements[i][j] = params.Inputs[i].PathElements[j]
}
}
assignment := NonInclusionCircuit{
Roots: roots,
Values: values,
LeafLowerRangeValues: leafLowerRangeValues,
LeafHigherRangeValues: leafHigherRangeValues,
NextIndices: nextIndices,
InPathIndices: inPathIndices,
InPathElements: inPathElements,
}
witness, err := frontend.NewWitness(&assignment, ecc.BN254.ScalarField())
if err != nil {
return nil, err
}
logging.Logger().Info().Msg("Proof non-inclusion" + strconv.Itoa(int(ps.NonInclusionTreeHeight)) + " " + strconv.Itoa(int(ps.NonInclusionNumberOfCompressedAccounts)))
proof, err := groth16.Prove(ps.ConstraintSystem, ps.ProvingKey, witness)
if err != nil {
logging.Logger().Error().Msg("non-inclusion prove error: " + err.Error())
return nil, err
}
return &Proof{proof}, nil
}
func (ps *ProvingSystemV1) VerifyNonInclusion(root []big.Int, leaves []big.Int, proof *Proof) error {
values := make([]frontend.Variable, ps.InclusionNumberOfCompressedAccounts)
for i, v := range leaves {
values[i] = v
}
roots := make([]frontend.Variable, ps.InclusionNumberOfCompressedAccounts)
for i, v := range root {
roots[i] = v
}
publicAssignment := NonInclusionCircuit{
Roots: roots,
Values: values,
}
witness, err := frontend.NewWitness(&publicAssignment, ecc.BN254.ScalarField(), frontend.PublicOnly())
if err != nil {
return err
}
return groth16.Verify(proof.Proof, ps.VerifyingKey, witness)
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/batch_append_with_proofs_circuit_test.go
|
package prover
import (
"testing"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/test"
)
func TestBatchAppendWithProofsCircuit(t *testing.T) {
assert := test.NewAssert(t)
t.Run("Valid batch update - full HashchainHash", func(t *testing.T) {
treeDepth := 10
batchSize := 2
startIndex := 0
params := BuildTestBatchAppendWithProofsTree(treeDepth, batchSize, nil, startIndex, false)
circuit := BatchAppendWithProofsCircuit{
PublicInputHash: frontend.Variable(0),
OldRoot: frontend.Variable(0),
NewRoot: frontend.Variable(0),
LeavesHashchainHash: frontend.Variable(0),
OldLeaves: make([]frontend.Variable, batchSize),
Leaves: make([]frontend.Variable, batchSize),
StartIndex: frontend.Variable(0),
MerkleProofs: make([][]frontend.Variable, batchSize),
Height: uint32(treeDepth),
BatchSize: uint32(batchSize),
}
for i := range circuit.MerkleProofs {
circuit.MerkleProofs[i] = make([]frontend.Variable, treeDepth)
}
witness := BatchAppendWithProofsCircuit{
PublicInputHash: frontend.Variable(params.PublicInputHash),
OldRoot: frontend.Variable(params.OldRoot),
NewRoot: frontend.Variable(params.NewRoot),
LeavesHashchainHash: frontend.Variable(params.LeavesHashchainHash),
OldLeaves: make([]frontend.Variable, batchSize),
Leaves: make([]frontend.Variable, batchSize),
MerkleProofs: make([][]frontend.Variable, batchSize),
StartIndex: frontend.Variable(params.StartIndex),
Height: uint32(treeDepth),
BatchSize: uint32(batchSize),
}
for i := 0; i < batchSize; i++ {
witness.Leaves[i] = frontend.Variable(params.Leaves[i])
witness.OldLeaves[i] = frontend.Variable(params.OldLeaves[i])
witness.StartIndex = frontend.Variable(params.StartIndex)
witness.MerkleProofs[i] = make([]frontend.Variable, treeDepth)
for j := 0; j < treeDepth; j++ {
witness.MerkleProofs[i][j] = frontend.Variable(params.MerkleProofs[i][j])
}
}
err := test.IsSolved(&circuit, &witness, ecc.BN254.ScalarField())
assert.NoError(err)
})
t.Run("Mixed batch update", func(t *testing.T) {
treeDepth := 26
batchSize := 1000
startIndex := 0
enable := true
params := BuildTestBatchAppendWithProofsTree(treeDepth, batchSize, nil, startIndex, enable)
circuit := BatchAppendWithProofsCircuit{
PublicInputHash: frontend.Variable(0),
OldRoot: frontend.Variable(0),
NewRoot: frontend.Variable(0),
LeavesHashchainHash: frontend.Variable(0),
OldLeaves: make([]frontend.Variable, batchSize),
Leaves: make([]frontend.Variable, batchSize),
StartIndex: frontend.Variable(0),
MerkleProofs: make([][]frontend.Variable, batchSize),
Height: uint32(treeDepth),
BatchSize: uint32(batchSize),
}
for i := range circuit.MerkleProofs {
circuit.MerkleProofs[i] = make([]frontend.Variable, treeDepth)
}
witness := BatchAppendWithProofsCircuit{
PublicInputHash: frontend.Variable(params.PublicInputHash),
OldRoot: frontend.Variable(params.OldRoot),
NewRoot: frontend.Variable(params.NewRoot),
LeavesHashchainHash: frontend.Variable(params.LeavesHashchainHash),
OldLeaves: make([]frontend.Variable, batchSize),
Leaves: make([]frontend.Variable, batchSize),
MerkleProofs: make([][]frontend.Variable, batchSize),
StartIndex: frontend.Variable(params.StartIndex),
Height: uint32(treeDepth),
BatchSize: uint32(batchSize),
}
for i := 0; i < batchSize; i++ {
witness.Leaves[i] = frontend.Variable(params.Leaves[i])
witness.OldLeaves[i] = frontend.Variable(params.OldLeaves[i])
witness.StartIndex = frontend.Variable(params.StartIndex)
witness.MerkleProofs[i] = make([]frontend.Variable, treeDepth)
for j := 0; j < treeDepth; j++ {
witness.MerkleProofs[i][j] = frontend.Variable(params.MerkleProofs[i][j])
}
}
err := test.IsSolved(&circuit, &witness, ecc.BN254.ScalarField())
assert.NoError(err)
})
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/marshal_update.go
|
package prover
import (
"encoding/json"
"fmt"
"math/big"
)
type BatchUpdateProofInputsJSON struct {
PublicInputHash string `json:"publicInputHash"`
OldRoot string `json:"oldRoot"`
NewRoot string `json:"newRoot"`
TxHashes []string `json:"txHashes"`
LeavesHashchainHash string `json:"leavesHashchainHash"`
Leaves []string `json:"leaves"`
OldLeaves []string `json:"oldLeaves"`
MerkleProofs [][]string `json:"newMerkleProofs"`
PathIndices []uint32 `json:"pathIndices"`
Height uint32 `json:"height"`
BatchSize uint32 `json:"batchSize"`
}
func ParseBatchUpdateInput(inputJSON string) (BatchUpdateParameters, error) {
var proofData BatchUpdateParameters
err := json.Unmarshal([]byte(inputJSON), &proofData)
if err != nil {
return BatchUpdateParameters{}, fmt.Errorf("error parsing JSON: %v", err)
}
return proofData, nil
}
func (p *BatchUpdateParameters) MarshalJSON() ([]byte, error) {
paramsJson := p.CreateBatchUpdateParametersJSON()
return json.Marshal(paramsJson)
}
func (p *BatchUpdateParameters) CreateBatchUpdateParametersJSON() BatchUpdateProofInputsJSON {
paramsJson := BatchUpdateProofInputsJSON{}
paramsJson.PublicInputHash = toHex(p.PublicInputHash)
paramsJson.OldRoot = toHex(p.OldRoot)
paramsJson.NewRoot = toHex(p.NewRoot)
paramsJson.LeavesHashchainHash = toHex(p.LeavesHashchainHash)
paramsJson.Height = p.Height
paramsJson.BatchSize = p.BatchSize
paramsJson.TxHashes = make([]string, len(p.TxHashes))
paramsJson.Leaves = make([]string, len(p.Leaves))
paramsJson.PathIndices = make([]uint32, len(p.PathIndices))
paramsJson.MerkleProofs = make([][]string, len(p.MerkleProofs))
paramsJson.OldLeaves = make([]string, len(p.OldLeaves))
// TODO: add assert that all slices are of the same length
for i := 0; i < len(p.Leaves); i++ {
paramsJson.OldLeaves[i] = toHex(p.OldLeaves[i])
paramsJson.Leaves[i] = toHex(p.Leaves[i])
paramsJson.TxHashes[i] = toHex(p.TxHashes[i])
paramsJson.PathIndices[i] = p.PathIndices[i]
paramsJson.MerkleProofs[i] = make([]string, len(p.MerkleProofs[i]))
for j := 0; j < len(p.MerkleProofs[i]); j++ {
paramsJson.MerkleProofs[i][j] = toHex(&p.MerkleProofs[i][j])
}
}
return paramsJson
}
func (p *BatchUpdateParameters) UnmarshalJSON(data []byte) error {
var params BatchUpdateProofInputsJSON
err := json.Unmarshal(data, ¶ms)
if err != nil {
return err
}
return p.UpdateWithJSON(params)
}
func (p *BatchUpdateParameters) UpdateWithJSON(params BatchUpdateProofInputsJSON) error {
var err error
p.Height = params.Height
p.BatchSize = params.BatchSize
p.OldRoot = new(big.Int)
err = fromHex(p.OldRoot, params.OldRoot)
if err != nil {
return err
}
p.NewRoot = new(big.Int)
err = fromHex(p.NewRoot, params.NewRoot)
if err != nil {
return err
}
p.LeavesHashchainHash = new(big.Int)
err = fromHex(p.LeavesHashchainHash, params.LeavesHashchainHash)
if err != nil {
return err
}
p.TxHashes = make([]*big.Int, len(params.TxHashes))
p.Leaves = make([]*big.Int, len(params.Leaves))
p.OldLeaves = make([]*big.Int, len(params.OldLeaves))
for i := 0; i < len(params.Leaves); i++ {
p.Leaves[i] = new(big.Int)
err = fromHex(p.Leaves[i], params.Leaves[i])
if err != nil {
return err
}
p.TxHashes[i] = new(big.Int)
err = fromHex(p.TxHashes[i], params.TxHashes[i])
if err != nil {
return err
}
p.OldLeaves[i] = new(big.Int)
err = fromHex(p.OldLeaves[i], params.OldLeaves[i])
if err != nil {
return err
}
}
p.PathIndices = make([]uint32, len(params.PathIndices))
copy(p.PathIndices, params.PathIndices)
p.MerkleProofs = make([][]big.Int, len(params.MerkleProofs))
for i := 0; i < len(params.MerkleProofs); i++ {
p.MerkleProofs[i] = make([]big.Int, len(params.MerkleProofs[i]))
for j := 0; j < len(params.MerkleProofs[i]); j++ {
err = fromHex(&p.MerkleProofs[i][j], params.MerkleProofs[i][j])
if err != nil {
return err
}
}
}
p.PublicInputHash = new(big.Int)
err = fromHex(p.PublicInputHash, params.PublicInputHash)
if err != nil {
return err
}
return nil
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/poseidon/poseidon_test.go
|
package poseidon
import (
"testing"
"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/test"
"github.com/reilabs/gnark-lean-extractor/v2/abstractor"
)
type TestPoseidonCircuit1 struct {
Input frontend.Variable `gnark:"input"`
Hash frontend.Variable `gnark:",public"`
}
type TestPoseidonCircuit2 struct {
Left frontend.Variable `gnark:"left"`
Right frontend.Variable `gnark:"right"`
Hash frontend.Variable `gnark:",public"`
}
type TestPoseidonCircuit3 struct {
First frontend.Variable `gnark:"first"`
Second frontend.Variable `gnark:"second"`
Third frontend.Variable `gnark:"third"`
Hash frontend.Variable `gnark:",public"`
}
func (circuit *TestPoseidonCircuit1) Define(api frontend.API) error {
poseidon := abstractor.Call(api, Poseidon1{circuit.Input})
api.AssertIsEqual(circuit.Hash, poseidon)
return nil
}
func (circuit *TestPoseidonCircuit2) Define(api frontend.API) error {
poseidon := abstractor.Call(api, Poseidon2{circuit.Left, circuit.Right})
api.AssertIsEqual(circuit.Hash, poseidon)
return nil
}
func (circuit *TestPoseidonCircuit3) Define(api frontend.API) error {
poseidon := abstractor.Call(api, Poseidon3{circuit.First, circuit.Second, circuit.Third})
api.AssertIsEqual(circuit.Hash, poseidon)
return nil
}
func TestPoseidon1(t *testing.T) {
assert := test.NewAssert(t)
var circuit1 TestPoseidonCircuit1
assert.ProverSucceeded(&circuit1, &TestPoseidonCircuit1{
Input: 0,
Hash: hex("0x2a09a9fd93c590c26b91effbb2499f07e8f7aa12e2b4940a3aed2411cb65e11c"),
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254))
assert.ProverSucceeded(&circuit1, &TestPoseidonCircuit1{
Input: 1,
Hash: hex("0x29176100eaa962bdc1fe6c654d6a3c130e96a4d1168b33848b897dc502820133"),
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254))
assert.ProverSucceeded(&circuit1, &TestPoseidonCircuit1{
Input: 2,
Hash: hex("0x131d73cf6b30079aca0dff6a561cd0ee50b540879abe379a25a06b24bde2bebd"),
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254))
}
func TestPoseidon2(t *testing.T) {
assert := test.NewAssert(t)
var circuit2 TestPoseidonCircuit2
assert.ProverSucceeded(&circuit2, &TestPoseidonCircuit2{
Left: 0,
Right: 0,
Hash: hex("0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864"),
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254))
assert.ProverSucceeded(&circuit2, &TestPoseidonCircuit2{
Left: 0,
Right: 1,
Hash: hex("0x1bd20834f5de9830c643778a2e88a3a1363c8b9ac083d36d75bf87c49953e65e"),
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254))
assert.ProverSucceeded(&circuit2, &TestPoseidonCircuit2{
Left: 1,
Right: 1,
Hash: hex("0x7af346e2d304279e79e0a9f3023f771294a78acb70e73f90afe27cad401e81"),
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254))
assert.ProverSucceeded(&circuit2, &TestPoseidonCircuit2{
Left: 1,
Right: 2,
Hash: hex("0x115cc0f5e7d690413df64c6b9662e9cf2a3617f2743245519e19607a4417189a"),
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254))
assert.ProverSucceeded(&circuit2, &TestPoseidonCircuit2{
Left: 31213,
Right: 132,
Hash: hex("0x303f59cd0831b5633bcda50514521b33776b5d4280eb5868ba1dbbe2e4d76ab5"),
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254))
}
func TestPoseidon3(t *testing.T) {
assert := test.NewAssert(t)
var circuit3 TestPoseidonCircuit3
assert.ProverSucceeded(&circuit3, &TestPoseidonCircuit3{
First: 123,
Second: 456,
Third: 789,
Hash: hex("0x15bf2dbca201b7b45f1ae01c1c1ac0eee26854c01758b9df14a319959c50155f"),
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254))
assert.ProverSucceeded(&circuit3, &TestPoseidonCircuit3{
First: 1,
Second: 1,
Third: 1,
Hash: hex("0x2c0066e10a72abd2b33c3b214cb3e81bcb1b6e30961cd23c202b18673bf2543"),
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254))
assert.ProverSucceeded(&circuit3, &TestPoseidonCircuit3{
First: 1,
Second: 2,
Third: 3,
Hash: hex("0xe7732d89e6939c0ff03d5e58dab6302f3230e269dc5b968f725df34ab36d732"),
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254))
assert.ProverSucceeded(&circuit3, &TestPoseidonCircuit3{
First: 1,
Second: 2,
Third: 3,
Hash: hex("0xe7732d89e6939c0ff03d5e58dab6302f3230e269dc5b968f725df34ab36d732"),
}, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254))
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/poseidon/constants.go
|
package poseidon
import (
"math/big"
"github.com/consensys/gnark/frontend"
)
func hex(s string) big.Int {
var bi big.Int
bi.SetString(s, 0)
return bi
}
var MDS_2 = [][]frontend.Variable{
{
hex("0x066f6f85d6f68a85ec10345351a23a3aaf07f38af8c952a7bceca70bd2af7ad5"),
hex("0x2b9d4b4110c9ae997782e1509b1d0fdb20a7c02bbd8bea7305462b9f8125b1e8"),
}, {
hex("0x0cc57cdbb08507d62bf67a4493cc262fb6c09d557013fff1f573f431221f8ff9"),
hex("0x1274e649a32ed355a31a6ed69724e1adade857e86eb5c3a121bcd147943203c8"),
},
}
var CONSTANTS_2 = [][]frontend.Variable{
{
hex("0x09c46e9ec68e9bd4fe1faaba294cba38a71aa177534cdd1b6c7dc0dbd0abd7a7"),
hex("0x0c0356530896eec42a97ed937f3135cfc5142b3ae405b8343c1d83ffa604cb81"),
}, {
hex("0x1e28a1d935698ad1142e51182bb54cf4a00ea5aabd6268bd317ea977cc154a30"),
hex("0x27af2d831a9d2748080965db30e298e40e5757c3e008db964cf9e2b12b91251f"),
}, {
hex("0x1e6f11ce60fc8f513a6a3cfe16ae175a41291462f214cd0879aaf43545b74e03"),
hex("0x2a67384d3bbd5e438541819cb681f0be04462ed14c3613d8f719206268d142d3"),
}, {
hex("0x0b66fdf356093a611609f8e12fbfecf0b985e381f025188936408f5d5c9f45d0"),
hex("0x012ee3ec1e78d470830c61093c2ade370b26c83cc5cebeeddaa6852dbdb09e21"),
}, {
hex("0x0252ba5f6760bfbdfd88f67f8175e3fd6cd1c431b099b6bb2d108e7b445bb1b9"),
hex("0x179474cceca5ff676c6bec3cef54296354391a8935ff71d6ef5aeaad7ca932f1"),
}, {
hex("0x2c24261379a51bfa9228ff4a503fd4ed9c1f974a264969b37e1a2589bbed2b91"),
hex("0x1cc1d7b62692e63eac2f288bd0695b43c2f63f5001fc0fc553e66c0551801b05"),
}, {
hex("0x255059301aada98bb2ed55f852979e9600784dbf17fbacd05d9eff5fd9c91b56"),
hex("0x28437be3ac1cb2e479e1f5c0eccd32b3aea24234970a8193b11c29ce7e59efd9"),
}, {
hex("0x28216a442f2e1f711ca4fa6b53766eb118548da8fb4f78d4338762c37f5f2043"),
hex("0x2c1f47cd17fa5adf1f39f4e7056dd03feee1efce03094581131f2377323482c9"),
}, {
hex("0x07abad02b7a5ebc48632bcc9356ceb7dd9dafca276638a63646b8566a621afc9"),
hex("0x0230264601ffdf29275b33ffaab51dfe9429f90880a69cd137da0c4d15f96c3c"),
}, {
hex("0x1bc973054e51d905a0f168656497ca40a864414557ee289e717e5d66899aa0a9"),
hex("0x2e1c22f964435008206c3157e86341edd249aff5c2d8421f2a6b22288f0a67fc"),
}, {
hex("0x1224f38df67c5378121c1d5f461bbc509e8ea1598e46c9f7a70452bc2bba86b8"),
hex("0x02e4e69d8ba59e519280b4bd9ed0068fd7bfe8cd9dfeda1969d2989186cde20e"),
}, {
hex("0x1f1eccc34aaba0137f5df81fc04ff3ee4f19ee364e653f076d47e9735d98018e"),
hex("0x1672ad3d709a353974266c3039a9a7311424448032cd1819eacb8a4d4284f582"),
}, {
hex("0x283e3fdc2c6e420c56f44af5192b4ae9cda6961f284d24991d2ed602df8c8fc7"),
hex("0x1c2a3d120c550ecfd0db0957170fa013683751f8fdff59d6614fbd69ff394bcc"),
}, {
hex("0x216f84877aac6172f7897a7323456efe143a9a43773ea6f296cb6b8177653fbd"),
hex("0x2c0d272becf2a75764ba7e8e3e28d12bceaa47ea61ca59a411a1f51552f94788"),
}, {
hex("0x16e34299865c0e28484ee7a74c454e9f170a5480abe0508fcb4a6c3d89546f43"),
hex("0x175ceba599e96f5b375a232a6fb9cc71772047765802290f48cd939755488fc5"),
}, {
hex("0x0c7594440dc48c16fead9e1758b028066aa410bfbc354f54d8c5ffbb44a1ee32"),
hex("0x1a3c29bc39f21bb5c466db7d7eb6fd8f760e20013ccf912c92479882d919fd8d"),
}, {
hex("0x0ccfdd906f3426e5c0986ea049b253400855d349074f5a6695c8eeabcd22e68f"),
hex("0x14f6bc81d9f186f62bdb475ce6c9411866a7a8a3fd065b3ce0e699b67dd9e796"),
}, {
hex("0x0962b82789fb3d129702ca70b2f6c5aacc099810c9c495c888edeb7386b97052"),
hex("0x1a880af7074d18b3bf20c79de25127bc13284ab01ef02575afef0c8f6a31a86d"),
}, {
hex("0x10cba18419a6a332cd5e77f0211c154b20af2924fc20ff3f4c3012bb7ae9311b"),
hex("0x057e62a9a8f89b3ebdc76ba63a9eaca8fa27b7319cae3406756a2849f302f10d"),
}, {
hex("0x287c971de91dc0abd44adf5384b4988cb961303bbf65cff5afa0413b44280cee"),
hex("0x21df3388af1687bbb3bca9da0cca908f1e562bc46d4aba4e6f7f7960e306891d"),
}, {
hex("0x1be5c887d25bce703e25cc974d0934cd789df8f70b498fd83eff8b560e1682b3"),
hex("0x268da36f76e568fb68117175cea2cd0dd2cb5d42fda5acea48d59c2706a0d5c1"),
}, {
hex("0x0e17ab091f6eae50c609beaf5510ececc5d8bb74135ebd05bd06460cc26a5ed6"),
hex("0x04d727e728ffa0a67aee535ab074a43091ef62d8cf83d270040f5caa1f62af40"),
}, {
hex("0x0ddbd7bf9c29341581b549762bc022ed33702ac10f1bfd862b15417d7e39ca6e"),
hex("0x2790eb3351621752768162e82989c6c234f5b0d1d3af9b588a29c49c8789654b"),
}, {
hex("0x1e457c601a63b73e4471950193d8a570395f3d9ab8b2fd0984b764206142f9e9"),
hex("0x21ae64301dca9625638d6ab2bbe7135ffa90ecd0c43ff91fc4c686fc46e091b0"),
}, {
hex("0x0379f63c8ce3468d4da293166f494928854be9e3432e09555858534eed8d350b"),
hex("0x002d56420359d0266a744a080809e054ca0e4921a46686ac8c9f58a324c35049"),
}, {
hex("0x123158e5965b5d9b1d68b3cd32e10bbeda8d62459e21f4090fc2c5af963515a6"),
hex("0x0be29fc40847a941661d14bbf6cbe0420fbb2b6f52836d4e60c80eb49cad9ec1"),
}, {
hex("0x1ac96991dec2bb0557716142015a453c36db9d859cad5f9a233802f24fdf4c1a"),
hex("0x1596443f763dbcc25f4964fc61d23b3e5e12c9fa97f18a9251ca3355bcb0627e"),
}, {
hex("0x12e0bcd3654bdfa76b2861d4ec3aeae0f1857d9f17e715aed6d049eae3ba3212"),
hex("0x0fc92b4f1bbea82b9ea73d4af9af2a50ceabac7f37154b1904e6c76c7cf964ba"),
}, {
hex("0x1f9c0b1610446442d6f2e592a8013f40b14f7c7722236f4f9c7e965233872762"),
hex("0x0ebd74244ae72675f8cde06157a782f4050d914da38b4c058d159f643dbbf4d3"),
}, {
hex("0x2cb7f0ed39e16e9f69a9fafd4ab951c03b0671e97346ee397a839839dccfc6d1"),
hex("0x1a9d6e2ecff022cc5605443ee41bab20ce761d0514ce526690c72bca7352d9bf"),
}, {
hex("0x2a115439607f335a5ea83c3bc44a9331d0c13326a9a7ba3087da182d648ec72f"),
hex("0x23f9b6529b5d040d15b8fa7aee3e3410e738b56305cd44f29535c115c5a4c060"),
}, {
hex("0x05872c16db0f72a2249ac6ba484bb9c3a3ce97c16d58b68b260eb939f0e6e8a7"),
hex("0x1300bdee08bb7824ca20fb80118075f40219b6151d55b5c52b624a7cdeddf6a7"),
}, {
hex("0x19b9b63d2f108e17e63817863a8f6c288d7ad29916d98cb1072e4e7b7d52b376"),
hex("0x015bee1357e3c015b5bda237668522f613d1c88726b5ec4224a20128481b4f7f"),
}, {
hex("0x2953736e94bb6b9f1b9707a4f1615e4efe1e1ce4bab218cbea92c785b128ffd1"),
hex("0x0b069353ba091618862f806180c0385f851b98d372b45f544ce7266ed6608dfc"),
}, {
hex("0x304f74d461ccc13115e4e0bcfb93817e55aeb7eb9306b64e4f588ac97d81f429"),
hex("0x15bbf146ce9bca09e8a33f5e77dfe4f5aad2a164a4617a4cb8ee5415cde913fc"),
}, {
hex("0x0ab4dfe0c2742cde44901031487964ed9b8f4b850405c10ca9ff23859572c8c6"),
hex("0x0e32db320a044e3197f45f7649a19675ef5eedfea546dea9251de39f9639779a"),
}, {
hex("0x0a1756aa1f378ca4b27635a78b6888e66797733a82774896a3078efa516da016"),
hex("0x044c4a33b10f693447fd17177f952ef895e61d328f85efa94254d6a2a25d93ef"),
}, {
hex("0x2ed3611b725b8a70be655b537f66f700fe0879d79a496891d37b07b5466c4b8b"),
hex("0x1f9ba4e8bab7ce42c8ecc3d722aa2e0eadfdeb9cfdd347b5d8339ea7120858aa"),
}, {
hex("0x1b233043052e8c288f7ee907a84e518aa38e82ac4502066db74056f865c5d3da"),
hex("0x2431e1cc164bb8d074031ab72bd55b4c902053bfc0f14db0ca2f97b020875954"),
}, {
hex("0x082f934c91f5aac330cd6953a0a7db45a13e322097583319a791f273965801fd"),
hex("0x2b9a0a223e7538b0a34be074315542a3c77245e2ae7cbe999ad6bb930c48997c"),
}, {
hex("0x0e1cd91edd2cfa2cceb85483b887a9be8164163e75a8a00eb0b589cc70214e7d"),
hex("0x2e1eac0f2bfdfd63c951f61477e3698999774f19854d00f588d324601cebe2f9"),
}, {
hex("0x0cbfa95f37fb74060c76158e769d6d157345784d8efdb33c23d748115b500b83"),
hex("0x08f05b3be923ed44d65ad49d8a61e9a676d991e3a77513d9980c232dfa4a4f84"),
}, {
hex("0x22719e2a070bcd0852bf8e21984d0443e7284925dc0758a325a2dd510c047ef6"),
hex("0x041f596a9ee1cb2bc060f7fcc3a1ab4c7bdbf036119982c0f41f62b2f26830c0"),
}, {
hex("0x233fd35de1be520a87628eb06f6b1d4c021be1c2d0dc464a19fcdd0986b10f89"),
hex("0x0524b46d1aa87a5e4325e0a423ebc810d31e078aa1b4707eefcb453c61c9c267"),
}, {
hex("0x2c34f424c81e5716ce47fcac894b85824227bb954b0f3199cc4486237c515211"),
hex("0x0b5f2a4b63387819207effc2b5541fb72dd2025b5457cc97f33010327de4915e"),
}, {
hex("0x22207856082ccc54c5b72fe439d2cfd6c17435d2f57af6ceaefac41fe05c659f"),
hex("0x24d57a8bf5da63fe4e24159b7f8950b5cdfb210194caf79f27854048ce2c8171"),
}, {
hex("0x0afab181fdd5e0583b371d75bd693f98374ad7097bb01a8573919bb23b79396e"),
hex("0x2dba9b108f208772998a52efac7cbd5676c0057194c16c0bf16290d62b1128ee"),
}, {
hex("0x26349b66edb8b16f56f881c788f53f83cbb83de0bd592b255aff13e6bce420b3"),
hex("0x25af7ce0e5e10357685e95f92339753ad81a56d28ecc193b235288a3e6f137db"),
}, {
hex("0x25b4ce7bd2294390c094d6a55edd68b970eed7aae88b2bff1f7c0187fe35011f"),
hex("0x22c543f10f6c89ec387e53f1908a88e5de9cef28ebdf30b18cb9d54c1e02b631"),
}, {
hex("0x0236f93e7789c4724fc7908a9f191e1e425e906a919d7a34df668e74882f87a9"),
hex("0x29350b401166ca010e7d27e37d05da99652bdae114eb01659cb497af980c4b52"),
}, {
hex("0x0eed787d65820d3f6bd31bbab547f75a65edb75d844ebb89ee1260916652363f"),
hex("0x07cc1170f13b46f2036a753f520b3291fdcd0e99bd94297d1906f656f4de6fad"),
}, {
hex("0x22b939233b1d7205f49bcf613a3d30b1908786d7f9f5d10c2059435689e8acea"),
hex("0x01451762a0aab81c8aad1dc8bc33e870740f083a5aa85438add650ace60ae5a6"),
}, {
hex("0x23506bb5d8727d4461fabf1025d46d1fe32eaa61dec7da57e704fec0892fce89"),
hex("0x2e484c44e838aea0bac06ae3f71bdd092a3709531e1efea97f8bd68907355522"),
}, {
hex("0x0f4bc7d07ebafd64379e78c50bd2e42baf4a594545cedc2545418da26835b54c"),
hex("0x1f4d3c8f6583e9e5fa76637862faaee851582388725df460e620996d50d8e74e"),
}, {
hex("0x093514e0c70711f82660d07be0e4a988fae02abc7b681d9153eb9bcb48fe7389"),
hex("0x1adab0c8e2b3bad346699a2b5f3bc03643ee83ece47228f24a58e0a347e153d8"),
}, {
hex("0x1672b1726057d99dd14709ebb474641a378c1b94b8072bac1a22dbef9e80dad2"),
hex("0x1dfd53d4576af2e38f44f53fdcab468cc5d8e2fae0acc4ee30d47b239b479c14"),
}, {
hex("0x0c6888a10b75b0f3a70a36263a37e17fe6d77d640f6fc3debc7f207753205c60"),
hex("0x1addb933a65be77092b34a7e77d12fe8611a61e00ee6848b85091ecca9d1e508"),
}, {
hex("0x00d7540dcd268a845c10ae18d1de933cf638ff5425f0afff7935628e299d1791"),
hex("0x140c0e42687e9ead01b2827a5664ca9c26fedde4acd99db1d316939d20b82c0e"),
}, {
hex("0x2f0c3a115d4317d191ba89b8d13d1806c20a0f9b24f8c5edc091e2ae56565984"),
hex("0x0c4ee778ff7c14553006ed220cf9c81008a0cff670b22b82d8c538a1dc958c61"),
}, {
hex("0x1704f2766d46f82c3693f00440ccc3609424ed26c0acc66227c3d7485de74c69"),
hex("0x2f2d19cc3ea5d78ea7a02c1b51d244abf0769c9f8544e40239b66fe9009c3cfa"),
}, {
hex("0x1ae03853b75fcaba5053f112e2a8e8dcdd7ee6cb9cfed9c7d6c766a806fc6629"),
hex("0x0971aabf795241df51d131d0fa61aa5f3556921b2d6f014e4e41a86ddaf056d5"),
}, {
hex("0x1408c316e6014e1a91d4cf6b6e0de73eda624f8380df1c875f5c29f7bfe2f646"),
hex("0x1667f3fe2edbe850248abe42b543093b6c89f1f773ef285341691f39822ef5bd"),
}, {
hex("0x13bf7c5d0d2c4376a48b0a03557cdf915b81718409e5c133424c69576500fe37"),
hex("0x07620a6dfb0b6cec3016adf3d3533c24024b95347856b79719bc0ba743a62c2c"),
}, {
hex("0x1574c7ef0c43545f36a8ca08bdbdd8b075d2959e2f322b731675de3e1982b4d0"),
hex("0x269e4b5b7a2eb21afd567970a717ceec5bd4184571c254fdc06e03a7ff8378f0"),
},
}
var MDS_3 = [][]frontend.Variable{
{
hex("0x109b7f411ba0e4c9b2b70caf5c36a7b194be7c11ad24378bfedb68592ba8118b"),
hex("0x16ed41e13bb9c0c66ae119424fddbcbc9314dc9fdbdeea55d6c64543dc4903e0"),
hex("0x2b90bba00fca0589f617e7dcbfe82e0df706ab640ceb247b791a93b74e36736d"),
},
{
hex("0x2969f27eed31a480b9c36c764379dbca2cc8fdd1415c3dded62940bcde0bd771"),
hex("0x2e2419f9ec02ec394c9871c832963dc1b89d743c8c7b964029b2311687b1fe23"),
hex("0x101071f0032379b697315876690f053d148d4e109f5fb065c8aacc55a0f89bfa"),
},
{
hex("0x143021ec686a3f330d5f9e654638065ce6cd79e28c5b3753326244ee65a1b1a7"),
hex("0x176cc029695ad02582a70eff08a6fd99d057e12e58e7d7b6b16cdfabc8ee2911"),
hex("0x19a3fc0a56702bf417ba7fee3802593fa644470307043f7773279cd71d25d5e0"),
},
}
var CONSTANTS_3 = [][]frontend.Variable{
{
hex("0x0ee9a592ba9a9518d05986d656f40c2114c4993c11bb29938d21d47304cd8e6e"),
hex("0x00f1445235f2148c5986587169fc1bcd887b08d4d00868df5696fff40956e864"),
hex("0x08dff3487e8ac99e1f29a058d0fa80b930c728730b7ab36ce879f3890ecf73f5"),
}, {
hex("0x2f27be690fdaee46c3ce28f7532b13c856c35342c84bda6e20966310fadc01d0"),
hex("0x2b2ae1acf68b7b8d2416bebf3d4f6234b763fe04b8043ee48b8327bebca16cf2"),
hex("0x0319d062072bef7ecca5eac06f97d4d55952c175ab6b03eae64b44c7dbf11cfa"),
}, {
hex("0x28813dcaebaeaa828a376df87af4a63bc8b7bf27ad49c6298ef7b387bf28526d"),
hex("0x2727673b2ccbc903f181bf38e1c1d40d2033865200c352bc150928adddf9cb78"),
hex("0x234ec45ca27727c2e74abd2b2a1494cd6efbd43e340587d6b8fb9e31e65cc632"),
}, {
hex("0x15b52534031ae18f7f862cb2cf7cf760ab10a8150a337b1ccd99ff6e8797d428"),
hex("0x0dc8fad6d9e4b35f5ed9a3d186b79ce38e0e8a8d1b58b132d701d4eecf68d1f6"),
hex("0x1bcd95ffc211fbca600f705fad3fb567ea4eb378f62e1fec97805518a47e4d9c"),
}, {
hex("0x10520b0ab721cadfe9eff81b016fc34dc76da36c2578937817cb978d069de559"),
hex("0x1f6d48149b8e7f7d9b257d8ed5fbbaf42932498075fed0ace88a9eb81f5627f6"),
hex("0x1d9655f652309014d29e00ef35a2089bfff8dc1c816f0dc9ca34bdb5460c8705"),
}, {
hex("0x04df5a56ff95bcafb051f7b1cd43a99ba731ff67e47032058fe3d4185697cc7d"),
hex("0x0672d995f8fff640151b3d290cedaf148690a10a8c8424a7f6ec282b6e4be828"),
hex("0x099952b414884454b21200d7ffafdd5f0c9a9dcc06f2708e9fc1d8209b5c75b9"),
}, {
hex("0x052cba2255dfd00c7c483143ba8d469448e43586a9b4cd9183fd0e843a6b9fa6"),
hex("0x0b8badee690adb8eb0bd74712b7999af82de55707251ad7716077cb93c464ddc"),
hex("0x119b1590f13307af5a1ee651020c07c749c15d60683a8050b963d0a8e4b2bdd1"),
}, {
hex("0x03150b7cd6d5d17b2529d36be0f67b832c4acfc884ef4ee5ce15be0bfb4a8d09"),
hex("0x2cc6182c5e14546e3cf1951f173912355374efb83d80898abe69cb317c9ea565"),
hex("0x005032551e6378c450cfe129a404b3764218cadedac14e2b92d2cd73111bf0f9"),
}, {
hex("0x233237e3289baa34bb147e972ebcb9516469c399fcc069fb88f9da2cc28276b5"),
hex("0x05c8f4f4ebd4a6e3c980d31674bfbe6323037f21b34ae5a4e80c2d4c24d60280"),
hex("0x0a7b1db13042d396ba05d818a319f25252bcf35ef3aeed91ee1f09b2590fc65b"),
}, {
hex("0x2a73b71f9b210cf5b14296572c9d32dbf156e2b086ff47dc5df542365a404ec0"),
hex("0x1ac9b0417abcc9a1935107e9ffc91dc3ec18f2c4dbe7f22976a760bb5c50c460"),
hex("0x12c0339ae08374823fabb076707ef479269f3e4d6cb104349015ee046dc93fc0"),
}, {
hex("0x0b7475b102a165ad7f5b18db4e1e704f52900aa3253baac68246682e56e9a28e"),
hex("0x037c2849e191ca3edb1c5e49f6e8b8917c843e379366f2ea32ab3aa88d7f8448"),
hex("0x05a6811f8556f014e92674661e217e9bd5206c5c93a07dc145fdb176a716346f"),
}, {
hex("0x29a795e7d98028946e947b75d54e9f044076e87a7b2883b47b675ef5f38bd66e"),
hex("0x20439a0c84b322eb45a3857afc18f5826e8c7382c8a1585c507be199981fd22f"),
hex("0x2e0ba8d94d9ecf4a94ec2050c7371ff1bb50f27799a84b6d4a2a6f2a0982c887"),
}, {
hex("0x143fd115ce08fb27ca38eb7cce822b4517822cd2109048d2e6d0ddcca17d71c8"),
hex("0x0c64cbecb1c734b857968dbbdcf813cdf8611659323dbcbfc84323623be9caf1"),
hex("0x028a305847c683f646fca925c163ff5ae74f348d62c2b670f1426cef9403da53"),
}, {
hex("0x2e4ef510ff0b6fda5fa940ab4c4380f26a6bcb64d89427b824d6755b5db9e30c"),
hex("0x0081c95bc43384e663d79270c956ce3b8925b4f6d033b078b96384f50579400e"),
hex("0x2ed5f0c91cbd9749187e2fade687e05ee2491b349c039a0bba8a9f4023a0bb38"),
}, {
hex("0x30509991f88da3504bbf374ed5aae2f03448a22c76234c8c990f01f33a735206"),
hex("0x1c3f20fd55409a53221b7c4d49a356b9f0a1119fb2067b41a7529094424ec6ad"),
hex("0x10b4e7f3ab5df003049514459b6e18eec46bb2213e8e131e170887b47ddcb96c"),
}, {
hex("0x2a1982979c3ff7f43ddd543d891c2abddd80f804c077d775039aa3502e43adef"),
hex("0x1c74ee64f15e1db6feddbead56d6d55dba431ebc396c9af95cad0f1315bd5c91"),
hex("0x07533ec850ba7f98eab9303cace01b4b9e4f2e8b82708cfa9c2fe45a0ae146a0"),
}, {
hex("0x21576b438e500449a151e4eeaf17b154285c68f42d42c1808a11abf3764c0750"),
hex("0x2f17c0559b8fe79608ad5ca193d62f10bce8384c815f0906743d6930836d4a9e"),
hex("0x2d477e3862d07708a79e8aae946170bc9775a4201318474ae665b0b1b7e2730e"),
}, {
hex("0x162f5243967064c390e095577984f291afba2266c38f5abcd89be0f5b2747eab"),
hex("0x2b4cb233ede9ba48264ecd2c8ae50d1ad7a8596a87f29f8a7777a70092393311"),
hex("0x2c8fbcb2dd8573dc1dbaf8f4622854776db2eece6d85c4cf4254e7c35e03b07a"),
}, {
hex("0x1d6f347725e4816af2ff453f0cd56b199e1b61e9f601e9ade5e88db870949da9"),
hex("0x204b0c397f4ebe71ebc2d8b3df5b913df9e6ac02b68d31324cd49af5c4565529"),
hex("0x0c4cb9dc3c4fd8174f1149b3c63c3c2f9ecb827cd7dc25534ff8fb75bc79c502"),
}, {
hex("0x174ad61a1448c899a25416474f4930301e5c49475279e0639a616ddc45bc7b54"),
hex("0x1a96177bcf4d8d89f759df4ec2f3cde2eaaa28c177cc0fa13a9816d49a38d2ef"),
hex("0x066d04b24331d71cd0ef8054bc60c4ff05202c126a233c1a8242ace360b8a30a"),
}, {
hex("0x2a4c4fc6ec0b0cf52195782871c6dd3b381cc65f72e02ad527037a62aa1bd804"),
hex("0x13ab2d136ccf37d447e9f2e14a7cedc95e727f8446f6d9d7e55afc01219fd649"),
hex("0x1121552fca26061619d24d843dc82769c1b04fcec26f55194c2e3e869acc6a9a"),
}, {
hex("0x00ef653322b13d6c889bc81715c37d77a6cd267d595c4a8909a5546c7c97cff1"),
hex("0x0e25483e45a665208b261d8ba74051e6400c776d652595d9845aca35d8a397d3"),
hex("0x29f536dcb9dd7682245264659e15d88e395ac3d4dde92d8c46448db979eeba89"),
}, {
hex("0x2a56ef9f2c53febadfda33575dbdbd885a124e2780bbea170e456baace0fa5be"),
hex("0x1c8361c78eb5cf5decfb7a2d17b5c409f2ae2999a46762e8ee416240a8cb9af1"),
hex("0x151aff5f38b20a0fc0473089aaf0206b83e8e68a764507bfd3d0ab4be74319c5"),
}, {
hex("0x04c6187e41ed881dc1b239c88f7f9d43a9f52fc8c8b6cdd1e76e47615b51f100"),
hex("0x13b37bd80f4d27fb10d84331f6fb6d534b81c61ed15776449e801b7ddc9c2967"),
hex("0x01a5c536273c2d9df578bfbd32c17b7a2ce3664c2a52032c9321ceb1c4e8a8e4"),
}, {
hex("0x2ab3561834ca73835ad05f5d7acb950b4a9a2c666b9726da832239065b7c3b02"),
hex("0x1d4d8ec291e720db200fe6d686c0d613acaf6af4e95d3bf69f7ed516a597b646"),
hex("0x041294d2cc484d228f5784fe7919fd2bb925351240a04b711514c9c80b65af1d"),
}, {
hex("0x154ac98e01708c611c4fa715991f004898f57939d126e392042971dd90e81fc6"),
hex("0x0b339d8acca7d4f83eedd84093aef51050b3684c88f8b0b04524563bc6ea4da4"),
hex("0x0955e49e6610c94254a4f84cfbab344598f0e71eaff4a7dd81ed95b50839c82e"),
}, {
hex("0x06746a6156eba54426b9e22206f15abca9a6f41e6f535c6f3525401ea0654626"),
hex("0x0f18f5a0ecd1423c496f3820c549c27838e5790e2bd0a196ac917c7ff32077fb"),
hex("0x04f6eeca1751f7308ac59eff5beb261e4bb563583ede7bc92a738223d6f76e13"),
}, {
hex("0x2b56973364c4c4f5c1a3ec4da3cdce038811eb116fb3e45bc1768d26fc0b3758"),
hex("0x123769dd49d5b054dcd76b89804b1bcb8e1392b385716a5d83feb65d437f29ef"),
hex("0x2147b424fc48c80a88ee52b91169aacea989f6446471150994257b2fb01c63e9"),
}, {
hex("0x0fdc1f58548b85701a6c5505ea332a29647e6f34ad4243c2ea54ad897cebe54d"),
hex("0x12373a8251fea004df68abcf0f7786d4bceff28c5dbbe0c3944f685cc0a0b1f2"),
hex("0x21e4f4ea5f35f85bad7ea52ff742c9e8a642756b6af44203dd8a1f35c1a90035"),
}, {
hex("0x16243916d69d2ca3dfb4722224d4c462b57366492f45e90d8a81934f1bc3b147"),
hex("0x1efbe46dd7a578b4f66f9adbc88b4378abc21566e1a0453ca13a4159cac04ac2"),
hex("0x07ea5e8537cf5dd08886020e23a7f387d468d5525be66f853b672cc96a88969a"),
}, {
hex("0x05a8c4f9968b8aa3b7b478a30f9a5b63650f19a75e7ce11ca9fe16c0b76c00bc"),
hex("0x20f057712cc21654fbfe59bd345e8dac3f7818c701b9c7882d9d57b72a32e83f"),
hex("0x04a12ededa9dfd689672f8c67fee31636dcd8e88d01d49019bd90b33eb33db69"),
}, {
hex("0x27e88d8c15f37dcee44f1e5425a51decbd136ce5091a6767e49ec9544ccd101a"),
hex("0x2feed17b84285ed9b8a5c8c5e95a41f66e096619a7703223176c41ee433de4d1"),
hex("0x1ed7cc76edf45c7c404241420f729cf394e5942911312a0d6972b8bd53aff2b8"),
}, {
hex("0x15742e99b9bfa323157ff8c586f5660eac6783476144cdcadf2874be45466b1a"),
hex("0x1aac285387f65e82c895fc6887ddf40577107454c6ec0317284f033f27d0c785"),
hex("0x25851c3c845d4790f9ddadbdb6057357832e2e7a49775f71ec75a96554d67c77"),
}, {
hex("0x15a5821565cc2ec2ce78457db197edf353b7ebba2c5523370ddccc3d9f146a67"),
hex("0x2411d57a4813b9980efa7e31a1db5966dcf64f36044277502f15485f28c71727"),
hex("0x002e6f8d6520cd4713e335b8c0b6d2e647e9a98e12f4cd2558828b5ef6cb4c9b"),
}, {
hex("0x2ff7bc8f4380cde997da00b616b0fcd1af8f0e91e2fe1ed7398834609e0315d2"),
hex("0x00b9831b948525595ee02724471bcd182e9521f6b7bb68f1e93be4febb0d3cbe"),
hex("0x0a2f53768b8ebf6a86913b0e57c04e011ca408648a4743a87d77adbf0c9c3512"),
}, {
hex("0x00248156142fd0373a479f91ff239e960f599ff7e94be69b7f2a290305e1198d"),
hex("0x171d5620b87bfb1328cf8c02ab3f0c9a397196aa6a542c2350eb512a2b2bcda9"),
hex("0x170a4f55536f7dc970087c7c10d6fad760c952172dd54dd99d1045e4ec34a808"),
}, {
hex("0x29aba33f799fe66c2ef3134aea04336ecc37e38c1cd211ba482eca17e2dbfae1"),
hex("0x1e9bc179a4fdd758fdd1bb1945088d47e70d114a03f6a0e8b5ba650369e64973"),
hex("0x1dd269799b660fad58f7f4892dfb0b5afeaad869a9c4b44f9c9e1c43bdaf8f09"),
}, {
hex("0x22cdbc8b70117ad1401181d02e15459e7ccd426fe869c7c95d1dd2cb0f24af38"),
hex("0x0ef042e454771c533a9f57a55c503fcefd3150f52ed94a7cd5ba93b9c7dacefd"),
hex("0x11609e06ad6c8fe2f287f3036037e8851318e8b08a0359a03b304ffca62e8284"),
}, {
hex("0x1166d9e554616dba9e753eea427c17b7fecd58c076dfe42708b08f5b783aa9af"),
hex("0x2de52989431a859593413026354413db177fbf4cd2ac0b56f855a888357ee466"),
hex("0x3006eb4ffc7a85819a6da492f3a8ac1df51aee5b17b8e89d74bf01cf5f71e9ad"),
}, {
hex("0x2af41fbb61ba8a80fdcf6fff9e3f6f422993fe8f0a4639f962344c8225145086"),
hex("0x119e684de476155fe5a6b41a8ebc85db8718ab27889e85e781b214bace4827c3"),
hex("0x1835b786e2e8925e188bea59ae363537b51248c23828f047cff784b97b3fd800"),
}, {
hex("0x28201a34c594dfa34d794996c6433a20d152bac2a7905c926c40e285ab32eeb6"),
hex("0x083efd7a27d1751094e80fefaf78b000864c82eb571187724a761f88c22cc4e7"),
hex("0x0b6f88a3577199526158e61ceea27be811c16df7774dd8519e079564f61fd13b"),
}, {
hex("0x0ec868e6d15e51d9644f66e1d6471a94589511ca00d29e1014390e6ee4254f5b"),
hex("0x2af33e3f866771271ac0c9b3ed2e1142ecd3e74b939cd40d00d937ab84c98591"),
hex("0x0b520211f904b5e7d09b5d961c6ace7734568c547dd6858b364ce5e47951f178"),
}, {
hex("0x0b2d722d0919a1aad8db58f10062a92ea0c56ac4270e822cca228620188a1d40"),
hex("0x1f790d4d7f8cf094d980ceb37c2453e957b54a9991ca38bbe0061d1ed6e562d4"),
hex("0x0171eb95dfbf7d1eaea97cd385f780150885c16235a2a6a8da92ceb01e504233"),
}, {
hex("0x0c2d0e3b5fd57549329bf6885da66b9b790b40defd2c8650762305381b168873"),
hex("0x1162fb28689c27154e5a8228b4e72b377cbcafa589e283c35d3803054407a18d"),
hex("0x2f1459b65dee441b64ad386a91e8310f282c5a92a89e19921623ef8249711bc0"),
}, {
hex("0x1e6ff3216b688c3d996d74367d5cd4c1bc489d46754eb712c243f70d1b53cfbb"),
hex("0x01ca8be73832b8d0681487d27d157802d741a6f36cdc2a0576881f9326478875"),
hex("0x1f7735706ffe9fc586f976d5bdf223dc680286080b10cea00b9b5de315f9650e"),
}, {
hex("0x2522b60f4ea3307640a0c2dce041fba921ac10a3d5f096ef4745ca838285f019"),
hex("0x23f0bee001b1029d5255075ddc957f833418cad4f52b6c3f8ce16c235572575b"),
hex("0x2bc1ae8b8ddbb81fcaac2d44555ed5685d142633e9df905f66d9401093082d59"),
}, {
hex("0x0f9406b8296564a37304507b8dba3ed162371273a07b1fc98011fcd6ad72205f"),
hex("0x2360a8eb0cc7defa67b72998de90714e17e75b174a52ee4acb126c8cd995f0a8"),
hex("0x15871a5cddead976804c803cbaef255eb4815a5e96df8b006dcbbc2767f88948"),
}, {
hex("0x193a56766998ee9e0a8652dd2f3b1da0362f4f54f72379544f957ccdeefb420f"),
hex("0x2a394a43934f86982f9be56ff4fab1703b2e63c8ad334834e4309805e777ae0f"),
hex("0x1859954cfeb8695f3e8b635dcb345192892cd11223443ba7b4166e8876c0d142"),
}, {
hex("0x04e1181763050e58013444dbcb99f1902b11bc25d90bbdca408d3819f4fed32b"),
hex("0x0fdb253dee83869d40c335ea64de8c5bb10eb82db08b5e8b1f5e5552bfd05f23"),
hex("0x058cbe8a9a5027bdaa4efb623adead6275f08686f1c08984a9d7c5bae9b4f1c0"),
}, {
hex("0x1382edce9971e186497eadb1aeb1f52b23b4b83bef023ab0d15228b4cceca59a"),
hex("0x03464990f045c6ee0819ca51fd11b0be7f61b8eb99f14b77e1e6634601d9e8b5"),
hex("0x23f7bfc8720dc296fff33b41f98ff83c6fcab4605db2eb5aaa5bc137aeb70a58"),
}, {
hex("0x0a59a158e3eec2117e6e94e7f0e9decf18c3ffd5e1531a9219636158bbaf62f2"),
hex("0x06ec54c80381c052b58bf23b312ffd3ce2c4eba065420af8f4c23ed0075fd07b"),
hex("0x118872dc832e0eb5476b56648e867ec8b09340f7a7bcb1b4962f0ff9ed1f9d01"),
}, {
hex("0x13d69fa127d834165ad5c7cba7ad59ed52e0b0f0e42d7fea95e1906b520921b1"),
hex("0x169a177f63ea681270b1c6877a73d21bde143942fb71dc55fd8a49f19f10c77b"),
hex("0x04ef51591c6ead97ef42f287adce40d93abeb032b922f66ffb7e9a5a7450544d"),
}, {
hex("0x256e175a1dc079390ecd7ca703fb2e3b19ec61805d4f03ced5f45ee6dd0f69ec"),
hex("0x30102d28636abd5fe5f2af412ff6004f75cc360d3205dd2da002813d3e2ceeb2"),
hex("0x10998e42dfcd3bbf1c0714bc73eb1bf40443a3fa99bef4a31fd31be182fcc792"),
}, {
hex("0x193edd8e9fcf3d7625fa7d24b598a1d89f3362eaf4d582efecad76f879e36860"),
hex("0x18168afd34f2d915d0368ce80b7b3347d1c7a561ce611425f2664d7aa51f0b5d"),
hex("0x29383c01ebd3b6ab0c017656ebe658b6a328ec77bc33626e29e2e95b33ea6111"),
}, {
hex("0x10646d2f2603de39a1f4ae5e7771a64a702db6e86fb76ab600bf573f9010c711"),
hex("0x0beb5e07d1b27145f575f1395a55bf132f90c25b40da7b3864d0242dcb1117fb"),
hex("0x16d685252078c133dc0d3ecad62b5c8830f95bb2e54b59abdffbf018d96fa336"),
}, {
hex("0x0a6abd1d833938f33c74154e0404b4b40a555bbbec21ddfafd672dd62047f01a"),
hex("0x1a679f5d36eb7b5c8ea12a4c2dedc8feb12dffeec450317270a6f19b34cf1860"),
hex("0x0980fb233bd456c23974d50e0ebfde4726a423eada4e8f6ffbc7592e3f1b93d6"),
}, {
hex("0x161b42232e61b84cbf1810af93a38fc0cece3d5628c9282003ebacb5c312c72b"),
hex("0x0ada10a90c7f0520950f7d47a60d5e6a493f09787f1564e5d09203db47de1a0b"),
hex("0x1a730d372310ba82320345a29ac4238ed3f07a8a2b4e121bb50ddb9af407f451"),
}, {
hex("0x2c8120f268ef054f817064c369dda7ea908377feaba5c4dffbda10ef58e8c556"),
hex("0x1c7c8824f758753fa57c00789c684217b930e95313bcb73e6e7b8649a4968f70"),
hex("0x2cd9ed31f5f8691c8e39e4077a74faa0f400ad8b491eb3f7b47b27fa3fd1cf77"),
}, {
hex("0x23ff4f9d46813457cf60d92f57618399a5e022ac321ca550854ae23918a22eea"),
hex("0x09945a5d147a4f66ceece6405dddd9d0af5a2c5103529407dff1ea58f180426d"),
hex("0x188d9c528025d4c2b67660c6b771b90f7c7da6eaa29d3f268a6dd223ec6fc630"),
}, {
hex("0x3050e37996596b7f81f68311431d8734dba7d926d3633595e0c0d8ddf4f0f47f"),
hex("0x15af1169396830a91600ca8102c35c426ceae5461e3f95d89d829518d30afd78"),
hex("0x1da6d09885432ea9a06d9f37f873d985dae933e351466b2904284da3320d8acc"),
}, {
hex("0x2796ea90d269af29f5f8acf33921124e4e4fad3dbe658945e546ee411ddaa9cb"),
hex("0x202d7dd1da0f6b4b0325c8b3307742f01e15612ec8e9304a7cb0319e01d32d60"),
hex("0x096d6790d05bb759156a952ba263d672a2d7f9c788f4c831a29dace4c0f8be5f"),
}, {
hex("0x054efa1f65b0fce283808965275d877b438da23ce5b13e1963798cb1447d25a4"),
hex("0x1b162f83d917e93edb3308c29802deb9d8aa690113b2e14864ccf6e18e4165f1"),
hex("0x21e5241e12564dd6fd9f1cdd2a0de39eedfefc1466cc568ec5ceb745a0506edc"),
}, {
hex("0x1cfb5662e8cf5ac9226a80ee17b36abecb73ab5f87e161927b4349e10e4bdf08"),
hex("0x0f21177e302a771bbae6d8d1ecb373b62c99af346220ac0129c53f666eb24100"),
hex("0x1671522374606992affb0dd7f71b12bec4236aede6290546bcef7e1f515c2320"),
}, {
hex("0x0fa3ec5b9488259c2eb4cf24501bfad9be2ec9e42c5cc8ccd419d2a692cad870"),
hex("0x193c0e04e0bd298357cb266c1506080ed36edce85c648cc085e8c57b1ab54bba"),
hex("0x102adf8ef74735a27e9128306dcbc3c99f6f7291cd406578ce14ea2adaba68f8"),
}, {
hex("0x0fe0af7858e49859e2a54d6f1ad945b1316aa24bfbdd23ae40a6d0cb70c3eab1"),
hex("0x216f6717bbc7dedb08536a2220843f4e2da5f1daa9ebdefde8a5ea7344798d22"),
hex("0x1da55cc900f0d21f4a3e694391918a1b3c23b2ac773c6b3ef88e2e4228325161"),
},
}
var MDS_4 = [][]frontend.Variable{
{
hex("0x236d13393ef85cc48a351dd786dd7a1de5e39942296127fd87947223ae5108ad"),
hex("0x277686494f7644bbc4a9b194e10724eb967f1dc58718e59e3cedc821b2a7ae19"),
hex("0x023db68784e3f0cc0b85618826a9b3505129c16479973b0a84a4529e66b09c62"),
hex("0x1d359d245f286c12d50d663bae733f978af08cdbd63017c57b3a75646ff382c1"),
},
{
hex("0x2a75a171563b807db525be259699ab28fe9bc7fb1f70943ff049bc970e841a0c"),
hex("0x083abff5e10051f078e2827d092e1ae808b4dd3e15ccc3706f38ce4157b6770e"),
hex("0x1a5ad71bbbecd8a97dc49cfdbae303ad24d5c4741eab8b7568a9ff8253a1eb6f"),
hex("0x0d745fd00dd167fb86772133640f02ce945004a7bc2c59e8790f725c5d84f0af"),
},
{
hex("0x2070679e798782ef592a52ca9cef820d497ad2eecbaa7e42f366b3e521c4ed42"),
hex("0x2e18c8570d20bf5df800739a53da75d906ece318cd224ab6b3a2be979e2d7eab"),
hex("0x0fa86f0f27e4d3dd7f3367ce86f684f1f2e4386d3e5b9f38fa283c6aa723b608"),
hex("0x03f3e6fab791f16628168e4b14dbaeb657035ee3da6b2ca83f0c2491e0b403eb"),
},
{
hex("0x2f545e578202c9732488540e41f783b68ff0613fd79375f8ba8b3d30958e7677"),
hex("0x23810bf82877fc19bff7eefeae3faf4bb8104c32ba4cd701596a15623d01476e"),
hex("0x014fcd5eb0be6d5beeafc4944034cf321c068ef930f10be2207ed58d2a34cdd6"),
hex("0xc15fc3a1d5733dd835eae0823e377f8ba4a8b627627cc2bb661c25d20fb52a"),
},
}
var CONSTANTS_4 = [][]frontend.Variable{
{
hex("0x19b849f69450b06848da1d39bd5e4a4302bb86744edc26238b0878e269ed23e5"),
hex("0x265ddfe127dd51bd7239347b758f0a1320eb2cc7450acc1dad47f80c8dcf34d6"),
hex("0x199750ec472f1809e0f66a545e1e51624108ac845015c2aa3dfc36bab497d8aa"),
hex("0x157ff3fe65ac7208110f06a5f74302b14d743ea25067f0ffd032f787c7f1cdf8"),
},
{
hex("0x2e49c43c4569dd9c5fd35ac45fca33f10b15c590692f8beefe18f4896ac94902"),
hex("0x0e35fb89981890520d4aef2b6d6506c3cb2f0b6973c24fa82731345ffa2d1f1e"),
hex("0x251ad47cb15c4f1105f109ae5e944f1ba9d9e7806d667ffec6fe723002e0b996"),
hex("0x13da07dc64d428369873e97160234641f8beb56fdd05e5f3563fa39d9c22df4e"),
},
{
hex("0x0c009b84e650e6d23dc00c7dccef7483a553939689d350cd46e7b89055fd4738"),
hex("0x011f16b1c63a854f01992e3956f42d8b04eb650c6d535eb0203dec74befdca06"),
hex("0x0ed69e5e383a688f209d9a561daa79612f3f78d0467ad45485df07093f367549"),
hex("0x04dba94a7b0ce9e221acad41472b6bbe3aec507f5eb3d33f463672264c9f789b"),
},
{
hex("0x0a3f2637d840f3a16eb094271c9d237b6036757d4bb50bf7ce732ff1d4fa28e8"),
hex("0x259a666f129eea198f8a1c502fdb38fa39b1f075569564b6e54a485d1182323f"),
hex("0x28bf7459c9b2f4c6d8e7d06a4ee3a47f7745d4271038e5157a32fdf7ede0d6a1"),
hex("0x0a1ca941f057037526ea200f489be8d4c37c85bbcce6a2aeec91bd6941432447"),
},
{
hex("0x0c6f8f958be0e93053d7fd4fc54512855535ed1539f051dcb43a26fd926361cf"),
hex("0x123106a93cd17578d426e8128ac9d90aa9e8a00708e296e084dd57e69caaf811"),
hex("0x26e1ba52ad9285d97dd3ab52f8e840085e8fa83ff1e8f1877b074867cd2dee75"),
hex("0x1cb55cad7bd133de18a64c5c47b9c97cbe4d8b7bf9e095864471537e6a4ae2c5"),
},
{
hex("0x1dcd73e46acd8f8e0e2c7ce04bde7f6d2a53043d5060a41c7143f08e6e9055d0"),
hex("0x011003e32f6d9c66f5852f05474a4def0cda294a0eb4e9b9b12b9bb4512e5574"),
hex("0x2b1e809ac1d10ab29ad5f20d03a57dfebadfe5903f58bafed7c508dd2287ae8c"),
hex("0x2539de1785b735999fb4dac35ee17ed0ef995d05ab2fc5faeaa69ae87bcec0a5"),
},
{
hex("0x0c246c5a2ef8ee0126497f222b3e0a0ef4e1c3d41c86d46e43982cb11d77951d"),
hex("0x192089c4974f68e95408148f7c0632edbb09e6a6ad1a1c2f3f0305f5d03b527b"),
hex("0x1eae0ad8ab68b2f06a0ee36eeb0d0c058529097d91096b756d8fdc2fb5a60d85"),
hex("0x179190e5d0e22179e46f8282872abc88db6e2fdc0dee99e69768bd98c5d06bfb"),
},
{
hex("0x29bb9e2c9076732576e9a81c7ac4b83214528f7db00f31bf6cafe794a9b3cd1c"),
hex("0x225d394e42207599403efd0c2464a90d52652645882aac35b10e590e6e691e08"),
hex("0x064760623c25c8cf753d238055b444532be13557451c087de09efd454b23fd59"),
hex("0x10ba3a0e01df92e87f301c4b716d8a394d67f4bf42a75c10922910a78f6b5b87"),
},
{
hex("0x0e070bf53f8451b24f9c6e96b0c2a801cb511bc0c242eb9d361b77693f21471c"),
hex("0x1b94cd61b051b04dd39755ff93821a73ccd6cb11d2491d8aa7f921014de252fb"),
hex("0x1d7cb39bafb8c744e148787a2e70230f9d4e917d5713bb050487b5aa7d74070b"),
hex("0x2ec93189bd1ab4f69117d0fe980c80ff8785c2961829f701bb74ac1f303b17db"),
},
{
hex("0x2db366bfdd36d277a692bb825b86275beac404a19ae07a9082ea46bd83517926"),
hex("0x062100eb485db06269655cf186a68532985275428450359adc99cec6960711b8"),
hex("0x0761d33c66614aaa570e7f1e8244ca1120243f92fa59e4f900c567bf41f5a59b"),
hex("0x20fc411a114d13992c2705aa034e3f315d78608a0f7de4ccf7a72e494855ad0d"),
},
{
hex("0x25b5c004a4bdfcb5add9ec4e9ab219ba102c67e8b3effb5fc3a30f317250bc5a"),
hex("0x23b1822d278ed632a494e58f6df6f5ed038b186d8474155ad87e7dff62b37f4b"),
hex("0x22734b4c5c3f9493606c4ba9012499bf0f14d13bfcfcccaa16102a29cc2f69e0"),
hex("0x26c0c8fe09eb30b7e27a74dc33492347e5bdff409aa3610254413d3fad795ce5"),
},
{
hex("0x070dd0ccb6bd7bbae88eac03fa1fbb26196be3083a809829bbd626df348ccad9"),
hex("0x12b6595bdb329b6fb043ba78bb28c3bec2c0a6de46d8c5ad6067c4ebfd4250da"),
hex("0x248d97d7f76283d63bec30e7a5876c11c06fca9b275c671c5e33d95bb7e8d729"),
hex("0x1a306d439d463b0816fc6fd64cc939318b45eb759ddde4aa106d15d9bd9baaaa"),
},
{
hex("0x28a8f8372e3c38daced7c00421cb4621f4f1b54ddc27821b0d62d3d6ec7c56cf"),
hex("0x0094975717f9a8a8bb35152f24d43294071ce320c829f388bc852183e1e2ce7e"),
hex("0x04d5ee4c3aa78f7d80fde60d716480d3593f74d4f653ae83f4103246db2e8d65"),
hex("0x2a6cf5e9aa03d4336349ad6fb8ed2269c7bef54b8822cc76d08495c12efde187"),
},
{
hex("0x2304d31eaab960ba9274da43e19ddeb7f792180808fd6e43baae48d7efcba3f3"),
hex("0x03fd9ac865a4b2a6d5e7009785817249bff08a7e0726fcb4e1c11d39d199f0b0"),
hex("0x00b7258ded52bbda2248404d55ee5044798afc3a209193073f7954d4d63b0b64"),
hex("0x159f81ada0771799ec38fca2d4bf65ebb13d3a74f3298db36272c5ca65e92d9a"),
},
{
hex("0x1ef90e67437fbc8550237a75bc28e3bb9000130ea25f0c5471e144cf4264431f"),
hex("0x1e65f838515e5ff0196b49aa41a2d2568df739bc176b08ec95a79ed82932e30d"),
hex("0x2b1b045def3a166cec6ce768d079ba74b18c844e570e1f826575c1068c94c33f"),
hex("0x0832e5753ceb0ff6402543b1109229c165dc2d73bef715e3f1c6e07c168bb173"),
},
{
hex("0x02f614e9cedfb3dc6b762ae0a37d41bab1b841c2e8b6451bc5a8e3c390b6ad16"),
hex("0x0e2427d38bd46a60dd640b8e362cad967370ebb777bedff40f6a0be27e7ed705"),
hex("0x0493630b7c670b6deb7c84d414e7ce79049f0ec098c3c7c50768bbe29214a53a"),
hex("0x22ead100e8e482674decdab17066c5a26bb1515355d5461a3dc06cc85327cea9"),
},
{
hex("0x25b3e56e655b42cdaae2626ed2554d48583f1ae35626d04de5084e0b6d2a6f16"),
hex("0x1e32752ada8836ef5837a6cde8ff13dbb599c336349e4c584b4fdc0a0cf6f9d0"),
hex("0x2fa2a871c15a387cc50f68f6f3c3455b23c00995f05078f672a9864074d412e5"),
hex("0x2f569b8a9a4424c9278e1db7311e889f54ccbf10661bab7fcd18e7c7a7d83505"),
},
{
hex("0x044cb455110a8fdd531ade530234c518a7df93f7332ffd2144165374b246b43d"),
hex("0x227808de93906d5d420246157f2e42b191fe8c90adfe118178ddc723a5319025"),
hex("0x02fcca2934e046bc623adead873579865d03781ae090ad4a8579d2e7a6800355"),
hex("0x0ef915f0ac120b876abccceb344a1d36bad3f3c5ab91a8ddcbec2e060d8befac"),
},
{
hex("0x1797130f4b7a3e1777eb757bc6f287f6ab0fb85f6be63b09f3b16ef2b1405d38"),
hex("0x0a76225dc04170ae3306c85abab59e608c7f497c20156d4d36c668555decc6e5"),
hex("0x1fffb9ec1992d66ba1e77a7b93209af6f8fa76d48acb664796174b5326a31a5c"),
hex("0x25721c4fc15a3f2853b57c338fa538d85f8fbba6c6b9c6090611889b797b9c5f"),
},
{
hex("0x0c817fd42d5f7a41215e3d07ba197216adb4c3790705da95eb63b982bfcaf75a"),
hex("0x13abe3f5239915d39f7e13c2c24970b6df8cf86ce00a22002bc15866e52b5a96"),
hex("0x2106feea546224ea12ef7f39987a46c85c1bc3dc29bdbd7a92cd60acb4d391ce"),
hex("0x21ca859468a746b6aaa79474a37dab49f1ca5a28c748bc7157e1b3345bb0f959"),
},
{
hex("0x05ccd6255c1e6f0c5cf1f0df934194c62911d14d0321662a8f1a48999e34185b"),
hex("0x0f0e34a64b70a626e464d846674c4c8816c4fb267fe44fe6ea28678cb09490a4"),
hex("0x0558531a4e25470c6157794ca36d0e9647dbfcfe350d64838f5b1a8a2de0d4bf"),
hex("0x09d3dca9173ed2faceea125157683d18924cadad3f655a60b72f5864961f1455"),
},
{
hex("0x0328cbd54e8c0913493f866ed03d218bf23f92d68aaec48617d4c722e5bd4335"),
hex("0x2bf07216e2aff0a223a487b1a7094e07e79e7bcc9798c648ee3347dd5329d34b"),
hex("0x1daf345a58006b736499c583cb76c316d6f78ed6a6dffc82111e11a63fe412df"),
hex("0x176563472456aaa746b694c60e1823611ef39039b2edc7ff391e6f2293d2c404"),
},
{
hex("0x2ef1e0fad9f08e87a3bb5e47d7e33538ca964d2b7d1083d4fb0225035bd3f8db"),
hex("0x226c9b1af95babcf17b2b1f57c7310179c1803dec5ae8f0a1779ed36c817ae2a"),
hex("0x14bce3549cc3db7428126b4c3a15ae0ff8148c89f13fb35d35734eb5d4ad0def"),
hex("0x2debff156e276bb5742c3373f2635b48b8e923d301f372f8e550cfd4034212c7"),
},
{
hex("0x2d4083cf5a87f5b6fc2395b22e356b6441afe1b6b29c47add7d0432d1d4760c7"),
hex("0x0c225b7bcd04bf9c34b911262fdc9c1b91bf79a10c0184d89c317c53d7161c29"),
hex("0x03152169d4f3d06ec33a79bfac91a02c99aa0200db66d5aa7b835265f9c9c8f3"),
hex("0x0b61811a9210be78b05974587486d58bddc8f51bfdfebbb87afe8b7aa7d3199c"),
},
{
hex("0x203e000cad298daaf7eba6a5c5921878b8ae48acf7048f16046d637a533b6f78"),
hex("0x1a44bf0937c722d1376672b69f6c9655ba7ee386fda1112c0757143d1bfa9146"),
hex("0x0376b4fae08cb03d3500afec1a1f56acb8e0fde75a2106d7002f59c5611d4daa"),
hex("0x00780af2ca1cad6465a2171250fdfc32d6fc241d3214177f3d553ef363182185"),
},
{
hex("0x10774d9ab80c25bdeb808bedfd72a8d9b75dbe18d5221c87e9d857079bdc31d5"),
hex("0x10dc6e9c006ea38b04b1e03b4bd9490c0d03f98929ca1d7fb56821fd19d3b6e8"),
hex("0x00544b8338791518b2c7645a50392798b21f75bb60e3596170067d00141cac16"),
hex("0x222c01175718386f2e2e82eb122789e352e105a3b8fa852613bc534433ee428c"),
},
{
hex("0x2840d045e9bc22b259cfb8811b1e0f45b77f7bdb7f7e2b46151a1430f608e3c5"),
hex("0x062752f86eebe11a009c937e468c335b04554574c2990196508e01fa5860186b"),
hex("0x06041bdac48205ac87adb87c20a478a71c9950c12a80bc0a55a8e83eaaf04746"),
hex("0x04a533f236c422d1ff900a368949b0022c7a2ae092f308d82b1dcbbf51f5000d"),
},
{
hex("0x13e31d7a67232fd811d6a955b3d4f25dfe066d1e7dc33df04bde50a2b2d05b2a"),
hex("0x011c2683ae91eb4dfbc13d6357e8599a9279d1648ff2c95d2f79905bb13920f1"),
hex("0x0b0d219346b8574525b1a270e0b4cba5d56c928e3e2c2bd0a1ecaed015aaf6ae"),
hex("0x14abdec8db9c6dc970291ee638690209b65080781ef9fd13d84c7a726b5f1364"),
},
{
hex("0x1a0b70b4b26fdc28fcd32aa3d266478801eb12202ef47ced988d0376610be106"),
hex("0x278543721f96d1307b6943f9804e7fe56401deb2ef99c4d12704882e7278b607"),
hex("0x16eb59494a9776cf57866214dbd1473f3f0738a325638d8ba36535e011d58259"),
hex("0x2567a658a81ffb444f240088fa5524c69a9e53eeab6b7f8c41c3479dcf8c644a"),
},
{
hex("0x29aa1d7c151e9ad0a7ab39f1abd9cf77ab78e0215a5715a6b882ade840bb13d8"),
hex("0x15c091233e60efe0d4bbfce2b36415006a4f017f9a85388ce206b91f99f2c984"),
hex("0x16bd7d22ff858e5e0882c2c999558d77e7673ad5f1915f9feb679a8115f014cf"),
hex("0x02db50480a07be0eb2c2e13ed6ef4074c0182d9b668b8e08ffe6769250042025"),
},
{
hex("0x05e4a220e6a3bc9f7b6806ec9d6cdba186330ef2bf7adb4c13ba866343b73119"),
hex("0x1dda05ebc30170bc98cbf2a5ee3b50e8b5f70bc424d39fa4104d37f1cbcf7a42"),
hex("0x0184bef721888187f645b6fee3667f3c91da214414d89ba5cd301f22b0de8990"),
hex("0x1498a307e68900065f5e8276f62aef1c37414b84494e1577ad1a6d64341b78ec"),
},
{
hex("0x25f40f82b31dacc4f4939800b9d2c3eacef737b8fab1f864fe33548ad46bd49d"),
hex("0x09d317cc670251943f6f5862a30d2ea9e83056ce4907bfbbcb1ff31ce5bb9650"),
hex("0x2f77d77786d979b23ba4ce4a4c1b3bd0a41132cd467a86ab29b913b6cf3149d0"),
hex("0x0f53dafd535a9f4473dc266b6fccc6841bbd336963f254c152f89e785f729bbf"),
},
{
hex("0x25c1fd72e223045265c3a099e17526fa0e6976e1c00baf16de96de85deef2fa2"),
hex("0x2a902c8980c17faae368d385d52d16be41af95c84eaea3cf893e65d6ce4a8f62"),
hex("0x1ce1580a3452ecf302878c8976b82be96676dd114d1dc8d25527405762f83529"),
hex("0x24a6073f91addc33a49a1fa306df008801c5ec569609034d2fc50f7f0f4d0056"),
},
{
hex("0x25e52dbd6124530d9fc27fe306d71d4583e07ca554b5d1577f256c68b0be2b74"),
hex("0x23dffae3c423fa7a93468dbccfb029855974be4d0a7b29946796e5b6cd70f15d"),
hex("0x06342da370cc0d8c49b77594f6b027c480615d50be36243a99591bc9924ed6f5"),
hex("0x2754114281286546b75f09f115fc751b4778303d0405c1b4cc7df0d8e9f63925"),
},
{
hex("0x15c19e8534c5c1a8862c2bc1d119eddeabf214153833d7bdb59ee197f8187cf5"),
hex("0x265fe062766d08fab4c78d0d9ef3cabe366f3be0a821061679b4b3d2d77d5f3e"),
hex("0x13ccf689d67a3ec9f22cb7cd0ac3a327d377ac5cd0146f048debfd098d3ec7be"),
hex("0x17662f7456789739f81cd3974827a887d92a5e05bdf3fe6b9fbccca4524aaebd"),
},
{
hex("0x21b29c76329b31c8ef18631e515f7f2f82ca6a5cca70cee4e809fd624be7ad5d"),
hex("0x18137478382aadba441eb97fe27901989c06738165215319939eb17b01fa975c"),
hex("0x2bc07ea2bfad68e8dc724f5fef2b37c2d34f761935ffd3b739ceec4668f37e88"),
hex("0x2ddb2e376f54d64a563840480df993feb4173203c2bd94ad0e602077aef9a03e"),
},
{
hex("0x277eb50f2baa706106b41cb24c602609e8a20f8d72f613708adb25373596c3f7"),
hex("0x0d4de47e1aba34269d0c620904f01a56b33fc4b450c0db50bb7f87734c9a1fe5"),
hex("0x0b8442bfe9e4a1b4428673b6bd3eea6f9f445697058f134aae908d0279a29f0c"),
hex("0x11fe5b18fbbea1a86e06930cb89f7d4a26e186a65945e96574247fddb720f8f5"),
},
{
hex("0x224026f6dfaf71e24d25d8f6d9f90021df5b774dcad4d883170e4ad89c33a0d6"),
hex("0x0b2ca6a999fe6887e0704dad58d03465a96bc9e37d1091f61bc9f9c62bbeb824"),
hex("0x221b63d66f0b45f9d40c54053a28a06b1d0a4ce41d364797a1a7e0c96529f421"),
hex("0x30185c48b7b2f1d53d4120801b047d087493bce64d4d24aedce2f4836bb84ad4"),
},
{
hex("0x23f5d372a3f0e3cba989e223056227d3533356f0faa48f27f8267318632a61f0"),
hex("0x2716683b32c755fd1bf8235ea162b1f388e1e0090d06162e8e6dfbe4328f3e3b"),
hex("0x0977545836866fa204ca1d853ec0909e3d140770c80ac67dc930c69748d5d4bc"),
hex("0x1444e8f592bdbfd8025d91ab4982dd425f51682d31472b05e81c43c0f9434b31"),
},
{
hex("0x26e04b65e9ca8270beb74a1c5cb8fee8be3ffbfe583f7012a00f874e7718fbe3"),
hex("0x22a5c2fa860d11fe34ee47a5cd9f869800f48f4febe29ad6df69816fb1a914d2"),
hex("0x174b54d9907d8f5c6afd672a738f42737ec338f3a0964c629f7474dd44c5c8d7"),
hex("0x1db1db8aa45283f31168fa66694cf2808d2189b87c8c8143d56c871907b39b87"),
},
{
hex("0x1530bf0f46527e889030b8c7b7dfde126f65faf8cce0ab66387341d813d1bfd1"),
hex("0x0b73f613993229f59f01c1cec8760e9936ead9edc8f2814889330a2f2bade457"),
hex("0x29c25a22fe2164604552aaea377f448d587ab977fc8227787bd2dc0f36bcf41e"),
hex("0x2b30d53ed1759bfb8503da66c92cf4077abe82795dc272b377df57d77c875526"),
},
{
hex("0x12f6d703b5702aab7b7b7e69359d53a2756c08c85ede7227cf5f0a2916787cd2"),
hex("0x2520e18300afda3f61a40a0b8837293a55ad01071028d4841ffa9ac706364113"),
hex("0x1ec9daea860971ecdda8ed4f346fa967ac9bc59278277393c68f09fa03b8b95f"),
hex("0x0a99b3e178db2e2e432f5cd5bef8fe4483bf5cbf70ed407c08aae24b830ad725"),
},
{
hex("0x07cda9e63db6e39f086b89b601c2bbe407ee0abac3c817a1317abad7c5778492"),
hex("0x08c9c65a4f955e8952d571b191bb0adb49bd8290963203b35d48aab38f8fc3a3"),
hex("0x2737f8ce1d5a67b349590ddbfbd709ed9af54a2a3f2719d33801c9c17bdd9c9e"),
hex("0x1049a6c65ff019f0d28770072798e8b7909432bd0c129813a9f179ba627f7d6a"),
},
{
hex("0x18b4fe968732c462c0ea5a9beb27cecbde8868944fdf64ee60a5122361daeddb"),
hex("0x2ff2b6fd22df49d2440b2eaeeefa8c02a6f478cfcf11f1b2a4f7473483885d19"),
hex("0x2ec5f2f1928fe932e56c789b8f6bbcb3e8be4057cbd8dbd18a1b352f5cef42ff"),
hex("0x265a5eccd8b92975e33ad9f75bf3426d424a4c6a7794ee3f08c1d100378e545e"),
},
{
hex("0x2405eaa4c0bde1129d6242bb5ada0e68778e656cfcb366bf20517da1dfd4279c"),
hex("0x094c97d8c194c42e88018004cbbf2bc5fdb51955d8b2d66b76dd98a2dbf60417"),
hex("0x2c30d5f33bb32c5c22b9979a605bf64d508b705221e6a686330c9625c2afe0b8"),
hex("0x01a75666f6241f6825d01cc6dcb1622d4886ea583e87299e6aa2fc716fdb6cf5"),
},
{
hex("0x0a3290e8398113ea4d12ac091e87be7c6d359ab9a66979fcf47bf2e87d382fcb"),
hex("0x154ade9ca36e268dfeb38461425bb0d8c31219d8fa0dfc75ecd21bf69aa0cc74"),
hex("0x27aa8d3e25380c0b1b172d79c6f22eee99231ef5dc69d8dc13a4b5095d028772"),
hex("0x2cf4051e6cab48301a8b2e3bca6099d756bbdf485afa1f549d395bbcbd806461"),
},
{
hex("0x301e70f729f3c94b1d3f517ddff9f2015131feab8afa5eebb0843d7f84b23e71"),
hex("0x298beb64f812d25d8b4d9620347ab02332dc4cef113ae60d17a8d7a4c91f83bc"),
hex("0x1b362e72a5f847f84d03fd291c3c471ed1c14a15b221680acf11a3f02e46aa95"),
hex("0x0dc8a2146110c0b375432902999223d5aa1ef6e78e1e5ebcbc1d9ba41dc1c737"),
},
{
hex("0x0a48663b34ce5e1c05dc93092cb69778cb21729a72ddc03a08afa1eb922ff279"),
hex("0x0a87391fb1cd8cdf6096b64a82f9e95f0fe46f143b702d74545bb314881098ee"),
hex("0x1b5b2946f7c28975f0512ff8e6ca362f8826edd7ea9c29f382ba8a2a0892fd5d"),
hex("0x01001cf512ac241d47ebe2239219bc6a173a8bbcb8a5b987b4eac1f533315b6b"),
},
{
hex("0x2fd977c70f645db4f704fa7d7693da727ac093d3fb5f5febc72beb17d8358a32"),
hex("0x23c0039a3fab4ad3c2d7cc688164f39e761d5355c05444d99be763a97793a9c4"),
hex("0x19d43ee0c6081c052c9c0df6161eaac1aec356cf435888e79f27f22ff03fa25d"),
hex("0x2d9b10c2f2e7ac1afddccffd94a563028bf29b646d020830919f9d5ca1cefe59"),
},
{
hex("0x2457ca6c2f2aa30ec47e4aff5a66f5ce2799283e166fc81cdae2f2b9f83e4267"),
hex("0x0abc392fe85eda855820592445094022811ee8676ed6f0c3044dfb54a7c10b35"),
hex("0x19d2cc5ca549d1d40cebcd37f3ea54f31161ac3993acf3101d2c2bc30eac1eb0"),
hex("0x0f97ae3033ffa01608aafb26ae13cd393ee0e4ec041ba644a3d3ab546e98c9c8"),
},
{
hex("0x16dbc78fd28b7fb8260e404cf1d427a7fa15537ea4e168e88a166496e88cfeca"),
hex("0x240faf28f11499b916f085f73bc4f22eef8344e576f8ad3d1827820366d5e07b"),
hex("0x0a1bb075aa37ff0cfe6c8531e55e1770eaba808c8fdb6dbf46f8cab58d9ef1af"),
hex("0x2e47e15ea4a47ff1a6a853aaf3a644ca38d5b085ac1042fdc4a705a7ce089f4d"),
},
{
hex("0x166e5bf073378348860ca4a9c09d39e1673ab059935f4df35fb14528375772b6"),
hex("0x18b42d7ffdd2ea4faf235902f057a2740cacccd027233001ed10f96538f0916f"),
hex("0x089cb1b032238f5e4914788e3e3c7ead4fc368020b3ed38221deab1051c37702"),
hex("0x242acd3eb3a2f72baf7c7076dd165adf89f9339c7b971921d9e70863451dd8d1"),
},
{
hex("0x174fbb104a4ee302bf47f2bd82fce896eac9a068283f326474af860457245c3b"),
hex("0x17340e71d96f466d61f3058ce092c67d2891fb2bb318613f780c275fe1116c6b"),
hex("0x1e8e40ac853b7d42f00f2e383982d024f098b9f8fd455953a2fd380c4df7f6b2"),
hex("0x0529898dc0649907e1d4d5e284b8d1075198c55cad66e8a9bf40f92938e2e961"),
},
{
hex("0x2162754db0baa030bf7de5bb797364dce8c77aa017ee1d7bf65f21c4d4e5df8f"),
hex("0x12c7553698c4bf6f3ceb250ae00c58c2a9f9291efbde4c8421bef44741752ec6"),
hex("0x292643e3ba2026affcb8c5279313bd51a733c93353e9d9c79cb723136526508e"),
hex("0x00ccf13e0cb6f9d81d52951bea990bd5b6c07c5d98e66ff71db6e74d5b87d158"),
},
{
hex("0x185d1e20e23b0917dd654128cf2f3aaab6723873cb30fc22b0f86c15ab645b4b"),
hex("0x14c61c836d55d3df742bdf11c60efa186778e3de0f024c0f13fe53f8d8764e1f"),
hex("0x0f356841b3f556fce5dbe4680457691c2919e2af53008184d03ee1195d72449e"),
hex("0x1b8fd9ff39714e075df124f887bf40b383143374fd2080ba0c0a6b6e8fa5b3e8"),
},
{
hex("0x0e86a8c2009c140ca3f873924e2aaa14fc3c8ae04e9df0b3e9103418796f6024"),
hex("0x2e6c5e898f5547770e5462ad932fcdd2373fc43820ca2b16b0861421e79155c8"),
hex("0x05d797f1ab3647237c14f9d1df032bc9ff9fe1a0ecd377972ce5fd5a0c014604"),
hex("0x29a3110463a5aae76c3d152875981d0c1daf2dcd65519ef5ca8929851da8c008"),
},
{
hex("0x2974da7bc074322273c3a4b91c05354cdc71640a8bbd1f864b732f8163883314"),
hex("0x1ed0fb06699ba249b2a30621c05eb12ca29cb91aa082c8bfcce9c522889b47dc"),
hex("0x1c793ef0dcc51123654ff26d8d863feeae29e8c572eca912d80c8ae36e40fe9b"),
hex("0x1e6aac1c6d3dd3157956257d3d234ef18c91e82589a78169fbb4a8770977dc2f"),
},
{
hex("0x1a20ada7576234eee6273dd6fa98b25ed037748080a47d948fcda33256fb6bf5"),
hex("0x191033d6d85ceaa6fc7a9a23a6fd9996642d772045ece51335d49306728af96c"),
hex("0x006e5979da7e7ef53a825aa6fddc3abfc76f200b3740b8b232ef481f5d06297b"),
hex("0x0b0d7e69c651910bbef3e68d417e9fa0fbd57f596c8f29831eff8c0174cdb06d"),
},
{
hex("0x25caf5b0c1b93bc516435ec084e2ecd44ac46dbbb033c5112c4b20a25c9cdf9d"),
hex("0x12c1ea892cc31e0d9af8b796d9645872f7f77442d62fd4c8085b2f150f72472a"),
hex("0x16af29695157aba9b8bbe3afeb245feee5a929d9f928b9b81de6dadc78c32aae"),
hex("0x0136df457c80588dd687fb2f3be18691705b87ec5a4cfdc168d31084256b67dc"),
},
{
hex("0x1639a28c5b4c81166aea984fba6e71479e07b1efbc74434db95a285060e7b089"),
hex("0x03d62fbf82fd1d4313f8e650f587ec06816c28b700bdc50f7e232bd9b5ca9b76"),
hex("0x11aeeb527dc8ce44b4d14aaddca3cfe2f77a1e40fc6da97c249830de1edfde54"),
hex("0x13f9b9a41274129479c5e6138c6c8ee36a670e6bc68c7a49642b645807bfc824"),
},
{
hex("0x0e4772fa3d75179dc8484cd26c7c1f635ddeeed7a939440c506cae8b7ebcd15b"),
hex("0x1b39a00cbc81e427de4bdec58febe8d8b5971752067a612b39fc46a68c5d4db4"),
hex("0x2bedb66e1ad5a1d571e16e2953f48731f66463c2eb54a245444d1c0a3a25707e"),
hex("0x2cf0a09a55ca93af8abd068f06a7287fb08b193b608582a27379ce35da915dec"),
},
{
hex("0x2d1bd78fa90e77aa88830cabfef2f8d27d1a512050ba7db0753c8fb863efb387"),
hex("0x065610c6f4f92491f423d3071eb83539f7c0d49c1387062e630d7fd283dc3394"),
hex("0x2d933ff19217a5545013b12873452bebcc5f9969033f15ec642fb464bd607368"),
hex("0x1aa9d3fe4c644910f76b92b3e13b30d500dae5354e79508c3c49c8aa99e0258b"),
},
{
hex("0x027ef04869e482b1c748638c59111c6b27095fa773e1aca078cea1f1c8450bdd"),
hex("0x2b7d524c5172cbbb15db4e00668a8c449f67a2605d9ec03802e3fa136ad0b8fb"),
hex("0x0c7c382443c6aa787c8718d86747c7f74693ae25b1e55df13f7c3c1dd735db0f"),
hex("0x00b4567186bc3f7c62a7b56acf4f76207a1f43c2d30d0fe4a627dcdd9bd79078"),
},
{
hex("0x1e41fc29b825454fe6d61737fe08b47fb07fe739e4c1e61d0337490883db4fd5"),
hex("0x12507cd556b7bbcc72ee6dafc616584421e1af872d8c0e89002ae8d3ba0653b6"),
hex("0x13d437083553006bcef312e5e6f52a5d97eb36617ef36fe4d77d3e97f71cb5db"),
hex("0x163ec73251f85443687222487dda9a65467d90b22f0b38664686077c6a4486d5"),
},
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/prover/poseidon/poseidon.go
|
package poseidon
import (
"github.com/consensys/gnark/frontend"
"github.com/reilabs/gnark-lean-extractor/v2/abstractor"
)
type cfg struct {
RF int
RP int
constants [][]frontend.Variable
mds [][]frontend.Variable
}
var CFG_2 = cfg{
RF: 8,
RP: 56,
constants: CONSTANTS_2,
mds: MDS_2,
}
var CFG_3 = cfg{
RF: 8,
RP: 57,
constants: CONSTANTS_3,
mds: MDS_3,
}
var CFG_4 = cfg{
RF: 8,
RP: 56,
constants: CONSTANTS_4,
mds: MDS_4,
}
func cfgFor(t int) *cfg {
switch t {
case 2:
return &CFG_2
case 3:
return &CFG_3
case 4:
return &CFG_4
}
panic("Poseidon: unsupported arg count")
}
type Poseidon1 struct {
In frontend.Variable
}
func (g Poseidon1) DefineGadget(api frontend.API) interface{} {
inp := []frontend.Variable{0, g.In}
return abstractor.Call1(api, poseidon{inp})[0]
}
type Poseidon2 struct {
In1, In2 frontend.Variable
}
func (g Poseidon2) DefineGadget(api frontend.API) interface{} {
inp := []frontend.Variable{0, g.In1, g.In2}
return abstractor.Call1(api, poseidon{inp})[0]
}
type Poseidon3 struct {
In1, In2, In3 frontend.Variable
}
func (g Poseidon3) DefineGadget(api frontend.API) interface{} {
inp := []frontend.Variable{0, g.In1, g.In2, g.In3}
result := abstractor.Call1(api, poseidon{inp})[0]
return result
}
type poseidon struct {
Inputs []frontend.Variable
}
func (g poseidon) DefineGadget(api frontend.API) interface{} {
state := g.Inputs
cfg := cfgFor(len(state))
for i := 0; i < cfg.RF/2; i += 1 {
state = abstractor.Call1(api, fullRound{state, cfg.constants[i]})
}
for i := 0; i < cfg.RP; i += 1 {
state = abstractor.Call1(api, halfRound{state, cfg.constants[cfg.RF/2+i]})
}
for i := 0; i < cfg.RF/2; i += 1 {
state = abstractor.Call1(api, fullRound{state, cfg.constants[cfg.RF/2+cfg.RP+i]})
}
return state
}
type sbox struct {
Inp frontend.Variable
}
func (s sbox) DefineGadget(api frontend.API) interface{} {
v2 := api.Mul(s.Inp, s.Inp)
v4 := api.Mul(v2, v2)
r := api.Mul(s.Inp, v4)
return r
}
type mds struct {
Inp []frontend.Variable
}
func (m mds) DefineGadget(api frontend.API) interface{} {
var mds = make([]frontend.Variable, len(m.Inp))
cfg := cfgFor(len(m.Inp))
for i := 0; i < len(m.Inp); i += 1 {
var sum frontend.Variable = 0
for j := 0; j < len(m.Inp); j += 1 {
sum = api.Add(sum, api.Mul(m.Inp[j], cfg.mds[i][j]))
}
mds[i] = sum
}
return mds
}
type halfRound struct {
Inp []frontend.Variable
Consts []frontend.Variable
}
func (h halfRound) DefineGadget(api frontend.API) interface{} {
for i := 0; i < len(h.Inp); i += 1 {
h.Inp[i] = api.Add(h.Inp[i], h.Consts[i])
}
h.Inp[0] = abstractor.Call(api, sbox{h.Inp[0]})
return abstractor.Call1(api, mds{h.Inp})
}
type fullRound struct {
Inp []frontend.Variable
Consts []frontend.Variable
}
func (h fullRound) DefineGadget(api frontend.API) interface{} {
for i := 0; i < len(h.Inp); i += 1 {
h.Inp[i] = api.Add(h.Inp[i], h.Consts[i])
}
for i := 0; i < len(h.Inp); i += 1 {
h.Inp[i] = abstractor.Call(api, sbox{h.Inp[i]})
}
result := abstractor.Call1(api, mds{h.Inp})
return result
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/formal-verification/lean-toolchain
|
leanprover/lean4:v4.2.0
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/formal-verification/lake-manifest.json
|
{"version": 6,
"packagesDir": "lake-packages",
"packages":
[{"git":
{"url": "https://github.com/leanprover-community/mathlib4.git",
"subDir?": null,
"rev": "753159252c585df6b6aa7c48d2b8828d58388b79",
"opts": {},
"name": "mathlib",
"inputRev?": "v4.2.0",
"inherited": false}},
{"git":
{"url": "https://github.com/reilabs/proven-zk.git",
"subDir?": null,
"rev": "659b51e94d4c5160c5d93b92323f0d0dda05c3ad",
"opts": {},
"name": "«proven-zk»",
"inputRev?": "v1.4.0",
"inherited": false}},
{"git":
{"url": "https://github.com/leanprover-community/quote4",
"subDir?": null,
"rev": "a387c0eb611857e2460cf97a8e861c944286e6b2",
"opts": {},
"name": "Qq",
"inputRev?": "master",
"inherited": true}},
{"git":
{"url": "https://github.com/leanprover/lean4-cli",
"subDir?": null,
"rev": "39229f3630d734af7d9cfb5937ddc6b41d3aa6aa",
"opts": {},
"name": "Cli",
"inputRev?": "nightly",
"inherited": true}},
{"git":
{"url": "https://github.com/leanprover-community/ProofWidgets4",
"subDir?": null,
"rev": "f1a5c7808b001305ba07d8626f45ee054282f589",
"opts": {},
"name": "proofwidgets",
"inputRev?": "v0.0.21",
"inherited": true}},
{"git":
{"url": "https://github.com/leanprover/std4",
"subDir?": null,
"rev": "6747f41f28627bed83e6d5891683538211caa2c1",
"opts": {},
"name": "std",
"inputRev?": "main",
"inherited": true}},
{"git":
{"url": "https://github.com/leanprover-community/aesop",
"subDir?": null,
"rev": "6749fa4e776919514dae85bfc0ad62a511bc42a7",
"opts": {},
"name": "aesop",
"inputRev?": "master",
"inherited": true}}],
"name": "«formal-verification»"}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/formal-verification/lakefile.lean
|
import Lake
open Lake DSL
package «formal-verification» {
-- add package configuration options here
}
require mathlib from git
"https://github.com/leanprover-community/mathlib4.git"@"v4.2.0"
require «proven-zk» from git
"https://github.com/reilabs/proven-zk.git"@"v1.4.0"
lean_lib FormalVerification {
moreLeanArgs := #["--tstack=65520", "-DmaxRecDepth=10000", "-DmaxHeartbeats=200000000"]
-- add library configuration options here
}
@[default_target]
lean_exe «formal-verification» {
moreLeanArgs := #["--tstack=65520", "-DmaxRecDepth=10000", "-DmaxHeartbeats=200000000"]
root := `Main
}
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/formal-verification/Main.lean
|
import «ProvenZk»
import FormalVerification.Circuit
import FormalVerification.Lemmas
import FormalVerification.Merkle
open LightProver (F)
theorem poseidon₂_testVector :
poseidon₂ vec![1, 2] = 7853200120776062878684798364095072458815029376092732009249414926327459813530 := rfl
theorem poseidon₃_testVector :
poseidon₃ vec![1, 2, 3] = 6542985608222806190361240322586112750744169038454362455181422643027100751666 := rfl
theorem InclusionCircuit.correct
[Fact (CollisionResistant poseidon₂)]
{trees : Vector (MerkleTree F poseidon₂ 26) 8}
{leaves : Vector F 8}:
(∃p₁ p₂, LightProver.InclusionCircuit_8_8_8_26_8_8_26 (trees.map (·.root)) leaves p₁ p₂)
↔ ∀i (_: i∈[0:8]), leaves[i] ∈ trees[i]
:= InclusionCircuit_correct
theorem NonInclusionCircuit.correct
[Fact (CollisionResistant poseidon₃)]
[Fact (CollisionResistant poseidon₂)]
{trees : Vector (RangeTree 26) 8}
{leaves : Vector F 8}:
(∃p₁ p₂ p₃ p₄ p₅,
LightProver.NonInclusionCircuit_8_8_8_8_8_8_26_8_8_26 (trees.map (·.val.root)) leaves p₁ p₂ p₃ p₄ p₅)
↔ ∀i (_: i∈[0:8]), leaves[i] ∈ trees[i]
:= NonInclusionCircuit_correct
theorem CombinedCircuit.correct
[Fact (CollisionResistant poseidon₃)]
[Fact (CollisionResistant poseidon₂)]
{inclusionTrees : Vector (MerkleTree F poseidon₂ 26) 8}
{nonInclusionTrees : Vector (RangeTree 26) 8}
{inclusionLeaves nonInclusionLeaves : Vector F 8}:
(∃p₁ p₂ p₃ p₄ p₅ p₆ p₇,
LightProver.CombinedCircuit_8_8_8_26_8_8_8_8_8_8_8_26_8
(inclusionTrees.map (·.root)) inclusionLeaves p₁ p₂
(nonInclusionTrees.map (·.val.root)) nonInclusionLeaves p₃ p₄ p₅ p₆ p₇)
↔ ∀i (_: i∈[0:8]), inclusionLeaves[i] ∈ inclusionTrees[i]
∧ nonInclusionLeaves[i] ∈ nonInclusionTrees[i]
:= CombinedCircuit_correct
def main : IO Unit := pure ()
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/formal-verification
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/formal-verification/FormalVerification/Merkle.lean
|
import «ProvenZk»
import FormalVerification.Circuit
import FormalVerification.Lemmas
import FormalVerification.Rangecheck
import FormalVerification.Poseidon
import FormalVerification.RangeTree
import Mathlib
open LightProver (F Order Gates)
def hashLevel (d : Bool) (s h : F): F := match d with
| false => poseidon₂ vec![h,s]
| true => poseidon₂ vec![s,h]
theorem hashLevel_def (d : Bool) (s h : F):
hashLevel d s h = match d with
| false => poseidon₂ vec![h,s]
| true => poseidon₂ vec![s,h] := by rfl
@[simp]
lemma ProveParentHash_rw {d : Bool} {h s : F} {k : F → Prop}:
LightProver.ProveParentHash d.toZMod h s k ↔
(k $ hashLevel d s h)
:= by
cases d <;> simp [LightProver.ProveParentHash, Gates, GatesGnark8, hashLevel]
lemma MerkleTree.recover_succ' {ix : Vector Bool (Nat.succ N)} {proof : Vector F (Nat.succ N)} :
MerkleTree.recover poseidon₂ ix proof item = hashLevel ix.head proof.head (MerkleTree.recover poseidon₂ ix.tail proof.tail item) := Eq.refl _
theorem MerkleRootGadget_rw {h i : F} {p : Vector F 26} {k : F → Prop}:
LightProver.MerkleRootGadget_26_26 h i p k ↔ ∃ (hi : i.val < 2^26), k (MerkleTree.recoverAtFin poseidon₂ ⟨i.val, hi⟩ p.reverse h) := by
unfold LightProver.MerkleRootGadget_26_26
simp_rw [Gates, GatesGnark8, Gates.to_binary_iff_eq_fin_to_bits_le_of_pow_length_lt, ←exists_and_right]
rw [exists_swap]
apply exists_congr
intro
rw [←Vector.ofFn_get (v:=p)]
simp [Vector.getElem_map, ProveParentHash_rw, MerkleTree.recoverAtFin, MerkleTree.recover_succ', Fin.toBitsLE, Fin.toBitsBE, -Vector.ofFn_get]
rfl
lemma InclusionProofStep_rw {l i e r} {k : F → Prop}:
(LightProver.MerkleRootGadget_26_26 l i e fun gate_0 => Gates.eq gate_0 r ∧ k gate_0) ↔
(∃ (hi : i.val < 2^26), MerkleTree.recoverAtFin poseidon₂ ⟨i.val, hi⟩ e.reverse l = r) ∧ k r := by
simp [MerkleRootGadget_rw]
apply Iff.intro
. rintro ⟨_, ⟨_⟩, _⟩; tauto
. rintro ⟨⟨_, ⟨_⟩⟩⟩; tauto
lemma InclusionProof_rw {roots leaves inPathIndices inPathElements k}:
LightProver.InclusionProof_8_8_8_26_8_8_26 roots leaves inPathIndices inPathElements k ↔
k roots ∧
∀i (_: i ∈ [0:8]), ∃ (hi : (inPathIndices[i]).val < 2^26), MerkleTree.recoverAtFin poseidon₂ ⟨(inPathIndices[i]).val, hi⟩ (inPathElements[i]).reverse (leaves[i]) = roots[i] := by
unfold LightProver.InclusionProof_8_8_8_26_8_8_26
simp_rw [InclusionProofStep_rw]
apply Iff.intro
. intro hp
repeat rcases hp with ⟨_, hp⟩
apply And.intro (by rw [←Vector.ofFn_get (v:=roots)]; exact hp)
intro i ir
have hir : i ∈ ([0:8].toList) := Std.Range.mem_toList_of_mem ir
fin_cases hir <;> assumption
. rintro ⟨hk, hp⟩
repeat apply And.intro (by apply hp _ ⟨by decide, by decide⟩)
rw [←Vector.ofFn_get (v:=roots)] at hk
exact hk
theorem InclusionProof_correct [Fact (CollisionResistant poseidon₂)] {trees : Vector (MerkleTree F poseidon₂ 26) 8} {leaves : Vector F 8}:
(∃inPathIndices proofs, LightProver.InclusionProof_8_8_8_26_8_8_26 (trees.map (·.root)) leaves inPathIndices proofs k) ↔
k (trees.map (·.root)) ∧ ∀i (_: i∈[0:8]), leaves[i] ∈ trees[i] := by
simp [InclusionProof_rw, MerkleTree.recoverAtFin_eq_root_iff_proof_and_item_correct]
intro
apply Iff.intro
. rintro ⟨_, _, hp⟩ i ir
have := hp i ir
rcases this with ⟨h, _, hp⟩
exact Exists.intro _ (Eq.symm hp)
. intro hp
have ⟨ind, indhp⟩ := Vector.exists_ofElems.mp fun (i : Fin 8) => hp i.val ⟨by simp, i.prop⟩
use ind.map fun i => (⟨i.val, Nat.lt_trans i.prop (by decide)⟩: F)
use Vector.ofFn fun (i : Fin 8) => (Vector.reverse $ trees[i.val].proofAtFin ind[i])
intro i ir
use by
simp only [Vector.getElem_map, ZMod.val, Order]
apply Fin.prop
simp [getElem]
apply And.intro
. rfl
. have := indhp i ir.2
simp [getElem] at this
rw [←this]
congr
theorem InclusionCircuit_correct [Fact (CollisionResistant poseidon₂)] {trees : Vector (MerkleTree F poseidon₂ 26) 8} {leaves : Vector F 8}:
(∃inPathIndices proofs, LightProver.InclusionCircuit_8_8_8_26_8_8_26 (trees.map (·.root)) leaves inPathIndices proofs) ↔
∀i (_: i∈[0:8]), leaves[i] ∈ trees[i] := by
unfold LightProver.InclusionCircuit_8_8_8_26_8_8_26
simp [InclusionProof_correct]
lemma LeafHashGadget_rw {r : Range} {v : F} {k : F → Prop}:
LightProver.LeafHashGadget r.lo r.index r.hi v k ↔ v ∈ r ∧ k r.hash := by
unfold LightProver.LeafHashGadget
simp only [Poseidon3_iff_uniqueAssignment]
apply Iff.intro
. rintro ⟨lo, hi, cont⟩
apply And.intro _ cont
have lo' := AssertIsLess_range (by
rw [ZMod.val_nat_cast, Nat.mod_eq_of_lt]
. exact Fin.prop _
. exact Nat.lt_trans (Fin.prop _) (by decide)
) ⟨lo, hi⟩
simp_rw [ZMod.val_nat_cast] at lo'
repeat rw [Nat.mod_eq_of_lt] at lo'
. exact lo'
. exact Nat.lt_trans r.hi.prop (by decide)
. exact Nat.lt_trans r.lo.prop (by decide)
. rintro ⟨⟨lo, hi⟩, cont⟩
refine ⟨?_, ?_, cont⟩
. rw [AssertIsLess_248_semantics]
zify
zify at lo hi
simp at lo hi
simp [ZMod.castInt_add, ZMod.castInt_sub]
have : (((2:F)^248).cast : ℤ) = 2^248 := by rfl
rw [this]
rw [ZMod.cast_eq_val, ZMod.val_cast_of_lt]
. rw [Int.emod_eq_of_lt]
. linarith
. linarith [r.hi.prop]
. have : 2^248 + 2^248 < (Order : ℤ) := by decide
linarith [r.lo.prop]
. exact Nat.lt_trans r.lo.prop (by decide)
. rw [AssertIsLess_248_semantics]
zify
zify at lo hi
simp at lo hi
simp [ZMod.castInt_add, ZMod.castInt_sub]
have : (((2:F)^248).cast : ℤ) = 2^248 := by rfl
rw [this]
rw [ZMod.cast_eq_val (r.hi.val : F), ZMod.val_cast_of_lt]
. rw [Int.emod_eq_of_lt]
. linarith
. linarith [r.hi.prop]
. have : 2^248 + 2^248 < (Order : ℤ) := by decide
linarith [r.lo.prop]
. exact Nat.lt_trans r.hi.prop (by decide)
theorem MerkleRootGadget_eq_rw [Fact (CollisionResistant poseidon₂)] {h i : F} {p : Vector F 26} {tree : MerkleTree F poseidon₂ 26} {k : F → Prop}:
LightProver.MerkleRootGadget_26_26 h i p (fun r => Gates.eq r tree.root ∧ k r) ↔ (∃(hi: i.val < 2^26), h = tree.itemAtFin ⟨i.val, hi⟩ ∧ p.reverse = tree.proofAtFin ⟨i.val, hi⟩) ∧ k tree.root := by
simp [MerkleRootGadget_rw]
rw [←exists_and_right]
apply exists_congr
simp [Gates, GatesGnark8, -MerkleTree.recoverAtFin_eq_root_iff_proof_and_item_correct]
intro i
apply Iff.intro
. intro ⟨l, r⟩
rw [l] at r
simp at l
rcases l with ⟨_, l⟩
simp [*]
. intro ⟨l, r⟩
have l' := l
rw [And.comm, ←MerkleTree.recoverAtFin_eq_root_iff_proof_and_item_correct] at l'
rw [l']
simp [*]
lemma LeafHashGadget_hashing {p : F → Prop} : (LightProver.LeafHashGadget lo nxt hi leaf p) → p (poseidon₃ vec![lo, nxt, hi]) := by
simp [LightProver.LeafHashGadget]
lemma LeafHashGadget_in_tree [Fact (CollisionResistant poseidon₃)] {p : F → Prop} {tree : RangeTree 26} (p_in_tree : ∀ r, p r → ∃i, r = tree.val.itemAtFin i) :
(LightProver.LeafHashGadget lo nxt hi leaf p) → ∃(r:Range), lo = r.lo ∧ hi = r.hi ∧ nxt = r.index := by
intro h
have := p_in_tree _ $ LeafHashGadget_hashing h
rcases this with ⟨i, heq⟩
rcases tree.prop i with ⟨r, h⟩
rw [h] at heq
simp [Range.hash, Vector.eq_cons] at heq
apply Exists.intro r
simp [heq]
theorem MerkleTreeRoot_LeafHashGadget_rw [Fact (CollisionResistant poseidon₃)] [Fact (CollisionResistant poseidon₂)] {lo hi nxt leaf ind proof} {k : F → Prop } {tree : RangeTree 26}:
(LightProver.LeafHashGadget lo nxt hi leaf fun r =>
LightProver.MerkleRootGadget_26_26 r ind proof fun root => Gates.eq root tree.val.root ∧ k root)
↔ ∃(range : Range) (h: ind.val < 2^26), tree.val.itemAtFin ⟨ind.val, h⟩ = range.hash ∧ lo = range.lo ∧ nxt = range.index ∧ hi = range.hi ∧ proof.reverse = tree.val.proofAtFin ⟨ind.val, h⟩ ∧ leaf ∈ range ∧ k tree.val.root := by
apply Iff.intro
. intro h
simp only [MerkleRootGadget_eq_rw] at h
have := LeafHashGadget_in_tree (tree := tree) (by
simp
intro r hp r_eq _ _
apply Exists.intro ⟨ind.val, hp⟩
exact r_eq
) h
rcases this with ⟨r, ⟨_⟩, ⟨_⟩, ⟨_⟩⟩
rw [LeafHashGadget_rw] at h
rcases h with ⟨_, ⟨hlt, _, _⟩ , _⟩
apply Exists.intro r
apply Exists.intro hlt
simp [*]
. rintro ⟨r, h, _, ⟨_⟩, ⟨_⟩, ⟨_⟩, _, _, _⟩
rw [LeafHashGadget_rw, MerkleRootGadget_eq_rw]
simp [*]
def NonInclusionProof_rec {n : Nat} (lo nxt hi leaf inds roots : Vector F n) (proofs : Vector (Vector F 26) n) (k : Vector F n → Prop): Prop :=
match n with
| 0 => k Vector.nil
| _ + 1 => LightProver.LeafHashGadget lo.head nxt.head hi.head leaf.head fun r =>
LightProver.MerkleRootGadget_26_26 r inds.head proofs.head fun root =>
Gates.eq root roots.head ∧ NonInclusionProof_rec lo.tail nxt.tail hi.tail leaf.tail inds.tail roots.tail proofs.tail fun rs => k (root ::ᵥ rs)
lemma NonInclusionProof_rec_equiv {lo nxt hi leaf inds roots proofs k}:
NonInclusionProof_rec lo nxt hi leaf inds roots proofs k ↔
LightProver.NonInclusionProof_8_8_8_8_8_8_26_8_8_26 roots leaf lo hi nxt inds proofs k := by
rw [ ←Vector.ofFn_get (v:=roots)
, ←Vector.ofFn_get (v:=lo)
, ←Vector.ofFn_get (v:=nxt)
, ←Vector.ofFn_get (v:=hi)
, ←Vector.ofFn_get (v:=leaf)
, ←Vector.ofFn_get (v:=inds)
, ←Vector.ofFn_get (v:=proofs)
]
rfl
theorem NonInclusionCircuit_rec_correct [Fact (CollisionResistant poseidon₃)] [Fact (CollisionResistant poseidon₂)] {n : Nat} {trees : Vector (RangeTree 26) n} {leaves : Vector F n} {k : Vector F n → Prop}:
(∃lo hi nxt inds proofs, NonInclusionProof_rec lo nxt hi leaves inds (trees.map (·.val.root)) proofs k) ↔
k (trees.map (·.val.root)) ∧ ∀i (_: i∈[0:n]), leaves[i] ∈ trees[i] := by
induction n with
| zero =>
cases trees using Vector.casesOn
simp [NonInclusionProof_rec]
intro _ _ k
linarith [k.2]
| succ n ih =>
apply Iff.intro
. intro ⟨lo, hi, nxt, inds, proofs, hp⟩
cases lo using Vector.casesOn with | cons hlo tlo =>
cases hi using Vector.casesOn with | cons hhi thi =>
cases nxt using Vector.casesOn with | cons hnxt tnxt =>
cases leaves using Vector.casesOn with | cons hleaf tleaf =>
cases inds using Vector.casesOn with | cons hinds tinds =>
cases proofs using Vector.casesOn with | cons hproof tproof =>
cases trees using Vector.casesOn with | cons htree ttree =>
simp [NonInclusionProof_rec, MerkleTreeRoot_LeafHashGadget_rw] at hp
rcases hp with ⟨range, _, hinc, ⟨_⟩, ⟨_⟩, ⟨_⟩, _, hlr, hp⟩
have := ih.mp $ Exists.intro _ $ Exists.intro _ $ Exists.intro _ $ Exists.intro _ $ Exists.intro _ hp
apply And.intro
. simp [*]
. intro i ir
cases i with
| zero =>
simp [Membership.mem, rangeTreeMem]
simp [Membership.mem] at hlr
apply Exists.intro range
apply And.intro
. exact Exists.intro _ hinc
. assumption
| succ i =>
rcases ir with ⟨l, r⟩
simp
exact this.2 i ⟨by simp, by linarith⟩
. intro ⟨hk, hmem⟩
cases trees using Vector.casesOn with | cons htree ttree =>
cases leaves using Vector.casesOn with | cons hleaf tleaf =>
have := (ih (trees := ttree) (leaves := tleaf) (k := fun roots => k $ htree.val.root ::ᵥ roots)).mpr $ by
simp at hk
apply And.intro hk
intro i ir
have := hmem (i+1) ⟨by simp, by linarith [ir.2]⟩
simp at this
exact this
rcases this with ⟨lo, hi, nxt, inds, proofs, hp⟩
have := hmem 0 ⟨by simp, by simp⟩
simp at this
simp [NonInclusionProof_rec, MerkleTreeRoot_LeafHashGadget_rw]
rcases this with ⟨r, ⟨ix, hitem⟩, hlo, hhi⟩
use r.lo ::ᵥ lo
use r.hi ::ᵥ hi
use r.index ::ᵥ nxt
use ix ::ᵥ inds
use (htree.val.proofAtFin ix).reverse ::ᵥ proofs
use r
have : (ZMod.val (ix.val : F)) = ix.val := by
rw [ZMod.val_nat_cast, Nat.mod_eq_of_lt]
exact Nat.lt_trans ix.prop (by decide)
apply Exists.intro
simp [*, Membership.mem]
exact hp
simp [this]
theorem NonInclusionCircuit_correct [Fact (CollisionResistant poseidon₃)] [Fact (CollisionResistant poseidon₂)] {trees : Vector (RangeTree 26) 8} {leaves : Vector F 8}:
(∃lo hi nxt inds proofs, LightProver.NonInclusionCircuit_8_8_8_8_8_8_26_8_8_26 (trees.map (·.val.root)) leaves lo hi nxt inds proofs) ↔
∀i (_: i∈[0:8]), leaves[i] ∈ trees[i] := by
unfold LightProver.NonInclusionCircuit_8_8_8_8_8_8_26_8_8_26
simp [←NonInclusionProof_rec_equiv, NonInclusionCircuit_rec_correct, Gates, GatesGnark8]
lemma InclusionProof_swap_ex {k : α → Vector F 8 → Prop} : (∃ a, LightProver.InclusionProof_8_8_8_26_8_8_26 x y z w fun r => k a r) ↔
LightProver.InclusionProof_8_8_8_26_8_8_26 x y z w fun r => ∃a, k a r := by
simp [InclusionProof_rw]
theorem CombinedCircuit_correct [Fact (CollisionResistant poseidon₃)] [Fact (CollisionResistant poseidon₂)]
{inclusionTrees : Vector (MerkleTree F poseidon₂ 26) 8} { nonInclusionTrees : Vector (RangeTree 26) 8}
{inclusionLeaves nonInclusionLeaves : Vector F 8}:
(∃a b c d e f g, LightProver.CombinedCircuit_8_8_8_26_8_8_8_8_8_8_8_26_8 (inclusionTrees.map (·.root)) inclusionLeaves a b (nonInclusionTrees.map (·.val.root)) nonInclusionLeaves c d e f g) ↔
∀i (_: i∈[0:8]), inclusionLeaves[i] ∈ inclusionTrees[i] ∧ nonInclusionLeaves[i] ∈ nonInclusionTrees[i] := by
unfold LightProver.CombinedCircuit_8_8_8_26_8_8_8_8_8_8_8_26_8
simp [InclusionProof_swap_ex, InclusionProof_correct, ←NonInclusionProof_rec_equiv, NonInclusionCircuit_rec_correct]
apply Iff.intro
. tauto
. intro hp
apply And.intro
. exact fun i ir => (hp i ir).2
. exact fun i ir => (hp i ir).1
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/formal-verification
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/formal-verification/FormalVerification/Lemmas.lean
|
import Mathlib
import «ProvenZk»
import FormalVerification.Circuit
open LightProver (F Order)
axiom bn254_Fr_prime : Nat.Prime Order
instance : Fact (Nat.Prime Order) := Fact.mk bn254_Fr_prime
instance : Membership α (MerkleTree α H d) where
mem x t := ∃i, t.itemAtFin i = x
namespace ZMod
lemma castInt_lt [NeZero N] {n : ZMod N}: (n:ℤ) < N := by
rw [cast_eq_val, Nat.cast_lt]
apply ZMod.val_lt
lemma castInt_nonneg [NeZero N] {n : ZMod N}: (0:ℤ) ≤ n := by
rw [cast_eq_val]
apply Int.ofNat_nonneg
lemma castInt_neg [NeZero N] {n : ZMod N}: (((-n): ZMod N) : ℤ) = -(n:ℤ) % N := by
rw [cast_eq_val, neg_val]
split
. simp [*]
. rw [Nat.cast_sub]
. rw [←Int.add_emod_self_left, Int.emod_eq_of_lt]
. simp; rfl
. linarith [castInt_lt (N:=N)]
. simp_arith
rw [ZMod.cast_eq_val, ←Int.ofNat_zero, Int.ofNat_lt]
apply Nat.zero_lt_of_ne_zero
simp [*]
. exact Nat.le_of_lt (ZMod.val_lt _)
lemma castInt_add [NeZero N] {n m : ZMod N}: (((n + m): ZMod N) : ℤ) = ((n:ℤ) + (m:ℤ)) % N := by
rw [ZMod.cast_eq_val, val_add]
simp
lemma castInt_sub [NeZero N] {n m : ZMod N}: (((n - m): ZMod N) : ℤ) = ((n:ℤ) - (m:ℤ)) % N := by
rw [sub_eq_add_neg, castInt_add, castInt_neg]
simp
rfl
end ZMod
namespace Int
lemma ofNat_pow {a b : ℕ} : (a^b : ℤ) = (OfNat.ofNat a)^b := by simp [OfNat.ofNat]
theorem negSucc_le_negSucc (m n : Nat) : negSucc m ≤ negSucc n ↔ n ≤ m := by
rw [le_def]
apply Iff.intro
. conv => lhs; arg 1; whnf
split
. rename_i h; intro; rw [Nat.succ_sub_succ_eq_sub] at h; exact Nat.le_of_sub_eq_zero h
. intro; contradiction
. intro hp;
conv => arg 1; whnf
split
. apply NonNeg.mk
. rename_i hpc
linarith [Nat.lt_of_sub_eq_succ hpc]
theorem emod_negSucc (m : Nat) (n : Int) :
negSucc m % n = subNatNat (natAbs n) (Nat.succ (m % natAbs n)) := rfl
theorem emod_eq_add_self_of_neg_and_lt_neg_self {a : ℤ} {mod : ℤ}: a < 0 → a ≥ -mod → a % mod = a + mod := by
intro hlt hge
rw [←add_emod_self]
apply emod_eq_of_lt
. linarith
. linarith
end Int
lemma Membership.get_elem_helper {i n : ℕ} {r : Std.Range} (h₁ : i ∈ r) (h₂ : r.stop = n) :
i < n := h₂ ▸ h₁.2
macro_rules
| `(tactic| get_elem_tactic_trivial) => `(tactic| (exact Membership.get_elem_helper (by assumption) (by rfl)))
def Std.Range.toList (r : Std.Range): List Nat := go r.start (r.stop - r.start) where
go start
| 0 => []
| i + 1 => start :: go (start + 1) i
theorem Std.Range.mem_toList_of_mem {r : Std.Range} (hp : i ∈ r) : i ∈ r.toList := by
rcases hp with ⟨h₁, h₂⟩
rcases r with ⟨start, stop, _⟩
simp at h₁ h₂
have h₃ : ∃d, stop = start + d := by
exists stop - start
apply Eq.symm
apply Nat.add_sub_cancel'
apply Nat.le_trans h₁ (Nat.le_of_lt h₂)
rcases h₃ with ⟨d, ⟨_⟩⟩
induction d generalizing start i with
| zero => linarith
| succ d ih =>
simp [toList, toList.go]
cases h₁ with
| refl => tauto
| @step m h₁ =>
simp at h₁
apply Or.inr
simp [toList] at ih
apply ih <;> linarith
@[simp]
lemma MerkleTree.GetElem.def {tree : MerkleTree α H d} {i : ℕ} {ih : i < 2^d}:
tree[i] = tree.itemAtFin ⟨i, ih⟩ := by rfl
theorem Vector.exists_ofElems {p : Fin n → α → Prop} : (∀ (i : Fin n), ∃j, p i j) ↔ ∃(v : Vector α n), ∀i (_: i<n), p ⟨i, by assumption⟩ v[i] := by
apply Iff.intro
. intro h
induction n with
| zero =>
exists Vector.nil
intro i h
linarith [h]
| succ n ih =>
rw [Vector.exists_succ_iff_exists_snoc]
have hp_init := ih fun (i : Fin n) => h (Fin.castLE (by linarith) i)
rcases hp_init with ⟨vinit, hpinit⟩
exists vinit
have hp_last := h (Fin.last n)
rcases hp_last with ⟨vlast, hplast⟩
exists vlast
intro i ihp
cases Nat.lt_succ_iff_lt_or_eq.mp ihp with
| inl ihp =>
simp [ihp]
apply hpinit
| inr ihp =>
simp [ihp]
apply hplast
. rintro ⟨v, h⟩ i
exact ⟨v[i], h i i.2⟩
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/formal-verification
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/formal-verification/FormalVerification/Poseidon.lean
|
import FormalVerification.Circuit
import FormalVerification.Lemmas
import Mathlib
import «ProvenZk»
open LightProver (F Order)
def sbox_uniqueAssignment (Inp : F): UniqueAssignment (LightProver.sbox Inp) id := UniqueAssignment.mk _ $ by
simp [LightProver.sbox]; tauto
def mds_3_uniqueAssignment (S : Vector F 3): UniqueAssignment (LightProver.mds_3 S) id := UniqueAssignment.mk _ $ by
simp [LightProver.mds_3]; tauto
def fullRound_3_3_uniqueAssignment (S C : Vector F 3): UniqueAssignment (LightProver.fullRound_3_3 S C) id := UniqueAssignment.mk _ $ by
simp [LightProver.fullRound_3_3, (sbox_uniqueAssignment _).equiv, (mds_3_uniqueAssignment _).equiv]; tauto
def halfRound_3_3_uniqueAssignment (S C : Vector F 3): UniqueAssignment (LightProver.halfRound_3_3 S C) id := UniqueAssignment.mk _ $ by
simp [LightProver.halfRound_3_3, (sbox_uniqueAssignment _).equiv, (mds_3_uniqueAssignment _).equiv]; tauto
def poseidon_3_uniqueAssignment (inp : Vector F 3): UniqueAssignment (LightProver.poseidon_3 inp) id := by
unfold LightProver.poseidon_3
repeat (
apply UniqueAssignment.compose
. (first | apply fullRound_3_3_uniqueAssignment | apply halfRound_3_3_uniqueAssignment)
intro _
)
apply UniqueAssignment.constant
theorem poseidon_3_testVector : (poseidon_3_uniqueAssignment (vec![0,1,2])).val = vec![0x115cc0f5e7d690413df64c6b9662e9cf2a3617f2743245519e19607a4417189a, 0x0fca49b798923ab0239de1c9e7a4a9a2210312b6a2f616d18b5a87f9b628ae29, 0x0e7ae82e40091e63cbd4f16a6d16310b3729d4b6e138fcf54110e2867045a30c] :=
by native_decide
def poseidon₂ : Hash F 2 := fun a => (poseidon_3_uniqueAssignment vec![0, a.get 0, a.get 1]).val.get 0
@[simp]
lemma Poseidon2_iff_uniqueAssignment (a b : F) (k : F -> Prop) : LightProver.Poseidon2 a b k ↔ k (poseidon₂ vec![a, b]) := by
unfold LightProver.Poseidon2 poseidon₂
apply Iff.of_eq
rw [(poseidon_3_uniqueAssignment _).equiv]
congr
def mds_4_uniqueAssignment (S : Vector F 4): UniqueAssignment (LightProver.mds_4 S) id := UniqueAssignment.mk _ $ by
simp [LightProver.mds_4]; tauto
def fullRound_4_4_uniqueAssignment (S C : Vector F 4): UniqueAssignment (LightProver.fullRound_4_4 S C) id := UniqueAssignment.mk _ $ by
simp [LightProver.fullRound_4_4, (sbox_uniqueAssignment _).equiv, (mds_4_uniqueAssignment _).equiv]; tauto
def halfRound_4_4_uniqueAssignment (S C : Vector F 4): UniqueAssignment (LightProver.halfRound_4_4 S C) id := UniqueAssignment.mk _ $ by
simp [LightProver.halfRound_4_4, (sbox_uniqueAssignment _).equiv, (mds_4_uniqueAssignment _).equiv]; tauto
def poseidon_4_uniqueAssignment (inp : Vector F 4): UniqueAssignment (LightProver.poseidon_4 inp) id := by
unfold LightProver.poseidon_4
repeat (
apply UniqueAssignment.compose
. (first | apply fullRound_4_4_uniqueAssignment | apply halfRound_4_4_uniqueAssignment)
intro _
)
apply UniqueAssignment.constant
def poseidon₃ : Hash F 3 := fun a => (poseidon_4_uniqueAssignment vec![0, a.get 0, a.get 1, a.get 2]).val.get 0
@[simp]
lemma Poseidon3_iff_uniqueAssignment (a b c : F) (k : F -> Prop) : LightProver.Poseidon3 a b c k ↔ k (poseidon₃ vec![a, b, c]) := by
unfold LightProver.Poseidon3 poseidon₃
apply Iff.of_eq
rw [(poseidon_4_uniqueAssignment _).equiv]
congr
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/formal-verification
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/formal-verification/FormalVerification/RangeTree.lean
|
import «ProvenZk»
import FormalVerification.Poseidon
import FormalVerification.Circuit
import FormalVerification.Lemmas
open LightProver (F)
structure Range : Type where
lo : Fin (2^248)
hi : Fin (2^248)
index : F
def Range.hash : Range → F := fun r => poseidon₃ vec![r.lo, r.index, r.hi]
def RangeTree (d : ℕ) : Type := { t: MerkleTree F poseidon₂ d // ∀ (i : Fin (2^d)), ∃ range, t.itemAtFin i = Range.hash range }
def rangeTreeMem {d} : Range → RangeTree d → Prop := fun r t => r.hash ∈ t.val
instance : Membership F Range where
mem x r := r.lo.val < x.val ∧ x.val < r.hi.val
instance {d} : Membership F (RangeTree d) where
mem x t := ∃(r:Range), rangeTreeMem r t ∧ x ∈ r
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/formal-verification
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/formal-verification/FormalVerification/Circuit.lean
|
import ProvenZk.Gates
import ProvenZk.Ext.Vector
set_option linter.unusedVariables false
namespace LightProver
def Order : ℕ := 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001
variable [Fact (Nat.Prime Order)]
abbrev F := ZMod Order
abbrev Gates := GatesGnark8 Order
def sbox (Inp: F) (k: F -> Prop): Prop :=
∃gate_0, gate_0 = Gates.mul Inp Inp ∧
∃gate_1, gate_1 = Gates.mul gate_0 gate_0 ∧
∃gate_2, gate_2 = Gates.mul Inp gate_1 ∧
k gate_2
def mds_3 (Inp: Vector F 3) (k: Vector F 3 -> Prop): Prop :=
∃gate_0, gate_0 = Gates.mul Inp[0] (7511745149465107256748700652201246547602992235352608707588321460060273774987:F) ∧
∃gate_1, gate_1 = Gates.add (0:F) gate_0 ∧
∃gate_2, gate_2 = Gates.mul Inp[1] (10370080108974718697676803824769673834027675643658433702224577712625900127200:F) ∧
∃gate_3, gate_3 = Gates.add gate_1 gate_2 ∧
∃gate_4, gate_4 = Gates.mul Inp[2] (19705173408229649878903981084052839426532978878058043055305024233888854471533:F) ∧
∃gate_5, gate_5 = Gates.add gate_3 gate_4 ∧
∃gate_6, gate_6 = Gates.mul Inp[0] (18732019378264290557468133440468564866454307626475683536618613112504878618481:F) ∧
∃gate_7, gate_7 = Gates.add (0:F) gate_6 ∧
∃gate_8, gate_8 = Gates.mul Inp[1] (20870176810702568768751421378473869562658540583882454726129544628203806653987:F) ∧
∃gate_9, gate_9 = Gates.add gate_7 gate_8 ∧
∃gate_10, gate_10 = Gates.mul Inp[2] (7266061498423634438633389053804536045105766754026813321943009179476902321146:F) ∧
∃gate_11, gate_11 = Gates.add gate_9 gate_10 ∧
∃gate_12, gate_12 = Gates.mul Inp[0] (9131299761947733513298312097611845208338517739621853568979632113419485819303:F) ∧
∃gate_13, gate_13 = Gates.add (0:F) gate_12 ∧
∃gate_14, gate_14 = Gates.mul Inp[1] (10595341252162738537912664445405114076324478519622938027420701542910180337937:F) ∧
∃gate_15, gate_15 = Gates.add gate_13 gate_14 ∧
∃gate_16, gate_16 = Gates.mul Inp[2] (11597556804922396090267472882856054602429588299176362916247939723151043581408:F) ∧
∃gate_17, gate_17 = Gates.add gate_15 gate_16 ∧
k vec![gate_5, gate_11, gate_17]
def fullRound_3_3 (Inp: Vector F 3) (Consts: Vector F 3) (k: Vector F 3 -> Prop): Prop :=
∃gate_0, gate_0 = Gates.add Inp[0] Consts[0] ∧
∃gate_1, gate_1 = Gates.add Inp[1] Consts[1] ∧
∃gate_2, gate_2 = Gates.add Inp[2] Consts[2] ∧
sbox gate_0 fun gate_3 =>
sbox gate_1 fun gate_4 =>
sbox gate_2 fun gate_5 =>
mds_3 vec![gate_3, gate_4, gate_5] fun gate_6 =>
k gate_6
def halfRound_3_3 (Inp: Vector F 3) (Consts: Vector F 3) (k: Vector F 3 -> Prop): Prop :=
∃gate_0, gate_0 = Gates.add Inp[0] Consts[0] ∧
∃gate_1, gate_1 = Gates.add Inp[1] Consts[1] ∧
∃gate_2, gate_2 = Gates.add Inp[2] Consts[2] ∧
sbox gate_0 fun gate_3 =>
mds_3 vec![gate_3, gate_1, gate_2] fun gate_4 =>
k gate_4
def poseidon_3 (Inputs: Vector F 3) (k: Vector F 3 -> Prop): Prop :=
fullRound_3_3 Inputs vec![(6745197990210204598374042828761989596302876299545964402857411729872131034734:F), (426281677759936592021316809065178817848084678679510574715894138690250139748:F), (4014188762916583598888942667424965430287497824629657219807941460227372577781:F)] fun gate_0 =>
fullRound_3_3 gate_0 vec![(21328925083209914769191926116470334003273872494252651254811226518870906634704:F), (19525217621804205041825319248827370085205895195618474548469181956339322154226:F), (1402547928439424661186498190603111095981986484908825517071607587179649375482:F)] fun gate_1 =>
fullRound_3_3 gate_1 vec![(18320863691943690091503704046057443633081959680694199244583676572077409194605:F), (17709820605501892134371743295301255810542620360751268064484461849423726103416:F), (15970119011175710804034336110979394557344217932580634635707518729185096681010:F)] fun gate_2 =>
fullRound_3_3 gate_2 vec![(9818625905832534778628436765635714771300533913823445439412501514317783880744:F), (6235167673500273618358172865171408902079591030551453531218774338170981503478:F), (12575685815457815780909564540589853169226710664203625668068862277336357031324:F)] fun gate_3 =>
halfRound_3_3 gate_3 vec![(7381963244739421891665696965695211188125933529845348367882277882370864309593:F), (14214782117460029685087903971105962785460806586237411939435376993762368956406:F), (13382692957873425730537487257409819532582973556007555550953772737680185788165:F)] fun gate_4 =>
halfRound_3_3 gate_4 vec![(2203881792421502412097043743980777162333765109810562102330023625047867378813:F), (2916799379096386059941979057020673941967403377243798575982519638429287573544:F), (4341714036313630002881786446132415875360643644216758539961571543427269293497:F)] fun gate_5 =>
halfRound_3_3 gate_5 vec![(2340590164268886572738332390117165591168622939528604352383836760095320678310:F), (5222233506067684445011741833180208249846813936652202885155168684515636170204:F), (7963328565263035669460582454204125526132426321764384712313576357234706922961:F)] fun gate_6 =>
halfRound_3_3 gate_6 vec![(1394121618978136816716817287892553782094854454366447781505650417569234586889:F), (20251767894547536128245030306810919879363877532719496013176573522769484883301:F), (141695147295366035069589946372747683366709960920818122842195372849143476473:F)] fun gate_7 =>
halfRound_3_3 gate_7 vec![(15919677773886738212551540894030218900525794162097204800782557234189587084981:F), (2616624285043480955310772600732442182691089413248613225596630696960447611520:F), (4740655602437503003625476760295930165628853341577914460831224100471301981787:F)] fun gate_8 =>
halfRound_3_3 gate_8 vec![(19201590924623513311141753466125212569043677014481753075022686585593991810752:F), (12116486795864712158501385780203500958268173542001460756053597574143933465696:F), (8481222075475748672358154589993007112877289817336436741649507712124418867136:F)] fun gate_9 =>
halfRound_3_3 gate_9 vec![(5181207870440376967537721398591028675236553829547043817076573656878024336014:F), (1576305643467537308202593927724028147293702201461402534316403041563704263752:F), (2555752030748925341265856133642532487884589978209403118872788051695546807407:F)] fun gate_10 =>
halfRound_3_3 gate_10 vec![(18840924862590752659304250828416640310422888056457367520753407434927494649454:F), (14593453114436356872569019099482380600010961031449147888385564231161572479535:F), (20826991704411880672028799007667199259549645488279985687894219600551387252871:F)] fun gate_11 =>
halfRound_3_3 gate_11 vec![(9159011389589751902277217485643457078922343616356921337993871236707687166408:F), (5605846325255071220412087261490782205304876403716989785167758520729893194481:F), (1148784255964739709393622058074925404369763692117037208398835319441214134867:F)] fun gate_12 =>
halfRound_3_3 gate_12 vec![(20945896491956417459309978192328611958993484165135279604807006821513499894540:F), (229312996389666104692157009189660162223783309871515463857687414818018508814:F), (21184391300727296923488439338697060571987191396173649012875080956309403646776:F)] fun gate_13 =>
halfRound_3_3 gate_13 vec![(21853424399738097885762888601689700621597911601971608617330124755808946442758:F), (12776298811140222029408960445729157525018582422120161448937390282915768616621:F), (7556638921712565671493830639474905252516049452878366640087648712509680826732:F)] fun gate_14 =>
halfRound_3_3 gate_14 vec![(19042212131548710076857572964084011858520620377048961573689299061399932349935:F), (12871359356889933725034558434803294882039795794349132643274844130484166679697:F), (3313271555224009399457959221795880655466141771467177849716499564904543504032:F)] fun gate_15 =>
halfRound_3_3 gate_15 vec![(15080780006046305940429266707255063673138269243146576829483541808378091931472:F), (21300668809180077730195066774916591829321297484129506780637389508430384679582:F), (20480395468049323836126447690964858840772494303543046543729776750771407319822:F)] fun gate_16 =>
halfRound_3_3 gate_16 vec![(10034492246236387932307199011778078115444704411143703430822959320969550003883:F), (19584962776865783763416938001503258436032522042569001300175637333222729790225:F), (20155726818439649091211122042505326538030503429443841583127932647435472711802:F)] fun gate_17 =>
halfRound_3_3 gate_17 vec![(13313554736139368941495919643765094930693458639277286513236143495391474916777:F), (14606609055603079181113315307204024259649959674048912770003912154260692161833:F), (5563317320536360357019805881367133322562055054443943486481491020841431450882:F)] fun gate_18 =>
halfRound_3_3 gate_18 vec![(10535419877021741166931390532371024954143141727751832596925779759801808223060:F), (12025323200952647772051708095132262602424463606315130667435888188024371598063:F), (2906495834492762782415522961458044920178260121151056598901462871824771097354:F)] fun gate_19 =>
halfRound_3_3 gate_19 vec![(19131970618309428864375891649512521128588657129006772405220584460225143887876:F), (8896386073442729425831367074375892129571226824899294414632856215758860965449:F), (7748212315898910829925509969895667732958278025359537472413515465768989125274:F)] fun gate_20 =>
halfRound_3_3 gate_20 vec![(422974903473869924285294686399247660575841594104291551918957116218939002865:F), (6398251826151191010634405259351528880538837895394722626439957170031528482771:F), (18978082967849498068717608127246258727629855559346799025101476822814831852169:F)] fun gate_21 =>
halfRound_3_3 gate_21 vec![(19150742296744826773994641927898928595714611370355487304294875666791554590142:F), (12896891575271590393203506752066427004153880610948642373943666975402674068209:F), (9546270356416926575977159110423162512143435321217584886616658624852959369669:F)] fun gate_22 =>
halfRound_3_3 gate_22 vec![(2159256158967802519099187112783460402410585039950369442740637803310736339200:F), (8911064487437952102278704807713767893452045491852457406400757953039127292263:F), (745203718271072817124702263707270113474103371777640557877379939715613501668:F)] fun gate_23 =>
halfRound_3_3 gate_23 vec![(19313999467876585876087962875809436559985619524211587308123441305315685710594:F), (13254105126478921521101199309550428567648131468564858698707378705299481802310:F), (1842081783060652110083740461228060164332599013503094142244413855982571335453:F)] fun gate_24 =>
halfRound_3_3 gate_24 vec![(9630707582521938235113899367442877106957117302212260601089037887382200262598:F), (5066637850921463603001689152130702510691309665971848984551789224031532240292:F), (4222575506342961001052323857466868245596202202118237252286417317084494678062:F)] fun gate_25 =>
halfRound_3_3 gate_25 vec![(2919565560395273474653456663643621058897649501626354982855207508310069954086:F), (6828792324689892364977311977277548750189770865063718432946006481461319858171:F), (2245543836264212411244499299744964607957732316191654500700776604707526766099:F)] fun gate_26 =>
halfRound_3_3 gate_26 vec![(19602444885919216544870739287153239096493385668743835386720501338355679311704:F), (8239538512351936341605373169291864076963368674911219628966947078336484944367:F), (15053013456316196458870481299866861595818749671771356646798978105863499965417:F)] fun gate_27 =>
halfRound_3_3 gate_27 vec![(7173615418515925804810790963571435428017065786053377450925733428353831789901:F), (8239211677777829016346247446855147819062679124993100113886842075069166957042:F), (15330855478780269194281285878526984092296288422420009233557393252489043181621:F)] fun gate_28 =>
halfRound_3_3 gate_28 vec![(10014883178425964324400942419088813432808659204697623248101862794157084619079:F), (14014440630268834826103915635277409547403899966106389064645466381170788813506:F), (3580284508947993352601712737893796312152276667249521401778537893620670305946:F)] fun gate_29 =>
halfRound_3_3 gate_29 vec![(2559754020964039399020874042785294258009596917335212876725104742182177996988:F), (14898657953331064524657146359621913343900897440154577299309964768812788279359:F), (2094037260225570753385567402013028115218264157081728958845544426054943497065:F)] fun gate_30 =>
halfRound_3_3 gate_30 vec![(18051086536715129874440142649831636862614413764019212222493256578581754875930:F), (21680659279808524976004872421382255670910633119979692059689680820959727969489:F), (13950668739013333802529221454188102772764935019081479852094403697438884885176:F)] fun gate_31 =>
halfRound_3_3 gate_31 vec![(9703845704528288130475698300068368924202959408694460208903346143576482802458:F), (12064310080154762977097567536495874701200266107682637369509532768346427148165:F), (16970760937630487134309762150133050221647250855182482010338640862111040175223:F)] fun gate_32 =>
halfRound_3_3 gate_32 vec![(9790997389841527686594908620011261506072956332346095631818178387333642218087:F), (16314772317774781682315680698375079500119933343877658265473913556101283387175:F), (82044870826814863425230825851780076663078706675282523830353041968943811739:F)] fun gate_33 =>
halfRound_3_3 gate_33 vec![(21696416499108261787701615667919260888528264686979598953977501999747075085778:F), (327771579314982889069767086599893095509690747425186236545716715062234528958:F), (4606746338794869835346679399457321301521448510419912225455957310754258695442:F)] fun gate_34 =>
halfRound_3_3 gate_34 vec![(64499140292086295251085369317820027058256893294990556166497635237544139149:F), (10455028514626281809317431738697215395754892241565963900707779591201786416553:F), (10421411526406559029881814534127830959833724368842872558146891658647152404488:F)] fun gate_35 =>
halfRound_3_3 gate_35 vec![(18848084335930758908929996602136129516563864917028006334090900573158639401697:F), (13844582069112758573505569452838731733665881813247931940917033313637916625267:F), (13488838454403536473492810836925746129625931018303120152441617863324950564617:F)] fun gate_36 =>
halfRound_3_3 gate_36 vec![(15742141787658576773362201234656079648895020623294182888893044264221895077688:F), (6756884846734501741323584200608866954194124526254904154220230538416015199997:F), (7860026400080412708388991924996537435137213401947704476935669541906823414404:F)] fun gate_37 =>
halfRound_3_3 gate_37 vec![(7871040688194276447149361970364037034145427598711982334898258974993423182255:F), (20758972836260983284101736686981180669442461217558708348216227791678564394086:F), (21723241881201839361054939276225528403036494340235482225557493179929400043949:F)] fun gate_38 =>
halfRound_3_3 gate_38 vec![(19428469330241922173653014973246050805326196062205770999171646238586440011910:F), (7969200143746252148180468265998213908636952110398450526104077406933642389443:F), (10950417916542216146808986264475443189195561844878185034086477052349738113024:F)] fun gate_39 =>
halfRound_3_3 gate_39 vec![(18149233917533571579549129116652755182249709970669448788972210488823719849654:F), (3729796741814967444466779622727009306670204996071028061336690366291718751463:F), (5172504399789702452458550583224415301790558941194337190035441508103183388987:F)] fun gate_40 =>
halfRound_3_3 gate_40 vec![(6686473297578275808822003704722284278892335730899287687997898239052863590235:F), (19426913098142877404613120616123695099909113097119499573837343516470853338513:F), (5120337081764243150760446206763109494847464512045895114970710519826059751800:F)] fun gate_41 =>
halfRound_3_3 gate_41 vec![(5055737465570446530938379301905385631528718027725177854815404507095601126720:F), (14235578612970484492268974539959119923625505766550088220840324058885914976980:F), (653592517890187950103239281291172267359747551606210609563961204572842639923:F)] fun gate_42 =>
halfRound_3_3 gate_42 vec![(5507360526092411682502736946959369987101940689834541471605074817375175870579:F), (7864202866011437199771472205361912625244234597659755013419363091895334445453:F), (21294659996736305811805196472076519801392453844037698272479731199885739891648:F)] fun gate_43 =>
halfRound_3_3 gate_43 vec![(13767183507040326119772335839274719411331242166231012705169069242737428254651:F), (810181532076738148308457416289197585577119693706380535394811298325092337781:F), (14232321930654703053193240133923161848171310212544136614525040874814292190478:F)] fun gate_44 =>
halfRound_3_3 gate_44 vec![(16796904728299128263054838299534612533844352058851230375569421467352578781209:F), (16256310366973209550759123431979563367001604350120872788217761535379268327259:F), (19791658638819031543640174069980007021961272701723090073894685478509001321817:F)] fun gate_45 =>
halfRound_3_3 gate_45 vec![(7046232469803978873754056165670086532908888046886780200907660308846356865119:F), (16001732848952745747636754668380555263330934909183814105655567108556497219752:F), (9737276123084413897604802930591512772593843242069849260396983774140735981896:F)] fun gate_46 =>
halfRound_3_3 gate_46 vec![(11410895086919039954381533622971292904413121053792570364694836768885182251535:F), (19098362474249267294548762387533474746422711206129028436248281690105483603471:F), (11013788190750472643548844759298623898218957233582881400726340624764440203586:F)] fun gate_47 =>
halfRound_3_3 gate_47 vec![(2206958256327295151076063922661677909471794458896944583339625762978736821035:F), (7171889270225471948987523104033632910444398328090760036609063776968837717795:F), (2510237900514902891152324520472140114359583819338640775472608119384714834368:F)] fun gate_48 =>
halfRound_3_3 gate_48 vec![(8825275525296082671615660088137472022727508654813239986303576303490504107418:F), (1481125575303576470988538039195271612778457110700618040436600537924912146613:F), (16268684562967416784133317570130804847322980788316762518215429249893668424280:F)] fun gate_49 =>
halfRound_3_3 gate_49 vec![(4681491452239189664806745521067158092729838954919425311759965958272644506354:F), (3131438137839074317765338377823608627360421824842227925080193892542578675835:F), (7930402370812046914611776451748034256998580373012248216998696754202474945793:F)] fun gate_50 =>
halfRound_3_3 gate_50 vec![(8973151117361309058790078507956716669068786070949641445408234962176963060145:F), (10223139291409280771165469989652431067575076252562753663259473331031932716923:F), (2232089286698717316374057160056566551249777684520809735680538268209217819725:F)] fun gate_51 =>
halfRound_3_3 gate_51 vec![(16930089744400890347392540468934821520000065594669279286854302439710657571308:F), (21739597952486540111798430281275997558482064077591840966152905690279247146674:F), (7508315029150148468008716674010060103310093296969466203204862163743615534994:F)] fun gate_52 =>
halfRound_3_3 gate_52 vec![(11418894863682894988747041469969889669847284797234703818032750410328384432224:F), (10895338268862022698088163806301557188640023613155321294365781481663489837917:F), (18644184384117747990653304688839904082421784959872380449968500304556054962449:F)] fun gate_53 =>
halfRound_3_3 gate_53 vec![(7414443845282852488299349772251184564170443662081877445177167932875038836497:F), (5391299369598751507276083947272874512197023231529277107201098701900193273851:F), (10329906873896253554985208009869159014028187242848161393978194008068001342262:F)] fun gate_54 =>
halfRound_3_3 gate_54 vec![(4711719500416619550464783480084256452493890461073147512131129596065578741786:F), (11943219201565014805519989716407790139241726526989183705078747065985453201504:F), (4298705349772984837150885571712355513879480272326239023123910904259614053334:F)] fun gate_55 =>
halfRound_3_3 gate_55 vec![(9999044003322463509208400801275356671266978396985433172455084837770460579627:F), (4908416131442887573991189028182614782884545304889259793974797565686968097291:F), (11963412684806827200577486696316210731159599844307091475104710684559519773777:F)] fun gate_56 =>
halfRound_3_3 gate_56 vec![(20129916000261129180023520480843084814481184380399868943565043864970719708502:F), (12884788430473747619080473633364244616344003003135883061507342348586143092592:F), (20286808211545908191036106582330883564479538831989852602050135926112143921015:F)] fun gate_57 =>
halfRound_3_3 gate_57 vec![(16282045180030846845043407450751207026423331632332114205316676731302016331498:F), (4332932669439410887701725251009073017227450696965904037736403407953448682093:F), (11105712698773407689561953778861118250080830258196150686012791790342360778288:F)] fun gate_58 =>
halfRound_3_3 gate_58 vec![(21853934471586954540926699232107176721894655187276984175226220218852955976831:F), (9807888223112768841912392164376763820266226276821186661925633831143729724792:F), (13411808896854134882869416756427789378942943805153730705795307450368858622668:F)] fun gate_59 =>
halfRound_3_3 gate_59 vec![(17906847067500673080192335286161014930416613104209700445088168479205894040011:F), (14554387648466176616800733804942239711702169161888492380425023505790070369632:F), (4264116751358967409634966292436919795665643055548061693088119780787376143967:F)] fun gate_60 =>
fullRound_3_3 gate_60 vec![(2401104597023440271473786738539405349187326308074330930748109868990675625380:F), (12251645483867233248963286274239998200789646392205783056343767189806123148785:F), (15331181254680049984374210433775713530849624954688899814297733641575188164316:F)] fun gate_61 =>
fullRound_3_3 gate_61 vec![(13108834590369183125338853868477110922788848506677889928217413952560148766472:F), (6843160824078397950058285123048455551935389277899379615286104657075620692224:F), (10151103286206275742153883485231683504642432930275602063393479013696349676320:F)] fun gate_62 =>
fullRound_3_3 gate_62 vec![(7074320081443088514060123546121507442501369977071685257650287261047855962224:F), (11413928794424774638606755585641504971720734248726394295158115188173278890938:F), (7312756097842145322667451519888915975561412209738441762091369106604423801080:F)] fun gate_63 =>
fullRound_3_3 gate_63 vec![(7181677521425162567568557182629489303281861794357882492140051324529826589361:F), (15123155547166304758320442783720138372005699143801247333941013553002921430306:F), (13409242754315411433193860530743374419854094495153957441316635981078068351329:F)] fun gate_64 =>
k gate_64
def Poseidon2 (In1: F) (In2: F) (k: F -> Prop): Prop :=
poseidon_3 vec![(0:F), In1, In2] fun gate_0 =>
k gate_0[0]
def ProveParentHash (Bit: F) (Hash: F) (Sibling: F) (k: F -> Prop): Prop :=
Gates.is_bool Bit ∧
∃gate_1, Gates.select Bit Sibling Hash gate_1 ∧
∃gate_2, Gates.select Bit Hash Sibling gate_2 ∧
Poseidon2 gate_1 gate_2 fun gate_3 =>
k gate_3
def MerkleRootGadget_26_26 (Hash: F) (Index: F) (Path: Vector F 26) (k: F -> Prop): Prop :=
∃gate_0, Gates.to_binary Index 26 gate_0 ∧
ProveParentHash gate_0[0] Hash Path[0] fun gate_1 =>
ProveParentHash gate_0[1] gate_1 Path[1] fun gate_2 =>
ProveParentHash gate_0[2] gate_2 Path[2] fun gate_3 =>
ProveParentHash gate_0[3] gate_3 Path[3] fun gate_4 =>
ProveParentHash gate_0[4] gate_4 Path[4] fun gate_5 =>
ProveParentHash gate_0[5] gate_5 Path[5] fun gate_6 =>
ProveParentHash gate_0[6] gate_6 Path[6] fun gate_7 =>
ProveParentHash gate_0[7] gate_7 Path[7] fun gate_8 =>
ProveParentHash gate_0[8] gate_8 Path[8] fun gate_9 =>
ProveParentHash gate_0[9] gate_9 Path[9] fun gate_10 =>
ProveParentHash gate_0[10] gate_10 Path[10] fun gate_11 =>
ProveParentHash gate_0[11] gate_11 Path[11] fun gate_12 =>
ProveParentHash gate_0[12] gate_12 Path[12] fun gate_13 =>
ProveParentHash gate_0[13] gate_13 Path[13] fun gate_14 =>
ProveParentHash gate_0[14] gate_14 Path[14] fun gate_15 =>
ProveParentHash gate_0[15] gate_15 Path[15] fun gate_16 =>
ProveParentHash gate_0[16] gate_16 Path[16] fun gate_17 =>
ProveParentHash gate_0[17] gate_17 Path[17] fun gate_18 =>
ProveParentHash gate_0[18] gate_18 Path[18] fun gate_19 =>
ProveParentHash gate_0[19] gate_19 Path[19] fun gate_20 =>
ProveParentHash gate_0[20] gate_20 Path[20] fun gate_21 =>
ProveParentHash gate_0[21] gate_21 Path[21] fun gate_22 =>
ProveParentHash gate_0[22] gate_22 Path[22] fun gate_23 =>
ProveParentHash gate_0[23] gate_23 Path[23] fun gate_24 =>
ProveParentHash gate_0[24] gate_24 Path[24] fun gate_25 =>
ProveParentHash gate_0[25] gate_25 Path[25] fun gate_26 =>
k gate_26
def InclusionProof_8_8_8_26_8_8_26 (Roots: Vector F 8) (Leaves: Vector F 8) (InPathIndices: Vector F 8) (InPathElements: Vector (Vector F 26) 8) (k: Vector F 8 -> Prop): Prop :=
MerkleRootGadget_26_26 Leaves[0] InPathIndices[0] InPathElements[0] fun gate_0 =>
Gates.eq gate_0 Roots[0] ∧
MerkleRootGadget_26_26 Leaves[1] InPathIndices[1] InPathElements[1] fun gate_2 =>
Gates.eq gate_2 Roots[1] ∧
MerkleRootGadget_26_26 Leaves[2] InPathIndices[2] InPathElements[2] fun gate_4 =>
Gates.eq gate_4 Roots[2] ∧
MerkleRootGadget_26_26 Leaves[3] InPathIndices[3] InPathElements[3] fun gate_6 =>
Gates.eq gate_6 Roots[3] ∧
MerkleRootGadget_26_26 Leaves[4] InPathIndices[4] InPathElements[4] fun gate_8 =>
Gates.eq gate_8 Roots[4] ∧
MerkleRootGadget_26_26 Leaves[5] InPathIndices[5] InPathElements[5] fun gate_10 =>
Gates.eq gate_10 Roots[5] ∧
MerkleRootGadget_26_26 Leaves[6] InPathIndices[6] InPathElements[6] fun gate_12 =>
Gates.eq gate_12 Roots[6] ∧
MerkleRootGadget_26_26 Leaves[7] InPathIndices[7] InPathElements[7] fun gate_14 =>
Gates.eq gate_14 Roots[7] ∧
k vec![gate_0, gate_2, gate_4, gate_6, gate_8, gate_10, gate_12, gate_14]
def AssertIsLess_248 (A: F) (B: F) : Prop :=
∃gate_0, gate_0 = Gates.sub (452312848583266388373324160190187140051835877600158453279131187530910662656:F) B ∧
∃gate_1, gate_1 = Gates.add A gate_0 ∧
∃_ignored_, Gates.to_binary gate_1 248 _ignored_ ∧
True
def mds_4 (Inp: Vector F 4) (k: Vector F 4 -> Prop): Prop :=
∃gate_0, gate_0 = Gates.mul Inp[0] (16023668707004248971294664614290028914393192768609916554276071736843535714477:F) ∧
∃gate_1, gate_1 = Gates.add (0:F) gate_0 ∧
∃gate_2, gate_2 = Gates.mul Inp[1] (17849615858846139011678879517964683507928512741474025695659909954675835121177:F) ∧
∃gate_3, gate_3 = Gates.add gate_1 gate_2 ∧
∃gate_4, gate_4 = Gates.mul Inp[2] (1013663139540921998616312712475594638459213772728467613870351821911056489570:F) ∧
∃gate_5, gate_5 = Gates.add gate_3 gate_4 ∧
∃gate_6, gate_6 = Gates.mul Inp[3] (13211800058103802189838759488224684841774731021206389709687693993627918500545:F) ∧
∃gate_7, gate_7 = Gates.add gate_5 gate_6 ∧
∃gate_8, gate_8 = Gates.mul Inp[0] (19204974983793400699898444372535256207646557857575315905278218870961389967884:F) ∧
∃gate_9, gate_9 = Gates.add (0:F) gate_8 ∧
∃gate_10, gate_10 = Gates.mul Inp[1] (3722304780857845144568029505892077496425786544014166938942516810831732569870:F) ∧
∃gate_11, gate_11 = Gates.add gate_9 gate_10 ∧
∃gate_12, gate_12 = Gates.mul Inp[2] (11920634922168932145084219049241528148129057802067880076377897257847125830511:F) ∧
∃gate_13, gate_13 = Gates.add gate_11 gate_12 ∧
∃gate_14, gate_14 = Gates.mul Inp[3] (6085682566123812000257211683010755099394491689511511633947011263229442977967:F) ∧
∃gate_15, gate_15 = Gates.add gate_13 gate_14 ∧
∃gate_16, gate_16 = Gates.mul Inp[0] (14672613178263529785795301930884172260797190868602674472542654261498546023746:F) ∧
∃gate_17, gate_17 = Gates.add (0:F) gate_16 ∧
∃gate_18, gate_18 = Gates.mul Inp[1] (20850178060552184587113773087797340350525370429749200838012809627359404457643:F) ∧
∃gate_19, gate_19 = Gates.add gate_17 gate_18 ∧
∃gate_20, gate_20 = Gates.mul Inp[2] (7082289538076771741936674361200789891432311337766695368327626572220036527624:F) ∧
∃gate_21, gate_21 = Gates.add gate_19 gate_20 ∧
∃gate_22, gate_22 = Gates.mul Inp[3] (1787876543469562003404632310460227730887431311758627706450615128255538398187:F) ∧
∃gate_23, gate_23 = Gates.add gate_21 gate_22 ∧
∃gate_24, gate_24 = Gates.mul Inp[0] (21407770160218607278833379114951608489910182969042472165261557405353704846967:F) ∧
∃gate_25, gate_25 = Gates.add (0:F) gate_24 ∧
∃gate_26, gate_26 = Gates.mul Inp[1] (16058955581309173858487265533260133430557379878452348481750737813742488209262:F) ∧
∃gate_27, gate_27 = Gates.add gate_25 gate_26 ∧
∃gate_28, gate_28 = Gates.mul Inp[2] (593311177550138061601452020934455734040559402531605836278498327468203888086:F) ∧
∃gate_29, gate_29 = Gates.add gate_27 gate_28 ∧
∃gate_30, gate_30 = Gates.mul Inp[3] (341662423637860635938968460722645910313598807845686354625820505885069260074:F) ∧
∃gate_31, gate_31 = Gates.add gate_29 gate_30 ∧
k vec![gate_7, gate_15, gate_23, gate_31]
def fullRound_4_4 (Inp: Vector F 4) (Consts: Vector F 4) (k: Vector F 4 -> Prop): Prop :=
∃gate_0, gate_0 = Gates.add Inp[0] Consts[0] ∧
∃gate_1, gate_1 = Gates.add Inp[1] Consts[1] ∧
∃gate_2, gate_2 = Gates.add Inp[2] Consts[2] ∧
∃gate_3, gate_3 = Gates.add Inp[3] Consts[3] ∧
sbox gate_0 fun gate_4 =>
sbox gate_1 fun gate_5 =>
sbox gate_2 fun gate_6 =>
sbox gate_3 fun gate_7 =>
mds_4 vec![gate_4, gate_5, gate_6, gate_7] fun gate_8 =>
k gate_8
def halfRound_4_4 (Inp: Vector F 4) (Consts: Vector F 4) (k: Vector F 4 -> Prop): Prop :=
∃gate_0, gate_0 = Gates.add Inp[0] Consts[0] ∧
∃gate_1, gate_1 = Gates.add Inp[1] Consts[1] ∧
∃gate_2, gate_2 = Gates.add Inp[2] Consts[2] ∧
∃gate_3, gate_3 = Gates.add Inp[3] Consts[3] ∧
sbox gate_0 fun gate_4 =>
mds_4 vec![gate_4, gate_1, gate_2, gate_3] fun gate_5 =>
k gate_5
def poseidon_4 (Inputs: Vector F 4) (k: Vector F 4 -> Prop): Prop :=
fullRound_4_4 Inputs vec![(11633431549750490989983886834189948010834808234699737327785600195936805266405:F), (17353750182810071758476407404624088842693631054828301270920107619055744005334:F), (11575173631114898451293296430061690731976535592475236587664058405912382527658:F), (9724643380371653925020965751082872123058642683375812487991079305063678725624:F)] fun gate_0 =>
fullRound_4_4 gate_0 vec![(20936725237749945635418633443468987188819556232926135747685274666391889856770:F), (6427758822462294912934022562310355233516927282963039741999349770315205779230:F), (16782979953202249973699352594809882974187694538612412531558950864304931387798:F), (8979171037234948998646722737761679613767384188475887657669871981433930833742:F)] fun gate_1 =>
fullRound_4_4 gate_1 vec![(5428827536651017352121626533783677797977876323745420084354839999137145767736:F), (507241738797493565802569310165979445570507129759637903167193063764556368390:F), (6711578168107599474498163409443059675558516582274824463959700553865920673097:F), (2197359304646916921018958991647650011119043556688567376178243393652789311643:F)] fun gate_2 =>
fullRound_4_4 gate_2 vec![(4634703622846121403803831560584049007806112989824652272428991253572845447400:F), (17008376818199175111793852447685303011746023680921106348278379453039148937791:F), (18430784755956196942937899353653692286521408688385681805132578732731487278753:F), (4573768376486344895797915946239137669624900197544620153250805961657870918727:F)] fun gate_3 =>
halfRound_4_4 gate_3 vec![(5624865188680173294191042415227598609140934495743721047183803859030618890703:F), (8228252753786907198149068514193371173033070694924002912950645971088002709521:F), (17586714789554691446538331362711502394998837215506284064347036653995353304693:F), (12985198716830497423350597750558817467658937953000235442251074063454897365701:F)] fun gate_4 =>
halfRound_4_4 gate_4 vec![(13480076116139680784838493959937969792577589073830107110893279354229821035984:F), (480609231761423388761863647137314056373740727639536352979673303078459561332:F), (19503345496799249258956440299354839375920540225688429628121751361906635419276:F), (16837818502122887883669221005435922946567532037624537243846974433811447595173:F)] fun gate_5 =>
halfRound_4_4 gate_5 vec![(5492108497278641078569490709794391352213168666744080628008171695469579703581:F), (11365311159988448419785032079155356000691294261495515880484003277443744617083:F), (13876891705632851072613751905778242936713392247975808888614530203269491723653:F), (10660388389107698747692475159023710744797290186015856503629656779989214850043:F)] fun gate_6 =>
halfRound_4_4 gate_6 vec![(18876318870401623474401728758498150977988613254023317877612912724282285739292:F), (15543349138237018307536452195922365893694804703361435879256942490123776892424:F), (2839988449157209999638903652853828318645773519300826410959678570041742458201:F), (7566039810305694135184226097163626060317478635973510706368412858136696413063:F)] fun gate_7 =>
halfRound_4_4 gate_7 vec![(6344830340705033582410486810600848473125256338903726340728639711688240744220:F), (12475357769019880256619207099578191648078162511547701737481203260317463892731:F), (13337401254840718303633782478677852514218549070508887338718446132574012311307:F), (21161869193849404954234950798647336336709035097706159414187214758702055364571:F)] fun gate_8 =>
halfRound_4_4 gate_8 vec![(20671052961616073313397254362345395594858011165315285344464242404604146448678:F), (2772189387845778213446441819361180378678387127454165972767013098872140927416:F), (3339032002224218054945450150550795352855387702520990006196627537441898997147:F), (14919705931281848425960108279746818433850049439186607267862213649460469542157:F)] fun gate_9 =>
halfRound_4_4 gate_9 vec![(17056699976793486403099510941807022658662936611123286147276760381688934087770:F), (16144580075268719403964467603213740327573316872987042261854346306108421013323:F), (15582343953927413680541644067712456296539774919658221087452235772880573393376:F), (17528510080741946423534916423363640132610906812668323263058626230135522155749:F)] fun gate_10 =>
halfRound_4_4 gate_10 vec![(3190600034239022251529646836642735752388641846393941612827022280601486805721:F), (8463814172152682468446984305780323150741498069701538916468821815030498611418:F), (16533435971270903741871235576178437313873873358463959658178441562520661055273:F), (11845696835505436397913764735273748291716405946246049903478361223369666046634:F)] fun gate_11 =>
halfRound_4_4 gate_11 vec![(18391057370973634202531308463652130631065370546571735004701144829951670507215:F), (262537877325812689820791215463881982531707709719292538608229687240243203710:F), (2187234489894387585309965540987639130975753519805550941279098789852422770021:F), (19189656350920455659006418422409390013967064310525314160026356916172976152967:F)] fun gate_12 =>
halfRound_4_4 gate_12 vec![(15839474183930359560478122372067744245080413846070743460407578046890458719219:F), (1805019124769763805045852541831585930225376844141668951787801647576910524592:F), (323592203814803486950280155834638828455175703393817797003361354810251742052:F), (9780393509796825017346015868945480913627956475147371732521398519483580624282:F)] fun gate_13 =>
halfRound_4_4 gate_13 vec![(14009429785059642386335012561867511048847749030947687313594053997432177705759:F), (13749550162460745037234826077137388777330401847577727796245150843898019635981:F), (19497187499283431845443758879472819384797584633472792651343926414232528405311:F), (3708428802547661961864524194762556064568867603968214870300574294082023305587:F)] fun gate_14 =>
halfRound_4_4 gate_14 vec![(1339414413482882567499652761996854155383863472782829777976929310155400981782:F), (6396261245879814100794661157306877072718690153118140891315137894471052482309:F), (2069661495404347929962833138824526893650803079024564477269192079629046031674:F), (15793521554502133342917616035884588152451122589545915605459159078589855944361:F)] fun gate_15 =>
halfRound_4_4 gate_15 vec![(17053424498357819626596285492499512504457128907932827007302385782133229252374:F), (13658536470391360399708067455536748955260723760813498481671323619545320978896:F), (21546095668130239633971575351786704948662094117932406102037724221634677838565:F), (21411726238386979516934941789127061362496195649331822900487557574597304399109:F)] fun gate_16 =>
halfRound_4_4 gate_16 vec![(1944776378988765673004063363506638781964264107780425928778257145151172817981:F), (15590719714223718537172639598316570285163081746016049278954513732528516468773:F), (1351266421179051765004709939353170430290500926943038391678843253157009556309:F), (6772476224477167317130064764757502335545080109882028900432703947986275397548:F)] fun gate_17 =>
halfRound_4_4 gate_17 vec![(10670120969725161535937685539136065944959698664551200616467222887025111751992:F), (4731853626374224678749618809759140702342195350742653173378450474772131006181:F), (14473527495914528513885847341981310373531349450901830749157165104135412062812:F), (16937191362061486658876740597821783333355021670608822932942683228741190786143:F)] fun gate_18 =>
halfRound_4_4 gate_18 vec![(5656559696428674390125424316117443507583679061659043998559560535270557939546:F), (8897648276515725841133578021896617755369443750194849587616503841335248902806:F), (14938684446722672719637788054570691068799510611164812175626676768545923371470:F), (15284149043690546115252102390417391226617211133644099356880071475803043461465:F)] fun gate_19 =>
halfRound_4_4 gate_19 vec![(2623479025068612775740107497276979457946709347831661908218182874823658838107:F), (6809791961761836061129379546794905411734858375517368211894790874813684813988:F), (2417620338751920563196799065781703780495622795713803712576790485412779971775:F), (4445143310792944321746901285176579692343442786777464604312772017806735512661:F)] fun gate_20 =>
halfRound_4_4 gate_20 vec![(1429019233589939118995503267516676481141938536269008901607126781291273208629:F), (19874283200702583165110559932895904979843482162236139561356679724680604144459:F), (13426632171723830006915194799390005513190035492503509233177687891041405113055:F), (10582332261829184460912611488470654685922576576939233092337240630493625631748:F)] fun gate_21 =>
halfRound_4_4 gate_21 vec![(21233753931561918964692715735079738969202507286592442257083521969358109931739:F), (15570526832729960536088203016939646235070527502823725736220985057263010426410:F), (9379993197409194016084018867205217180276068758980710078281820842068357746159:F), (20771047769547788232530761122022227554484215799917531852224053856574439035591:F)] fun gate_22 =>
halfRound_4_4 gate_22 vec![(20468066117407230615347036860121267564735050776924839007390915936603720868039:F), (5488458379783632930817704196671117722181776789793038046303454621235628350505:F), (1394272944960494549436156060041871735938329188644910029274839018389507786995:F), (5147716541319265558364686380685869814344975511061045836883803841066664401308:F)] fun gate_23 =>
halfRound_4_4 gate_23 vec![(14583556014436264794011679557180458872925270147116325433110111823036572987256:F), (11881598145635709076820802010238799308467020773223027240974808290357539410246:F), (1566675577370566803714158020143436746360531503329117352692311127363508063658:F), (212097210828847555076368799807292486212366234848453077606919035866276438405:F)] fun gate_24 =>
halfRound_4_4 gate_24 vec![(7447795983723838393344606913699113402588250391491430720006009618589586043349:F), (7626475329478847982857743246276194948757851985510858890691733676098590062312:F), (148936322117705719734052984176402258788283488576388928671173547788498414614:F), (15456385653678559339152734484033356164266089951521103188900320352052358038156:F)] fun gate_25 =>
halfRound_4_4 gate_25 vec![(18207029603568083031075933940507782729612798852390383193518574746240484434885:F), (2783356767974552799246444090988849933848968900471538294757665724820698962027:F), (2721136724873145834448711197875719736776242904173494370334510875996324906822:F), (2101139679159828164567502977338446902934095964116292264803779234163802308621:F)] fun gate_26 =>
halfRound_4_4 gate_26 vec![(8995221857405946029753863203034191016106353727035116779995228902499254557482:F), (502050382895618998241481591846956281507455925731652006822624065608151015665:F), (4998642074447347292230083981705092465562944918178587362047610976950173759150:F), (9349925422548495396957991080641322437286312278286826683803695584372829655908:F)] fun gate_27 =>
halfRound_4_4 gate_27 vec![(11780347248050333407713097022607360765169543706092266937432199545936788840710:F), (17875657248128792902343900636176628524337469245418171053476833541334867949063:F), (10366707960411170224546487410133378396211437543372531210718212258701730218585:F), (16918708725327525329474486073529093971911689155838787615544405646587858805834:F)] fun gate_28 =>
halfRound_4_4 gate_28 vec![(18845394288827839099791436411179859406694814287249240544635770075956540806104:F), (9838806160073701591447223014625214979004281138811495046618998465898136914308:F), (10285680425916086863571101560978592912547567902925573205991454216988033815759:F), (1292119286233210185026381033809498665433650491423040630240164455269575958565:F)] fun gate_29 =>
halfRound_4_4 gate_29 vec![(2665524343601461489082054230426835550060387413710679950970616347092017688857:F), (13502286133892103192305476866434484921895765252706158317341618311553476426306:F), (686854655578191041672292972738875170071982317195092845673566320025160026512:F), (9315942923163981372372434957632152754092082859001311184186702151150554806508:F)] fun gate_30 =>
halfRound_4_4 gate_30 vec![(17166793131238158480636170455452575971861309825745828685724097210995239015581:F), (4443784618760852757287735236046535266034706880634443644576653970979377878608:F), (21470445782021672615018345703580059646973568891521510437236903770708690160080:F), (6932852445473908850835611723958058203645654625170962537129706393570586565567:F)] fun gate_31 =>
halfRound_4_4 gate_31 vec![(17078326120157725640173982185667969009350208542843294226397809921509565607842:F), (19251873001736801921864956728611772738233338338726553113352118847732921831266:F), (13062907978694932362695258750558734366820802962383346229947907261606619788585:F), (16576609187793673559170206379939616900133457644695219057683704871664434872406:F)] fun gate_32 =>
halfRound_4_4 gate_32 vec![(17140499059660867342372156843620845644831519603574612796639429147195776838516:F), (16226688173010504218547945848523900236290532501559570164276462499487632388445:F), (2806068123803905806401128967330263340459046260107112845068533446899070326517:F), (17788735370835052317224182711467216134690146479710634688273650370951230404901:F)] fun gate_33 =>
halfRound_4_4 gate_33 vec![(9840665370904113434661468973557421114403401847108482949465899631150766783733:F), (17357287363046228581837055771327121704742940914150998420465281177406182088510:F), (8956082469997974864521346025916496675956939495318858500685756691488425559998:F), (10583741436561099911914917245130852199607666337956354910388730829023746895549:F)] fun gate_34 =>
halfRound_4_4 gate_34 vec![(15241902639811607164983030447109332729761435946009172128089506810551693978973:F), (10889882303914055687481932975789161945462141459528413507160087442461090813788:F), (19789561133254944544821898921133697408237804586549835559829396563401674817160:F), (20741336668287037026472434608739333171202674306575625457456116338034432647230:F)] fun gate_35 =>
halfRound_4_4 gate_35 vec![(17864073449995977742930566850933082711031717858550870842712972350665650521079:F), (6017691253505466300212182439349954426085752315661098358839308909771637792741:F), (5209125836207196173669497054522582922896061838702136844305036341250990710540:F), (8138726312837322624537330169363664364899441867118983214176695868443641051381:F)] fun gate_36 =>
halfRound_4_4 gate_36 vec![(15491983986041746833254372934846748393213690608865689646440909282144232382678:F), (5054332867608171303802774230688792431028169804536607979111644888500809938980:F), (15427030776591294577308915282298854681562344215287630895931797573417982096417:F), (21754057982677295571284116502193272661309010996970316384923307174180521790164:F)] fun gate_37 =>
halfRound_4_4 gate_37 vec![(16265286590463120486705206231835953324076688991892805307349612983237844034032:F), (17679791107777049796013011282788633179411040182820636236163074053597517790779:F), (4281652562868629887097957174897458165728741859103571825874408386197225591996:F), (9168010397863299719604788533602757515513214141450093775967322808686129400625:F)] fun gate_38 =>
halfRound_4_4 gate_38 vec![(17584182367226175071087689123358883902969885218985589531538416263709138156515:F), (15671512310414658663135385639435845966109237059155734764323312289873534719186:F), (10536294659491685326297777845632759824567028904726211134518740400643540109527:F), (13431319759608247201135260841651365578663315527795431484765940626659812285319:F)] fun gate_39 =>
halfRound_4_4 gate_39 vec![(9584697124715190200241839387725546204368618031045071660911490086723434692561:F), (5180327104839158483066851400960171505063442195966219343315555549982472660055:F), (18888217223053385111625483360538133292128748730565502371803782424772027937822:F), (19535732913737027522540340630296365525208404217634392013266346283017745945894:F)] fun gate_40 =>
halfRound_4_4 gate_40 vec![(8577759627886344995887423695190093296190181539234301534326157005220006624466:F), (16793670928407147476673650839110019799844249677846432113010280456483595763987:F), (13926032620965299897272071104154310460519723329016284975305942957859374938463:F), (4794697578055472890255676575927616606591024075768967985031137397587590174501:F)] fun gate_41 =>
halfRound_4_4 gate_41 vec![(3529566190782060578446859853852791941913086545101307988176595267965876143250:F), (3975008029239568933166738482470827494289192118694622729549964538823092192163:F), (17739094873244464728483944474780943281491793683051033330476367597242349886622:F), (7367136451127531266518046223598095299278392589059366687082785080179161005418:F)] fun gate_42 =>
halfRound_4_4 gate_42 vec![(11175297939460631138047404082172242706491354303440776362693987984031241399771:F), (21687543815463985355165197827968086406938428974327951792877419032069230058777:F), (21156136641989461785420005321350884477682466566148802533375726181416623358719:F), (17347558768803521970212188258074365309929638984714303299899732035040892048478:F)] fun gate_43 =>
halfRound_4_4 gate_43 vec![(16293716234695956076322008955071091921491953458541407305955104663269677475740:F), (4206144021605871396668976569508168522675546062304959729829228403361714668567:F), (19988050626299122864942213847548542155670073758974734015174045163059179151544:F), (747972634423324369570795147739377097591383105262743308036321386836856106229:F)] fun gate_44 =>
halfRound_4_4 gate_44 vec![(4612470951309047869982067912468200581649949743307592869671537990797895413707:F), (9630852913694079049153027193127278569487291430069466630362958024525616303220:F), (17941539917430916523930519432495442476511211427972760202450248798031711471474:F), (20332911350443969653703295317915788278109458962706923653715140186132935894113:F)] fun gate_45 =>
halfRound_4_4 gate_45 vec![(21764801803055897327474057344100833670291402543384934706514147201527191846513:F), (18792043166429470991157980448329308661526906138700725174612608941551872082876:F), (12308177224490762720061048892842527800271687977085172836705858261595655154325:F), (6234555076867437297776538521925679658360922070165740193866337972293380196151:F)] fun gate_46 =>
halfRound_4_4 gate_46 vec![(4651047048822067434403056477377459986292934655827821636179452835839127581305:F), (4762047093602693619418269784972874862577325737690375448572644958129932507374:F), (12373514879531674477721132062882065826558811149582829246378921774344318418269:F), (452512704634345955634014968317367844987135264395068376894497483188243356523:F)] fun gate_47 =>
halfRound_4_4 gate_47 vec![(21642936370936057063268550589361090955573362743817395689260298777690935495218:F), (16170209200627740434842090607802586195654207376087117044989637541681675086276:F), (11682826760471401430136435257946377996085824742031456481961511737883954750045:F), (20628055165039718158878805520495324869838279647796500565701893698896698211929:F)] fun gate_48 =>
halfRound_4_4 gate_48 vec![(16438375313036818694140277721632185529697783132872683043559674569424388375143:F), (4855690425141732729622202649174026736476144238882856677953515240716341676853:F), (11680269552161854836013784579325442981497075865007420427279871128110023581360:F), (7052688838948398479718163301866620773458411881591190572311273079833122884040:F)] fun gate_49 =>
halfRound_4_4 gate_49 vec![(10339199500986679207942447430230758709198802637648680544816596214595887890122:F), (16310974164366557619327768780809157500356605306298690718711623172209302167675:F), (4572051236178600578566286373491186377601851723137133424312445102215267283375:F), (20933392620931420860078756859763708025350478446661033451436796955762857910093:F)] fun gate_50 =>
halfRound_4_4 gate_50 vec![(10145870387395991071594748880090507240612313913083518483680901820696866812598:F), (11173854866888110108878560284050142518686158431744851782991510385755602063727:F), (3895357290105797542988795070918100785105415165483657264407967118738833241858:F), (16358886674154007883356717944805100413481233709808000948036974385803613296849:F)] fun gate_51 =>
halfRound_4_4 gate_51 vec![(10544067501284177518983466437755150442726536257903869254459488412549270232123:F), (10495171258604974589451578238018388630585794890815982293891430761424812600427:F), (13820724103604550843562070971473423552484851063169471886037640613650155173554:F), (2334954333435579600152488915208745055087482119087065911968347050969338669409:F)] fun gate_52 =>
halfRound_4_4 gate_52 vec![(15100284614446277058846085121308897497066957549089629374506920751044105723791:F), (8493821960754696376711287628276980042183127459347650448500304251148421115590:F), (18612435536889941393944858783110719304584209891406420832295898519317994950798:F), (362101794940079733974215941991047456600874474038781578925062694203564740952:F)] fun gate_53 =>
halfRound_4_4 gate_53 vec![(11020033081956343850903875701444955317664141075326494650405276926536449284939:F), (9396289482656518627529185765935649373549564165735162258912975312413185691167:F), (6879055176150676925438486069371149089824290576271090206945130252868108043422:F), (12466610601804566637227883322591924115458766539177061670432424956205788935144:F)] fun gate_54 =>
halfRound_4_4 gate_54 vec![(6570302110526154075173287644133038486970998888099669190857256824048085590052:F), (20997862990590350605775941983360263378441519274215787225587679916056749626824:F), (2642485040919927233352421501444361753154137311893617974318977215281720542724:F), (18832940311494549247524002614969382413324906834787422940144532352384742506504:F)] fun gate_55 =>
halfRound_4_4 gate_55 vec![(18751288968473015103659806087408412890105261892140397690496125593160830694164:F), (13938622158186434739533995447553824444480420613323252752005511269934155122652:F), (12878982657080117316101160964182202074759312554860119090514406868768962707099:F), (13757859113119127982418426758782225628393556023865807897214601826218702003247:F)] fun gate_56 =>
halfRound_4_4 gate_56 vec![(11817871682869491875135867072669251115204978941736982465520516648114811792373:F), (11336448548896065624515261709306933490181794458266726453198857687608284871020:F), (194970717714150352477887371297168267861902418496792228400198694925721020795:F), (4999282817977533227652305360183045040853565298259070645110453061034932285549:F)] fun gate_57 =>
halfRound_4_4 gate_57 vec![(17094174197873140035316532568922652294881600587639905417701074492648767414173:F), (8484251464872873032022789624790167173458682056313339863651348894878144808746:F), (10260366716129057466862964875306868898686918428814373470382979997177852668590:F), (549263552864476084904464374701167884060947403076520259964592729731619317724:F)] fun gate_58 =>
halfRound_4_4 gate_58 vec![(10052714818439832487575851829190658679562445501271745818931448693381812170889:F), (1735373362835209096342827192021124337509188507323448903608623506589963950966:F), (7998373949540733111485892137806629484517602009122941425332571732658301689428:F), (9035170288660659483243066011612158174896974797912618405030929911180945246244:F)] fun gate_59 =>
fullRound_4_4 gate_59 vec![(6458619567307414386633203375143968061892762498463026121155477954682976784731:F), (12314261817227551876673777186352972884847144237148169773300066404053441924532:F), (19869454329688183813243851218196625862680921049019496233616575272637276975230:F), (20326917073492686652690019138603910654692396590122884746951129061818467704300:F)] fun gate_60 =>
fullRound_4_4 gate_60 vec![(20403270805536666081472738304916561119325397964511536801752236086414818653063:F), (2865941730880218719188224311916978807415673142487507504983320505748719154068:F), (20614246027521726470902405957496110178017768563127335842405314212897493119848:F), (12060194341463088508348622863463208827312128863463014006529428845777217660299:F)] fun gate_61 =>
fullRound_4_4 gate_61 vec![(1128906798719793375274166820235650701301189774851381709919492584451845983197:F), (19670876372911656158743764425809421400123168087389888660308456184201759209723:F), (5647230694522866559497222129254930524469944430191328619422533907417776118543:F), (318629082509194371490189248876734616088516535434806492900653650176451776632:F)] fun gate_62 =>
fullRound_4_4 gate_62 vec![(13685970881538585172319228162662520285656571966985351768743970447782846353365:F), (8283840607829148567836919316142994745766280854211662326632930274668867638198:F), (8968895518159422029900464138741638511289476298837958524156654785428413265371:F), (10061801991000917366002570579819627134666386452411986168205986791283562415829:F)] fun gate_63 =>
k gate_63
def Poseidon3 (In1: F) (In2: F) (In3: F) (k: F -> Prop): Prop :=
poseidon_4 vec![(0:F), In1, In2, In3] fun gate_0 =>
k gate_0[0]
def LeafHashGadget (LeafLowerRangeValue: F) (NextIndex: F) (LeafHigherRangeValue: F) (Value: F) (k: F -> Prop): Prop :=
AssertIsLess_248 LeafLowerRangeValue Value ∧
AssertIsLess_248 Value LeafHigherRangeValue ∧
Poseidon3 LeafLowerRangeValue NextIndex LeafHigherRangeValue fun gate_2 =>
k gate_2
def NonInclusionProof_8_8_8_8_8_8_26_8_8_26 (Roots: Vector F 8) (Values: Vector F 8) (LeafLowerRangeValues: Vector F 8) (LeafHigherRangeValues: Vector F 8) (NextIndices: Vector F 8) (InPathIndices: Vector F 8) (InPathElements: Vector (Vector F 26) 8) (k: Vector F 8 -> Prop): Prop :=
LeafHashGadget LeafLowerRangeValues[0] NextIndices[0] LeafHigherRangeValues[0] Values[0] fun gate_0 =>
MerkleRootGadget_26_26 gate_0 InPathIndices[0] InPathElements[0] fun gate_1 =>
Gates.eq gate_1 Roots[0] ∧
LeafHashGadget LeafLowerRangeValues[1] NextIndices[1] LeafHigherRangeValues[1] Values[1] fun gate_3 =>
MerkleRootGadget_26_26 gate_3 InPathIndices[1] InPathElements[1] fun gate_4 =>
Gates.eq gate_4 Roots[1] ∧
LeafHashGadget LeafLowerRangeValues[2] NextIndices[2] LeafHigherRangeValues[2] Values[2] fun gate_6 =>
MerkleRootGadget_26_26 gate_6 InPathIndices[2] InPathElements[2] fun gate_7 =>
Gates.eq gate_7 Roots[2] ∧
LeafHashGadget LeafLowerRangeValues[3] NextIndices[3] LeafHigherRangeValues[3] Values[3] fun gate_9 =>
MerkleRootGadget_26_26 gate_9 InPathIndices[3] InPathElements[3] fun gate_10 =>
Gates.eq gate_10 Roots[3] ∧
LeafHashGadget LeafLowerRangeValues[4] NextIndices[4] LeafHigherRangeValues[4] Values[4] fun gate_12 =>
MerkleRootGadget_26_26 gate_12 InPathIndices[4] InPathElements[4] fun gate_13 =>
Gates.eq gate_13 Roots[4] ∧
LeafHashGadget LeafLowerRangeValues[5] NextIndices[5] LeafHigherRangeValues[5] Values[5] fun gate_15 =>
MerkleRootGadget_26_26 gate_15 InPathIndices[5] InPathElements[5] fun gate_16 =>
Gates.eq gate_16 Roots[5] ∧
LeafHashGadget LeafLowerRangeValues[6] NextIndices[6] LeafHigherRangeValues[6] Values[6] fun gate_18 =>
MerkleRootGadget_26_26 gate_18 InPathIndices[6] InPathElements[6] fun gate_19 =>
Gates.eq gate_19 Roots[6] ∧
LeafHashGadget LeafLowerRangeValues[7] NextIndices[7] LeafHigherRangeValues[7] Values[7] fun gate_21 =>
MerkleRootGadget_26_26 gate_21 InPathIndices[7] InPathElements[7] fun gate_22 =>
Gates.eq gate_22 Roots[7] ∧
k vec![gate_1, gate_4, gate_7, gate_10, gate_13, gate_16, gate_19, gate_22]
def InclusionCircuit_8_8_8_26_8_8_26 (Roots: Vector F 8) (Leaves: Vector F 8) (InPathIndices: Vector F 8) (InPathElements: Vector (Vector F 26) 8): Prop :=
InclusionProof_8_8_8_26_8_8_26 Roots Leaves InPathIndices InPathElements fun _ =>
True
def NonInclusionCircuit_8_8_8_8_8_8_26_8_8_26 (Roots: Vector F 8) (Values: Vector F 8) (LeafLowerRangeValues: Vector F 8) (LeafHigherRangeValues: Vector F 8) (NextIndices: Vector F 8) (InPathIndices: Vector F 8) (InPathElements: Vector (Vector F 26) 8): Prop :=
NonInclusionProof_8_8_8_8_8_8_26_8_8_26 Roots Values LeafLowerRangeValues LeafHigherRangeValues NextIndices InPathIndices InPathElements fun _ =>
True
def CombinedCircuit_8_8_8_26_8_8_8_8_8_8_8_26_8 (Inclusion_Roots: Vector F 8) (Inclusion_Leaves: Vector F 8) (Inclusion_InPathIndices: Vector F 8) (Inclusion_InPathElements: Vector (Vector F 26) 8) (NonInclusion_Roots: Vector F 8) (NonInclusion_Values: Vector F 8) (NonInclusion_LeafLowerRangeValues: Vector F 8) (NonInclusion_LeafHigherRangeValues: Vector F 8) (NonInclusion_NextIndices: Vector F 8) (NonInclusion_InPathIndices: Vector F 8) (NonInclusion_InPathElements: Vector (Vector F 26) 8): Prop :=
InclusionProof_8_8_8_26_8_8_26 Inclusion_Roots Inclusion_Leaves Inclusion_InPathIndices Inclusion_InPathElements fun _ =>
NonInclusionProof_8_8_8_8_8_8_26_8_8_26 NonInclusion_Roots NonInclusion_Values NonInclusion_LeafLowerRangeValues NonInclusion_LeafHigherRangeValues NonInclusion_NextIndices NonInclusion_InPathIndices NonInclusion_InPathElements fun _ =>
True
end LightProver
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/formal-verification
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/formal-verification/FormalVerification/Rangecheck.lean
|
import «ProvenZk»
import FormalVerification.Circuit
import FormalVerification.Lemmas
open LightProver (F Order Gates)
theorem AssertIsLess_248_semantics {A B : F} : LightProver.AssertIsLess_248 A B ↔ (A + (2^248 - B)).val < 2^248 := by
unfold LightProver.AssertIsLess_248
simp [LightProver.AssertIsLess_248, Gates_base.add]
apply Iff.intro
. rintro ⟨_, hp⟩
have hp := Gates.to_binary_rangecheck hp
zify at hp
simp at hp
zify
exact hp
. intro hp
zify at hp
simp at hp
simp [Gates, GatesGnark8]
simp_rw [Gates.to_binary_iff_eq_Fin_ofBitsLE]
rw [exists_swap]
exists Fin.toBitsLE (Fin.mk (A + (2^248 - B)).val (by zify; simp [hp]))
simp; rfl
example : LightProver.AssertIsLess_248 (Order - 20) 10 ∧ (Order - 20 : F).val > 10 := by
rw [AssertIsLess_248_semantics]; decide
theorem AssertIsLess_bounds { A B : F} (A_range : A.val ≤ 2 ^ 249): LightProver.AssertIsLess_248 A B → A.val < B.val ∧ B.val ≤ A.val + 2^248 := by
rw [AssertIsLess_248_semantics];
zify; simp;
zify at A_range; simp at A_range;
simp [ZMod.castInt_add, ZMod.castInt_sub]
have : (((2:F)^248).cast:ℤ) = 2^248 := by rfl
simp [this]
have hge : (A:ℤ) + (2^248 - (B:ℤ)) ≥ -Order := by
linarith [ZMod.castInt_nonneg (n:=A), ZMod.castInt_lt (n:=B)]
have hle : (A:ℤ) + (2^248 - (B:ℤ)) < Order := by
have : (A:ℤ) + 2^248 < Order := by
calc
(A:ℤ) + (2:ℤ)^248 ≤ ((2:ℤ)^249 + (2:ℤ)^248 : ℤ) := by linarith
_ < Order := by decide
linarith [ZMod.castInt_nonneg (n:=B)]
cases lt_or_ge ((A:ℤ) + (2^248 - (B:ℤ))) 0 with
| inl h =>
rw [Int.emod_eq_add_self_of_neg_and_lt_neg_self h hge]
intro hp
linarith [ZMod.castInt_lt (n:=B), ZMod.castInt_nonneg (n:=A)]
| inr h =>
rw [Int.emod_eq_of_lt h hle]
intro hp
apply And.intro
. linarith
. linarith
theorem AssertIsLess_range {hi lo val : F} (lo_range : lo.val < 2^248) :
LightProver.AssertIsLess_248 lo val ∧ LightProver.AssertIsLess_248 val hi → lo.val < val.val ∧ val.val < hi.val := by
rintro ⟨hlo, hhi⟩
have ⟨hl, nextRange⟩ := AssertIsLess_bounds (by linarith) hlo
have val_range : val.val ≤ 2^249 := by linarith
have ⟨hv, _⟩ := AssertIsLess_bounds val_range hhi
exact ⟨hl, hv⟩
| 0
|
solana_public_repos/Lightprotocol/light-protocol/light-prover
|
solana_public_repos/Lightprotocol/light-protocol/light-prover/logging/logger.go
|
package logging
import (
gnarkLogger "github.com/consensys/gnark/logger"
"github.com/rs/zerolog"
"os"
)
var log = zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: "15:04:05"}).With().Timestamp().Logger()
func Logger() *zerolog.Logger {
return &log
}
func SetJSONOutput() {
log = zerolog.New(os.Stdout).With().Timestamp().Logger()
gnarkLogger.Set(log)
}
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.