Skip to main content

extract_template_hash_from_script

Function extract_template_hash_from_script 

Source
pub fn extract_template_hash_from_script(script: &[u8]) -> Option<[u8; 32]>
Expand description

Extract template hash from script

For CTV scripts, the template hash is typically the last 32 bytes pushed before OP_CHECKTEMPLATEVERIFY (0xb3).

§Arguments

  • script - The script to extract template hash from

§Returns

The template hash if found, None otherwise