Circle Internet Financial
Circle Internet Financial Logo

Mar 05, 2025

March 5, 2025

Unlocking a Better USDC Transaction Experience with Modular Wallets and Passkeys

what you’ll learn

Modular Wallets with Passkeys enable a secure, seamless, non-custodial USDC transaction experience with strong authentication.

Unlocking a Better USDC Transaction Experience with Modular Wallets and Passkeys

The Challenge of Secure and Seamless Wallet Onboarding

For years, crypto wallets have required users to manage seed phrases, install browser extensions, and remember passwords. While this approach offers control, it introduces friction and security risks. When handling digital dollars like USDC, security and ease of use should not be trade-offs. Users need a way to securely authenticate and sign transactions without unnecessary complexity.

The challenge extends beyond just onboarding. Signing transactions in blockchain applications can be risky, with phishing attacks and blind signing posing serious threats. A better authentication model is needed to protect users and improve the transaction experience.

Introducing Modular Wallets with Passkey Support

Circle’s Modular Wallets now support Passkeys for secure authentication, allowing developers to offer an effortless way for users to onboard and transact securely. By integrating the WebAuthn standard, users can sign transactions using Face ID, Touch ID, or biometrics—improving authentication flows and security without adding complexity.

Why Are Passkeys Important?

Passkeys are cryptographic key pairs stored securely on user devices, removing the need for seed phrases while maintaining the highest level of security. They work across:

  • Apple: iPhones, iPads, MacBooks (via iCloud Keychain)
  • Android: Phones and tablets (via Google Password Manager)
  • Browsers: Chrome, Edge, Firefox
  • FIDO2 Security Keys: YubiKey and similar devices

How Passkeys Improve Security for USDC Transactions

  • Passwordless Authentication – Users log in using biometrics, avoiding the need for passwords or recovery phrases.
  • Phishing-Resistant Security – Passkeys are tied to specific applications, preventing misuse in fraudulent sites.
  • Seamless Multi-Device Syncing – iCloud Keychain and Google Password Manager allow access across devices.
  • No Server-Side Secrets – Only public keys are stored, eliminating risks associated with centralized credential storage.

Enhancing USDC Transactions with Modular Wallets

Transacting with USDC requires a secure yet seamless authentication experience. With Passkeys and Modular Wallets, users can onboard and transact effortlessly:

  • Instant Wallet Creation – Users create a self-custodial wallet without passwords or extensions.
  • Secure and Frictionless Transactions – Biometric authentication protects transaction integrity while simplifying signing.
  • A Safer Payment Experience – Passkeys reduce blind signing risks, ensuring users have full control over their funds.

Integrating Modular Wallets and Passkeys in Your App

  1. Passkey Registration and Login Setup:
import * as React from "react"
import {
  WebAuthnMode,
  toPasskeyTransport,
  toWebAuthnCredential,
} from "@circle-fin/modular-wallets-core"
import { useToast } from "@/components/ui/toast"


// ... existing code ...


const register = React.useCallback(
  async (event: React.FormEvent<HTMLFormElement>) => {
    event.preventDefault()
    const formData = new FormData(event.currentTarget)
    const newUsername = formData.get("username") as string
    try {
      const newCredential = await toWebAuthnCredential({
        transport: passkeyTransport,
        mode: WebAuthnMode.Register,
        username: newUsername,
      })
      localStorage.setItem("credential", JSON.stringify(newCredential))
      localStorage.setItem("username", newUsername)
      setCredential(newCredential)
      setUsername(newUsername)
    } catch (error) {
      console.error("Error registering:", error)
      toast({
        title: "Registration Failed",
        description: "An error occurred during registration. Please try again.",
        variant: "destructive",
      })
    }
  },
  [passkeyTransport, toast],
)

       2. Circle Smart Account Creation:

import {
  type P256Credential,
  type SmartAccount,
  type WebAuthnAccount,
  toWebAuthnAccount,
} from "viem/account-abstraction"
import {
  toCircleSmartAccount,
} from "@circle-fin/modular-wallets-core"


// ... existing code ...


React.useEffect(() => {
  if (!credential || !username) return
  toCircleSmartAccount({
    client,
    owner: toWebAuthnAccount({ credential }) as WebAuthnAccount,
    name: username,
  }).then(setAccount)
}, [credential, username, client])

        3. USDC Transfer with User Operations:

import { type Hex, encodeFunctionData } from "viem"
import { type SmartAccount, createBundlerClient } from "viem/account-abstraction"

// ... existing code ...

try {
  const data = encodeFunctionData({
    abi: USDC_ABI,
    functionName: "transfer",
    args: [to, BigInt(Number.parseFloat(value) * 10 ** USDC_DECIMALS)],
  })
  const userOpHash = await bundlerClient.sendUserOperation({
    account,
    calls: [
      {
        to: USDC_CONTRACT_ADDRESS,
        data,
      },
    ],
    paymaster: true,
  })
  setUserOpHash(userOpHash)
  const { receipt } = await bundlerClient.waitForUserOperationReceipt({ hash: userOpHash })
  setHash(receipt.transactionHash)
  setIsDialogOpen(true)
  fetchBalance()
} catch (error) {
  console.error("Error sending transaction:", error)
  toast({
    title: "Transaction Failed",
    description: "An error occurred while sending the transaction. Please try again.",
    variant: "destructive",
  })
}

With this approach, developers can easily integrate Passkey authentication into their applications, making USDC transactions more secure and user-friendly.

Click here to try it out today!

Related posts

Native USDC is coming to Linea with the industry’s first bridged-to-native upgrade

Native USDC is coming to Linea with the industry’s first bridged-to-native upgrade

March 5, 2025
Modular Wallets: A latest enhancement to Programmable Wallets

Modular Wallets: A latest enhancement to Programmable Wallets

February 25, 2025
Now Available: USDC on Unichain and Circle’s Developer Tools

Now Available: USDC on Unichain and Circle’s Developer Tools

February 11, 2025
Blog
Unlocking a Better USDC Transaction Experience with Modular Wallets and Passkeys
unlocking-a-better-usdc-transaction-experience-with-modular-wallets-and-passkeys
March 5, 2025
Modular Wallets with Passkeys enable a secure, seamless, non-custodial USDC transaction experience with strong authentication.
Developer
USDC
Web3 Services
Programmable Wallets