blockchainkit.constants#

Every consensus-relevant constant: hash domain tags, encoding bounds, and the default chain ID. Changing any of them changes hashes, signatures, or validation; see Exact conventions and model boundaries.

Consensus-relevant constants shared across blockchainkit.

Every hash domain tag, encoding bound, and default identifier lives here, so a change to one of them is visible as a change to the protocol. Changing any value changes hashes, signatures, or validation: update docs/source/protocol.rst, the tests, the examples, and CHANGELOG.md together.

>>> from blockchainkit import constants
>>> constants.UINT64_LIMIT == 2**64
True
blockchainkit.constants.UINT64_LIMIT = 18446744073709551616#

Exclusive upper bound of the unsigned 64-bit fields (nonces, amounts, heights).

Type:

int

blockchainkit.constants.WORD_MODULUS = 115792089237316195423570985008687907853269984665640564039457584007913129639936#

The virtual machine’s word size; arithmetic wraps modulo this value.

Type:

int

blockchainkit.constants.DEFAULT_CHAIN_ID = 'blockchainkit-demo'#

Network identifier signed into every transaction to prevent cross-chain replay.

Type:

str

blockchainkit.constants.COMMIT_DOMAIN = b'blockchainkit:commit:v1\x00'#

Domain tag prefixed to hash commitments.

Type:

bytes

blockchainkit.constants.SCHNORR_DOMAIN = 'blockchainkit:schnorr:v1'#

Domain tag prefixed, with the curve parameters, to Schnorr challenges.

Type:

str

blockchainkit.constants.MERKLE_LEAF_PREFIX = b'\x00'#

Prefix for hashing a Merkle leaf payload.

Type:

bytes

blockchainkit.constants.MERKLE_NODE_PREFIX = b'\x01'#

Prefix for hashing two child digests into a Merkle node.

Type:

bytes

blockchainkit.constants.MERKLE_ROOT_PREFIX = b'\x02'#

Prefix for binding the leaf count to the top Merkle digest.

Type:

bytes

blockchainkit.constants.PUZZLE_DOMAIN = b'blockchainkit:puzzle:v1'#

Domain tag for the keystream that encrypts a Merkle puzzle.

Type:

bytes

blockchainkit.constants.PUZZLE_MAGIC = b'MERKLE78'#

Known plaintext prefix that tells a solver a puzzle has opened.

Type:

bytes

blockchainkit.constants.LAMPORT_DOMAIN = b'blockchainkit:lamport:v1'#

Domain tag for deriving Lamport private preimages from a seed.

Type:

bytes

blockchainkit.constants.PEDERSEN_DOMAIN = b'blockchainkit:pedersen:v1'#

Domain tag for deriving the second Pedersen generator.

Type:

bytes

blockchainkit.constants.MUSIG_DOMAIN = b'blockchainkit:musig:v1'#

Domain tag for MuSig key-aggregation coefficients.

Type:

bytes

blockchainkit.constants.MMR_ROOT_PREFIX = b'\x03'#

Prefix for bagging Merkle-mountain-range peaks into one root.

Type:

bytes

blockchainkit.constants.BLOOM_DOMAIN = b'blockchainkit:bloom:v1'#

Domain tag for deriving Bloom-filter bit positions.

Type:

bytes

blockchainkit.constants.UTXO_DOMAIN = 'blockchainkit:utxo:v1'#

Domain tag signed into every UTXO transaction.

Type:

str

blockchainkit.constants.SORTITION_DOMAIN = b'blockchainkit:sortition:v1'#

Domain tag for the hash that stands in for a VRF in cryptographic sortition.

Type:

bytes

blockchainkit.constants.COMPACT_BLOCK_DOMAIN = b'blockchainkit:compact-block:v1'#

Domain tag for the salted short transaction IDs of compact blocks.

Type:

bytes