Changeset View
Changeset View
Standalone View
Standalone View
src/script/script_flags.h
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Copyright (c) 2017-2018 The Bitcoin developers | // Copyright (c) 2017-2018 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_SCRIPT_SCRIPTFLAGS_H | #ifndef BITCOIN_SCRIPT_SCRIPTFLAGS_H | ||||
#define BITCOIN_SCRIPT_SCRIPTFLAGS_H | #define BITCOIN_SCRIPT_SCRIPTFLAGS_H | ||||
/** Script verification flags */ | /** Script verification flags */ | ||||
enum { | enum { | ||||
SCRIPT_VERIFY_NONE = 0, | SCRIPT_VERIFY_NONE = 0, | ||||
// Evaluate P2SH subscripts (softfork safe, BIP16). | // Evaluate P2SH subscripts (softfork safe, BIP16). | ||||
// Note: The Segwit Recovery feature is an exception to P2SH | |||||
SCRIPT_VERIFY_P2SH = (1U << 0), | SCRIPT_VERIFY_P2SH = (1U << 0), | ||||
// Passing a non-strict-DER signature or one with undefined hashtype to a | // Passing a non-strict-DER signature or one with undefined hashtype to a | ||||
// checksig operation causes script failure. Evaluating a pubkey that is not | // checksig operation causes script failure. Evaluating a pubkey that is not | ||||
// (0x04 + 64 bytes) or (0x02 or 0x03 + 32 bytes) by checksig causes script | // (0x04 + 64 bytes) or (0x02 or 0x03 + 32 bytes) by checksig causes script | ||||
// failure. | // failure. | ||||
SCRIPT_VERIFY_STRICTENC = (1U << 1), | SCRIPT_VERIFY_STRICTENC = (1U << 1), | ||||
Show All 35 Lines | enum { | ||||
// Require that only a single stack element remains after evaluation. This | // Require that only a single stack element remains after evaluation. This | ||||
// changes the success criterion from "At least one stack element must | // changes the success criterion from "At least one stack element must | ||||
// remain, and when interpreted as a boolean, it must be true" to "Exactly | // remain, and when interpreted as a boolean, it must be true" to "Exactly | ||||
// one stack element must remain, and when interpreted as a boolean, it must | // one stack element must remain, and when interpreted as a boolean, it must | ||||
// be true". | // be true". | ||||
// (softfork safe, BIP62 rule 6) | // (softfork safe, BIP62 rule 6) | ||||
// Note: CLEANSTACK should never be used without P2SH or WITNESS. | // Note: CLEANSTACK should never be used without P2SH or WITNESS. | ||||
// Note: The Segwit Recovery feature is an exception to CLEANSTACK | |||||
SCRIPT_VERIFY_CLEANSTACK = (1U << 8), | SCRIPT_VERIFY_CLEANSTACK = (1U << 8), | ||||
// Verify CHECKLOCKTIMEVERIFY | // Verify CHECKLOCKTIMEVERIFY | ||||
// | // | ||||
// See BIP65 for details. | // See BIP65 for details. | ||||
SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY = (1U << 9), | SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY = (1U << 9), | ||||
// support CHECKSEQUENCEVERIFY opcode | // support CHECKSEQUENCEVERIFY opcode | ||||
Show All 27 Lines | enum { | ||||
// | // | ||||
SCRIPT_VERIFY_CHECKDATASIG_SIGOPS = (1U << 18), | SCRIPT_VERIFY_CHECKDATASIG_SIGOPS = (1U << 18), | ||||
// Are Schnorr signatures enabled for OP_CHECK(DATA)SIG(VERIFY) and | // Are Schnorr signatures enabled for OP_CHECK(DATA)SIG(VERIFY) and | ||||
// 65-byte signatures banned for OP_CHECKMULTISIG(VERIFY)? | // 65-byte signatures banned for OP_CHECKMULTISIG(VERIFY)? | ||||
// | // | ||||
SCRIPT_ENABLE_SCHNORR = (1U << 19), | SCRIPT_ENABLE_SCHNORR = (1U << 19), | ||||
// Allows the recovery of coins sent to p2sh segwit addresses | // The exception to CLEANSTACK and P2SH for the recovery of coins sent | ||||
SCRIPT_ALLOW_SEGWIT_RECOVERY = (1U << 20), | // to p2sh segwit addresses is not allowed. | ||||
SCRIPT_DISALLOW_SEGWIT_RECOVERY = (1U << 20), | |||||
}; | }; | ||||
#endif // BITCOIN_SCRIPT_SCRIPTFLAGS_H | #endif // BITCOIN_SCRIPT_SCRIPTFLAGS_H |