#[light_system_accounts]
Expand description
Adds required fields to your anchor instruction for applying a zk-compressed state transition.
§Usage
Add #[light_system_accounts]
to your struct. Ensure it’s applied before Anchor’s
#[derive(Accounts)]
and Light’s #[derive(LightTraits)]
.
§Example
Note: You will have to build your program IDL using Anchor’s idl-build
feature, otherwise your IDL won’t include these accounts.
ⓘ
#[light_system_accounts]
#[derive(Accounts)]
pub struct ExampleInstruction<'info> {
pub my_program: Program<'info, MyProgram>,
}
This will expand to add the following fields to your struct:
light_system_program
: Verifies and applies zk-compression state transitions.registered_program_pda
: A light protocol PDA to authenticate state tree updates.noop_program
: The SPL noop program to write compressed-account state as calldata to the Solana ledger.account_compression_authority
: The authority for account compression operations.account_compression_program
: Called by light_system_program. Updates state trees.system_program
: The Solana System program.