Expand description
Blockchain collection kind — pure logic.
A KIND blockchain collection stores append-only rows whose hash field
depends on the previous row’s hash, forming a tamper-evident chain.
Issue #521 lands the engine integration in a later iteration; this module
ships the deterministic primitives (hash, verify_chain, error types) so the
later wiring is a thin storage adapter on top of audited logic.
Structs§
- Block
- A materialized block as stored.
hashMUST equalcompute_block_hash(...)over the other fields —verify_chainenforces this. - Chain
Tip - Engine response to
GET /collections/:name/chain-tip. - Signed
Fields - Optional signer fields included in the hash preimage when the collection
has
SIGNED_BY (...)declared. Issue #520 supplies the signer registry; the chain hash binds the signature so a replaced signature also breaks the chain.
Enums§
- Blockchain
Error - Operational errors surfaced by the blockchain engine path.
- Verify
Report - Result of walking a chain end-to-end.
Inconsistentreports the FIRST block whose stored fields disagree with a recomputed hash; the chain is not walked past the first failure.
Constants§
- GENESIS_
PREV_ HASH - All-zero hash used as
prev_hashfor the genesis block.
Functions§
- compute_
block_ hash - Canonical hash preimage:
- verify_
chain - Walk
blocksin order. Returns the first inconsistency orOkif every block’s stored hash matches the recomputed hash AND links the previous block.