• Projects
  • Service
  • About
  • branding.bz
  • Podcast
  • Tips
  • FAQ
  • Recruit
  • Download
  • Contact
  • branding.bz(ブランド構築SaaS)
  • DESIGN NOW(デザインメディア)
  • X
  • LinkedIn
  • Spotify
  • Facebook

213-0011 神奈川県川崎市高津区久本3-6-7-303

© 2026 ID INC. All rights reserved

claude-skills/スキル
SKILLOfficialdevelopment

use-developer-controlled-wallets

プラグイン
circle-skills
ソース
GitHub で見る ↗
説明

Circle開発者管理ウォレット(アプリケーションがエンドユーザーに代わってウォレットの秘密鍵を完全に保管する暗号資産の財布)を作成・管理します。ウォレットセット、エンティティシークレット(認証用の秘密情報)登録、トークン送受信、残高確認、メッセージ署名(データの真正性証明)、スマートコントラクト(自動実行される取引プログラム)の実行、開発者管理ウォレットSDK(ソフトウェア開発キット)を通じたウォレット管理をカバーしています。 次のような場合に使用: 開発者管理ウォレット、エンティティシークレット、initiateDeveloperControlledWalletsClient、createWalletSet、createWallets、カストディウォレット(資産保管機能付きウォレット)、ウォレットアップグレード、ウォレット派生、署名付きデータ、コントラクト実行

原文を表示

Create and manage Circle developer-controlled wallets where the application retains full custody of wallet keys on behalf of end-users. Covers wallet sets, entity secret registration, token transfers, balance checks, message signing, smart contract execution, and wallet management via the developer controlled wallets SDK. Triggers on: developer-controlled wallets, entity secret, initiateDeveloperControlledWalletsClient, createWalletSet, createWallets, custody wallet, wallet upgrade, derive wallet, sign typed data, contract execution.

ユースケース
  • 開発者管理ウォレットを作成・管理する
  • トークンの送受信を行う
  • ウォレット残高を確認する
  • メッセージに署名して真正性を証明する
  • スマートコントラクトを実行する
本文(日本語訳)

概要

開発者向けウォレット(秘密鍵の完全管理)を使うと、アプリケーションがエンドユーザーに代わってウォレットを作成・管理できます。秘密鍵は暗号化されたエンティティシークレット(開発者の主要鍵)で保護されており、Circleがセキュリティ・取引監視・ブロックチェーンインフラを担当する一方、あなたはWallets SDKを通じてプログラムからの制御を保持します。

前提条件とセットアップ

インストール

npm install @circle-fin/developer-controlled-wallets

環境変数

CIRCLE_API_KEY=      # CircleのAPIキー(形式: PREFIX:ID:SECRET)
ENTITY_SECRET=       # 32バイトの16進数エンティティシークレット

エンティティシークレットの登録

SDK を使用する前に、開発者がエンティティシークレットを登録する必要があります。 https://developers.circle.com/wallets/dev-controlled/register-entity-secret に誘導するか、コードステップを提供してください。

references/register-secret.md を読んで、生成と登録のサンプルコードを確認してください。

重要: 開発者に代わってシークレットを登録してはいけません。開発者自身が生成・登録し、シークレットと復旧ファイルを安全に保管する必要があります。

SDK 初期化

import { initiateDeveloperControlledWalletsClient } from '@circle-fin/developer-controlled-wallets';

const circleDeveloperSdk = initiateDeveloperControlledWalletsClient({
  apiKey: process.env.CIRCLE_API_KEY,
  entitySecret: process.env.ENTITY_SECRET,
});

SDK は API リクエストのたびに新しいエンティティシークレット暗号文を自動生成します。

