pub fn build_shielded_withdrawal_transition<P: OrchardProver>(
spends: Vec<SpendableNote>,
withdrawal_amount: u64,
output_script: CoreScript,
core_fee_per_byte: u32,
pooling: Pooling,
change_address: &OrchardAddress,
fvk: &FullViewingKey,
ask: &SpendAuthorizingKey,
anchor: Anchor,
prover: &P,
memo: [u8; 36],
fee: Option<Credits>,
platform_version: &PlatformVersion,
) -> Result<StateTransition, ProtocolError>Expand description
Builds a ShieldedWithdrawal state transition (shielded pool -> core L1 address).
Spends existing notes and withdraws value to a core chain script output.
The shielded fee is deducted from the spent notes. Any remaining value is
returned to the shielded change_address.
ยงParameters
spends- Notes to spend with their Merkle pathswithdrawal_amount- Amount to withdraw to the core chainoutput_script- Core chain script to receive the fundscore_fee_per_byte- Core chain fee ratepooling- Withdrawal pooling strategychange_address- Orchard address for change outputfvk- Full viewing key for spend authorizationask- Spend authorizing key for RedPallas signaturesanchor- Sinsemilla root of the note commitment tree (Orchard Anchor)prover- Orchard prover (holds the Halo 2 proving key)memo- 36-byte structured memo for the change output (4-byte type tag + 32-byte payload)fee- Optional fee override; ifNone, the minimum fee is computed automatically. IfSome, must be >= the minimum fee.platform_version- Protocol version