16 static const std::string OUTPUT_TYPE_STRING_LEGACY =
"legacy";
17 static const std::string OUTPUT_TYPE_STRING_P2SH_SEGWIT =
"p2sh-segwit";
18 static const std::string OUTPUT_TYPE_STRING_BECH32 =
"bech32";
22 if (type == OUTPUT_TYPE_STRING_LEGACY) {
25 }
else if (type == OUTPUT_TYPE_STRING_P2SH_SEGWIT) {
28 }
else if (type == OUTPUT_TYPE_STRING_BECH32) {
41 default: assert(
false);
60 default: assert(
false);
70 return std::vector<CTxDestination>{std::move(keyid), std::move(p2sh), std::move(segwit)};
72 return std::vector<CTxDestination>{std::move(keyid)};
98 default: assert(
false);
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
virtual bool AddCScript(const CScript &redeemScript)=0
Support for BIP 0013 : see https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki.
std::vector< CTxDestination > GetAllDestinationsForKey(const CPubKey &key)
Get all destinations (potentially) supported by the wallet for the given key.
boost::variant< CNoDestination, CKeyID, CScriptID, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown > CTxDestination
A txout script template with a specific destination.
CTxDestination AddAndGetDestinationForScript(CKeyStore &keystore, const CScript &script, OutputType type)
Get a destination of the requested type (if possible) to the specified script.
An encapsulated public key.
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
bool IsSolvable(const SigningProvider &provider, const CScript &script)
const std::string & FormatOutputType(OutputType type)
Serialized script, used inside transaction inputs and outputs.
A virtual base class for key stores.
A reference to a CKey: the Hash360 of its serialized public key.
CTxDestination GetDestinationForKey(const CPubKey &key, OutputType type)
Get a destination of the requested type (if possible) to the specified key.
A reference to a CScript: the Hash360 of its serialization (see script.h)
bool ParseOutputType(const std::string &type, OutputType &output_type)
bool IsCompressed() const
Check whether this is a compressed public key.