Expand description
Issue #526 — composition of KIND blockchain + SIGNED_BY (...).
Locks the contract a KIND blockchain SIGNED_BY (...) collection ships:
- The block hash binds the chain fields AND the row’s signer pubkey +
signature. Tampering with either reserved column breaks
verify_chainat that height — the hash is now a function of(prev_hash, block_height, timestamp, canonical(payload), signer_pubkey, signature). - Genesis is exempt:
block_height == 0carries the all-zero pubkey and an empty signature so the collection can be created before any signer registers a row. Every subsequent block MUST carry a non-genesis (allowed-signer) signature. verify_chain_with_signatureswalks the chain and additionally re-verifies the Ed25519 signature on each non-genesis block, so an integrity scan flags signature tampering even when the storedhashwas recomputed to “match” the tampered bytes.
This module is pure logic on top of the audited primitives in
storage::blockchain and
storage::signed_writes. Runtime
wiring (INSERT pipeline composition, DDL persistence of the registry
on a KIND blockchain collection, REST error mapping) is owned by
the parent issues #522 and #524 and is consumed by this module via
the same primitives once both land.
Structs§
- Signed
Chain Verify Outcome - Outcome of
verify_chain_with_signatures. Distinguishes “hash chain is broken” (recomputed hash differs from stored hash) from “signature is invalid” (hash chain still links but the stored signature does NOT verify against the stored pubkey over the canonical payload).
Constants§
- GENESIS_
SIGNATURE - Empty signature recorded on the genesis row. Pair with
GENESIS_SIGNER_PUBKEY. - GENESIS_
SIGNER_ PUBKEY - All-zero pubkey marker recorded on the genesis row of a signed chain.
Documented exemption: the genesis block predates any signer’s first
INSERTso it cannot itself carry a real signature. - RESERVED_
COLUMNS_ SIGNED_ CHAIN - Reserved column set for a
KIND blockchain SIGNED_BY (...)collection — the union of the chain reserved columns and the signed-writes reserved columns.
Functions§
- genesis_
signed_ fields - Genesis row builder for a signed chain. Returns the field list that
execute_create_collectionwrites when the collection has bothKIND blockchainand a non-empty signer registry. - is_
genesis_ signed_ marker - True for the documented genesis exemption pair (null pubkey + null signature). Used by the verify walker to skip Ed25519 verification on the genesis row.
- make_
signed_ block_ reserved_ fields - Build the reserved-column field list + hash for a new block on a signed chain. Caller supplies the row’s canonical payload bytes (engine’s canonical payload encoder, identical to what the client signed) and the signer fields produced by the client.
- verify_
chain_ with_ signatures - Issue #526 — walk a signed chain end-to-end. Combines: