Bitcoin ABC  0.22.13
P2P Digital Currency
script_flags.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2016 The Bitcoin Core developers
3 // Copyright (c) 2017-2020 The Bitcoin developers
4 // Distributed under the MIT software license, see the accompanying
5 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6 
7 #ifndef BITCOIN_SCRIPT_SCRIPT_FLAGS_H
8 #define BITCOIN_SCRIPT_SCRIPT_FLAGS_H
9 
11 enum {
13 
14  // Evaluate P2SH subscripts (softfork safe, BIP16).
15  // Note: The Segwit Recovery feature is an exception to P2SH
16  SCRIPT_VERIFY_P2SH = (1U << 0),
17 
18  // Passing a non-strict-DER signature or one with undefined hashtype to a
19  // checksig operation causes script failure. Evaluating a pubkey that is not
20  // (0x04 + 64 bytes) or (0x02 or 0x03 + 32 bytes) by checksig causes script
21  // failure.
23 
24  // Passing a non-strict-DER signature to a checksig operation causes script
25  // failure (BIP62 rule 1)
26  SCRIPT_VERIFY_DERSIG = (1U << 2),
27 
28  // Passing a non-strict-DER signature or one with S > order/2 to a checksig
29  // operation causes script failure
30  // (BIP62 rule 5).
31  SCRIPT_VERIFY_LOW_S = (1U << 3),
32 
33  // Using a non-push operator in the scriptSig causes script failure
34  // (BIP62 rule 2).
36 
37  // Require minimal encodings for all push operations (OP_0... OP_16,
38  // OP_1NEGATE where possible, direct pushes up to 75 bytes, OP_PUSHDATA up
39  // to 255 bytes, OP_PUSHDATA2 for anything larger). Evaluating any other
40  // push causes the script to fail (BIP62 rule 3). In addition, whenever a
41  // stack element is interpreted as a number, it must be of minimal length
42  // (BIP62 rule 4).
44 
45  // Discourage use of NOPs reserved for upgrades (NOP1-10)
46  //
47  // Provided so that nodes can avoid accepting or mining transactions
48  // containing executed NOP's whose meaning may change after a soft-fork,
49  // thus rendering the script invalid; with this flag set executing
50  // discouraged NOPs fails the script. This verification flag will never be a
51  // mandatory flag applied to scripts in a block. NOPs that are not executed,
52  // e.g. within an unexecuted IF ENDIF block, are *not* rejected.
54 
55  // Require that only a single stack element remains after evaluation. This
56  // changes the success criterion from "At least one stack element must
57  // remain, and when interpreted as a boolean, it must be true" to "Exactly
58  // one stack element must remain, and when interpreted as a boolean, it must
59  // be true".
60  // (BIP62 rule 6)
61  // Note: CLEANSTACK should never be used without P2SH.
62  // Note: The Segwit Recovery feature is an exception to CLEANSTACK
64 
65  // Verify CHECKLOCKTIMEVERIFY
66  //
67  // See BIP65 for details.
69 
70  // support CHECKSEQUENCEVERIFY opcode
71  //
72  // See BIP112 for details
74 
75  // Require the argument of OP_IF/NOTIF to be exactly 0x01 or empty vector
76  //
78 
79  // Signature(s) must be empty vector if an CHECK(MULTI)SIG operation failed
80  //
81  SCRIPT_VERIFY_NULLFAIL = (1U << 14),
82 
83  // Do we accept signature using SIGHASH_FORKID
84  //
86 
87  // Do we accept activate replay protection using a different fork id.
88  //
90 
91  // Count sigops for OP_CHECKDATASIG and variant. The interpreter treats
92  // OP_CHECKDATASIG(VERIFY) as always valid. This flag only affects sigops
93  // counting, and will be removed during cleanup of the SigChecks upgrade.
95 
96  // The exception to CLEANSTACK and P2SH for the recovery of coins sent
97  // to p2sh segwit addresses is not allowed.
99 
100  // Whether to allow new OP_CHECKMULTISIG logic to trigger. (new multisig
101  // logic verifies faster, and only allows Schnorr signatures)
103 
104  // Require the number of sigchecks in an input to satisfy a specific
105  // bound, defined by scriptSig length.
106  // Note: The Segwit Recovery feature is a (currently moot) exception to
107  // VERIFY_INPUT_SIGCHECKS
109 
110  // A utility flag to decide whether we must enforce sigcheck limits.
112 };
113 
114 #endif // BITCOIN_SCRIPT_SCRIPT_FLAGS_H