Bitcoin ABC
0.22.13
P2P Digital Currency
src
script
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
{
12
SCRIPT_VERIFY_NONE
= 0,
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.
22
SCRIPT_VERIFY_STRICTENC
= (1U << 1),
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).
35
SCRIPT_VERIFY_SIGPUSHONLY
= (1U << 5),
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).
43
SCRIPT_VERIFY_MINIMALDATA
= (1U << 6),
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.
53
SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS
= (1U << 7),
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
63
SCRIPT_VERIFY_CLEANSTACK
= (1U << 8),
64
65
// Verify CHECKLOCKTIMEVERIFY
66
//
67
// See BIP65 for details.
68
SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY
= (1U << 9),
69
70
// support CHECKSEQUENCEVERIFY opcode
71
//
72
// See BIP112 for details
73
SCRIPT_VERIFY_CHECKSEQUENCEVERIFY
= (1U << 10),
74
75
// Require the argument of OP_IF/NOTIF to be exactly 0x01 or empty vector
76
//
77
SCRIPT_VERIFY_MINIMALIF
= (1U << 13),
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
//
85
SCRIPT_ENABLE_SIGHASH_FORKID
= (1U << 16),
86
87
// Do we accept activate replay protection using a different fork id.
88
//
89
SCRIPT_ENABLE_REPLAY_PROTECTION
= (1U << 17),
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.
94
SCRIPT_VERIFY_CHECKDATASIG_SIGOPS
= (1U << 18),
95
96
// The exception to CLEANSTACK and P2SH for the recovery of coins sent
97
// to p2sh segwit addresses is not allowed.
98
SCRIPT_DISALLOW_SEGWIT_RECOVERY
= (1U << 20),
99
100
// Whether to allow new OP_CHECKMULTISIG logic to trigger. (new multisig
101
// logic verifies faster, and only allows Schnorr signatures)
102
SCRIPT_ENABLE_SCHNORR_MULTISIG
= (1U << 21),
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
108
SCRIPT_VERIFY_INPUT_SIGCHECKS
= (1U << 22),
109
110
// A utility flag to decide whether we must enforce sigcheck limits.
111
SCRIPT_ENFORCE_SIGCHECKS
= (1U << 23),
112
};
113
114
#endif // BITCOIN_SCRIPT_SCRIPT_FLAGS_H
SCRIPT_ENABLE_SIGHASH_FORKID
Definition:
script_flags.h:85
SCRIPT_VERIFY_LOW_S
Definition:
script_flags.h:31
SCRIPT_VERIFY_INPUT_SIGCHECKS
Definition:
script_flags.h:108
SCRIPT_VERIFY_SIGPUSHONLY
Definition:
script_flags.h:35
SCRIPT_VERIFY_CHECKDATASIG_SIGOPS
Definition:
script_flags.h:94
SCRIPT_VERIFY_P2SH
Definition:
script_flags.h:16
SCRIPT_VERIFY_MINIMALDATA
Definition:
script_flags.h:43
SCRIPT_VERIFY_CLEANSTACK
Definition:
script_flags.h:63
SCRIPT_VERIFY_DERSIG
Definition:
script_flags.h:26
SCRIPT_VERIFY_STRICTENC
Definition:
script_flags.h:22
SCRIPT_DISALLOW_SEGWIT_RECOVERY
Definition:
script_flags.h:98
SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS
Definition:
script_flags.h:53
SCRIPT_VERIFY_CHECKSEQUENCEVERIFY
Definition:
script_flags.h:73
SCRIPT_VERIFY_NONE
Definition:
script_flags.h:12
SCRIPT_ENABLE_REPLAY_PROTECTION
Definition:
script_flags.h:89
SCRIPT_VERIFY_MINIMALIF
Definition:
script_flags.h:77
SCRIPT_VERIFY_NULLFAIL
Definition:
script_flags.h:81
SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY
Definition:
script_flags.h:68
SCRIPT_ENFORCE_SIGCHECKS
Definition:
script_flags.h:111
SCRIPT_ENABLE_SCHNORR_MULTISIG
Definition:
script_flags.h:102
Generated on Wed Jan 27 2021 17:36:25 for Bitcoin ABC by
1.8.13