Skip to main content

Module primitives

Module primitives 

Source
Expand description

Fundamental type aliases, protocol version tags, and Chia type re-exports (BLK-006).

Requirement: BLK-006 / NORMATIVE § BLK-006 / SPEC §2.1.

§Usage

Downstream crates should import Cost, VERSION_V1, VERSION_V2, Bytes32, Signature, and PublicKey from dig_block so DIG L2 code shares one type identity with validation and builders in this crate (see crate::constants for limits that use Cost).

§Rationale

  • Cost documents intent: a u64 in header or bundle context is CLVM cost, not an arbitrary scalar (fees, heights, timestamps remain plain integers per domain).
  • Re-exports keep dependency graphs shallow: consumers need not add direct chia-protocol / chia-bls edges only to name hashes or BLS material aligned with blocks produced here.

§Decisions

  • Version constants are u16 to match header wire format (BLK-007 auto-detection). Values 1 and 2 are stable protocol identifiers; changing them is a breaking network upgrade.
  • This module is declared before crate::constants in crate so limit constants can use Cost and Bytes32 without circular imports.

Structs§

PublicKey
Signature

Constants§

VERSION_V1
Protocol version for blocks strictly before DFSP activation height (SPEC §2.2 version semantics).
VERSION_V2
Protocol version for blocks at or after DFSP activation height (SPEC §2.2 version semantics).

Type Aliases§

Bytes32
Cost
CLVM execution cost unit (alias of u64) (SPEC §2.1).