building-with-base-account作成者: base
Integrates Base Account SDK for authentication and payments. Covers Sign in with Base (SIWB), Base Pay, Paymasters, Sub Accounts, Spend Permissions, Prolinks,…
npx skills add https://github.com/base/base-skills --skill building-with-base-accountBuilding with Base Account
Base Account is an ERC-4337 smart wallet providing universal sign-on, one-tap USDC payments, and multi-chain support (Base, Arbitrum, Optimism, Zora, Polygon, BNB, Avalanche, Lordchain, Ethereum Mainnet).
Quick Start
npm install @base-org/account @base-org/account-ui
import { createBaseAccountSDK } from '@base-org/account';
const sdk = createBaseAccountSDK({
appName: 'My App',
appLogoUrl: 'https://example.com/logo.png',
appChainIds: [8453], // Base Mainnet
});
const provider = sdk.getProvider();
Feature References
Read the reference for the feature you're implementing:
| Feature | Reference | When to Read |
|---|---|---|
| Sign in with Base | references/authentication.md | Wallet auth, SIWE, backend verification, SignInWithBaseButton, Wagmi/Privy setup |
| Base Pay | references/payments.md | One-tap USDC payments, payerInfo, server-side verification, BasePayButton |
| Subscriptions | references/subscriptions.md | Recurring charges, spend permissions, CDP wallet setup, charge/revoke lifecycle |
| Sub Accounts | references/sub-accounts.md | App-specific embedded wallets, key generation, funding |
| Capabilities | references/capabilities.md | Batch transactions, gas sponsorship (paymasters), atomic execution, auxiliaryFunds, attribution |
| Prolinks | references/prolinks.md | Shareable payment links, QR codes, encoded transaction URLs |
| Troubleshooting | references/troubleshooting.md | Popup issues, gas usage, unsupported calls, migration, doc links |
Critical Requirements
Security
- Track transaction IDs to prevent replay attacks
- Verify sender matches authenticated user to prevent impersonation
- Use a proxy to protect Paymaster URLs from frontend exposure
- Paymaster providers must be ERC-7677-compliant
- Never expose CDP credentials client-side (subscription backend only)
Popup Handling
- Generate nonces before user clicks "Sign in" to avoid popup blockers
- Use
Cross-Origin-Opener-Policy: same-origin-allow-popups same-originbreaks the Base Account popup
Base Pay
- Base Pay works independently from SIWB — no auth required for
pay() testnetparam ingetPaymentStatus()must matchpay()call- Never disable actions based on onchain balance alone — check
auxiliaryFundscapability
Sub Accounts
- Call
wallet_addSubAccounteach session before use - Ownership changes expected on new devices/browsers
- Only Coinbase Smart Wallet contracts supported for import
Smart Wallets
- ERC-6492 wrapper enables signature verification before wallet deployment
- Viem's
verifyMessage/verifyTypedDatahandle this automatically
For Edge Cases and Latest API Changes
- AI-optimized docs: docs.base.org/llms.txt
- Full reference: docs.base.org/base-account
baseのその他のスキル
adding-builder-codes
by base
Integrate Base Builder Codes (ERC-8021) into web3 applications for onchain transaction attribution and referral fee earning. Use when a project needs to append…
connecting-to-base-network
by base
Provides Base network configuration including RPC endpoints, chain IDs, and explorer URLs. Use when connecting wallets, configuring development environments,…
convert-farcaster-miniapp-to-app
by base
Converts Farcaster miniapp SDK projects into regular Base/web apps. Starts with an interactive quiz to choose between the default regular-app conversion and a…
converting-minikit-to-farcaster
by base
Converts Mini Apps from MiniKit (OnchainKit) to native Farcaster SDK. Use when migrating from @coinbase/onchainkit/minikit, converting MiniKit hooks, removing…
deploying-contracts-on-base
by base
Deploys smart contracts to Base using Foundry. Covers forge create commands, contract verification, testnet faucet setup via CDP, and BaseScan API key…
migrating-an-onchainkit-app
by base
Migrate apps from @coinbase/onchainkit to standalone wagmi / viem components with zero OnchainKit dependency.
registering-agent-base-dev
by base
Invoke this skill when a user is building or running any automated transaction sender on Base (trading bot, arbitrage bot, sniper bot, yield farmer, AI agent,…
running-a-base-node
by base
Runs a Base node for production environments. Covers hardware requirements, Reth client setup, networking, and sync troubleshooting. Use when setting up…