# Wallet Setup Guide for Pizza x402 Payments

This guide will help you set up a Base wallet with USDC to pay for your pizza order. The process takes about 5-10 minutes.

## Quick Start (Fastest Path)

1. **Download Coinbase Wallet** from [coinbase.com/wallet](https://www.coinbase.com/wallet)
2. **Buy USDC** in the Coinbase app
3. **Send USDC** to your Coinbase Wallet on Base network
4. **Ready to pay!**

> **Tip:** This is the simplest path. For more options, see the detailed steps below.

---

## Overview

Pizza x402 accepts payments in **USDC (USD Coin)** on the **Base network**. You'll need:
1. A crypto wallet that supports Base network
2. USDC tokens on Base network
3. Enough USDC to cover your order total + small network fees (~$0.01)

**Estimated time:** 5-10 minutes  
**Network:** Base (Chain ID: 8453)  
**Currency:** USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)
**RPC URL:** https://mainnet.base.org

---

## Step 1: Choose a Wallet

You need a crypto wallet that supports Base network. We recommend **Coinbase Wallet** for beginners, but **MetaMask** also works.

### Option A: Coinbase Wallet (Recommended for Beginners)

**Why choose Coinbase Wallet:**
- Built-in support for Base network
- Easy USDC purchase and transfer
- Mobile app available
- Beginner-friendly interface

