Skip to main content
Create a user-owned smart wallet, authorize an agent as a delegated signer, and send USDXM on Base Sepolia. This quickstart runs the stablecoin wallet reference app. By the end you’ll have a running app where a user can sign in, get a non-custodial wallet, authorize an agent with a one-time email code, and watch the agent send a stablecoin transfer signed entirely on your backend — no user prompt per transaction.

Try the live demo

See the full flow in action without setting anything up locally.

Stablecoin Wallet Quickstart

Explore the full reference implementation for user wallets, server signers, and USDXM transfers.

Prerequisites

  • Node.js 20+ and pnpm

Setup

1

Clone the repo and install dependencies

You can ask your agent to walk you through the setup to run this quickstart.
git clone https://github.com/Crossmint/stablecoin-wallet-quickstart.git
cd stablecoin-wallet-quickstart
pnpm install
2

Configure environment variables

Copy the example file. You’ll fill in the values in the next steps.
cp .env.example .env.local
.env.local
NEXT_PUBLIC_CROSSMINT_CLIENT_API_KEY=your-crossmint-client-api-key
CROSSMINT_SERVER_SIDE_API_KEY=your-crossmint-server-api-key
CROSSMINT_SIGNER_SECRET=your-64-char-hex-secret
3

Get Crossmint staging API keys

Sign in to the Crossmint Staging Console and create a project. Then in Project Settings → API keys, create:
  1. A client-side key → paste into NEXT_PUBLIC_CROSSMINT_CLIENT_API_KEY.
  2. A server-side key → paste into CROSSMINT_SERVER_SIDE_API_KEY.
Staging keys come with all scopes enabled by default, so you don’t need to configure anything else for the quickstart.
4

Generate a signer secret

The agent’s server signer uses a 32-byte secret that never leaves your backend. Generate one and paste it into CROSSMINT_SIGNER_SECRET. Both raw 64-char hex and the prefixed xmsk1_<64-hex> format are accepted.
Anyone who holds this secret can sign on behalf of the wallets it has been authorized on. Store it only as a server-side environment variable; never commit it or ship it to the browser.
5

Run the dev server

pnpm dev
Open http://localhost:3000.

Understanding the user flow

Once running, the app walks the user through four steps on Base Sepolia:
  1. Authenticate. Sign in with email OTP or Google via CrossmintAuthProvider. Crossmint issues a user JWT that scopes every subsequent SDK call to the signed-in user.
  2. Get a wallet. CrossmintWalletProvider is configured with createOnLogin={{ chain: "base-sepolia", recovery: { type: "email" } }}, so a non-custodial smart wallet is created on first login with the user’s email as the recovery signer. The address appears as soon as useWallet() resolves.
  3. Authorize the agent. Clicking Authorize your agent calls wallet.addSigner({ type: "server", secret }, { prepareOnly: true }) from your backend, then the user approves the pending registration with a one-time email code. From here on, the server signer can sign for the wallet without any user prompt.
  4. Fund and send. wallet.stagingFund(5) mints 5 USDXM into the wallet (staging-only). A server action then activates the server signer with wallet.useSigner({ type: "server", secret }) and calls wallet.send(recipient, "usdxm", amount) — signed entirely on your backend. This is how an agent spends from a user’s wallet in production.
Toggle Show code in the header to view the relevant SDK snippet alongside each step.

Next Steps

Using the Wallet

Send stablecoins, swap, bridge, and call any contract from your agent.

x402

HTTP-native micropayments — pay-per-call APIs and machine-to-machine settlement.

Remove Agent Access

Revoke an agent’s signer from a user’s wallet.