[]Trait bdk::descriptor::ScriptContext

pub trait ScriptContext: Sealed + Clone + PartialEq<Self> + Eq + Ord + PartialOrd<Self> + Debug {
    fn check_frag_non_malleable<Pk, Ctx>(
        _frag: &Terminal<Pk, Ctx>
    ) -> Result<(), ScriptContextError>
    where
        Ctx: ScriptContext,
        Pk: MiniscriptKey
;
fn check_frag_validity<Pk, Ctx>(
        _frag: &Terminal<Pk, Ctx>
    ) -> Result<(), ScriptContextError>
    where
        Ctx: ScriptContext,
        Pk: MiniscriptKey
; }

Required methods

fn check_frag_non_malleable<Pk, Ctx>(
    _frag: &Terminal<Pk, Ctx>
) -> Result<(), ScriptContextError> where
    Ctx: ScriptContext,
    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.

fn check_frag_validity<Pk, Ctx>(
    _frag: &Terminal<Pk, Ctx>
) -> Result<(), ScriptContextError> where
    Ctx: ScriptContext,
    Pk: MiniscriptKey

Depending on script Context, some of the Terminals might not be valid. For example, in Segwit Context with MiniscriptKey as bitcoin::PublicKey uncompressed public keys are non-standard and thus invalid. Post Tapscript upgrade, this would have to consider other nodes. This does not recursively check

Loading content...

Implementors

impl ScriptContext for Legacy

impl ScriptContext for Segwitv0

Loading content...