Skip to main content

Module payment

Module payment 

Source
Expand description

Wire-side payment artifacts shared by client and node.

This module holds the types and helpers that both the client (when building a payment proof for a PUT request) and the node (when verifying that proof before storing a chunk) must agree on.

The analogue in evmlib is the co-location of pay and verify on PaymentVault — keeping both halves in one crate means the encoding, validation, and on-chain interaction are tested end to end.

Re-exports§

pub use commitment::commitment_hash;
pub use commitment::verify_commitment_signature;
pub use commitment::StorageCommitment;
pub use commitment::MAX_COMMITMENT_KEY_COUNT;
pub use pricing::calculate_price;
pub use pricing::derive_records_stored_from_price;
pub use proof::deserialize_merkle_proof;
pub use proof::deserialize_proof;
pub use proof::detect_proof_type;
pub use proof::serialize_merkle_proof;
pub use proof::serialize_single_node_proof;
pub use proof::PaymentProof;
pub use proof::ProofType;
pub use single_node::QuotePaymentInfo;
pub use single_node::SingleNodePayment;
pub use verify::verify_merkle_candidate_signature;
pub use verify::verify_quote_content;
pub use verify::verify_quote_signature;

Modules§

commitment
Signed storage-commitment type + verification shared by node and client (ADR-0004). The signed storage commitment — shared between node and client (ADR-0004).
pricing
Quadratic storage-pricing formula shared by node and client (ADR-0004). Quadratic pricing with a baseline floor.
proof
Payment proof serialization and type tagging. Payment proof wrapper that includes transaction hashes.
single_node
SingleNodePayment construction, on-chain payment, and verification. SingleNode payment strategy.
verify
Pure ML-DSA-65 verification helpers for quotes and merkle candidates. Pure verification helpers for payment quotes and merkle candidates.