saorsa_node/payment/
mod.rs

1//! Payment verification system for saorsa-node.
2//!
3//! This module implements the payment verification strategy:
4//! 1. Check LRU cache for already-verified data
5//! 2. Require and verify EVM/Arbitrum payment for new data
6//!
7//! # Architecture
8//!
9//! ```text
10//! PUT request received
11//!        │
12//!        ▼
13//! ┌─────────────────────┐
14//! │ Check LRU cache     │
15//! └─────────┬───────────┘
16//!           │
17//!    ┌──────┴──────┐
18//!    │             │
19//!   HIT          MISS
20//!    │             │
21//!    ▼             ▼
22//! Store (paid)   Require EVM payment
23//! ```
24//!
25//! # Payment Flow
26//!
27//! All new data requires EVM payment:
28//! 1. Client requests a quote from the node
29//! 2. Node generates `PaymentQuote` with ML-DSA-65 signature
30//! 3. Client pays on Arbitrum via `PaymentVault.payForQuotes()`
31//! 4. Client sends PUT with `ProofOfPayment`
32//! 5. Node verifies on-chain payment and stores data
33
34mod cache;
35pub mod metrics;
36pub mod quote;
37mod verifier;
38pub mod wallet;
39
40pub use cache::VerifiedCache;
41pub use metrics::QuotingMetricsTracker;
42pub use quote::{verify_quote_content, QuoteGenerator, XorName};
43pub use verifier::{PaymentStatus, PaymentVerifier, PaymentVerifierConfig};
44pub use wallet::{is_valid_address, parse_rewards_address, WalletConfig};