82 std::vector<valtype> &pubkeys) {
99 pubkeys.emplace_back(std::move(data));
105 if (pubkeys.size() != keys || keys < required) {
108 return (it + 1 == script.
end());
112 std::vector<std::vector<uint8_t>> &vSolutionsRet) {
113 vSolutionsRet.clear();
119 std::vector<uint8_t> hashBytes(scriptPubKey.
begin() + 2,
120 scriptPubKey.
begin() + 22);
121 vSolutionsRet.push_back(hashBytes);
130 if (scriptPubKey.
size() >= 1 && scriptPubKey[0] ==
OP_RETURN &&
135 std::vector<uint8_t> data;
137 vSolutionsRet.push_back(std::move(data));
142 vSolutionsRet.push_back(std::move(data));
146 unsigned int required;
147 std::vector<std::vector<uint8_t>> keys;
150 vSolutionsRet.push_back({
static_cast<uint8_t
>(required)});
151 vSolutionsRet.insert(vSolutionsRet.end(), keys.begin(), keys.end());
153 vSolutionsRet.push_back({
static_cast<uint8_t
>(keys.size())});
157 vSolutionsRet.clear();
163 std::vector<valtype> vSolutions;
172 addressRet =
PKHash(pubKey);
188 std::vector<CTxDestination> &addressRet,
191 std::vector<valtype> vSolutions;
192 typeRet =
Solver(scriptPubKey, vSolutions);
201 nRequiredRet = vSolutions.front()[0];
202 for (
size_t i = 1; i < vSolutions.size() - 1; i++) {
209 addressRet.push_back(address);
212 if (addressRet.empty()) {
221 addressRet.push_back(address);
228 class CScriptVisitor :
public boost::static_visitor<CScript> {
244 return boost::apply_visitor(CScriptVisitor(), dest);
256 for (
const CPubKey &key : keys) {
264 return dest.which() != 0;
A reference to a CKey: the Hash160 of its serialized public key.
An encapsulated public key.
const uint8_t * begin() const
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)
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.
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.
std::vector< uint8_t > ToByteVector(const T &in)
opcodetype
Script opcodes.
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.
bool fAcceptDatacarrier
A data carrying output is an unspendable output containing data.
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.
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.
TxoutType Solver(const CScript &scriptPubKey, std::vector< std::vector< uint8_t >> &vSolutionsRet)
Parse a scriptPubKey and identify script type for standard scripts.
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)
boost::variant< CNoDestination, PKHash, ScriptHash > CTxDestination
A txout script template with a specific destination.
static const bool DEFAULT_ACCEPT_DATACARRIER