![]() |
Bitcoin Core 30.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 439 of file miniscript.h.
|
inlineconstexprnoexcept |
Empty script set.
Definition at line 448 of file miniscript.h.
|
inlineconstexprnoexcept |
Script set with a single script in it, with specified netdiff and exec.
Definition at line 451 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
A script consisting of just a binary operator (OP_BOOLAND, OP_BOOLOR, OP_ADD).
Definition at line 486 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
The empty script.
Definition at line 476 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
A script consisting of a single hash opcode.
Definition at line 480 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 484 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
A script consisting of just a repurposed nop (OP_CHECKLOCKTIMEVERIFY, OP_CHECKSEQUENCEVERIFY).
Definition at line 482 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
Definition at line 495 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
Definition at line 494 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
Definition at line 489 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
Definition at line 492 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
Definition at line 491 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
Definition at line 490 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
Definition at line 493 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
Definition at line 496 of file miniscript.h.
|
inlinestaticconstexprnoexcept |
A script consisting of a single push opcode.
Definition at line 478 of file miniscript.h.
Script set concatenation.
Definition at line 465 of file miniscript.h.
Script set union.
Definition at line 455 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 445 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 443 of file miniscript.h.
| const bool miniscript::internal::SatInfo::valid |
Whether a canonical satisfaction/dissatisfaction is possible at all.
Definition at line 441 of file miniscript.h.