Skip to main content

is_pay_to_script_hash

Function is_pay_to_script_hash 

Source
pub fn is_pay_to_script_hash(script: &[u8]) -> bool
Expand description

Orange Paper 5.2.1: P2SH scriptPubKey pattern (consensus IsP2SH-style predicate).

Structural invariant: if the function returns true, the script has exactly 23 bytes (OP_HASH160 + 0x14 push + 20-byte hash + OP_EQUAL). When length ≠ 23 the first AND condition short-circuits to false, so result == true implies script.len() == 23.