Gasless Payments with x402
x402 is the payment protocol that powers the Ad Marketplace. It lets you pay for things in crypto without gas fees - just one signature and you’re done.The Problem with Traditional Crypto Payments
Buying things with crypto is usually painful: ❌ Step 1: Approve token spending (costs gas)❌ Step 2: Wait for confirmation
❌ Step 3: Make payment (costs more gas)
❌ Step 4: Wait again
❌ Step 5: Gas fees that vary wildly Result: Bad UX, unpredictable costs, multiple steps
The x402 Way
✅ One Signature - Sign once, done✅ Zero Gas Fees - Pay only the product price
✅ Instant - Settled immediately
✅ Simple - Feels like web2 Result: Amazon-like checkout experience in web3
How It Works (Simple Version)
Instead of sending a transaction, you sign a message authorizing the payment.- You click “Buy”
- MetaMask asks you to sign (not send a transaction)
- Payment is instantly settled on-chain
- You pay zero gas
The signature is a cryptographic authorization that allows the payment to be processed without you paying gas fees.
Real Example: Buying an Ad Slot
Traditional Way
x402 Way
Why Zero Gas?
You’re probably wondering: “How can there be no gas fees?” Here’s the secret:- You sign a permit message (not a transaction)
- The x402 facilitator submits the transaction for you
- The facilitator pays the gas
- You just pay the product price
Think of it like a credit card payment - you don’t pay the payment processor’s fees, the merchant does. Same concept here.
Benefits for You
As an Advertiser
- 💰 Predictable Costs - Always pay exactly the ad price
- ⚡ Fast - Book and go live instantly
- 🎯 Simple - One click to purchase
- 💸 No Surprises - Never worry about gas spikes
How x402 Compares
| Feature | x402 | Traditional | Coinbase Wallet |
|---|---|---|---|
| Gas Fees | $0 | $5-15 | Varies |
| Steps | 1 | 3-4 | 2-3 |
| Time | Instant | 30-60s | 15-30s |
| UX | ⭐⭐⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐⭐ |
What You’re Signing
When MetaMask pops up, you’ll see something like:Security
x402 is secure because:- ✅ You control the signature - No one can make you sign
- ✅ Expiration time - Signatures expire (can’t be replayed)
- ✅ One-time use - Each signature has a unique nonce
- ✅ Amount locked - Can’t charge more than you approve
- ✅ Protected from MEV - Private relay prevents frontrunning
Supported Networks
x402 works on:- ✅ Base (what Ad Marketplace uses)
- ✅ Ethereum Mainnet
- ✅ Polygon
- ✅ Arbitrum
- ✅ Optimism
Supported Tokens
Currently, the Ad Marketplace accepts:- USDC on Base - Primary payment method
More tokens coming soon! The protocol supports any ERC-20 token with permit functionality.
Common Questions
Is this safe?
Is this safe?
Yes! You’re signing a message, not giving unlimited access to your tokens. Each signature is for a specific amount, to a specific recipient, and expires quickly.
Who pays the gas if I don't?
Who pays the gas if I don't?
The x402 facilitator (run by the AnySpend network) pays the gas fees. They make this back through facilitator fees paid by merchants.
Can I get scammed?
Can I get scammed?
Not if you verify what you’re signing! Always check:
- Amount matches what you expect
- Recipient is the correct address
- You’re on the right network (Base)
What if my signature expires?
What if my signature expires?
Signatures expire after a few minutes for security. If yours expires, just sign again - it’s instant and free.
Do I need a special wallet?
Do I need a special wallet?
No! x402 works with any Web3 wallet: MetaMask, Coinbase Wallet, WalletConnect, etc.
The Technical Term
The technical term for what you’re signing is an EIP-2612 Permit or EIP-3009 Transfer Authorization. It’s a standard way for tokens to allow approvals via signatures instead of transactions.Try It Yourself
The best way to understand x402 is to experience it:Buy an Ad Slot
Experience zero-gas payments firsthand
Why This Matters
x402 makes crypto payments feel like normal internet payments.- No waiting for confirmations
- No worrying about gas prices
- No multi-step approval flows
- Just click, sign, done
HypeDuel