Skip to main content

Module commitment

Module commitment 

Source
Expand description

Signed storage-commitment type + verification shared by node and client (ADR-0004). The signed storage commitment — shared between node and client (ADR-0004).

ADR-0004 makes a quote’s price a function of the node’s audited storage commitment, and requires the client to fully verify that commitment before paying (“the client pays nothing it cannot resolve” — the ceiling’s load-bearing wall). To do that the client needs the commitment type, its pin (hash), and its signature/peer-binding check — exactly the pieces here.

This is the single source of truth for the commitment wire type and its verification: ant-node re-exports StorageCommitment, commitment_hash, verify_commitment_signature, and MAX_COMMITMENT_KEY_COUNT from this module so the node (gossip/audit) and the client (resolve-before-pay) can never disagree on what a valid commitment is or what pin it hashes to.

Only the verification surface lives here. The Merkle tree, inclusion paths, and signing live in ant-node (the responder/auditor own those); the client never builds or signs a commitment, it only verifies one.

Structs§

StorageCommitment
Signed storage commitment.

Constants§

DOMAIN_COMMITMENT
Domain-separation tag for the commitment signature.
DOMAIN_COMMITMENT_HASH
Domain-separation tag for the auditor’s pin: BLAKE3 over (this tag || canonical commitment blob).
MAX_COMMITMENT_KEY_COUNT
Maximum number of keys a single commitment may cover.
MAX_COMMITMENT_SIDECAR_BYTES
Maximum serialized size of a single commitment sidecar blob (ADR-0004).

Functions§

commitment_hash
The pin: BLAKE3(DOMAIN_COMMITMENT_HASH || postcard(commitment)).
verify_commitment_signature
Verify a commitment’s ML-DSA-65 signature against its embedded public key. Does NOT check the peer binding (BLAKE3(pubkey) == sender_peer_id) — callers that need it (the client, the node) check it separately so the same function serves both the “trust the embedded key” and “bind to a peer” uses.