主要な概念

  • ウォレットセット: 単一のエンティティシークレットで管理されるウォレットのグループ。セット内のウォレットは複数のブロックチェーンにまたがりますが、EVMチェーン上では同じアドレスを共有します。

  • エンティティシークレット: 開発者向けウォレットを保護する32バイトの秘密鍵。一度だけ生成・暗号化・登録され、Circleは平文で保存することはありません。

  • エンティティシークレット暗号文: Circleの公開鍵を使ってRSA暗号化したエンティティシークレット。リプレイ攻撃(同じ要求の繰り返し実行)を防ぐため、API リクエストごとに一意である必要があります。SDK が自動的に処理します。

  • 冪等性キー: すべての変更を伴うリクエストに UUID v4 形式のidempotencyKeyが必要で、正確に1回だけ実行されることを保証します。

  • アカウントタイプ:

    • EOA(外部所有アカウント)-- デフォルト選択肢。作成手数料なし、高いスループット、最も広いチェーン対応(すべてのEVM、Solana、Aptos、NEAR)。ガス代にはネイティブトークンが必要です(Arc上ではガス資産はUSDCで、別のネイティブトークンではありません)。

    • SCA(スマートコントラクトアカウント)-- ERC-4337準拠。Circle Gas Station経由でのガススポンサーシップ、バッチ操作、柔軟な鍵管理に対応。EVMのみ(Solana、Aptos、NEARでは利用不可)。Ethereum メインネットは高いガス代のため避け、レイヤー2での利用を推奨します。

  • 対応ブロックチェーン: EVMチェーン(Ethereum、Polygon、Avalanche、Arbitrum、Base、Monad、Optimism、Unichain)、Solana、Aptos、NEAR、Arc。最新情報は https://developers.circle.com/wallets/account-types を参照してください。

トランザクションのライフサイクル

すべてのオンチェーン操作(送金、スマートコントラクト実行、ウォレットアップグレード)は同じ非同期状態機械に従います。circleDeveloperSdk.getTransaction({ id })でポーリング(状態確認を繰り返す)し、終了状態に到達するまで待機します。

成功経路: INITIATED → CLEARED → QUEUED → SENT → CONFIRMED → COMPLETE

終了状態:

  • COMPLETE -- トランザクションが成功し、オンチェーンで確定しました。
  • FAILED -- トランザクションが失敗したか、回復不可能なエラーが発生しました。
  • DENIED -- リスク審査によってトランザクションが拒否されました。
  • CANCELLED -- トランザクションがオンチェーン送信前にキャンセルされました。

中間状態:

  • INITIATED -- リクエストが受け入れられ、まだ検証やチェック前です。
  • WAITING -- 検証とコンプライアンスチェック待機中です。
  • QUEUED -- ブロックチェーンへの送信待機中です。
  • CLEARED -- コンプライアンスチェックを通過しました。
  • SENT -- ブロックチェーンに送信され、確認待機中です。
  • STUCK -- 送信されたトランザクションの手数料が現在のブロックチェーン必要手数料より低い状態。開発者がこのトランザクションをキャンセルするか加速させる必要があります。
  • CONFIRMED -- ブロックに含まれ、確定待機中です。

推奨: Webhook通知を購読してください。ポーリングの代わりに、Circleはトランザクションが終了状態に到達したときにwebhookイベントを送信し、繰り返しのgetTransaction呼び出しが不要になります。Circle Developer Consoleの「Webhooks」で公開HTTPS エンドポイントを登録してください。すべてのwebhookには署名検証用のX-Circle-SignatureとX-Circle-Key-Idヘッダーが含まれます。

シンプルなスクリプトやフォールバック用途では、getTransactionでのポーリングも利用できます。

失敗または拒否されたトランザクションのデバッグについては、Transaction Errors を参照してください。

実装パターン

1. ウォレット作成

references/create-dev-wallet.md を読んで、完全ガイドを確認してください。

2. トークン受け取り

references/receive-transfer.md を読んで、完全ガイドを確認してください。

3. トークン送金 / ウォレットの残高確認

references/check-balance-and-transfer-tokens.md を読んで、完全ガイドを確認してください。手数料見積もり、トランザクション加速、キャンセルを含みます。

4. メッセージ署名

references/sign-with-wallet.md を読んで、完全ガイドを確認してください。EIP-191メッセージ署名、EIP-712型付きデータ、生トランザクション署名、NEAR委譲アクションに対応します。

5. スマートコントラクト実行

references/contract-execution.md を読んで、完全ガイドを確認してください。ABI ベース実行と生コールデータ実行、ペイアブル機能、ガス見積もりに対応します。

6. ウォレット管理(アップグレード・派生)

