Skip to main content

Module template

Module template 

Source
Expand description

Script template trait and types.

This module provides the ScriptTemplate trait for creating reusable script patterns, and the ScriptTemplateUnlock type for generating unlocking scripts.

§Example

use bsv_rs::script::templates::P2PKH;
use bsv_rs::script::template::ScriptTemplate;

let template = P2PKH::new();
let locking_script = template.lock(&pubkey_hash)?;

Re-exports§

pub use crate::script::Script;

Structs§

ScriptTemplateUnlock
Return type for template unlock methods.
SigningContext
Context for signing a transaction input.

Enums§

SignOutputs
Specifies which outputs to sign in a transaction signature.

Traits§

ScriptTemplate
A trait for reusable script patterns.

Functions§

build_p2pkh_unlocking_script
Helper function to build an unlocking script from signature and public key.
compute_sighash_scope
Computes the sighash scope byte from options.
create_transaction_signature
Helper function to create a transaction signature.