Expand description

Script Policies

Tools for representing Bitcoin scriptpubkeys as abstract spending policies. These may be compiled to Miniscript, which contains extra information to describe the exact representation as Bitcoin script.

The format represents EC public keys abstractly to allow wallets to replace these with BIP32 paths, pay-to-contract instructions, etc.

Re-exports

pub use self::concrete::Policy as Concrete;
pub use self::semantic::Policy as Semantic;

Modules

Concrete Policies

Abstract Policies

Enums

Detailed Error type for Policies

Traits

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.Miniscript], [descriptor.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 it contains a timelock combination. It is possible that 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.