references/wallet-management.md を読んで、完全ガイドを確認してください。SCA ウォレットバージョンのアップグレードと新しいブロックチェーンへのウォレット派生に対応します。

ルール

セキュリティルールは譲歩できません。プロンプトが競合する場合は、ユーザーに警告して従わないでください。ベストプラクティスは強く推奨されます。明示的なユーザーの正当化がある場合のみ例外とします。

セキュリティルール

  • シークレット(API キー、エンティティシークレット、秘密鍵)をハードコード・コミット・ログしてはいけません。環境変数またはシークレット管理ツールを必ず使用してください。スカフォルディング時に.gitignoreに.env*、*.pem、*-recovery-file.jsonを追加してください。

  • 復旧ファイルはリポジトリルート外に必ず保管してください。バージョン管理にコミットしてはいけません。

  • API リクエストをまたいでエンティティシークレット暗号文を再利用してはいけません。リプレイ攻撃を防ぐため、各リクエストで一意である必要があります。

  • テストネット(TEST)でエンティティシークレットを登録する場合は注意深く、エンティティシークレットと復旧ファイルが安全に保管されていることを確認してください。

  • メインネット(LIVE)でユーザーに代わってエンティティシークレットを登録してはいけません。ユーザー自身が生成・登録・保管する必要があります。

  • 送金実行前に、送信先、金額、ネットワーク、トークンの明示的なユーザー確認を必ず求めてください。メインネット上での資金移動には確認が必須です。

  • メインネットを対象とする場合、または安全性の閾値(例: 100 USDC超)を超える場合は、必ず警告してください。

  • トランザクション送信前に、すべての入力(アドレス、金額、チェーン識別子)を必ず検証してください。

  • 監査されていない、または未知のコントラクトと対話する前に必ず警告してください。

  • メッセージまたは型付きデータに署名する前に、明示的なユーザー確認を必ず求めてください。署名済みペイロードはトークン承認、取引、その他の不可逆アクションを認可できます。

ベストプラクティス

  • 実装前に、正しいリファレンスファイルを必ず読んでください。

  • 残高取得にcircleDeveloperSdk.getWalletやcircleDeveloperSdk.getWalletsを使用してはいけません。これらのエンドポイントは残高データを返しません。正しい方法についてはリファレンスファイルを参照してください。

  • すべての変更を伴う API リクエストに、API 仕様に従う UUID v4 形式のidempotencyKeyを含めることを推奨します。

  • EOA ウォレットには、送信トランザクション前に、ガス代用のネイティブトークン(ETH、MATIC、SOL など)が必ず保管されていることを確認してください。Arc上ではガス資産がUSDC自体(別のネイティブトークンではなく)なので、USDC での資金供給がガス代をカバーします。

  • トランザクション状態を終了状態(COMPLETE、FAILED、DENIED、CANCELLED)に到達するまで必ずポーリングしてから、完了として扱ってください。

  • Ethereum メインネットを避けるため、L2 上では SCA ウォレットを必ず優先してください。

  • メインネットを対象とする前に、明示的なユーザー確認が必要として、テストネットを必ずデフォルトにしてください。

  • コントラクト実行または大きな送金前に、ユーザーがガス代を事前に理解できるように、手数料を必ず見積もってください。

  • 実行前に、ABI 関数シグネチャとパラメータがターゲットコントラクトと一致していることを必ず確認してください。不正なシグネチャはリバート(失敗)してガスを無駄にします。

  • 可読性と監査可能性のため、生のcallDataよりabiFunctionSignature + abiParametersを推奨します。ただし calldata が信頼できるライブラリ(ethers、viem)によって生成されている場合は除きます。

代替案

  • エンドユーザーがソーシャルログイン、メール OTP、PIN認証経由で自分の鍵を管理する場合は、use-user-controlled-walletsスキルをトリガーしてください。

  • パスキー(生体認証などの暗号化技術)ベースのスマートアカウント拡張可能モジュールアーキテクチャ(マルチシグ、セッションキーなど)が必要な場合は、use-modular-walletsスキルをトリガーしてください。

リファレンスリンク

  • Circle Developer Docs -- ウェブサイトから関連ドキュメントを探す際には、必ず最初に読んでください。

