Overview
Thesettlement-verifier contract is the on-chain anchor for x402 payments on Stellar. It is compiled to WebAssembly targeting wasm32v1-none using soroban-sdk = "26.1.0" and Rust 1.92.0.
Live Deployments
Core Responsibilities
-
Replay Protection:
Tracks per-payer nonces in persistent contract storage. If an attacker attempts to replay an authorization payload, the contract detects that
provided_nonce != current_nonce + 1and reverts with error code4(InvalidNonce). -
Atomic Fee Distribution:
Transfers funds from the payer to the merchant and collects a protocol fee in basis points (
10,000 bps = 100%) in a single atomic transaction. Either all transfers succeed or the transaction reverts. -
Storage Tiering & TTL Management:
- Instance Storage: Stores protocol configuration (
Admin,FeeBps,FeeRecipient). Automatically renewed during calls. - Persistent Storage: Stores payer nonces with TTL extension helpers to prevent data eviction while keeping costs predictable.
- Instance Storage: Stores protocol configuration (
-
Structured Event Logging:
Emits
SettlementReceiptandInitializedEventon-chain, allowing off-chain indexers and accounting systems to track payments by topic.