Function tapleaf_hash

Source
pub fn tapleaf_hash() -> u256
Expand description

Return the SHA256 hash of the following:

  • The hash of the ASCII string TapLeaf/elements (32 bytes).
  • The hash of the ASCII string TapLeaf/elements again (32 bytes).
  • The result of tapleaf_version (1 byte).
  • The byte 0x20 (1 byte).
  • The result of script_cmr (32 bytes).

Note: this matches Element’s modified BIP-0341 definition of tapleaf hash.

§Cost

136 mWU (milli weight units)