Bitcoin Core 28.99.0
P2P Digital Currency
|
A data structure to help the calculation of stack size limits. More...
#include <miniscript.h>
Public Member Functions | |
constexpr | SatInfo () noexcept |
Empty script set. More... | |
constexpr | SatInfo (int32_t in_netdiff, int32_t in_exec) noexcept |
Script set with a single script in it, with specified netdiff and exec. More... | |
Static Public Member Functions | |
static constexpr SatInfo | Empty () noexcept |
The empty script. More... | |
static constexpr SatInfo | Push () noexcept |
A script consisting of a single push opcode. More... | |
static constexpr SatInfo | Hash () noexcept |
A script consisting of a single hash opcode. More... | |
static constexpr SatInfo | Nop () noexcept |
A script consisting of just a repurposed nop (OP_CHECKLOCKTIMEVERIFY, OP_CHECKSEQUENCEVERIFY). More... | |
static constexpr SatInfo | If () noexcept |
A script consisting of just OP_IF or OP_NOTIF. More... | |
static constexpr SatInfo | BinaryOp () noexcept |
A script consisting of just a binary operator (OP_BOOLAND, OP_BOOLOR, OP_ADD). More... | |
static constexpr SatInfo | OP_DUP () noexcept |
static constexpr SatInfo | OP_IFDUP (bool nonzero) noexcept |
static constexpr SatInfo | OP_EQUALVERIFY () noexcept |
static constexpr SatInfo | OP_EQUAL () noexcept |
static constexpr SatInfo | OP_SIZE () noexcept |
static constexpr SatInfo | OP_CHECKSIG () noexcept |
static constexpr SatInfo | OP_0NOTEQUAL () noexcept |
static constexpr SatInfo | OP_VERIFY () noexcept |
Public Attributes | |
const bool | valid |
Whether a canonical satisfaction/dissatisfaction is possible at all. More... | |
const int32_t | netdiff |
How much higher the stack size at start of execution can be compared to at the end. More... | |
const int32_t | exec |
Mow much higher the stack size can be during execution compared to at the end. More... | |
Friends | |
constexpr friend SatInfo | operator| (const SatInfo &a, const SatInfo &b) noexcept |
Script set union. More... | |
constexpr friend SatInfo | operator+ (const SatInfo &a, const SatInfo &b) noexcept |
Script set concatenation. More... | |
A data structure to help the calculation of stack size limits.
Conceptually, every SatInfo object corresponds to a (possibly empty) set of script execution traces (sequences of opcodes).
Its fields are:
This allows us to build up stack size limits for any script efficiently, by starting from the individual opcodes miniscripts correspond to, using concatenation to construct scripts, and using the union operation to choose between execution branches. Since any top-level script satisfaction ends with a single stack element, we know that for a full script:
Mathematically, SatInfo forms a semiring:
Definition at line 422 of file miniscript.h.
|
inlineconstexprnoexcept |
Empty script set.
Definition at line 431 of file miniscript.h.
|
inlineconstexprnoexcept |
Script set with a single script in it, with specified netdiff and exec.
Definition at line 434 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
A script consisting of just a binary operator (OP_BOOLAND, OP_BOOLOR, OP_ADD).
Definition at line 469 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
The empty script.
Definition at line 459 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
A script consisting of a single hash opcode.
Definition at line 463 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
A script consisting of just OP_IF or OP_NOTIF.
Note that OP_ELSE and OP_ENDIF have no stack effect.
Definition at line 467 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
A script consisting of just a repurposed nop (OP_CHECKLOCKTIMEVERIFY, OP_CHECKSEQUENCEVERIFY).
Definition at line 465 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
Definition at line 478 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
Definition at line 477 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
Definition at line 472 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
Definition at line 475 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
Definition at line 474 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
Definition at line 473 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
Definition at line 476 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
Definition at line 479 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
A script consisting of a single push opcode.
Definition at line 461 of file miniscript.h.
Script set concatenation.
Definition at line 448 of file miniscript.h.
Script set union.
Definition at line 438 of file miniscript.h.
const int32_t miniscript::internal::SatInfo::exec |
Mow much higher the stack size can be during execution compared to at the end.
Definition at line 428 of file miniscript.h.
const int32_t miniscript::internal::SatInfo::netdiff |
How much higher the stack size at start of execution can be compared to at the end.
Definition at line 426 of file miniscript.h.
const bool miniscript::internal::SatInfo::valid |
Whether a canonical satisfaction/dissatisfaction is possible at all.
Definition at line 424 of file miniscript.h.