Module miniscript::plan

source ·
Expand description

A spending plan or plan for short is a representation of a particular spending path on a descriptor. This allows us to analayze a choice of spending path without producing any signatures or other witness data for it.

To make a plan you provide the descriptor with “assets” like which keys you are able to use, hash pre-images you have access to, absolute/relative timelock constraints etc.

Once you’ve got a plan it can tell you its expected satisfaction weight which can be useful for doing coin selection. Furthermore it provides which subset of those keys and hash pre-images you will actually need as well as what locktime or sequence number you need to set.

Once you’ve obtained signatures, hash pre-images etc required by the plan, it can create a witness/script_sig for the input.

Structs

  • The Assets we can use to satisfy a particular spending path
  • Signatures which a key can produce
  • Wrapper around Assets that logs every query and value returned
  • Representation of a particular spending path on a descriptor. Contains the witness template and the timelocks needed for satisfying the plan. Calling plan on a Descriptor will return this structure, containing the cheapest spending path possible (considering the Assets given)
  • Signatures which a taproot key can produce

Enums

Traits

  • Trait describing a present/missing lookup table for constructing witness templates
  • Conversion into a Assets