Enum bdk::descriptor::Legacy
source · pub enum Legacy {}
Expand description
Legacy ScriptContext
To be used as P2SH scripts
For creation of Bare scriptpubkeys, construct the Miniscript
under Bare
ScriptContext
Trait Implementations
sourceimpl Ord for Legacy
impl Ord for Legacy
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Legacy> for Legacy
impl PartialOrd<Legacy> for Legacy
sourcefn partial_cmp(&self, other: &Legacy) -> Option<Ordering>
fn partial_cmp(&self, other: &Legacy) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
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 moresourceimpl ScriptContext for Legacy
impl ScriptContext for Legacy
sourcefn check_terminal_non_malleable<Pk>(
frag: &Terminal<Pk, Legacy>
) -> Result<(), ScriptContextError>where
Pk: MiniscriptKey,
fn check_terminal_non_malleable<Pk>(
frag: &Terminal<Pk, Legacy>
) -> 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. Read more
sourcefn check_witness<Pk>(
witness: &[Vec<u8, Global>]
) -> Result<(), ScriptContextError>where
Pk: MiniscriptKey,
fn check_witness<Pk>(
witness: &[Vec<u8, Global>]
) -> 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. Read more
sourcefn check_global_consensus_validity<Pk>(
ms: &Miniscript<Pk, Legacy>
) -> Result<(), ScriptContextError>where
Pk: MiniscriptKey,
fn check_global_consensus_validity<Pk>(
ms: &Miniscript<Pk, Legacy>
) -> 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. Read more
sourcefn check_local_consensus_validity<Pk>(
ms: &Miniscript<Pk, Legacy>
) -> Result<(), ScriptContextError>where
Pk: MiniscriptKey,
fn check_local_consensus_validity<Pk>(
ms: &Miniscript<Pk, Legacy>
) -> 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. Read more
sourcefn check_local_policy_validity<Pk>(
ms: &Miniscript<Pk, Legacy>
) -> Result<(), ScriptContextError>where
Pk: MiniscriptKey,
fn check_local_policy_validity<Pk>(
ms: &Miniscript<Pk, Legacy>
) -> 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 Read more
sourcefn max_satisfaction_size<Pk>(ms: &Miniscript<Pk, Legacy>) -> Option<usize>where
Pk: MiniscriptKey,
fn max_satisfaction_size<Pk>(ms: &Miniscript<Pk, Legacy>) -> Option<usize>where
Pk: MiniscriptKey,
Depending on script context, the size of a satifaction witness may slightly differ.
sourcefn pk_len<Pk>(pk: &Pk) -> usizewhere
Pk: MiniscriptKey,
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 Read more
sourcefn check_global_policy_validity<Pk>(
_ms: &Miniscript<Pk, Self>
) -> Result<(), ScriptContextError>where
Pk: MiniscriptKey,
fn check_global_policy_validity<Pk>(
_ms: &Miniscript<Pk, Self>
) -> 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. Read more
sourcefn check_global_validity<Pk>(
ms: &Miniscript<Pk, Self>
) -> Result<(), ScriptContextError>where
Pk: MiniscriptKey,
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 Read more
sourcefn check_local_validity<Pk>(
ms: &Miniscript<Pk, Self>
) -> Result<(), ScriptContextError>where
Pk: MiniscriptKey,
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 Read more
sourcefn top_level_type_check<Pk>(ms: &Miniscript<Pk, Self>) -> Result<(), Error>where
Pk: MiniscriptKey,
fn top_level_type_check<Pk>(ms: &Miniscript<Pk, Self>) -> Result<(), Error>where
Pk: MiniscriptKey,
Check whether the top-level is type B
sourcefn other_top_level_checks<Pk>(_ms: &Miniscript<Pk, Self>) -> Result<(), Error>where
Pk: MiniscriptKey,
fn other_top_level_checks<Pk>(_ms: &Miniscript<Pk, Self>) -> Result<(), Error>where
Pk: MiniscriptKey,
Other top level checks that are context specific
sourcefn top_level_checks<Pk>(ms: &Miniscript<Pk, Self>) -> Result<(), Error>where
Pk: MiniscriptKey,
fn top_level_checks<Pk>(ms: &Miniscript<Pk, Self>) -> Result<(), Error>where
Pk: MiniscriptKey,
Check top level consensus rules.
impl Eq for Legacy
impl StructuralEq for Legacy
impl StructuralPartialEq for Legacy
Auto Trait Implementations
impl RefUnwindSafe for Legacy
impl Send for Legacy
impl Sync for Legacy
impl Unpin for Legacy
impl UnwindSafe for Legacy
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for Twhere
T: Hash + ?Sized,
impl<T> CallHasher for Twhere
T: Hash + ?Sized,
sourceimpl<Ctx> ExtScriptContext for Ctxwhere
Ctx: 'static + ScriptContext,
impl<Ctx> ExtScriptContext for Ctxwhere
Ctx: 'static + ScriptContext,
sourcefn as_enum() -> ScriptContextEnum
fn as_enum() -> ScriptContextEnum
Returns the
ScriptContext
as a ScriptContextEnum
sourcefn is_segwit_v0() -> bool
fn is_segwit_v0() -> bool
Returns whether the script context is
Segwitv0
sourcefn is_taproot() -> bool
fn is_taproot() -> bool
Returns whether the script context is
Tap
, aka Taproot or Segwit V1