ScriptFlags class

Flags are used to signal various expected behaviours to the Script Interpreter.

Flags are taken from the bitcoind implementation

SCRIPT_VERIFY_P2SH

Evaluate P2SH subscripts (softfork safe, BIP16).

SCRIPT_VERIFY_STRICTENC

Passing a non-strict-DER signature or one with undefined hashtype to a checksig operation causes script failure. Passing a pubkey that is not (0x04 + 64 bytes) or (0x02 or 0x03 + 32 bytes) to checksig causes that pubkey to be skipped (not softfork safe: this flag can widen the validity of OP_CHECKSIG OP_NOT).

SCRIPT_VERIFY_DERSIG

Passing a non-strict-DER signature to a checksig operation causes script failure (softfork safe, BIP62 rule 1)

SCRIPT_VERIFY_LOW_S

Pa non-strict-DER signature or one with S > order/2 to a checksig operation causes script failure (softfork safe, BIP62 rule 5).

SCRIPT_VERIFY_NULLDUMMY

verify dummy stack item consumed by CHECKMULTISIG is of zero-length (softfork safe, BIP62 rule 7).

SCRIPT_VERIFY_SIGPUSHONLY

Using a non-push operator in the scriptSig causes script failure (softfork safe, BIP62 rule 2).

SCRIPT_VERIFY_MINIMALDATA

Require minimal encodings for all push operations (OP_0... OP_16, OP_1NEGATE where possible, direct pushes up to 75 bytes, OP_PUSHDATA up to 255 bytes, OP_PUSHDATA2 for anything larger). Evaluating any other push causes the script to fail (BIP62 rule 3). In addition, whenever a stack element is interpreted as a number, it must be of minimal length (BIP62 rule 4). (softfork safe)

SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS

Discourage use of NOPs reserved for upgrades (NOP1-10). Provided so that nodes can avoid accepting or mining transactions containing executed NOP's whose meaning may change after a soft-fork, thus rendering the script invalid; with this flag set executing discouraged NOPs fails the script. This verification flag will never be a mandatory flag applied to scripts in a block. NOPs that are not executed, e.g. within an unexecuted IF ENDIF block, are not rejected.

SCRIPT_VERIFY_CLEANSTACK

Require that only a single stack element remains after evaluation. This changes the success criterion from "At least one stack element must 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 be true". (softfork safe, BIP62 rule 6) Note: CLEANSTACK should never be used without P2SH or WITNESS.

SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY

Cstatic final LTV See BIP65 for details.

SCRIPT_VERIFY_CHECKSEQUENCEVERIFY

support CHECKSEQUENCEVERIFY opcode See BIP112 for details

SCRIPT_VERIFY_MINIMALIF

Segwit script only: Require the argument of OP_IF/NOTIF to be exactly 0x01 or empty vector

SCRIPT_VERIFY_NULLFAIL

Signature(s) must be empty vector if an CHECK(MULTI)SIG operation failed

SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE

Public keys in scripts must be compressed

SCRIPT_ENABLE_SIGHASH_FORKID

Do we accept signature using SIGHASH_FORKID

SCRIPT_ENABLE_REPLAY_PROTECTION

Do we accept activate replay protection using a different fork id.

SCRIPT_ENABLE_MONOLITH_OPCODES

Enable new opcodes.

SCRIPT_ENABLE_MAGNETIC_OPCODES

Are the Magnetic upgrade opcodes enabled?

Below flags apply in the context of BIP 68

SEQUENCE_LOCKTIME_DISABLE_FLAG

If this flag set, CTxIn::nSequence is NOT interpreted as a relative lock-time.

SEQUENCE_LOCKTIME_TYPE_FLAG

If CTxIn::nSequence encodes a relative lock-time and this flag is set, the relative lock-time has units of 512 seconds, otherwise it specifies blocks with a granularity of 1.

SEQUENCE_LOCKTIME_MASK

