wrap_script

Function wrap_script 

Source
pub fn wrap_script(
    script: ScriptBuf,
    num_witness_elements: usize,
    signer_pk: &XOnlyPublicKey,
) -> ScriptBuf
Expand description

Wraps the script in an envelope with the protocol id “cat”. Adds [num_witness_elements] OP_DROPs so the witness can be provided with the transaction still being valid. The script is then locked to a OP_CHECKSIG with the [signer_pk].