Skip to main content

Liftable

Trait Liftable 

Source
pub trait Liftable<Pk: MiniscriptKey> {
    // Required method
    fn lift(&self) -> Result<Semantic<Pk>, Error>;
}
Expand description

Trait describing script representations which can be lifted into an abstract policy, by discarding information.

After Lifting all policies are converted into KeyHash(Pk::HasH) to maintain the following invariant(modulo resource limits): Lift(Concrete) == Concrete -> Miniscript -> Script -> Miniscript -> Semantic

Lifting from Miniscript or Descriptor can fail if the miniscript contains a timelock combination or if it contains a branch that exceeds resource limits.

Lifting from concrete policies can fail if the policy contains a timelock combination. It is possible that a concrete policy has some branches that exceed resource limits for any compilation but cannot detect such policies while lifting. Note that our compiler would not succeed for any such policies.

Required Methods§

Source

fn lift(&self) -> Result<Semantic<Pk>, Error>

Converts this object into an abstract policy.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<Pk: MiniscriptKey> Liftable<Pk> for Arc<Concrete<Pk>>

Source§

fn lift(&self) -> Result<Semantic<Pk>, Error>

Implementors§

Source§

impl<Pk: MiniscriptKey, Ctx: ScriptContext> Liftable<Pk> for Miniscript<Pk, Ctx>

Source§

impl<Pk: MiniscriptKey, Ctx: ScriptContext> Liftable<Pk> for SortedMultiVec<Pk, Ctx>

Source§

impl<Pk: MiniscriptKey> Liftable<Pk> for Bare<Pk>

Source§

impl<Pk: MiniscriptKey> Liftable<Pk> for Concrete<Pk>

Source§

impl<Pk: MiniscriptKey> Liftable<Pk> for Descriptor<Pk>

Source§

impl<Pk: MiniscriptKey> Liftable<Pk> for Pkh<Pk>

Source§

impl<Pk: MiniscriptKey> Liftable<Pk> for Semantic<Pk>

Source§

impl<Pk: MiniscriptKey> Liftable<Pk> for Sh<Pk>

Source§

impl<Pk: MiniscriptKey> Liftable<Pk> for TapTree<Pk>

Source§

impl<Pk: MiniscriptKey> Liftable<Pk> for Tr<Pk>

Source§

impl<Pk: MiniscriptKey> Liftable<Pk> for Wpkh<Pk>

Source§

impl<Pk: MiniscriptKey> Liftable<Pk> for Wsh<Pk>