Skip to main content

ScriptPubKey

Type Alias ScriptPubKey 

Source
pub type ScriptPubKey = Script<ScriptPubKeyTag>;
Expand description

A reference to a scriptPubKey (locking script).

Aliased Type§

pub struct ScriptPubKey(/* private fields */);

Implementations§

Source§

impl ScriptPubKey

Source

pub fn is_witness_program(&self) -> bool

Checks whether a script pubkey is a Segregated Witness (SegWit) program.

Source

pub fn is_p2sh(&self) -> bool

Checks whether a script pubkey is a P2SH output.

Source

pub fn is_p2pkh(&self) -> bool

Checks whether a script pubkey is a P2PKH output.

Source

pub fn is_p2a(&self) -> bool

Checks whether a script pubkey is a P2A output.

Source

pub fn is_op_return(&self) -> bool

Check if this is a consensus-valid OP_RETURN output.

To validate if the OP_RETURN obeys Bitcoin Core’s current standardness policy, use bitcoin::ScriptPubKeyExt::is_standard_op_return() instead.