[][src]Module miniscript::descriptor

Output Descriptors

Tools for representing Bitcoin output's scriptPubKeys as abstract spending policies known as "output descriptors". These include a Miniscript which describes the actual signing policy, as well as the blockchain format (P2SH, Segwit v0, etc.)

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

Structs

DescriptorKeyParseError
DescriptorSinglePub
DescriptorXPub
SatisfiedConstraints

An iterator over all the satisfied constraints satisfied by a given descriptor/scriptSig/witness stack tuple. This returns all the redundant satisfied constraints even if they were not required for the entire satisfaction. For example, and_b(Pk,false) would return the witness for Pk if it was satisfied even if the entire and_b could have failed. In case the script would abort on the given witness stack OR if the entire script is dissatisfied, this would return keep on returning values _until_Error.

Stack

Stack Data structure representing the stack input to Miniscript. This Stack is created from the combination of ScriptSig and Witness stack.

Enums

Descriptor

Script descriptor

DescriptorPublicKey
InterpreterError

Detailed Error type for Interpreter

SatisfiedConstraint

A satisfied Miniscript condition (Signature, Hashlock, Timelock) 'desc represents the lifetime of descriptor and `stack represents the lifetime of witness

Functions

from_txin_with_witness_stack

Figures out the the type of descriptor based on scriptpubkey, witness and scriptsig. Outputs a Descriptor and Stack which can be directly fed into the interpreter. All script_sig and witness are translated into a single witness stack.