Account Structs
When making CPI calls to Inco Lightning, you need to pass specific account structures. This guide explains each account struct and when to use it.Overview
| Struct | Purpose | Used By |
|---|---|---|
Operation | General encrypted operations | All arithmetic, comparison, bitwise, random, input, select functions |
Allow | Grant/revoke decryption access | allow function |
IsAllowed | Check decryption permissions | is_allowed function |
VerifySignature | Verify attestation signatures | is_validsignature function |
Operation
The simplest account struct, used for most encrypted operations.e_add, e_sub, e_mul, e_rem), comparisons (e_ge, e_gt, e_le, e_lt, e_eq), bitwise operations (e_and, e_or, e_not, e_shl, e_shr), random generation (e_rand), input functions (new_euint128, new_ebool, as_euint128, as_ebool), and conditional selection (e_select).
Allow
Used to grant or revoke decryption permissions for a handle.| Account | Description |
|---|---|
allowance_account | PDA that stores the allowance state (mutable) |
signer | The handle owner who can grant permissions (mutable, signer) |
allowed_address | The address being granted/revoked access |
system_program | Required for PDA creation |
Allowance PDA Derivation
The allowance account is a PDA derived from the handle and allowed address:Usage
IsAllowed
Used to check if an address has decryption permission.VerifySignature
Used to verify Ed25519 signatures from the covalidator network for attested decryption.| Account | Description |
|---|---|
instructions | The instructions sysvar (SYSVAR_INSTRUCTIONS_ID) |
signer | Transaction signer (mutable, signer) |