Struct bitcoin_bech32::WitnessProgram [] [src]

pub struct WitnessProgram {
    pub version: u8,
    pub program: Vec<u8>,
    pub network: Network,
}

Witness version and program data

Fields

Witness program version

Witness program content

Cryptocurrency network

Methods

impl WitnessProgram
[src]

Converts a Witness Program to a SegWit Address

Decodes a segwit address into a Witness Program

Verifies that the address contains a known human-readable part hrp and decodes as proper Bech32-encoded string. Allowed values of the human-readable part correspond to the defined types in constants

Converts a WitnessProgram to a script public key

The format for the output is [version, program length, <program>]

Extracts a WitnessProgram out of a provided script public key

Validates the WitnessProgram against version and length constraints

Trait Implementations

impl PartialEq for WitnessProgram
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Debug for WitnessProgram
[src]

Formats the value using the given formatter.

impl Clone for WitnessProgram
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more