Module constants
Expand description
Blockdata constants.
This module provides various constants relating to the blockchain and consensus code. In particular, it defines the genesis block and its single transaction.
Structs§
- Chain
Hash - The uniquely identifying hash of the target blockchain.
Constants§
- COIN_
VALUE - How many satoshis are in “one bitcoin”
- DIFFCHANGE_
INTERVAL - How many blocks between diffchanges
- DIFFCHANGE_
TIMESPAN - How much time on average should occur between diffchanges
- MAX_
BLOCK_ SIGOPS_ COST - The maximum allowed number of signature check operations in a block
- MAX_
BLOCK_ WEIGHT - The maximum allowed weight for a block, see BIP 141 (network rule)
- MAX_
SCRIPTNUM_ VALUE - Maximum allowed value for an integer in Script.
- MAX_
SCRIPT_ ELEMENT_ SIZE - The maximum allowed script size.
- MIN_
TRANSACTION_ WEIGHT - The minimum transaction weight for a valid serialized transaction
- PUBKEY_
ADDRESS_ PREFIX_ MAIN - Mainnet (bitcoin) pubkey address prefix.
- PUBKEY_
ADDRESS_ PREFIX_ TEST - Test (tesnet, signet, regtest) pubkey address prefix.
- SCRIPT_
ADDRESS_ PREFIX_ MAIN - Mainnet (bitcoin) script address prefix.
- SCRIPT_
ADDRESS_ PREFIX_ TEST - Test (tesnet, signet, regtest) script address prefix.
- SUBSIDY_
HALVING_ INTERVAL - How may blocks between halvings.
- TARGET_
BLOCK_ SPACING - How many seconds between blocks we expect on average
- WITNESS_
SCALE_ FACTOR - The factor that non-witness serialization data is multiplied by during weight calculation
Functions§
- genesis_
block - Constructs and returns the genesis block
- max_
money - The maximum value allowed in an output (useful for sanity checking, since keeping everything below this value should prevent overflows if you are doing anything remotely sane with monetary values).
- max_
target - In Bitcoind this is insanely described as ~((u256)0 >> 32)