> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `/api/mcp` to find what you need.

# EVM and x402 support \[Use one SDK for MPP and x402 payments on any EVM blockchain]

## Choose a signing account

### Direct

Create a server-only wallet.ts module, then import account wherever an example creates a local signing account.

```ts
import { privateKeyToAccount } from 'viem/accounts'

export const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`)
```

### Privy

Create an EVM wallet in Privy, fund it with the required currency on this page's network, and keep PRIVY\_APP\_SECRET server-side.

```bash
pnpm add @privy-io/node
```

Create a server-only privy.ts module, then import its account wherever an example configures account or feePayer.

```ts
import { PrivyClient } from '@privy-io/node'
import { createViemAccount } from '@privy-io/node/viem'

const privy = new PrivyClient({
  appId: process.env.PRIVY_APP_ID!,
  appSecret: process.env.PRIVY_APP_SECRET!,
})

export const account = createViemAccount(privy, {
  address: process.env.PRIVY_WALLET_ADDRESS as `0x${string}`,
  walletId: process.env.PRIVY_WALLET_ID!,
})
```

createViemAccount delegates signatures to the Privy wallet, so it replaces any local viem account in the examples on this page.

MPP now supports `charge` payments on any EVM network, including Ethereum, Base, and Polygon. `mppx` also supports x402 [`exact`](https://docs.x402.org/schemes/exact) flows through the same payment-method interface.

Use `evm.charge` when you want one integration for MPP Challenges and compatible x402 payment requests. The server advertises both protocols, then verifies whichever Credential the client returns.

## Server

Configure one EVM charge method. Add `x402.facilitator` when the endpoint accepts x402 `exact` payments.

```ts [server.ts]
import { Mppx, evm } from 'mppx/server'

const mppx = Mppx.create({
  methods: [
    // [!code hl:start]
    evm.charge({
      currency: evm.assets.baseSepolia.USDC,
      recipient: '0xYourAddress',
      x402: {
        facilitator: 'https://example.com/facilitator',
      },
    }),
    // [!code hl:end]
  ],
})

const paid = mppx.evm.charge({
  amount: '0.01',
  description: 'Premium API access',
})
```

## Client

The client signs MPP Challenges and compatible x402 Challenges. It selects a protocol from the payment methods available to the request.

```ts [client.ts]
import { Fetch, evm } from 'mppx/client'
import { privateKeyToAccount } from 'viem/accounts'

const fetch = Fetch.from({
  methods: [
    // [!code hl:start]
    evm.charge({
      account: privateKeyToAccount(
        '0x0123456789012345678901234567890123456789012345678901234567890123',
      ),
      currencies: [evm.assets.baseSepolia.USDC],
      maxAmount: '1.00',
    }),
    // [!code hl:end]
  ],
})

const response = await fetch('https://mpp.dev/api/ping/paid')
console.log(response.status)
// @log: 200
```

## Learn more

* [Use MPP with x402](/guides/use-mpp-with-x402)
* [`evm.charge` payment method](/payment-methods/evm/charge#evm-charge)
