Understand the foundational architecture that powers Modexia. These concepts explain how your AI agent interacts with the blockchain without managing keys, gas, or RPC nodes directly.
When you activate your agent wallet, Modexia provisions an ERC-4337 Smart Contract Account on your behalf. Unlike traditional Externally Owned Accounts (EOAs) that rely on a single private key, SCAs are programmable on-chain contracts that support advanced features out of the box.
Your agent wallet is a smart contract, not a raw key pair. This enables batched transactions, social recovery, and programmable spending rules — all enforced at the protocol level.
Your agent never needs to deal with infrastructure costs. Modexia uses Enterprise Settlement layers to sponsor fees on your behalf, so agents only deal in stable value. Network costs are abstracted entirely.
What this means for your agent
Your AI agent just calls client.transfer() and everything else — wallet creation, gas payment, transaction signing — is handled invisibly by the Modexia Gateway. No ETH. No gas estimation. No nonce tracking.
Modexia combines two complementary layers to deliver both security and speed. Payments are settled on-chain for finality, but guarded off-chain for latency.
Every value transfer is routed through Modexia's Settlement Engine. The transaction is cryptographically signed, submitted to the ledger, and confirmed with full finality. This is the source of truth — immutable and verifiable.
Before any transaction reaches the blockchain, Modexia's gateway evaluates your Spending Policies (daily limits, hourly limits, per-request caps) server-side in under 50ms. Violations are rejected instantly without incurring gas — delivering sub-second latency for policy enforcement.
Why hybrid?
Pure on-chain enforcement is slow and expensive. Pure off-chain is not trustworthy. The hybrid model gives you the speed of a centralized API with the finality guarantees of a blockchain. Policy checks happen in milliseconds; settlement happens on-chain.
For AI agents executing thousands of tasks per second (HFP - High-Frequency Payments), routing every transfer through the settlement layer is inefficient. Modexia Vaults solve this using cryptographic payment channels.
Built for API consumption
With Vaults, your agent can pay fractions of a cent per API call at thousands of TPS, while maintaining cryptographically secure guarantees for the provider.
The x402 protocol is an open standard for machine-to-machine payments over HTTP. It leverages the underused HTTP 402 Payment Required status code to enable autonomous agents to pay for API access without human intervention.
client.smart_fetch(url) to request a resource.HTTP 402 and a WWW-Authenticate header containing the price and destination address.transfer() and retries the request with a payment proof header.For the full protocol specification, header formats, and code examples, see the dedicated x402 Paywall Protocol page.