Skip to content
MCP Servers
Skill

/use-modular-wallets

Build crypto wallets using Circle Modular Wallets SDK with passkey authentication, gasless transactions, and extensible module architecture. Use when: creating crypto wallets with passkey-based (WebAuthn) registration and login, sending gasless transactions using Circle Gas

From plugin
skills
17020 skills1 MCP

Claude Code

$ npx -y skills add circlefin/skills --skill use-modular-wallets --agent claude-code

SKILL.md

use-modular-wallets.SKILL.md
name: use-modular-wallets
description: "Build crypto wallets using Circle Modular Wallets SDK with passkey authentication, gasless transactions, and extensible module architecture. Use when: creating crypto wallets with passkey-based (WebAuthn) registration and login, sending gasless transactions using Circle Gas Station paymaster, batching multiple transactions into a single user operation, implementing passkey recovery using BIP-39 mnemonic phrases, building advanced onchain wallets with custom modules (multisig, subscriptions, session keys). Triggers on: MSCA, passkey authentication, WebAuthn, paymaster, Gas Station, ERC-4337, ERC-6900, toCircleSmartAccount, toModularTransport, sendUserOperation, 2D nonce, passkey recovery, EIP-1193 provider."
requirements:
  runtimes: []
  connectors: []

Overview

Modular Wallets are flexible smart contract accounts (MSCAs) that extend functionality through installable modules. Built on ERC-4337 (account abstraction) and ERC-6900 (modular smart contract framework), they support passkey authentication, gasless transactions, batch operations, and custom logic modules (multisig, subscriptions, session keys). MSCAs are lazily deployed -- gas fees for account creation are deferred until the first outbound transaction.

Prerequisites / Setup

Installation

npm install @circle-fin/modular-wallets-core viem@2.55.11
# Passkey recovery also needs bip39:
npm install bip39

Install the exact `viem` version the SDK pins (`2.55.11` for `@circle-fin/modular-wallets-core@1.0.16`) so the app and SDK share one viem copy. After an SDK upgrade, re-check with `npm view @circle-fin/modular-wallets-core dependencies`.

Environment Variables

Write or merge into the project's env file when scaffolding Modular Wallets:

# .env.local (Next.js) or .env (Vite)
# Paste your Client Key from Console → Keys → Client Keys (shown once; starts with TEST_CLIENT_KEY:)
NEXT_PUBLIC_CLIENT_KEY=
NEXT_PUBLIC_CLIENT_URL=https://modular-sdk.circle.com/v1/rpc/w3s/buidl
VITE_CLIENT_KEY=
VITE_CLIENT_URL=https://modular-sdk.circle.com/v1/rpc/w3s/buidl

Use the `NEXT_PUBLIC_*` pair for Next.js or the `VITE_*` pair for Vite — not both. Client URL is fixed — do not ask the user to copy it from Console. Chain paths (e.g. `/arcTestnet`) are appended in code via `toModularTransport`, not in the env var.

