Skip to main content
The 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

Pubkey
required
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.
i64
required
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)
u64
required
The transaction fee in lamports (for SOL) or token base units (for SPL tokens). This fee is paid to the relayer or fee recipient.
Pubkey
required
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.
Pubkey
required
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:
The full ExtData is reconstructed on-chain using context accounts:

For SOL Transactions

For SPL Token Transactions

Hash Calculation

The ExtData is hashed using the calculate_complete_ext_data_hash utility function:
This hash is compared against the 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 the deposit_fee_rate from global config
  • Withdrawals (ext_amount < 0): Fee must match the withdrawal_fee_rate from global config
  • Shielded Transfers (ext_amount == 0): No fee validation (can be zero)
Fees are calculated in basis points with an allowed error margin:
  • Proof - Contains the ext_data_hash that commits to this ExtData