bips
bips copied to clipboard
bip-tap: correct `asset_tree_root` usage
The field asset_tree_root is not 40 bytes long, but 32.
This is both consistent with the implementation, and with the definition of the field further down in this bip.
Definition:
the asset tree is calculated as either:
asset_tree_root = sha256(asset_id || left_hash || right_hash || sum_value)orasset_tree_root = sha256(asset_group_key || left_hash || right_hash || sum_value)
Implementation:
leafParts := [][]byte{
{byte(c.Version)}, TaprootAssetsMarker[:], rootHash[:],
rootSum[:],
}
The bip now reflects this.
Is this correct?
Yeah that's correct, the asset marker only comes into play in the actual tapscript commitment. So where we have a single hash that commits to all the decedent trees, and want to put that hash into a tapscript leaf.