Enum bdk::descriptor::Segwitv0

source ·
pub enum Segwitv0 {}
Expand description

Segwitv0 ScriptContext

Trait Implementations§

source§

impl Clone for Segwitv0

source§

fn clone(&self) -> Segwitv0

Returns a copy 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 Segwitv0

source§

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

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

impl Hash for Segwitv0

source§

fn hash<__H>(&self, state: &mut __H)where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Segwitv0

source§

fn cmp(&self, other: &Segwitv0) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Segwitv0

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Segwitv0

source§

fn partial_cmp(&self, other: &Segwitv0) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl ScriptContext for Segwitv0

§

type Key = PublicKey

The consensus key associated with the type. Must be a parseable key
source§

fn check_terminal_non_malleable<Pk>( _frag: &Terminal<Pk, Segwitv0> ) -> Result<(), ScriptContextError>where Pk: MiniscriptKey,

Depending on ScriptContext, fragments can be malleable. For Example, under Legacy context, PkH is malleable because it is possible to estimate the cost of satisfaction because of compressed keys This is currently only used in compiler code for removing malleable compilations. This does NOT recursively check if the children of the fragment are valid or not. Since the compilation proceeds in a leaf to root fashion, a recursive check is unnecessary.
source§

fn check_pk<Pk>(pk: &Pk) -> Result<(), ScriptContextError>where Pk: MiniscriptKey,

Each context has slightly different rules on what Pks are allowed in descriptors Legacy/Bare does not allow x_only keys Segwit does not allow uncompressed keys and x_only keys Tapscript does not allow uncompressed keys
source§

fn check_witness<Pk>(witness: &[Vec<u8>]) -> Result<(), ScriptContextError>where Pk: MiniscriptKey,

Check whether the given satisfaction is valid under the ScriptContext For example, segwit satisfactions may fail if the witness len is more 3600 or number of stack elements are more than 100.
source§

fn check_global_consensus_validity<Pk>( ms: &Miniscript<Pk, Segwitv0> ) -> Result<(), ScriptContextError>where Pk: MiniscriptKey,

Depending on script Context, some of the Terminals might not be valid under the current consensus rules. Or some of the script resource limits may have been exceeded. These miniscripts would never be accepted by the Bitcoin network and hence it is safe to discard them For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey uncompressed public keys are non-standard and thus invalid. In LegacyP2SH context, scripts above 520 bytes are invalid. Post Tapscript upgrade, this would have to consider other nodes. This does NOT recursively check the miniscript fragments.
source§

fn check_local_consensus_validity<Pk>( ms: &Miniscript<Pk, Segwitv0> ) -> Result<(), ScriptContextError>where Pk: MiniscriptKey,

Consensus rules at the Miniscript satisfaction time. It is possible that some paths of miniscript may exceed resource limits and our current satisfier and lifting analysis would not work correctly. For example, satisfaction path(Legacy/Segwitv0) may require more than 201 opcodes.
source§

fn check_global_policy_validity<Pk>( ms: &Miniscript<Pk, Segwitv0> ) -> Result<(), ScriptContextError>where Pk: MiniscriptKey,

Depending on script Context, some of the script resource limits may have been exceeded under the current bitcoin core policy rules These miniscripts would never be accepted by the Bitcoin network and hence it is safe to discard them. (unless explicitly disabled by non-standard flag) For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey scripts over 3600 bytes are invalid. Post Tapscript upgrade, this would have to consider other nodes. This does NOT recursively check the miniscript fragments.
source§

fn check_local_policy_validity<Pk>( ms: &Miniscript<Pk, Segwitv0> ) -> Result<(), ScriptContextError>where Pk: MiniscriptKey,

Policy rules at the Miniscript satisfaction time. It is possible that some paths of miniscript may exceed resource limits and our current satisfier and lifting analysis would not work correctly. For example, satisfaction path in Legacy context scriptSig more than 1650 bytes
source§

fn max_satisfaction_size<Pk>(ms: &Miniscript<Pk, Segwitv0>) -> Option<usize>where Pk: MiniscriptKey,

Depending on script context, the size of a satifaction witness may slightly differ.
source§

fn pk_len<Pk>(_pk: &Pk) -> usizewhere Pk: MiniscriptKey,

Get the len of public key when serialized based on context Note that this includes the serialization prefix. Returns 34/66 for Bare/Legacy based on key compressedness 34 for Segwitv0, 33 for Tap
source§

fn name_str() -> &'static str

Local helper function to display error messages with context
source§

fn sig_type() -> SigType

The type of signature required for satisfaction
source§

fn check_global_validity<Pk>( ms: &Miniscript<Pk, Self> ) -> Result<(), ScriptContextError>where Pk: MiniscriptKey,

Check the consensus + policy(if not disabled) rules that are not based satisfaction
source§

fn check_local_validity<Pk>( ms: &Miniscript<Pk, Self> ) -> Result<(), ScriptContextError>where Pk: MiniscriptKey,

Check the consensus + policy(if not disabled) rules including the ones for satisfaction
source§

fn top_level_type_check<Pk>(ms: &Miniscript<Pk, Self>) -> Result<(), Error>where Pk: MiniscriptKey,

Check whether the top-level is type B
source§

fn other_top_level_checks<Pk>(_ms: &Miniscript<Pk, Self>) -> Result<(), Error>where Pk: MiniscriptKey,

Other top level checks that are context specific
source§

fn top_level_checks<Pk>(ms: &Miniscript<Pk, Self>) -> Result<(), Error>where Pk: MiniscriptKey,

Check top level consensus rules.
source§

impl Eq for Segwitv0

source§

impl StructuralEq for Segwitv0

source§

impl StructuralPartialEq for Segwitv0

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> CallHasher for Twhere T: Hash + ?Sized,

source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where H: Hash + ?Sized, B: BuildHasher,

source§

impl<Ctx> ExtScriptContext for Ctxwhere Ctx: ScriptContext + 'static,

source§

fn as_enum() -> ScriptContextEnum

source§

fn is_legacy() -> bool

Returns whether the script context is Legacy
source§

fn is_segwit_v0() -> bool

Returns whether the script context is Segwitv0
source§

fn is_taproot() -> bool

Returns whether the script context is Tap, aka Taproot or Segwit V1
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V