|
27 | 27 | SIGHASH_ANYONECANPAY = 0x80,
|
28 | 28 | };
|
29 | 29 |
|
30 |
| -/** Script verification flags */ |
| 30 | +/** Script verification flags. |
| 31 | + * |
| 32 | + * All flags are intended to be soft forks: the set of acceptable scripts under |
| 33 | + * flags (A | B) is a subset of the acceptable scripts under flag (A). |
| 34 | + */ |
31 | 35 | enum
|
32 | 36 | {
|
33 | 37 | SCRIPT_VERIFY_NONE = 0,
|
34 | 38 |
|
35 |
| - // Evaluate P2SH subscripts (softfork safe, BIP16). |
| 39 | + // Evaluate P2SH subscripts (BIP16). |
36 | 40 | SCRIPT_VERIFY_P2SH = (1U << 0),
|
37 | 41 |
|
38 | 42 | // Passing a non-strict-DER signature or one with undefined hashtype to a checksig operation causes script failure.
|
39 | 43 | // Evaluating a pubkey that is not (0x04 + 64 bytes) or (0x02 or 0x03 + 32 bytes) by checksig causes script failure.
|
40 |
| - // (softfork safe, but not used or intended as a consensus rule). |
| 44 | + // (not used or intended as a consensus rule). |
41 | 45 | SCRIPT_VERIFY_STRICTENC = (1U << 1),
|
42 | 46 |
|
43 |
| - // Passing a non-strict-DER signature to a checksig operation causes script failure (softfork safe, BIP62 rule 1) |
| 47 | + // Passing a non-strict-DER signature to a checksig operation causes script failure (BIP62 rule 1) |
44 | 48 | SCRIPT_VERIFY_DERSIG = (1U << 2),
|
45 | 49 |
|
46 | 50 | // Passing a non-strict-DER signature or one with S > order/2 to a checksig operation causes script failure
|
47 |
| - // (softfork safe, BIP62 rule 5). |
| 51 | + // (BIP62 rule 5). |
48 | 52 | SCRIPT_VERIFY_LOW_S = (1U << 3),
|
49 | 53 |
|
50 |
| - // verify dummy stack item consumed by CHECKMULTISIG is of zero-length (softfork safe, BIP62 rule 7). |
| 54 | + // verify dummy stack item consumed by CHECKMULTISIG is of zero-length (BIP62 rule 7). |
51 | 55 | SCRIPT_VERIFY_NULLDUMMY = (1U << 4),
|
52 | 56 |
|
53 |
| - // Using a non-push operator in the scriptSig causes script failure (softfork safe, BIP62 rule 2). |
| 57 | + // Using a non-push operator in the scriptSig causes script failure (BIP62 rule 2). |
54 | 58 | SCRIPT_VERIFY_SIGPUSHONLY = (1U << 5),
|
55 | 59 |
|
56 | 60 | // Require minimal encodings for all push operations (OP_0... OP_16, OP_1NEGATE where possible, direct
|
57 | 61 | // pushes up to 75 bytes, OP_PUSHDATA up to 255 bytes, OP_PUSHDATA2 for anything larger). Evaluating
|
58 | 62 | // any other push causes the script to fail (BIP62 rule 3).
|
59 | 63 | // In addition, whenever a stack element is interpreted as a number, it must be of minimal length (BIP62 rule 4).
|
60 |
| - // (softfork safe) |
61 | 64 | SCRIPT_VERIFY_MINIMALDATA = (1U << 6),
|
62 | 65 |
|
63 | 66 | // Discourage use of NOPs reserved for upgrades (NOP1-10)
|
|
68 | 71 | // discouraged NOPs fails the script. This verification flag will never be
|
69 | 72 | // a mandatory flag applied to scripts in a block. NOPs that are not
|
70 | 73 | // executed, e.g. within an unexecuted IF ENDIF block, are *not* rejected.
|
| 74 | + // NOPs that have associated forks to give them new meaning (CLTV, CSV) |
| 75 | + // are not subject to this rule. |
71 | 76 | SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS = (1U << 7),
|
72 | 77 |
|
73 | 78 | // Require that only a single stack element remains after evaluation. This changes the success criterion from
|
74 | 79 | // "At least one stack element must remain, and when interpreted as a boolean, it must be true" to
|
75 | 80 | // "Exactly one stack element must remain, and when interpreted as a boolean, it must be true".
|
76 |
| - // (softfork safe, BIP62 rule 6) |
| 81 | + // (BIP62 rule 6) |
77 | 82 | // Note: CLEANSTACK should never be used without P2SH or WITNESS.
|
78 | 83 | SCRIPT_VERIFY_CLEANSTACK = (1U << 8),
|
79 | 84 |
|
|
0 commit comments