Expand description
Commitment Chain Verification
Walks a chain of commitments from present back to genesis,
verifying that each commitment’s previous_commitment field
matches the hash of the prior commitment.
§Overview
Each commitment in a contract’s history references the previous
commitment via its previous_commitment field. This forms a
hash chain:
Genesis Commitment (previous_commitment = 0)
↓ hash
Commitment 1 (previous_commitment = hash(genesis))
↓ hash
Commitment 2 (previous_commitment = hash(commitment_1))
↓ hash
Latest CommitmentThe commitment chain walker verifies:
- Each commitment’s
previous_commitmentmatches the hash of the prior commitment - The chain traces back to a genesis commitment (previous_commitment = zero hash)
- No commitments are missing in the sequence
- All commitments belong to the same contract (contract_id consistency)
Structs§
- Chain
Verification Result - Result of commitment chain verification.
Enums§
- Chain
Error - Errors that can occur during commitment chain verification.
Functions§
- verify_
commitment_ chain - Verifies a commitment chain from a collection of commitments.
- verify_
commitment_ link - Computes the expected hash of the previous commitment given a commitment.
- verify_
ordered_ commitment_ chain - Verifies a pre-ordered commitment chain.