Skip to main content

Module constants

Module constants 

Source
Expand description

Bitcoin consensus constants from Orange Paper

Constants§

BIP16_P2SH_ACTIVATION_MAINNET
BIP16: P2SH (Pay-to-Script-Hash) - Mainnet activation height
BIP16_P2SH_ACTIVATION_REGTEST
BIP16: P2SH (Pay-to-Script-Hash) - Regtest activation height
BIP16_P2SH_ACTIVATION_TESTNET
BIP16: P2SH (Pay-to-Script-Hash) - Testnet activation height
BIP30_DEACTIVATION_MAINNET
BIP30: Duplicate Coinbase Prevention - Mainnet deactivation height
BIP30_DEACTIVATION_REGTEST
BIP30: Duplicate Coinbase Prevention - Regtest deactivation height
BIP30_DEACTIVATION_TESTNET
BIP30: Duplicate Coinbase Prevention - Testnet deactivation height
BIP34_ACTIVATION_MAINNET
BIP34: Block Height in Coinbase - Mainnet activation height
BIP34_ACTIVATION_REGTEST
BIP34: Block Height in Coinbase - Regtest activation height
BIP34_ACTIVATION_TESTNET
BIP34: Block Height in Coinbase - Testnet activation height
BIP54_ACTIVATION_MAINNET
BIP54: Consensus Cleanup - Mainnet activation height
BIP54_ACTIVATION_REGTEST
BIP54: Consensus Cleanup - Regtest activation height
BIP54_ACTIVATION_TESTNET
BIP54: Consensus Cleanup - Testnet activation height
BIP54_MAX_SIGOPS_PER_TX
BIP54: Maximum sigop count per transaction (Consensus Cleanup). Transactions with total sigop count > this are invalid after BIP54 activation.
BIP65_ACTIVATION_MAINNET
BIP65: OP_CHECKLOCKTIMEVERIFY (CLTV) - Mainnet activation height
BIP65_ACTIVATION_TESTNET
BIP65: OP_CHECKLOCKTIMEVERIFY (CLTV) - Testnet activation height
BIP66_ACTIVATION_MAINNET
BIP66: Strict DER Signatures - Mainnet activation height
BIP66_ACTIVATION_REGTEST
BIP66: Strict DER Signatures - Regtest activation height
BIP66_ACTIVATION_TESTNET
BIP66: Strict DER Signatures - Testnet activation height
BIP112_CSV_ACTIVATION_MAINNET
BIP112/BIP113: CHECKSEQUENCEVERIFY (CSV) - Mainnet activation height
BIP112_CSV_ACTIVATION_REGTEST
BIP112/BIP113: CSV - Regtest (active from genesis for typical regtest chains)
BIP112_CSV_ACTIVATION_TESTNET
BIP112/BIP113: CSV - Testnet activation height (Bitcoin Core testnet3)
BIP147_ACTIVATION_MAINNET
BIP147: NULLDUMMY Enforcement - Mainnet activation height
BIP147_ACTIVATION_TESTNET
BIP147: NULLDUMMY Enforcement - Testnet activation height
C
satoshis per BTC (Orange Paper C)
COINBASE_MATURITY
Coinbase maturity requirement: 100 blocks
CSFS_ACTIVATION_MAINNET
CSFS (BIP348) - Mainnet activation height
CSFS_ACTIVATION_REGTEST
CSFS (BIP348) - Regtest activation height
CSFS_ACTIVATION_TESTNET
CSFS (BIP348) - Testnet activation height
CTV_ACTIVATION_MAINNET
CTV (BIP119) - Mainnet activation height
CTV_ACTIVATION_REGTEST
CTV (BIP119) - Regtest activation height
CTV_ACTIVATION_TESTNET
CTV (BIP119) - Testnet activation height
DIFFICULTY_ADJUSTMENT_INTERVAL
Difficulty adjustment interval: 2016 blocks
GENESIS_BLOCK_HASH
Genesis block hash (mainnet)
GENESIS_BLOCK_HASH_INTERNAL
Genesis block hash in internal / wire byte order.
GENESIS_BLOCK_MERKLE_ROOT
Genesis block merkle root
GENESIS_BLOCK_NONCE
Genesis block nonce
GENESIS_BLOCK_TIMESTAMP
Genesis block timestamp (Unix timestamp)
H
halving interval (Orange Paper H)
HALVING_INTERVAL
Halving interval: 210,000 blocks
INITIAL_SUBSIDY
Initial block subsidy: 50 BTC
LOCKTIME_THRESHOLD
Lock time threshold: transactions with lock time < this are block height
L_ELEMENT
maximum element size (Orange Paper L_ELEMENT)
L_OPS
maximum operations per script (Orange Paper L_OPS)
L_SCRIPT
maximum script length (Orange Paper L_SCRIPT)
L_STACK
maximum stack size (Orange Paper L_STACK)
MAX_BLOCK_SERIALIZED_SIZE
Maximum block serialized size in bytes (network rule) This is the maximum size of a block when serialized without witness data
MAX_BLOCK_SIGOPS_COST
Maximum block sigop cost (network rule)
MAX_BLOCK_SIZEDeprecated
Maximum block size (deprecated - use MAX_BLOCK_WEIGHT for SegWit blocks) Kept for backward compatibility
MAX_BLOCK_WEIGHT
Maximum block weight in weight units (network rule, BIP141) Weight = (stripped_size × 4) + witness_size This is the primary limit for SegWit blocks
MAX_FUTURE_BLOCK_TIME
Maximum future block time tolerance: 2 hours (7200 seconds)
MAX_INPUTS
Maximum number of inputs per transaction
MAX_MONEY
Maximum money supply: 21,000,000 BTC in satoshis
MAX_OUTPUTS
Maximum number of outputs per transaction
MAX_SCRIPT_ELEMENT_SIZE
Maximum script element size (BIP141: witness elements can be up to 520 bytes)
MAX_SCRIPT_OPS
Maximum number of operations in script
MAX_SCRIPT_SIZE
Maximum script length
MAX_STACK_SIZE
Maximum stack size during script execution
MAX_TARGET
Maximum target (minimum difficulty)
MAX_TRANSACTIONS_PER_BLOCK
Upper bound on the number of transactions in any consensus-valid block.
MAX_TX_SIZE
Maximum transaction size: 1MB
MIN_RELAY_FEE
Minimum relay fee for RBF replacement (BIP125)
MIN_TARGET
Minimum target (maximum difficulty) - Bitcoin’s genesis target
M_MAX
maximum money supply (Orange Paper M_MAX)
R
coinbase maturity (Orange Paper R)
SATOSHIS_PER_BTC
Satoshis per BTC
SEGWIT_ACTIVATION_MAINNET
SegWit (BIP141) - Mainnet activation height
SEGWIT_ACTIVATION_TESTNET
SegWit (BIP141) - Testnet activation height (Bitcoin Core testnet3 consensus.SegwitHeight)
SEGWIT_P2WPKH_LENGTH
SegWit witness program lengths (BIP141)
SEGWIT_P2WSH_LENGTH
SEQUENCE_FINAL
Sequence number for final transaction
SEQUENCE_RBF
Sequence number for RBF
S_MAX
maximum sigops per block (Orange Paper S_MAX)
TAPROOT_ACTIVATION_MAINNET
Taproot (BIP341) - Mainnet activation height
TAPROOT_ACTIVATION_TESTNET
Taproot (BIP341) - Testnet activation height (Bitcoin Core testnet3)
TAPROOT_PROGRAM_LENGTH
Taproot program hash length (BIP341)
TAPROOT_SCRIPT_LENGTH
Taproot script length (BIP341)
TARGET_TIME_PER_BLOCK
Target time per block: 10 minutes
WITNESS_COMMITMENT_HASH_LENGTH
Witness commitment hash length (BIP141)
WITNESS_COMMITMENT_SCRIPT_LENGTH
Witness commitment script length (BIP141)
W_MAX
maximum block weight (Orange Paper W_MAX)