**Setup:**
1. Download Coinbase Wallet from [coinbase.com/wallet](https://www.coinbase.com/wallet)
2. Create a new wallet or import an existing one
3. Follow the setup instructions in the app
4. **Important:** Save your recovery phrase in a safe place (never share it!)

**Links:**
- [Download Coinbase Wallet](https://www.coinbase.com/wallet)
- [Coinbase Wallet Help Center](https://help.coinbase.com/en/wallet)

### Option B: MetaMask

**Why choose MetaMask:**
- Popular and widely used
- Browser extension and mobile app
- More advanced features

**Setup:**
1. Download MetaMask from [metamask.io](https://metamask.io/)
2. Create a new wallet or import an existing one
3. Add Base network to MetaMask:
   - Network Name: `Base`
   - RPC URL: `https://mainnet.base.org`
   - Chain ID: `8453`
   - Currency Symbol: `ETH`
   - Block Explorer: `https://basescan.org`
4. **Important:** Save your recovery phrase in a safe place (never share it!)

**Links:**
- [Download MetaMask](https://metamask.io/)
- [Add Base Network to MetaMask](https://docs.base.org/tools/network-faucets)

---

## Step 2: Get USDC

You need USDC (USD Coin) to pay for your order. Here are the easiest ways to get it:

### Method 1: Buy USDC on Coinbase (Easiest)

1. **If using Coinbase Wallet:**
   - Open Coinbase Wallet app
   - Tap "Buy" or "Add funds"
   - Select USDC
   - Choose payment method (bank account, debit card, etc.)
   - Complete purchase
   - USDC will be in your Coinbase Wallet

2. **If using MetaMask:**
   - Buy USDC on Coinbase.com or Coinbase app
   - Send USDC from Coinbase to your MetaMask address
   - **Important:** When sending, select "Base" as the network (not Ethereum mainnet)

**Links:**
- [Coinbase App](https://www.coinbase.com/)
- [Coinbase Help: Buying Crypto](https://help.coinbase.com/en/coinbase/getting-started)

### Method 2: Bridge from Ethereum (If you already have USDC)

If you already have USDC on Ethereum mainnet, you can bridge it to Base:

1. Go to [Base Bridge](https://bridge.base.org/)
2. Connect your wallet
3. Select USDC as the token
4. Enter the amount to bridge
5. Confirm the transaction
6. Wait for confirmation (usually 1-2 minutes)

**Links:**
- [Base Bridge](https://bridge.base.org/)
- [Base Bridge Documentation](https://docs.base.org/tools/bridges)

---

## Step 3: Verify USDC is on Base Network

**Critical:** Make sure your USDC is on **Base network**, not Ethereum mainnet!

### How to Check:

1. **In Coinbase Wallet:**
   - Open your wallet
   - Look for USDC balance
   - Check that it shows "Base" network (not "Ethereum")

2. **In MetaMask:**
   - Make sure Base network is selected (top of the app)
   - Check your USDC balance
   - If you see 0 USDC, you may need to:
     - Add USDC token to MetaMask (token address: `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`)
     - Or bridge USDC from Ethereum mainnet to Base

### Common Mistakes to Avoid:

- ❌ **Don't send USDC on Ethereum mainnet** - it won't work for Base payments
- ❌ **Don't use the wrong network** - always select "Base" when sending
- ✅ **Double-check the network** before confirming any transaction
- ✅ **Verify your balance** shows USDC on Base network

---

## Step 4: Verify Your Setup

Before placing an order, make sure:

- ✅ Wallet is installed and set up
- ✅ Base network is added (if using MetaMask)
- ✅ You have USDC on Base network
- ✅ You have enough USDC for your order + network fees (usually $0.01-0.10)

**How to check your USDC balance:**
- Open your wallet app
- Select Base network
- Look for USDC token
- Verify balance is sufficient

---

## Step 5: Pay for Your Order

Once your wallet is set up with USDC on Base:

1. Place your order through the AI agent
2. When you receive the payment request (402 response), you'll see payment instructions
3. Connect your wallet to complete the payment
4. Confirm the transaction in your wallet
5. Wait for payment confirmation (usually 1-2 minutes)

**Payment Details:**
- **Network:** Base (eip155:8453)
- **Currency:** USDC
- **Token Address:** 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
- **Explorer:** [BaseScan](https://basescan.org/)

---

## Troubleshooting

### "I don't see USDC in my wallet"
- Make sure you're on Base network (not Ethereum mainnet)
- If using MetaMask, you may need to add the USDC token manually
- Token address: `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`

### "Payment failed"
- Check that you have enough USDC for the order + network fees
- Verify you're on Base network
- Make sure your wallet is connected
- Try refreshing and retrying

### "I sent USDC but it's not showing up"
- Check the transaction on [BaseScan](https://basescan.org/)
- Verify you sent to the correct network (Base, not Ethereum)
- Wait a few minutes for confirmation

### "I need help"
- Contact the merchant for support
- Check the [Base documentation](https://docs.base.org/)
- Visit [Coinbase Wallet Help](https://help.coinbase.com/en/wallet) or [MetaMask Support](https://support.metamask.io/)

---

## Security Tips

- 🔒 **Never share your recovery phrase** with anyone
- 🔒 **Double-check addresses** before sending USDC
- 🔒 **Verify network** before confirming transactions
- 🔒 **Only use official wallet apps** from trusted sources
- 🔒 **Keep your recovery phrase safe** - if you lose it, you lose access to your wallet

---

## Resources

- **Base Network:** [docs.base.org](https://docs.base.org/)
- **Coinbase Wallet:** [coinbase.com/wallet](https://www.coinbase.com/wallet)
- **MetaMask:** [metamask.io](https://metamask.io/)
- **Base Bridge:** [bridge.base.org](https://bridge.base.org/)
- **BaseScan Explorer:** [basescan.org](https://basescan.org/)
- **USDC on Base:** [Circle USDC](https://www.circle.com/en/usdc)

---

## Quick Reference

| Item | Value |
|------|-------|
| Network | Base |
| Chain ID | 8453 (eip155:8453) |
| Currency | USDC |
| Token Address | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| RPC URL | https://mainnet.base.org |
| Block Explorer | https://basescan.org |
| Estimated Setup Time | 5-10 minutes |

---

**Ready to order?** Make sure you have USDC on Base network, then place your order through the AI agent!