If CTxIn::nSequence encodes a relative lock-time, this mask is applied to extract that lock-time from the sequence field.

Constructors

ScriptFlags.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

SCRIPT_ENABLE_MONOLITH_OPCODES int
Enable new opcodes.
final
SCRIPT_ENABLE_REPLAY_PROTECTION int
Do we accept activate replay protection using a different fork id.
final
SCRIPT_UTXO_AFTER_GENESIS int
UTXO being used in this script was created after Genesis upgrade has been activated. This activates new rules (such as original meaning of OP_RETURN) This is per (input!) UTXO flag
final
SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY int
Cstatic final LTV See BIP65 for details.
final
SCRIPT_VERIFY_CHECKSEQUENCEVERIFY int
support CHECKSEQUENCEVERIFY opcode
final
SCRIPT_VERIFY_CLEANSTACK int
Require that only a single stack element remains after evaluation. This changes the success criterion from "At least one stack element must 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 be true". (softfork safe, BIP62 rule 6) Note: CLEANSTACK should never be used without P2SH or WITNESS.
final
SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE int
Public keys in scripts must be compressed
final
SCRIPT_VERIFY_DERSIG int
Passing a non-strict-DER signature to a checksig operation causes script failure (softfork safe, BIP62 rule 1)
final
SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS int
Discourage use of NOPs reserved for upgrades (NOP1-10)
final
SCRIPT_VERIFY_LOW_S int
Pa non-strict-DER signature or one with S > order/2 to a checksig operation causes script failure (softfork safe, BIP62 rule 5).
final
SCRIPT_VERIFY_MINIMALDATA int
Require minimal encodings for all push operations (OP_0... OP_16, OP_1NEGATE where possible, direct pushes up to 75 bytes, OP_PUSHDATA up to 255 bytes, OP_PUSHDATA2 for anything larger). Evaluating any other push causes the script to fail (BIP62 rule 3). In addition, whenever a stack element is interpreted as a number, it must be of minimal length (BIP62 rule 4). (softfork safe)
final
SCRIPT_VERIFY_MINIMALIF int
Segwit script only: Require the argument of OP_IF/NOTIF to be exactly 0x01 or empty vector
final
SCRIPT_VERIFY_NONE int
bitcoind commit: b5d1b1092998bc95313856d535c632ea5a8f9104
final
SCRIPT_VERIFY_NULLDUMMY int
verify dummy stack item consumed by CHECKMULTISIG is of zero-length (softfork safe, BIP62 rule 7).
final
SCRIPT_VERIFY_NULLFAIL int
Signature(s) must be empty vector if an CHECK(MULTI)SIG operation failed
final
SCRIPT_VERIFY_P2SH int
Evaluate P2SH subscripts (softfork safe, BIP16).
final
SCRIPT_VERIFY_SIGPUSHONLY int
Using a non-push operator in the scriptSig causes script failure (softfork safe, BIP62 rule 2).
final
SCRIPT_VERIFY_STRICTENC int
Passing a non-strict-DER signature or one with undefined hashtype to a checksig operation causes script failure. Passing a pubkey that is not (0x04 + 64 bytes) or (0x02 or 0x03 + 32 bytes) to checksig causes that pubkey to be skipped (not softfork safe: this flag can widen the validity of OP_CHECKSIG OP_NOT).
final
SEQUENCE_LOCKTIME_DISABLE_FLAG int
Below flags apply in the context of BIP 68
final
SEQUENCE_LOCKTIME_MASK int
If CTxIn::nSequence encodes a relative lock-time, this mask is applied to extract that lock-time from the sequence field.
final
SEQUENCE_LOCKTIME_TYPE_FLAG int
If CTxIn::nSequence encodes a relative lock-time and this flag is set, the relative lock-time has units of 512 seconds, otherwise it specifies blocks with a granularity of 1.
final

Constants

SCRIPT_ENABLE_SIGHASH_FORKID → const int
Do we accept signature using SIGHASH_FORKID