Skip to main content

ant_protocol/payment/
mod.rs

1//! Wire-side payment artifacts shared by client and node.
2//!
3//! This module holds the types and helpers that both the client (when
4//! building a payment proof for a PUT request) and the node (when
5//! verifying that proof before storing a chunk) must agree on.
6//!
7//! The analogue in `evmlib` is the co-location of `pay` and `verify`
8//! on `PaymentVault` — keeping both halves in one crate means the
9//! encoding, validation, and on-chain interaction are tested end to end.
10
11/// Signed storage-commitment type + verification shared by node and client (ADR-0004).
12pub mod commitment;
13/// Quadratic storage-pricing formula shared by node and client (ADR-0004).
14pub mod pricing;
15/// Payment proof serialization and type tagging.
16pub mod proof;
17/// `SingleNodePayment` construction, on-chain payment, and verification.
18pub mod single_node;
19/// Pure ML-DSA-65 verification helpers for quotes and merkle candidates.
20pub mod verify;
21
22pub use commitment::{
23    commitment_hash, verify_commitment_signature, StorageCommitment, MAX_COMMITMENT_KEY_COUNT,
24};
25pub use pricing::{calculate_price, derive_records_stored_from_price};
26pub use proof::{
27    deserialize_merkle_proof, deserialize_proof, detect_proof_type, serialize_merkle_proof,
28    serialize_single_node_proof, PaymentProof, ProofType,
29};
30pub use single_node::{QuotePaymentInfo, SingleNodePayment};
31pub use verify::{verify_merkle_candidate_signature, verify_quote_content, verify_quote_signature};