Expand description
Payment verification system for ant-node.
This module implements the payment verification strategy:
- Check LRU cache for already-verified data
- Require and verify EVM/Arbitrum payment for new data
§Default Policy
Production nodes require payment by default.
- EVM verification is always on — there is no way to disable it
- For unit tests, pre-populate the cache via
PaymentVerifier::cache_insert()
§Architecture
PUT request received
│
▼
┌─────────────────────┐
│ Check LRU cache │
└─────────┬───────────┘
│
┌──────┴──────┐
│ │
HIT MISS
│ │
▼ ▼
Store (paid) Require EVM payment§Payment Flow
All new data requires EVM payment:
- Client requests a quote from the node
- Node generates
PaymentQuotewith ML-DSA-65 signature - Client pays on Arbitrum via
PaymentVault.payForQuotes() - Client sends PUT with
ProofOfPayment - Node verifies on-chain payment and stores data
Re-exports§
pub use metrics::QuotingMetricsTracker;pub use pricing::calculate_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 quote::verify_merkle_candidate_signature;pub use quote::verify_quote_content;pub use quote::wire_ml_dsa_signer;pub use quote::QuoteGenerator;pub use quote::XorName;pub use single_node::SingleNodePayment;pub use wallet::is_valid_address;pub use wallet::parse_rewards_address;pub use wallet::WalletConfig;
Modules§
- metrics
- Quoting metrics tracking for ant-node.
- pricing
- Local fullness-based pricing algorithm for ant-node.
- proof
- Payment proof wrapper that includes transaction hashes.
- quote
- Payment quote generation for ant-node.
- single_
node SingleNodepayment mode implementation for ant-node.- wallet
- EVM wallet management for receiving payments.
Structs§
- Cache
Stats - Cache statistics for monitoring.
- EvmVerifier
Config - Configuration for EVM payment verification.
- Payment
Verifier - Main payment verifier for ant-node.
- Payment
Verifier Config - Configuration for the payment verifier.
- Verified
Cache - LRU cache for verified
XorNamevalues.
Enums§
- Payment
Status - Status returned by payment verification.
Constants§
- MAX_
PAYMENT_ PROOF_ SIZE_ BYTES - Maximum allowed size for a payment proof in bytes (256 KB).
- MIN_
PAYMENT_ PROOF_ SIZE_ BYTES - Minimum allowed size for a payment proof in bytes.