Module elements_miniscript::extensions
source · Expand description
Extensions to elements-miniscript
Users should implement the Extension trait to extend miniscript to have newer leaf nodes
Look at examples for implementation of ver_eq fragment
Re-exports
pub use self::param::ArgFromStr;pub use self::param::CovExtArgs;pub use self::param::ExtParam;pub use self::param::NoExtParam;
Modules
- Parameters to certain covenants
Structs
- Wrapper around [
ArithInner] that ensures that the expression is valid. See [ArithInner] for more details. - CheckSigFromStack struct
<msg> <pk> CHECKSIGFROMSTACK - Wrapper around XOnlyKeys used in CheckSigfromstack
- Wrapper around CheckSigFromStack signature messages
ExprInnerwith some values cached- Failed to extract a token from an iterator of tokens
- Prefix is initally encoded in the script pubkey User provides a suffix such that hash of (prefix || suffix) is equal to hashOutputs Since, there is a policy restriction that initial pushes must be only 80 bytes, we need user to provide suffix in separate items There can be atmost 7 cats, because the script element must be less than 520 bytes total in order to compute an hash256 on it. Even if the witness does not require 7 pushes, the user should push 7 elements with possibly empty values.
- Version struct
DEPTH <12> SUB PICK <num> EQUAL - Wrapper around
elements::Scriptfor representing script pubkeys - A satisfier for Covenant descriptors that can do transaction introspection ’tx denotes the lifetime of the transaction being satisfied and ’ptx denotes the lifetime of the previous transaction inputs
Enums
- Enum representing operations with transaction assets. Every variant of this enum pushes a 32 byte asset + 1 byte prefix on stack top.. These operations also support confidential assets. This will abort when - Supplied index is out of bounds.
- Miniscript Fragment containing arith expressions Expr cannot be directly used a miniscript fragment because it pushes a 64 bit value on stack. Two expressions can be combined with Arith to something is of Base type B to be used in miniscript expressions
- All known Extensions for elements-miniscript
- Evaluation Errors
- Enum representing arithmetic operations with transaction amounts. Every variant of this enum pushes a single singed 64 bit BE number on stack top. All of introspection opcodes explicitly assert the amount is explicit.
- Enum representing operations with input/output indexes. Pushes a single CScriptNum on stack top. This is used to represent the index of the input or output.
- No Extensions for elements-miniscript All the implementations for the this function are unreachable
- Enum representing operations with transaction script pubkeys. Every variant of this enum pushes a witness program + 1 byte witness version on stack top. If the script pubkey is not a witness program. Push a sha256 hash of the script pubkey followed by -1 witness version This will abort when - Supplied index is out of bounds.
- Enum representing operations with transaction values. Every variant of this enum pushes a 32 byte value + 1 byte prefix on stack top.. These operations also support confidential values. This will abort when - Supplied index is out of bounds.
Traits
- Extensions to elements-miniscript. Refer to implementations(unimplemented!) for example and tutorials
- Support for parsing/serializing/satisfaction of extensions.
Extensiontrait reasons about extension in abstract way whereas this trait reasons about the concrete data structures. Extension is similar toMiniscriptKey, whereas ParseableExt is similar toToPublicKey.
Functions
- API to check sig from fragment
price_oracle_1 - [
secp256k1_zkp::Message] for fragmentprice_oracle_1. To be used in for signing with schnorr signatures.