Skip to main content

shield_from_asset_lock_extra_sighash_data

Function shield_from_asset_lock_extra_sighash_data 

Source
pub fn shield_from_asset_lock_extra_sighash_data(
    asset_lock_proof: &AssetLockProof,
    platform_version: &PlatformVersion,
) -> Result<Vec<u8>, ProtocolError>
Expand description

Extra sighash data of a ShieldFromAssetLock bundle: its kind tag and the identifier of the asset lock that funds it (AssetLockProof::create_identifier, the double SHA-256 of the locked outpoint). See credit_pool_output_only_extra_sighash_data_v0.

Binding the full outpoint, rather than the transaction id, makes this binding single-use. A successful shield consumes the whole lock, so a given bundle can land at most once, whoever wraps it and however often it is resubmitted: a copier would have to fund it from this very lock, and so would the sender’s own retry. Binding only the transaction id would let anybody holding another credit output of the same asset-lock transaction lift the bundle. A sender who deliberately rebuilds the same notes under another lock is still not stopped; see credit_pool_output_only_extra_sighash_data_v0.

The identifier is the same one an identity created from that lock would get; the kind tag keeps this preimage apart from a ShieldFromIdentity of that identity.

Dispatches on dpp.methods.credit_pool_bundle_binding like shield_extra_sighash_data.