6 #ifndef BITCOIN_SCRIPT_INTERPRETER_H 7 #define BITCOIN_SCRIPT_INTERPRETER_H 170 void Init(
const T& tx, std::vector<CTxOut>&& spent_outputs);
187 bool m_tapleaf_hash_init =
false;
192 bool m_codeseparator_pos_init =
false;
197 bool m_annex_init =
false;
204 bool m_validation_weight_left_init =
false;
260 virtual bool VerifyECDSASignature(
const std::vector<unsigned char>& vchSig,
const CPubKey& vchPubKey,
const uint256& sighash)
const;
266 bool CheckECDSASignature(
const std::vector<unsigned char>& scriptSig,
const std::vector<unsigned char>& vchPubKey,
const CScript& scriptCode,
SigVersion sigversion)
const override;
268 bool CheckLockTime(
const CScriptNum& nLockTime)
const override;
269 bool CheckSequence(
const CScriptNum& nSequence)
const override;
283 #endif // BITCOIN_SCRIPT_INTERPRETER_H virtual bool CheckECDSASignature(const std::vector< unsigned char > &scriptSig, const std::vector< unsigned char > &vchPubKey, const CScript &scriptCode, SigVersion sigversion) const
Witness v0 (P2WPKH and P2WSH); see BIP 141.
virtual bool CheckLockTime(const CScriptNum &nLockTime) const
virtual ~BaseSignatureChecker()
Witness v1 with 32-byte program, not BIP16 P2SH-wrapped, key path spending; see BIP 341...
bool VerifyScript(const CScript &scriptSig, const CScript &scriptPubKey, const CScriptWitness *witness, unsigned int flags, const BaseSignatureChecker &checker, ScriptError *serror=nullptr)
enum ScriptError_t ScriptError
static constexpr size_t WITNESS_V1_TAPROOT_SIZE
GenericTransactionSignatureChecker(const T *txToIn, unsigned int nInIn, const CAmount &amountIn, const PrecomputedTransactionData &txdataIn)
uint256 m_spent_amounts_single_hash
bool m_annex_present
Whether an annex is present.
uint256 SignatureHash(const CScript &scriptCode, const T &txTo, unsigned int nIn, int nHashType, const CAmount &amount, SigVersion sigversion, const PrecomputedTransactionData *cache=nullptr)
GenericTransactionSignatureChecker(const T *txToIn, unsigned int nInIn, const CAmount &amountIn)
int64_t m_validation_weight_left
How much validation weight is left (decremented for every successful non-empty signature check)...
std::vector< CTxOut > m_spent_outputs
static constexpr uint8_t TAPROOT_LEAF_TAPSCRIPT
bool CheckSignatureEncoding(const std::vector< unsigned char > &vchSig, unsigned int flags, ScriptError *serror)
Bare scripts and BIP16 P2SH-wrapped redeemscripts.
Witness v1 with 32-byte program, not BIP16 P2SH-wrapped, script path spending, leaf version 0xc0; see...
static constexpr size_t TAPROOT_CONTROL_BASE_SIZE
Taproot only; implied when sighash byte is missing, and equivalent to SIGHASH_ALL.
uint32_t m_codeseparator_pos
Opcode position of the last executed OP_CODESEPARATOR (or 0xFFFFFFFF if none executed).
static constexpr size_t TAPROOT_CONTROL_NODE_SIZE
int64_t CAmount
Amount in satoshis (Can be negative)
uint256 m_tapleaf_hash
The tapleaf hash.
const PrecomputedTransactionData * txdata
static constexpr uint8_t TAPROOT_LEAF_MASK
An encapsulated public key.
bool m_bip143_segwit_ready
Whether the 3 fields above are initialized.
virtual bool CheckSchnorrSignature(Span< const unsigned char > sig, Span< const unsigned char > pubkey, SigVersion sigversion, const ScriptExecutionData &execdata, ScriptError *serror=nullptr) const
uint256 m_outputs_single_hash
bool EvalScript(std::vector< std::vector< unsigned char > > &stack, const CScript &script, unsigned int flags, const BaseSignatureChecker &checker, SigVersion sigversion, ScriptExecutionData &execdata, ScriptError *error=nullptr)
An output of a transaction.
static constexpr size_t WITNESS_V0_SCRIPTHASH_SIZE
Signature hash sizes.
bool m_bip341_taproot_ready
Whether the 5 fields above are initialized.
static constexpr size_t TAPROOT_CONTROL_MAX_SIZE
static constexpr size_t TAPROOT_CONTROL_MAX_NODE_COUNT
size_t CountWitnessSigOps(const CScript &scriptSig, const CScript &scriptPubKey, const CScriptWitness *witness, unsigned int flags)
Serialized script, used inside transaction inputs and outputs.
static constexpr size_t WITNESS_V0_KEYHASH_SIZE
bool m_spent_outputs_ready
Whether m_spent_outputs is initialized.
virtual bool CheckSequence(const CScriptNum &nSequence) const
int FindAndDelete(CScript &script, const CScript &b)
PrecomputedTransactionData()=default
A Span is an object that can refer to a contiguous sequence of objects.
The basic transaction that is broadcasted on the network and contained in blocks. ...
uint256 m_spent_scripts_single_hash
void Init(const T &tx, std::vector< CTxOut > &&spent_outputs)
uint256 m_sequences_single_hash
uint256 m_prevouts_single_hash
bool error(const char *fmt, const Args &... args)
uint256 m_annex_hash
Hash of the annex data.