Skip to main content

verify_script

Function verify_script 

Source
pub fn verify_script(
    script_sig: &Vec<u8>,
    script_pubkey: &[u8],
    witness: Option<&Vec<u8>>,
    flags: u32,
) -> Result<bool, ConsensusError>
👎Deprecated since 0.1.33:

Use verify_script_with_context for witness-aware script verification

Expand description

VerifyScript: 𝒮𝒞 × 𝒮𝒞 × 𝒲 × ℕ → {true, false}

For scriptSig ss, scriptPubKey spk, witness w, and flags f:

  1. Execute ss on empty stack
  2. Execute spk on resulting stack
  3. If witness present: execute w on stack
  4. Return final stack has exactly one true value

Legacy script verification (Base sigversion, at most one witness push).

Deprecated: accepts Option<&ByteString> not a full witness stack. SegWit and Taproot inputs require verify_script_with_context or verify_script_with_context_full.