Before using the SDK, complete setup (see [Console Setup](https://developers.circle.com/wallets/modular/console-setup.md)):

1. Install the SDK and set the client env vars (see Installation and Environment Variables above). 2. In Console → Keys → Client Keys, create a Client Key. 3. Configure the Passkey Domain (passkeys are domain-bound).

Quick Reference

Supported Chains

| Chain | Mainnet | Testnet | | --- | --- | --- | | Arc | Yes | Yes | | Arbitrum | Yes | Yes | | Avalanche | Yes | Yes | | Base | Yes | Yes | | Monad | Yes | Yes | | Optimism | Yes | Yes | | Polygon | Yes | Yes | | Unichain | Yes | Yes |

For the latest supported blockchains: https://developers.circle.com/wallets/supported-blockchains.md (MSCA chain restrictions are in Rules below.)

Transport URL Path Segments

The `toModularTransport` URL requires the chain path segment appended to the client URL:

| Chain | Mainnet Path | Testnet Path | | --- | --- | --- | | Arbitrum | `/arbitrum` | `/arbitrumSepolia` | | Arc | `/arc` | `/arcTestnet` | | Avalanche | `/avalanche` | `/avalancheFuji` | | Base | `/base` | `/baseSepolia` | | Monad | `/monad` | `/monadTestnet` | | Optimism | `/optimism` | `/optimismSepolia` | | Polygon | `/polygon` | `/polygonAmoy` | | Unichain | `/unichain` | `/unichainSepolia` |

Example: `toModularTransport(\`${clientUrl}/polygonAmoy\`, clientKey)` for Polygon Amoy testnet.

Core Concepts

  • **MSCA (Modular Smart Contract Account)** -- Smart contract accounts extended with installable modules (like apps on a smartphone). Ownership can be single owner, multi-owner, passkeys, or multi-sig.
  • **Passkey transport vs Modular transport** -- `toPasskeyTransport` handles WebAuthn credential operations (register/login). `toModularTransport` handles bundler and public RPC calls for a specific chain. They are separate transports with different purposes.
  • **Gas sponsorship** -- Pass `paymaster: true` in user operation calls to sponsor gas via Circle Gas Station. End users pay zero gas fees.
  • **Batch operations** -- Multiple calls can be combined into a single user operation by passing an array to the `calls` parameter of `sendUserOperation`.
  • **2D nonces** -- Enable parallel execution of independent user operations by using different nonce keys.
  • **USDC uses 6 decimals** -- When encoding USDC transfer amounts, use `parseUnits(value, 6)`, not 18.
  • **Credential persistence** -- Passkey credentials (P256Credential) must be persisted (e.g., httpOnly cookies) and restored on reload to maintain the user session.

Implementation Patterns

> **Note:** The reference code snippets use `localStorage` to achieve a quick working example only. Do not use `localStorage` in production.

READ the corresponding reference based on the user's request:

  • `references/circle-smart-account.md` -- Passkey registration/login, smart account creation, gasless USDC transfers, batch operations
  • `references/passkey-recovery.md` -- BIP-39 mnemonic recovery setup and execution when a passkey is lost

User Operation Lifecycle

User operations submitted via `sendUserOperation` follow an asynchronous state machine. The SDK's `waitForUserOperationReceipt` handles polling automatically. To query states directly, use the [List User Operations API](https://developers.circle.com/api-reference/wallets/buidl/list-user-ops.md).

**Happy path:** `SENT` -> `CONFIRMED` -> `COMPLETE`

**States:**

  • `SENT` -- Submitted to the bundler, awaiting inclusion in a block.
  • `CONFIRMED` -- Included in a block, awaiting finality.
  • `COMPLETE` -- Finalized on-chain.
  • `FAILED` -- User operation reverted or encoun
Read more
@circlefin
Ships withskills

Ship stablecoin apps faster with Circle Skills: best-practice guidance for USDC payments, crosschain transfers, wallets, and smart contracts, plus Circle's MCP server for real-time SDK and documentation context.

17020 skills1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
170
Star history of circlefin/skills on GitHub, a chart by star-history.com

Other skills on skills.

accept-agent-payments

accept-agent-payments

Use when a developer wants to monetize an API, endpoint, service, model, dataset, tool, or agent-facing resource with Circle USDC…

@circlefin@circlefinInstall Skill
agent-wallet-policy

agent-wallet-policy

View spending policy on a Circle agent wallet — per-transaction, daily, weekly, and monthly USDC caps and contract allowlists via…

@circlefin@circlefinInstall Skill
bridge-tokens

bridge-tokens

Build browser or server token bridging across chains with Circle App Kit or standalone Bridge Kit. Bridges USDC across CCTP…

@circlefin@circlefinInstall Skill
buy-crypto

buy-crypto

Set up and integrate Circle Onramp, the hosted widget that lets end users buy crypto with fiat (bank transfer, debit card, Apple…

@circlefin@circlefinInstall Skill
fund-agent-wallet

fund-agent-wallet

Fund a Circle agent wallet with USDC via the `circle` CLI. Payments are gas-abstracted: users pay with USDC only, no ETH…

@circlefin@circlefinInstall Skill
pay-via-agent-wallet

pay-via-agent-wallet

Use this skill when the user wants to call a paid API, look something up online, search for data, get prices, odds, or stats, or…

@circlefin@circlefinInstall Skill

More skills from other plugins.

gitnexus-cli

gitnexus-cli

Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate a wiki,…

@abhigyanpatwari@abhigyanpatwariInstall Skill
fastmcp-client-cli

fastmcp-client-cli

Query and invoke tools on MCP servers using fastmcp list and fastmcp call. Use when you need to discover what tools a server…

fastmcp8d29k
@prefecthq@prefecthqInstall Skill
n8n-agents

n8n-agents

Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node — an AI Agent, LLM chain,…

n8n-mcp7d23k
@czlonkowski@czlonkowskiInstall Skill
post-to-xhs

post-to-xhs

小红书内容发布技能。支持两种发布模式:(1) 上传图文模式 - 图片+短文;(2) 写长文模式 - 长篇文章+排版模板。 支持两种输入方式:用户提供完整内容和图片/图片URL,直接发布;或提供网页URL,自动提取内容和图片。…

@xpzouying@xpzouyingInstall Skill

Questions about use-modular-wallets.

Which coding agents can use use-modular-wallets?
use-modular-wallets installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.