ExtData struct contains the public transaction parameters that are not part of the zero-knowledge circuit but are committed to via the ext_data_hash in the proof.
Structure Definition
The recipient of the transaction. For SOL transactions, this is the wallet address. For SPL token transactions, this is the recipient’s token account address.
The external amount being deposited or withdrawn:
- Positive values indicate deposits (funds moving into the privacy pool)
- Negative values indicate withdrawals (funds moving out of the privacy pool)
- Zero indicates a shielded transfer (no external funds movement)
The transaction fee in lamports (for SOL) or token base units (for SPL tokens). This fee is paid to the relayer or fee recipient.
The account that will receive the transaction fee. For SOL transactions, this is a wallet address. For SPL token transactions, this is an associated token account.
The SPL token mint address for SPL token transactions, or a special SOL address constant for native SOL transactions.
ExtDataMinified
To optimize transaction size and costs, clients pass a minified version of ExtData to the program:ExtData is reconstructed on-chain using context accounts:
For SOL Transactions
For SPL Token Transactions
Hash Calculation
The ExtData is hashed using thecalculate_complete_ext_data_hash utility function:
ext_data_hash in the proof to ensure the transaction parameters match what was committed to in the zero-knowledge proof.
Fee Validation
The program validates fees based on the transaction type:- Deposits (
ext_amount > 0): Fee must match thedeposit_fee_ratefrom global config - Withdrawals (
ext_amount < 0): Fee must match thewithdrawal_fee_ratefrom global config - Shielded Transfers (
ext_amount == 0): No fee validation (can be zero)
Related Types
- Proof - Contains the
ext_data_hashthat commits to this ExtData