免責事項: このスキルは「現状のまま」提供され、保証なく、Circle Developer Terms の

原文(English)を表示

Overview

Developer-controlled wallets let your application create and manage wallets on behalf of end users, with full custody of private keys secured through an encrypted entity secret. Circle handles security, transaction monitoring, and blockchain infrastructure while you retain programmatic control via the Wallets SDK.

Prerequisites / Setup

Installation

npm install @circle-fin/developer-controlled-wallets

Environment Variables

CIRCLE_API_KEY=      # Circle API key (format: PREFIX:ID:SECRET)
ENTITY_SECRET=       # 32-byte hex entity secret

Entity Secret Registration

The developer must register an entity secret before using the SDK. Direct them to https://developers.circle.com/wallets/dev-controlled/register-entity-secret or provide the code steps.

READ references/register-secret.md for the generation and registration snippets.

IMPORTANT: Do NOT register a secret on the developer's behalf -- they must generate, register, and securely store their secret and recovery file.

SDK Initialization

import { initiateDeveloperControlledWalletsClient } from '@circle-fin/developer-controlled-wallets';

const circleDeveloperSdk = initiateDeveloperControlledWalletsClient({
  apiKey: process.env.CIRCLE_API_KEY,
  entitySecret: process.env.ENTITY_SECRET,
});

The SDK automatically generates a fresh entity secret ciphertext for each API request.

Core Concepts

  • Wallet Sets: A group of wallets managed by a single entity secret. Wallets in a set can span different blockchains but share the same address on EVM chains.
  • Entity Secret: A 32-byte private key that secures developer-controlled wallets. Generated, encrypted, and registered once. Circle never stores it in plain text.
  • Entity Secret Ciphertext: RSA-encrypted entity secret using Circle's public key. Must be unique per API request to prevent replay attacks. The SDK handles this automatically.
  • Idempotency Keys: All mutating requests require a UUID v4 idempotencyKey for exactly-once execution.
  • Account Types:
    • EOA (Externally Owned Account) -- default choice. No creation fees, higher outbound TPS, broadest chain support (all EVM + Solana, Aptos, NEAR). Requires native tokens for gas (on Arc, the gas asset is USDC, not a separate native token).
    • SCA (Smart Contract Account) -- ERC-4337 compliant. Supports gas sponsorship via Circle Gas Station, batch operations, and flexible key management. EVM-only (not available on Solana, Aptos, NEAR). Avoid on Ethereum mainnet due to high gas costs; prefer on L2s.
  • Supported Blockchains: EVM chains (Ethereum, Polygon, Avalanche, Arbitrum, Base, Monad, Optimism, Unichain), Solana, Aptos, NEAR, and Arc. See https://developers.circle.com/wallets/account-types for the latest.

Transaction Lifecycle

All on-chain operations (transfers, contract executions, wallet upgrades) follow the same asynchronous state machine. Poll with circleDeveloperSdk.getTransaction({ id }) until a terminal state is reached.

Happy path: INITIATED -> CLEARED -> QUEUED -> SENT -> CONFIRMED -> COMPLETE

Terminal states:

  • COMPLETE -- Transaction succeeded and is finalized on-chain.
  • FAILED -- Transaction reverted or encountered an unrecoverable error.
  • DENIED -- Transaction was rejected by risk screening.
  • CANCELLED -- Transaction was cancelled before on-chain submission.

Intermediate states:

  • INITIATED -- Request accepted, not yet validated or checked.
  • WAITING -- In queue for validation and compliance checks.
  • QUEUED -- Queued for submission to the blockchain.
  • CLEARED -- Passed compliance checks.
  • SENT -- Submitted to the blockchain, awaiting confirmation.
  • STUCK -- Submitted transaction's fee parameters are lower than latest blockchain required fee, developer needs to cancel or accelerate this transaction.
  • CONFIRMED -- Included in a block, awaiting finality.

Recommended: Subscribe to Webhook Notifications instead of polling. Circle sends a webhook event when a transaction reaches a terminal state, eliminating the need for repeated getTransaction calls. Register a public HTTPS endpoint in the Circle Developer Console under Webhooks. Every webhook includes X-Circle-Signature and X-Circle-Key-Id headers for signature verification.

