Skip to main content

build_token_shield_transition

Function build_token_shield_transition 

Source
pub async fn build_token_shield_transition<S: Signer<IdentityPublicKey>, P: OrchardProver>(
    token_id: Identifier,
    owner_id: Identifier,
    data_contract_id: Identifier,
    token_contract_position: u16,
    recipient: &OrchardAddress,
    amount: TokenAmount,
    memo: [u8; 36],
    sender_ovk: Option<OutgoingViewingKey>,
    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 TokenShield batch transition: proves an outputs-only Orchard bundle paying amount of the token to recipient inside the token’s own shielded pool, then wraps it in a batch transition signed by owner_id, the identity whose token balance funds the shield.

The identity pays the fee in credits; amount tokens leave its balance for the pool at execution. The bundle has no spends, so its anchor is never checked against a pool, and the identity signature over the batch only binds it inside this batch — the authorized bundle bytes on their own would verify in any pool. The extra sighash data pins them to this token, to the shield kind and to owner_id. sender_ovk lets the sending wallet recover the note it created (recipient, value, memo) from chain data.