Bitcoin Core 28.99.0
P2P Digital Currency
|
#include <algorithm>
#include <compare>
#include <cstdint>
#include <cstdlib>
#include <iterator>
#include <memory>
#include <optional>
#include <set>
#include <stdexcept>
#include <tuple>
#include <utility>
#include <vector>
#include <consensus/consensus.h>
#include <policy/policy.h>
#include <script/interpreter.h>
#include <script/parsing.h>
#include <script/script.h>
#include <serialize.h>
#include <span.h>
#include <util/check.h>
#include <util/strencodings.h>
#include <util/string.h>
#include <util/vector.h>
Go to the source code of this file.
Classes | |
class | miniscript::Type |
This type encapsulates the miniscript type system properties. More... | |
struct | miniscript::internal::InputStack |
An object representing a sequence of witness stack elements. More... | |
struct | miniscript::internal::InputResult |
A pair of a satisfaction and a dissatisfaction InputStack. More... | |
struct | miniscript::internal::MaxInt< I > |
Class whose objects represent the maximum of a list of integers. More... | |
struct | miniscript::internal::Ops |
struct | miniscript::internal::SatInfo |
A data structure to help the calculation of stack size limits. More... | |
struct | miniscript::internal::StackSize |
struct | miniscript::internal::WitnessSize |
struct | miniscript::internal::NoDupCheck |
struct | miniscript::Node< Key > |
A node in a miniscript expression. More... | |
Namespaces | |
namespace | miniscript |
namespace | miniscript::internal |
Typedefs | |
using | miniscript::Opcode = std::pair< opcodetype, std::vector< unsigned char > > |
template<typename Key > | |
using | miniscript::NodeRef = std::shared_ptr< const Node< Key > > |
Functions | |
consteval Type | miniscript::operator""_mst (const char *c, size_t l) |
Literal operator to construct Type objects. More... | |
template<typename Key , typename... Args> | |
NodeRef< Key > | miniscript::MakeNodeRef (Args &&... args) |
Construct a miniscript node as a shared_ptr. More... | |
constexpr bool | miniscript::IsTapscript (MiniscriptContext ms_ctx) |
Whether the context Tapscript, ensuring the only other possibility is P2WSH. More... | |
constexpr uint32_t | miniscript::internal::MaxScriptSize (MiniscriptContext ms_ctx) |
The maximum size of a script depending on the context. More... | |
Type | miniscript::internal::ComputeType (Fragment fragment, Type x, Type y, Type z, const std::vector< Type > &sub_types, uint32_t k, size_t data_size, size_t n_subs, size_t n_keys, MiniscriptContext ms_ctx) |
Helper function for Node::CalcType. More... | |
size_t | miniscript::internal::ComputeScriptLen (Fragment fragment, Type sub0typ, size_t subsize, uint32_t k, size_t n_subs, size_t n_keys, MiniscriptContext ms_ctx) |
Helper function for Node::CalcScriptLen. More... | |
Type | miniscript::internal::SanitizeType (Type x) |
A helper sanitizer/checker for the output of CalcType. More... | |
int | miniscript::internal::FindNextChar (Span< const char > sp, const char m) |
template<typename Key , typename Ctx > | |
std::optional< std::pair< Key, int > > | miniscript::internal::ParseKeyEnd (Span< const char > in, const Ctx &ctx) |
Parse a key string ending at the end of the fragment's text representation. More... | |
template<typename Ctx > | |
std::optional< std::pair< std::vector< unsigned char >, int > > | miniscript::internal::ParseHexStrEnd (Span< const char > in, const size_t expected_size, const Ctx &ctx) |
Parse a hex string ending at the end of the fragment's text representation. More... | |
template<typename Key > | |
void | miniscript::internal::BuildBack (const MiniscriptContext script_ctx, Fragment nt, std::vector< NodeRef< Key > > &constructed, const bool reverse=false) |
BuildBack pops the last two elements off constructed and wraps them in the specified Fragment. More... | |
template<typename Key , typename Ctx > | |
NodeRef< Key > | miniscript::internal::Parse (Span< const char > in, const Ctx &ctx) |
Parse a miniscript from its textual descriptor form. More... | |
std::optional< std::vector< Opcode > > | miniscript::internal::DecomposeScript (const CScript &script) |
Decode a script into opcode/push pairs. More... | |
std::optional< int64_t > | miniscript::internal::ParseScriptNumber (const Opcode &in) |
Determine whether the passed pair (created by DecomposeScript) is pushing a number. More... | |
template<typename Key , typename Ctx , typename I > | |
NodeRef< Key > | miniscript::internal::DecodeScript (I &in, I last, const Ctx &ctx) |
Parse a miniscript from a bitcoin script. More... | |
template<typename Ctx > | |
NodeRef< typename Ctx::Key > | miniscript::FromString (const std::string &str, const Ctx &ctx) |
template<typename Ctx > | |
NodeRef< typename Ctx::Key > | miniscript::FromScript (const CScript &script, const Ctx &ctx) |
Variables | |
static constexpr uint32_t | miniscript::internal::MAX_TAPMINISCRIPT_STACK_ELEM_SIZE {65} |
The maximum size of a witness item for a Miniscript under Tapscript context. (A BIP340 signature with a sighash type byte.) More... | |
constexpr uint32_t | miniscript::internal::TX_OVERHEAD {4 + 4} |
version + nLockTime More... | |
constexpr uint32_t | miniscript::internal::TXIN_BYTES_NO_WITNESS {36 + 4 + 1} |
prevout + nSequence + scriptSig More... | |
constexpr uint32_t | miniscript::internal::P2WSH_TXOUT_BYTES {8 + 1 + 1 + 33} |
nValue + script len + OP_0 + pushdata 32. More... | |
constexpr uint32_t | miniscript::internal::TX_BODY_LEEWAY_WEIGHT {(TX_OVERHEAD + GetSizeOfCompactSize(1) + TXIN_BYTES_NO_WITNESS + GetSizeOfCompactSize(1) + P2WSH_TXOUT_BYTES) * WITNESS_SCALE_FACTOR + 2} |
Data other than the witness in a transaction. Overhead + vin count + one vin + vout count + one vout + segwit marker. More... | |
constexpr uint32_t | miniscript::internal::MAX_TAPSCRIPT_SAT_SIZE {GetSizeOfCompactSize(MAX_STACK_SIZE) + (GetSizeOfCompactSize(MAX_TAPMINISCRIPT_STACK_ELEM_SIZE) + MAX_TAPMINISCRIPT_STACK_ELEM_SIZE) * MAX_STACK_SIZE + GetSizeOfCompactSize(TAPROOT_CONTROL_MAX_SIZE) + TAPROOT_CONTROL_MAX_SIZE} |
Maximum possible stack size to spend a Taproot output (excluding the script itself). More... | |
static const auto | miniscript::internal::ZERO = InputStack(std::vector<unsigned char>()) |
A stack consisting of a single zero-length element (interpreted as 0 by the script interpreter in numeric context). More... | |
static const auto | miniscript::internal::ZERO32 = InputStack(std::vector<unsigned char>(32, 0)).SetMalleable() |
A stack consisting of a single malleable 32-byte 0x0000...0000 element (for dissatisfying hash challenges). More... | |
static const auto | miniscript::internal::ONE = InputStack(Vector((unsigned char)1)) |
A stack consisting of a single 0x01 element (interpreted as 1 by the script interpreted in numeric context). More... | |
static const auto | miniscript::internal::EMPTY = InputStack() |
The empty stack. More... | |
static const auto | miniscript::internal::INVALID = InputStack().SetAvailable(Availability::NO) |
A stack representing the lack of any (dis)satisfactions. More... | |