79 std::vector<valtype> &pubkeys) {
96 pubkeys.emplace_back(std::move(data));
102 if (pubkeys.size() != keys || keys <
required) {
105 return (it + 1 == script.
end());
117 scriptPubKey.
begin() + 22);
127 if (scriptPubKey.
size() >= 1 && scriptPubKey[0] ==
OP_RETURN &&
132 std::vector<uint8_t> data;
144 std::vector<std::vector<uint8_t>> keys;
199 for (
size_t i = 1; i <
vSolutions.size() - 1; i++) {
225class CScriptVisitor {
241 return std::visit(CScriptVisitor(), dest);
253 for (
const CPubKey &key : keys) {
261 return dest.index() != 0;
A reference to a CKey: the Hash160 of its serialized public key.
An encapsulated public key.
static constexpr unsigned int COMPRESSED_SIZE
const uint8_t * end() const
static constexpr unsigned int SIZE
secp256k1:
static bool ValidSize(const std::vector< uint8_t > &vch)
const uint8_t * begin() const
Serialized script, used inside transaction inputs and outputs.
bool IsPushOnly(const_iterator pc) const
Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical).
bool IsPayToScriptHash() const
static int DecodeOP_N(opcodetype opcode)
Encode/decode small integers:
bool GetOp(const_iterator &pc, opcodetype &opcodeRet, std::vector< uint8_t > &vchRet) const
static opcodetype EncodeOP_N(int n)
A reference to a CScript: the Hash160 of its serialization (see script.h)
uint160 Hash160(const T1 &in1)
Compute the 160-bit hash an object.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
bool CheckMinimalPush(const std::vector< uint8_t > &data, opcodetype opcode)
Check whether the given stack element data would be minimally pushed using the given opcode.
opcodetype
Script opcodes.
std::vector< uint8_t > ToByteVector(const T &in)
std::vector< uint8_t > valtype
std::vector< uint8_t > valtype
static bool MatchPayToPubkeyHash(const CScript &script, valtype &pubkeyhash)
static constexpr bool IsSmallInteger(opcodetype opcode)
Test for "small positive integer" script opcodes - OP_1 through OP_16.
CScript GetScriptForMultisig(int nRequired, const std::vector< CPubKey > &keys)
Generate a multisig script.
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a standard scriptPubKey for the destination address.
TxoutType Solver(const CScript &scriptPubKey, std::vector< std::vector< uint8_t > > &vSolutionsRet)
Parse a scriptPubKey and identify script type for standard scripts.
std::string GetTxnOutputType(TxoutType t)
Get the name of a TxoutType as a string.
CScript GetScriptForRawPubKey(const CPubKey &pubKey)
Generate a P2PK script for the given pubkey.
bool ExtractDestinations(const CScript &scriptPubKey, TxoutType &typeRet, std::vector< CTxDestination > &addressRet, int &nRequiredRet)
Parse a standard scriptPubKey with one or more destination addresses.
static bool MatchPayToPubkey(const CScript &script, valtype &pubkey)
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination is a CNoDestination.
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
static bool MatchMultisig(const CScript &script, unsigned int &required, std::vector< valtype > &pubkeys)
CKeyID ToKeyID(const PKHash &key_hash)
std::variant< CNoDestination, PKHash, ScriptHash > CTxDestination
A txout script template with a specific destination.