Skip to main content

Crate light_compressed_account

Crate light_compressed_account 

Source
Expand description

§light-compressed-account

Compressed account struct and utility types for Light Protocol.

TypeDescription
CompressedAccountErrorError codes 12001–12025 for account operations
QueueTypeNullifier, address, and state queue variants
TreeTypeState and address tree version variants
CpiSignerProgram ID, CPI signer pubkey, and bump
addressAddress derivation and seed structs
compressed_accountCore compressed account struct
constantsProgram IDs and account discriminators as byte arrays
discriminatorsInstruction discriminators for invoke, invoke_cpi, and queue operations
instruction_dataInstruction data types and proof structs
nullifierNullifier computation
pubkeyPubkey struct (re-exported at root) and AsPubkey conversion trait
tx_hashTransaction hash computation

Re-exports§

pub use instruction_data::traits::InstructionDiscriminator;
pub use instruction_data::traits::LightInstructionData;
pub use pubkey::Pubkey;

Modules§

address
compressed_account
constants
discriminators
hash_chain
instruction_data
nullifier
pubkey
tx_hash
vec
A contiguous growable array type with heap-allocated contents, written Vec<T>.

Macros§

vec
Creates a Vec containing the arguments.

Structs§

CpiSigner
Configuration struct containing program ID, CPI signer, and bump for Light Protocol
Vec
A contiguous growable array type, written as Vec<T>, short for ‘vector’.

Enums§

CompressedAccountError
QueueType
TreeType

Constants§

ADDRESS_MERKLE_TREE_TYPE_V1
ADDRESS_MERKLE_TREE_TYPE_V2
ADDRESS_QUEUE_TYPE_V1
ADDRESS_QUEUE_TYPE_V2
INPUT_STATE_QUEUE_TYPE_V2
NULLIFIER_QUEUE_TYPE_V1
OUTPUT_STATE_QUEUE_TYPE_V2
STATE_MERKLE_TREE_TYPE_V1
STATE_MERKLE_TREE_TYPE_V2

Functions§

bigint_to_be_bytes_array
Converts the given ark_ff::BigUint into a big-endian byte array.
hash_to_bn254_field_size_be
Hashes the provided bytes with Keccak256 and ensures the result fits in the BN254 field by truncating the resulting hash to 31 bytes.
hashv_to_bn254_field_size_be