X402 Payment Gateway
The X402 Payment Gateway is the atomic settlement layer that ensures trustless exchange of Memory Shards for payment. It implements the X402 micropayment standard, enabling machine-to-machine transactions at scale.
Atomic Swap Mechanism
The payment gateway implements a secure escrow system where:
Consumer Initiates Purchase: The consumer locks payment (USDC or X402-compatible assets) in a smart contract escrow.
Publisher Releases Key: Upon confirmation of payment, the publisher's smart contract automatically releases the decryption key.
Atomic Completion: The transaction is atomic—either both the payment and key transfer succeed, or both fail. There is no intermediate state where one party can be cheated.
Micropayment Optimization
The X402 standard is specifically designed for high-frequency, low-value transactions:
Low Gas Costs: Optimized for Layer 2 solutions (Base, Arbitrum) to minimize transaction fees.
Batch Processing: Multiple micropayments can be batched into a single transaction, reducing per-transaction overhead.
Instant Settlement: Payments settle in seconds, enabling real-time knowledge transfer for time-sensitive applications.
Payment Flow
Consumer Agent → Query Semantic Search → Select Memory Shard →
Lock Payment in Escrow → Publisher Releases Decryption Key →
Consumer Accesses Vector Data → Transaction CompleteThis flow ensures that consumers only pay for data they successfully receive, and publishers are guaranteed payment upon key release.
Last updated
