Enum sapio_miniscript::Segwitv0
source · [−]pub enum Segwitv0 {}
Expand description
Segwitv0 ScriptContext
Trait Implementations
sourceimpl Ord for Segwitv0
impl Ord for Segwitv0
sourceimpl PartialOrd<Segwitv0> for Segwitv0
impl PartialOrd<Segwitv0> for Segwitv0
sourcefn partial_cmp(&self, other: &Segwitv0) -> Option<Ordering>
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 · sourcefn lt(&self, other: &Rhs) -> bool
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 · 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 more
sourceimpl ScriptContext for Segwitv0
impl ScriptContext for Segwitv0
sourcefn check_terminal_non_malleable<Pk: MiniscriptKey, Ctx: ScriptContext>(
_frag: &Terminal<Pk, Ctx>
) -> Result<(), ScriptContextError>
fn check_terminal_non_malleable<Pk: MiniscriptKey, Ctx: ScriptContext>(
_frag: &Terminal<Pk, Ctx>
) -> Result<(), ScriptContextError>
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: MiniscriptKey, Ctx: ScriptContext>(
witness: &[Vec<u8>]
) -> Result<(), ScriptContextError>
fn check_witness<Pk: MiniscriptKey, Ctx: ScriptContext>(
witness: &[Vec<u8>]
) -> Result<(), ScriptContextError>
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: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Result<(), ScriptContextError>
fn check_global_consensus_validity<Pk: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Result<(), ScriptContextError>
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: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Result<(), ScriptContextError>
fn check_local_consensus_validity<Pk: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Result<(), ScriptContextError>
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_global_policy_validity<Pk: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Result<(), ScriptContextError>
fn check_global_policy_validity<Pk: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Result<(), ScriptContextError>
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_local_policy_validity<Pk: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Result<(), ScriptContextError>
fn check_local_policy_validity<Pk: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Result<(), ScriptContextError>
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: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Option<usize>
fn max_satisfaction_size<Pk: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Option<usize>
Depending on script context, the size of a satifaction witness may slightly differ.
sourcefn check_global_validity<Pk: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Result<(), ScriptContextError>
fn check_global_validity<Pk: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Result<(), ScriptContextError>
Check the consensus + policy(if not disabled) rules that are not based satisfaction Read more
sourcefn check_local_validity<Pk: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Result<(), ScriptContextError>
fn check_local_validity<Pk: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Result<(), ScriptContextError>
Check the consensus + policy(if not disabled) rules including the ones for satisfaction Read more
sourcefn top_level_type_check<Pk: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Result<(), Error>
fn top_level_type_check<Pk: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Result<(), Error>
Check whether the top-level is type B
sourcefn other_top_level_checks<Pk: MiniscriptKey, Ctx: ScriptContext>(
_ms: &Miniscript<Pk, Ctx>
) -> Result<(), Error>
fn other_top_level_checks<Pk: MiniscriptKey, Ctx: ScriptContext>(
_ms: &Miniscript<Pk, Ctx>
) -> Result<(), Error>
Other top level checks that are context specific
sourcefn top_level_checks<Pk: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Result<(), Error>
fn top_level_checks<Pk: MiniscriptKey, Ctx: ScriptContext>(
ms: &Miniscript<Pk, Ctx>
) -> Result<(), Error>
Check top level consensus rules.
impl Eq for Segwitv0
impl StructuralEq for Segwitv0
impl StructuralPartialEq for Segwitv0
Auto Trait Implementations
impl RefUnwindSafe for Segwitv0
impl Send for Segwitv0
impl Sync for Segwitv0
impl Unpin for Segwitv0
impl UnwindSafe for Segwitv0
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more