build_shield_transition

Function build_shield_transition 

Source
pub 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],
    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 note
  • shield_amount - Amount of credits to shield
  • inputs - Platform address inputs with their nonces and balances
  • fee_strategy - How to deduct fees from the transparent inputs
  • signer - 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 with OnceLock — ~30s to build)
  • memo - 36-byte structured memo for the recipient (4-byte type tag + 32-byte payload)
  • platform_version - Protocol version