Verifier

Trait Verifier 

Source
pub trait Verifier {
    // Required method
    fn verify(
        &self,
        script_pubkey: &[u8],
        amount: Option<i64>,
        tx_to: &[u8],
        input_index: u32,
        spent_outputs: &[TxOut],
        tx_weight: Weight,
    ) -> Result<(), Error>;
}
Expand description

Trait to abstract the behavior of the bitcoin script verifier, allowing users to provide their own verifier.

Required Methods§

Source

fn verify( &self, script_pubkey: &[u8], amount: Option<i64>, tx_to: &[u8], input_index: u32, spent_outputs: &[TxOut], tx_weight: Weight, ) -> Result<(), Error>

Verify a bitcoin script, mirroring the API of bitcoinkernel::verify.

§Arguments
  • script_pubkey - The script public key to verify.
  • amount - The amount of the input being spent.
  • tx_to - The transaction containing the script.
  • input_index - The index of the input to verify.
  • spent_outputs - The outputs being spent by the transaction.
  • tx_weight - The weight of the transaction.
§Errors

Returns Error if verification fails.

Implementors§