TaprootWitness

Enum TaprootWitness 

Source
pub enum TaprootWitness {
    PubkeySpending {
        sig: SchnorrSig,
        annex: Option<Box<[u8]>>,
    },
    ScriptSpending {
        control_block: ControlBlock,
        annex: Option<Box<[u8]>>,
        script: LeafScript,
        script_input: Vec<Box<[u8]>>,
    },
}
Expand description

Parsed witness stack for Taproot inputs

Variants§

§

PubkeySpending

Public key path spending

Fields

§sig: SchnorrSig

BIP-341 signature

§annex: Option<Box<[u8]>>

Optional annex data (annex prefix is removed)

§

ScriptSpending

Script path spending

Fields

§control_block: ControlBlock

Taproot control block

§annex: Option<Box<[u8]>>

Optional annex data (annex prefix is removed)

§script: LeafScript

Leaf script for the spending

§script_input: Vec<Box<[u8]>>

The remaining part of the witness stack

Trait Implementations§

Source§

impl Clone for TaprootWitness

Source§

fn clone(&self) -> TaprootWitness

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TaprootWitness

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Decodable for TaprootWitness

Source§

fn consensus_decode<D: Read + ?Sized>(d: &mut D) -> Result<Self, Error>

Decode an object with a well-defined format. Read more
Source§

fn consensus_decode_from_finite_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + ?Sized,

Decode Self from a size-limited reader. Read more
Source§

impl Encodable for TaprootWitness

Source§

fn consensus_encode<W: Write + ?Sized>( &self, writer: &mut W, ) -> Result<usize, Error>

Encode an object with a well-defined format. Returns the number of bytes written on success. Read more
Source§

impl From<&TaprootWitness> for Witness

Source§

fn from(tw: &TaprootWitness) -> Self

Converts to this type from the input type.
Source§

impl From<TaprootWitness> for Witness

Source§

fn from(tw: TaprootWitness) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for TaprootWitness

Source§

fn eq(&self, other: &TaprootWitness) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Strategy for TaprootWitness

Source§

type Strategy = BitcoinConsensus

Specific strategy. List of supported strategies: Read more
Source§

impl TryFrom<Witness> for TaprootWitness

Source§

type Error = TaprootWitnessError

The type returned in the event of a conversion error.
Source§

fn try_from(witness: Witness) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Eq for TaprootWitness

Source§

impl StructuralPartialEq for TaprootWitness

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> StrictDecode for T
where T: Strategy, Holder<T, <T as Strategy>::Strategy>: StrictDecode,

Source§

fn strict_decode<D>(d: D) -> Result<T, Error>
where D: Read,

Decode with the given std::io::Read instance; must either construct an instance or return implementation-specific error type.
Source§

fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>

Tries to deserialize byte array into the current type using StrictDecode::strict_decode. If there are some data remains in the buffer once deserialization is completed, fails with Error::DataNotEntirelyConsumed. Use io::Cursor over the buffer and StrictDecode::strict_decode to avoid such failures.
Source§

fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>

Reads data from file at path and reconstructs object from it. Fails with Error::DataNotEntirelyConsumed if file contains remaining data after the object reconstruction.
Source§

impl<T> StrictEncode for T

Source§

fn strict_encode<E>(&self, e: E) -> Result<usize, Error>
where E: Write,

Encode with the given std::io::Write instance; must return result with either amount of bytes encoded – or implementation-specific error type.
Source§

fn strict_serialize(&self) -> Result<Vec<u8>, Error>

Serializes data as a byte array using StrictEncode::strict_encode function
Source§

fn strict_file_save(&self, path: impl AsRef<Path>) -> Result<usize, Error>

Saves data to a file at a given path. If the file does not exists, attempts to create the file. If the file already exists, it gets truncated.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.