pub async fn build_shield_transition<S: Signer<PlatformAddress>, P: OrchardProver>(
recipient: &OrchardAddress,
shield_amount: u64,
inputs: BTreeMap<PlatformAddress, (AddressNonce, Credits)>,
fee_strategy: AddressFundsFeeStrategy,
signer: &S,
user_fee_increase: UserFeeIncrease,
prover: &P,
memo: [u8; 36],
sender_ovk: Option<OutgoingViewingKey>,
platform_version: &PlatformVersion,
) -> Result<StateTransition, ProtocolError>Expand description
Builds a Shield state transition (transparent platform addresses -> shielded pool).
Constructs an output-only Orchard bundle (no spends), proves it, signs the
transparent input witnesses, and returns a ready-to-broadcast StateTransition.
§Parameters
recipient- Orchard address to receive the shielded noteshield_amount- Amount of credits to shieldinputs- Platform address inputs with their nonces and balancesfee_strategy- How to deduct fees from the transparent inputssigner- Signs each input address witness (ECDSA)user_fee_increase- Fee multiplier (0 = 100% base fee)prover- Orchard prover (holds the Halo 2 proving key; cache withOnceLock— ~30s to build)memo- 36-byte structured memo for the recipient (4-byte type tag + 32-byte payload)sender_ovk- The sender’s outgoing viewing key (External scope). WithSome, the recipient output’sout_ciphertextis encrypted under it so the sender can later recover the sent note (recipient, value, memo) from chain data via OVK recovery — the Zcash outgoing-transaction-history convention. WithNone, a random outgoing cipher key is used and the sent note is unrecoverable by anyone.platform_version- Protocol version