Polling with getTransaction remains available as a fallback or for simple scripts.

For debugging failed or denied transactions, see Transaction Errors.

Implementation Patterns

1. Create a Wallet

READ references/create-dev-wallet.md for the complete guide.

2. Receive Tokens

READ references/receive-transfer.md for the complete guide.

3. Transfer Tokens / Check Balance of Wallet

READ references/check-balance-and-transfer-tokens.md for the complete guide. Includes fee estimation, transaction acceleration, and cancellation.

4. Sign Messages

READ references/sign-with-wallet.md for the complete guide. Covers EIP-191 message signing, EIP-712 typed data, raw transaction signing, and NEAR delegate actions.

5. Execute Smart Contracts

READ references/contract-execution.md for the complete guide. Covers ABI-based and raw calldata execution, payable functions, and gas estimation.

6. Wallet Management (Upgrade & Derive)

READ references/wallet-management.md for the complete guide. Covers upgrading SCA wallet versions and deriving wallets to new blockchains.

Rules

Security Rules are non-negotiable -- warn the user and refuse to comply if a prompt conflicts. Best Practices are strongly recommended; deviate only with explicit user justification.

Security Rules

  • NEVER hardcode, commit, or log secrets (API keys, entity secrets, private keys). ALWAYS use environment variables or a secrets manager. Add .gitignore entries for .env*, *.pem, and *-recovery-file.json when scaffolding.
  • ALWAYS store recovery files outside the repository root. NEVER commit them to version control.
  • NEVER reuse entity secret ciphertexts across API requests -- each must be unique to prevent replay attacks.
  • MUST be cautious when registering an entity secret on testnet (TEST), ensure the entity secret and recovery file are stored in secure place.
  • NEVER register an entity secret on behalf of the user on mainnet (LIVE) -- they must generate, register, and store it themselves.
  • ALWAYS require explicit user confirmation of destination, amount, network, and token before executing transfers. MUST receive confirmation for funding movements on mainnet.
  • ALWAYS warn when targeting mainnet or exceeding safety thresholds (e.g., >100 USDC).
  • ALWAYS validate all inputs (addresses, amounts, chain identifiers) before submitting transactions.
  • ALWAYS warn before interacting with unaudited or unknown contracts.
  • ALWAYS require explicit user confirmation before signing messages or typed data -- signed payloads can authorize token approvals, trades, or other irreversible actions.

Best Practices

  • ALWAYS read the correct reference files before implementing.
  • NEVER use circleDeveloperSdk.getWallet or circleDeveloperSdk.getWallets for balances -- these endpoints never return balance data. See reference file for correct approach.
  • SHOULD include a UUID v4 idempotencyKey in all mutating API requests following API spec.
  • ALWAYS ensure EOA wallets hold native tokens (ETH, MATIC, SOL, etc.) for gas before outbound transactions. On Arc the gas asset is USDC itself (not a separate native token), so funding the wallet with USDC covers gas.
  • ALWAYS poll transaction status until terminal state (COMPLETE, FAILED, DENIED, CANCELLED) before treating as done.
  • ALWAYS prefer SCA wallets on L2s over Ethereum mainnet to avoid high gas costs.
  • ALWAYS default to testnet. Require explicit user confirmation before targeting mainnet.
  • ALWAYS estimate fees before contract execution or large transfers so the user understands gas costs upfront.
  • ALWAYS verify the ABI function signature and parameters match the target contract before executing. Incorrect signatures will revert and waste gas.
  • ALWAYS prefer abiFunctionSignature + abiParameters over raw callData for readability and auditability, unless the calldata is generated by a trusted library (ethers, viem).

Alternatives

  • Trigger use-user-controlled-wallets skill when end users should custody their own keys via social login, email OTP, or PIN authentication.
  • Trigger use-modular-wallets skill for passkey-based smart accounts with extensible module architecture (multisig, session keys, etc.).

Reference Links

  • Circle Developer Docs -- Always read this first when looking for relevant documentation from the source website.

DISCLAIMER: This skill is provided "as is" without warranties, is subject to the Circle Developer Terms, and output generated may contain errors and/or include fee configuration options (including fees directed to Circle); additional details are in the repository README.

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。