> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xmeta.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Base Network Support

> Payment verification on Base Mainnet and Base Sepolia Testnet

## Supported Networks

0xmeta.ai supports payment verification and settlement on Base networks:

<CardGroup cols={2}>
  <Card title="Base Mainnet" icon="b">
    **Production** Native: ETH Block Time: \~2s
  </Card>

  <Card title="Base Sepolia" icon="flask">
    **Testnet** Native: ETH For testing
  </Card>
</CardGroup>

## Chain Identifiers

Use these exact values in the `chain` parameter:

| Network      | Identifier     | Type    |
| ------------ | -------------- | ------- |
| Base Mainnet | `base`         | Mainnet |
| Base Sepolia | `base-sepolia` | Testnet |

```javascript theme={null}
// Correct ✅
{
  chain: "base";
}
{
  chain: "base-sepolia";
}

// Wrong ❌
{
  chain: "BASE";
}
{
  chain: "Base";
}
{
  chain: "base_mainnet";
}
```

## Basic Example

```javascript theme={null}
async function verifyPayment(txHash, chain, amount) {
  const response = await fetch("https://facilitator.0xmeta.ai/v1/verify", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-API-Key": "your_api_key",
      "Idempotency-Key": `verify_${txHash}`,
    },
    body: JSON.stringify({
      transaction_hash: txHash,
      chain: chain, // "base" or "base-sepolia"
      seller_address: YOUR_ADDRESS,
      expected_amount: amount,
    }),
  });

  return await response.json();
}

// Use with Base Mainnet
await verifyPayment("0x...", "base", "1000000000000000000");

// Use with Base Sepolia Testnet
await verifyPayment("0x...", "base-sepolia", "1000000000000000000");
```

## Base Mainnet

* **Pros**: Production-ready, very fast, very low fees, Coinbase-backed
* **Cons**: Real funds at risk
* **Best for**: Production applications
* **Confirmation time**: 2-5 seconds

```javascript theme={null}
{
  "chain": "base",
  "expected_amount": "1000000000000000000"  // 1 ETH
}
```

## Base Sepolia Testnet

* **Pros**: Free test tokens, safe for development
* **Cons**: Not for production use
* **Best for**: Testing and development
* **Confirmation time**: 2-5 seconds

```javascript theme={null}
{
  "chain": "base-sepolia",
  "expected_amount": "1000000000000000000"  // 1 test ETH
}
```

## Token Support

Both networks support both native tokens (ETH) and ERC20 tokens:

### Native Tokens (ETH)

```javascript theme={null}
{
  "chain": "base",
  "expected_token": null,  // null = native token
  "expected_amount": "1000000000000000000"
}
```

### ERC20 Tokens (USDC, DAI, etc.)

```javascript theme={null}
{
  "chain": "base",
  "expected_token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",  // USDC on Base
  "expected_amount": "1000000"  // 1 USDC (6 decimals)
}
```

## Common Token Addresses on Base

### USDC

| Network      | Address                                      |
| ------------ | -------------------------------------------- |
| Base Mainnet | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` |
| Base Sepolia | `0x036CbD53842c5426634e7929541eC2318f3dCF7e` |

### DAI

| Network      | Address                                      |
| ------------ | -------------------------------------------- |
| Base Mainnet | `0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb` |
| Base Sepolia | Check testnet token list                     |

## Testing on Base Sepolia

Use Base Sepolia for testing:

```javascript theme={null}
const config = {
  development: {
    chain: "base-sepolia",
    sellerAddress: process.env.DEV_ADDRESS,
  },
  production: {
    chain: "base",
    sellerAddress: process.env.PROD_ADDRESS,
  },
};

const { chain, sellerAddress } = config[process.env.NODE_ENV];
```

Get testnet ETH:

* Base Sepolia Faucet: [https://www.coinbase.com/faucets/base-ethereum-goerli-faucet](https://www.coinbase.com/faucets/base-ethereum-goerli-faucet)

## Environment Configuration

### 1. Let Users Choose Network

```javascript theme={null}
const SUPPORTED_CHAINS = [
  { id: "base", name: "Base Mainnet", native: "ETH" },
  { id: "base-sepolia", name: "Base Sepolia", native: "ETH" },
];

// Let user select chain
<select onChange={(e) => setChain(e.target.value)}>
  {SUPPORTED_CHAINS.map((chain) => (
    <option key={chain.id} value={chain.id}>
      {chain.name}
    </option>
  ))}
</select>;
```

### 2. Chain-Aware Amounts

```javascript theme={null}
function getChainDecimals(chain, isNativeToken) {
  if (isNativeToken) {
    return 18; // ETH uses 18 decimals
  }

  // Token-specific decimals
  const tokenDecimals = {
    USDC: 6,
    USDT: 6,
    DAI: 18,
  };

  return tokenDecimals[tokenName] || 18;
}
```

### 3. Display Chain Info

```javascript theme={null}
const response = await verifyPayment(txHash, chain, amount);

console.log(`Payment verified on ${chain}`);
console.log(`View on explorer: ${getExplorerUrl(chain, txHash)}`);

function getExplorerUrl(chain, txHash) {
  const explorers = {
    base: "https://basescan.org/tx/",
    "base-sepolia": "https://sepolia.basescan.org/tx/",
  };

  return explorers[chain] + txHash;
}
```

## Why Base?

<AccordionGroup>
  <Accordion title="Low Fees">
    Base has 100x lower fees than Ethereum mainnet, making it perfect for high-frequency transactions
  </Accordion>

  {" "}

  <Accordion title="Fast Settlement">
    Base settles in seconds vs minutes on Ethereum mainnet
  </Accordion>

  {" "}

  <Accordion title="Coinbase Backing">
    Built by Coinbase, Base offers enterprise-grade reliability and security
  </Accordion>

  <Accordion title="Ethereum Compatibility">
    Full EVM compatibility means you can use existing Ethereum tooling and contracts
  </Accordion>
</AccordionGroup>

<Info>
  All Base networks use the same API - just change the `chain` parameter between
  `base` and `base-sepolia`!
</Info>
