Skip to main content

build_token_shielded_transfer_transition

Function build_token_shielded_transfer_transition 

Source
pub async fn build_token_shielded_transfer_transition<S: Signer<IdentityPublicKey>, P: OrchardProver>(
    token_id: Identifier,
    owner_id: Identifier,
    data_contract_id: Identifier,
    token_contract_position: u16,
    spends: Vec<SpendableNote>,
    recipient: &OrchardAddress,
    transfer_amount: TokenAmount,
    change_address: &OrchardAddress,
    fvk: &FullViewingKey,
    ask: &SpendAuthorizingKey,
    anchor: Anchor,
    memo: [u8; 36],
    identity_public_key: &IdentityPublicKey,
    identity_contract_nonce: IdentityNonce,
    user_fee_increase: UserFeeIncrease,
    signer: &S,
    prover: &P,
    platform_version: &PlatformVersion,
) -> Result<StateTransition, ProtocolError>
Expand description

Builds a TokenShieldedTransfer batch transition: spends spends inside the token’s shielded pool, pays transfer_amount to recipient and any remainder to change_address, and wraps the bundle in a batch transition signed by owner_id, which pays the fee in credits.

Nothing leaves the pool, so the bundle’s value balance is exactly zero; consensus rejects anything else. Both outputs are encrypted under the sender’s external outgoing viewing key so the sending wallet can recover its own send history. The token id and owner id are bound into the Orchard sighash, so the bundle is tied to this token and this signing identity.