← Back to home

Omni402

Pay x402 from any chain, any token. Settle instantly in USDC on Base

Problem Statement

omni402 - Descriptionomni402 is a clearing layer between fragmented user liquidity and x402 USDC invoices. It solves a critical problem in web3 payments: users have tokens scattered across multiple chains, but merchants want to receive payments in a single, stable currency on one chain.The ProblemToday, if a merchant wants to accept crypto payments, they need to:Support multiple chains and tokensHandle volatile assetsWait for slow cross-chain bridgesManage complex treasury operationsMeanwhile, users are forced to bridge tokens, swap to the right asset, and pay high gas fees—often abandoning the purchase entirely.Our Solutionomni402 makes this seamless:For Users:Pay with whatever you have—ARB, ETH, USDC on Arbitrum, or any supported token. No bridging required. One click and you're done.For Merchants:Sign up with email, get a CDP-managed wallet, and receive instant USDC settlements on Base. No crypto complexity, no seed phrases, just a dashboard showing your payment history.For Developers:Two lines of code to protect any API endpoint with x402 payments. Wrap your route handler withrequirePayment()and you're monetizing.How It WorksUser initiates payment on source chain (e.g., Arbitrum)EdgePayment contract swaps their token to USDC via 1inch AquaLayerZero sends cross-chain message to BaseOmniTabHub triggers instant settlement from the poolMerchant receives USDC immediatelyConfirmation travels back to update invoice statusThe settlement pool provides instant liquidity so merchants don't wait for the cross-chain message—they get paid in seconds, not minutes.Use CasesAPI Monetization:Charge per-request for premium data, AI inference, or contentDigital Goods:One-time payments for downloads, licenses, or accessMicrotransactions:Sub-dollar payments without credit card minimumsGlobal Access:Accept payments from users worldwide without payment processor restrictionsomni402 turns any HTTP endpoint into a cross-chain monetizable resource, powered by the x402 protocol standard.

Solution

omni402 - How It's MadeCore Architectureomni402 is built on three main pillars:LayerZero V2for cross-chain messaging,1inch Aquafor token swaps, andCoinbase Developer Platformfor merchant wallets.Smart ContractsEdgePayment (Arbitrum)Extends LayerZero's OApp for bidirectional messaging. When a user pays, it:Accepts any token and swaps to USDC via 1inch SwapVMStores invoice as "Pending"Sends LayerZero message to Hub with payment detailsReceives settlement confirmation and marks invoice as "Settled"OmniTabHub (Base)The central coordinator that:Receives payment messages via_lzReceiveUseslzComposefor atomic settlement + confirmationCalls SettlementPool to transfer USDC to merchantSends confirmation back to EdgePaymentSettlementPool (Base)Share-based liquidity pool that enables instant settlements. LPs deposit USDC and earn fees from payments. The pool ensures merchants get paid immediately without waiting for cross-chain finality.LayerZero V2 IntegrationWe use the full OApp pattern with bothOAppSenderandOAppReceiverfor round-trip messaging. The executor options include bothlzReceivegas (200k) andlzComposegas (150k) to handle the settlement composition pattern.The hacky part: we usesendComposeto trigger a self-compose, which allows atomic execution of settlement + return message in a single transaction. This ensures the merchant gets paid and the confirmation gets sent in one atomic operation.1inch Aqua (SwapVM)Instead of routing through AMMs with slippage, we use 1inch Aqua's resolver network. The EdgePayment contract stores a pre-configured swap order (strategy hash), and resolvers fill the other side of the trade. This gives users better execution than typical DEX aggregation.The taker traitsIS_EXACT_INandUSE_TRANSFER_FROM_AND_AQUA_PUSHallow the router to pull tokens from our contract while resolvers push USDC output directly to us.Coinbase Developer PlatformMerchants authenticate with email via CDP Auth and get an embedded wallet automatically. No seed phrases, no MetaMask—just email login. We use@coinbase/cdp-hooksfor React integration:useCoinbaseAuthfor authentication stateuseFundWalletfor onrampuseWalletBalanceto display USDC balanceSDK ArchitectureThe TypeScript SDK provides:Server:requirePayment()wrapper for Next.js route handlersClient:Omni402Providercontext anduseOmni402hookPaymentModal:React component for the payment flow UIThe client intercepts 402 responses, shows the payment modal, and retries withX-PAYMENTheader containing the transaction hash.Facilitator ServiceExpress.js service with Prisma/PostgreSQL that:Verifies payment transactions by reading EdgePayment eventsStores payment records with status trackingListens to Hub'sPaymentSettledevents to update statusProvides payment history API for merchant dashboardStack SummaryChains:Arbitrum (edge), Base (hub)Messaging:LayerZero V2 OAppSwaps:1inch Aqua/SwapVMWallets:Coinbase Developer PlatformFrontend:Next.js 15, TailwindCSSBackend:Express.js, Prisma, PostgreSQLContracts:Solidity, Hardhat, OpenZeppelinBuilt for ETHGlobal Buenos Aires 2025.

Hackathon

ETHGlobal Buenos Aires

2025

Prizes

  • 🏆

    Utilize 1inch APIs

    1inch

  • 🏆

    Best Omnichain Implementation1st place

    LayerZero

Contributors