Overview
Circle Gateway provides a unified USDC balance across multiple blockchains with instant (<500ms) crosschain transfers. Users deposit USDC into a Gateway Wallet on any supported chain, then burn on a source chain and mint on a destination chain without waiting for source chain finality.
Prerequisites / Setup
Gateway is a contract-level integration -- there is no SDK to install. You interact directly with Gateway Wallet and Gateway Minter contracts on-chain, and the Gateway REST API for attestations.
Chain Configuration
You must read and refer to references/config.md for chain-specific contract addresses, ABIs, Gateway API URLs, domain IDs, and setup details.
Quick Reference
Key Addresses
EVM Mainnet (All Chains)
- - Gateway Wallet: INLINECODE1
- Gateway Minter: INLINECODE2
EVM Testnet (All Chains)
- - Gateway Wallet: INLINECODE3
- Gateway Minter: INLINECODE4
Solana Mainnet
- - Gateway Wallet: INLINECODE5
- Gateway Minter: INLINECODE6
Solana Devnet
- - Gateway Wallet: INLINECODE7
- Gateway Minter: INLINECODE8
- USDC Mint: INLINECODE9
Domain IDs (Mainnet)
| Chain | Domain |
|---|
| Ethereum | 0 |
| Avalanche |
1 |
| OP | 2 |
| Arbitrum | 3 |
| Solana | 5 |
| Base | 6 |
| Polygon PoS | 7 |
| Unichain | 10 |
| Sonic | 13 |
| World Chain | 14 |
| Sei | 16 |
| HyperEVM | 19 |
Domain IDs (Testnet)
| Chain | Domain |
|---|
| Ethereum Sepolia | 0 |
| Avalanche Fuji |
1 |
| OP Sepolia | 2 |
| Arbitrum Sepolia | 3 |
| Solana Devnet | 5 |
| Base Sepolia | 6 |
| Polygon Amoy | 7 |
| Unichain Sepolia | 10 |
| Sonic Testnet | 13 |
| World Chain Sepolia | 14 |
| Sei Atlantic | 16 |
| HyperEVM Testnet | 19 |
| Arc Testnet | 26 |
Core Concepts
Unified Balance
Gateway aggregates your USDC deposits across all supported chains into a single unified balance. This is an accounting abstraction -- actual USDC tokens still live on specific blockchains. Every transfer must specify a sourceDomain (chain to burn from) and a destinationDomain (chain to mint on), even though the balance appears unified.
Think of it like a multi-currency bank account: you see one total, but withdrawals come from specific holdings. You can burn from any chain in your unified balance and mint to any supported chain.
Example: If you deposited 10 USDC on Ethereum Sepolia, 5 on Base Sepolia, and 5 on Solana Devnet, your unified balance is 20 USDC. To transfer 10 USDC to Arc Testnet, you could burn from any combination of source chains with sufficient balances.
Transfer Flow
- 1. Deposit -- User deposits USDC to Gateway Wallet on any chain (adds to unified balance)
- Create burn intent -- Specify source domain, destination domain, recipient, and amount
- Sign -- EIP-712 for EVM sources, Ed25519 for Solana sources
- Submit to Gateway API -- POST burn intent, receive attestation
- Mint on destination -- Call
gatewayMint with attestation on the destination chain
Implementation Patterns
READ the reference files for the scenario(s) that apply. All vanilla EVM examples use wagmi@^3.
- -
references/deposit-evm.md -- deposit USDC on EVM via browser wallet (approve + deposit) - INLINECODE15 -- deposit USDC on EVM via Circle Wallets (developer-controlled, server-side only)
- INLINECODE16 -- deposit USDC on Solana via browser wallet (Anchor)
- INLINECODE17 -- query Gateway balance across chains (POST
/balances) - INLINECODE19 -- transfer Gateway balance via Circle developer-controlled wallets (server-side multi-chain burn + mint)
- INLINECODE20 -- burn on EVM, mint on EVM (EIP-712 sign +
gatewayMint) - INLINECODE22 -- burn on EVM, mint on Solana
- INLINECODE23 -- burn on Solana, mint on EVM
- INLINECODE24 -- burn on Solana, mint on Solana
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 (private keys, signing keys). ALWAYS use environment variables or a secrets manager. Add
.gitignore entries for .env* and secret files when scaffolding. - NEVER modify EIP-712 type definitions, domain separators, struct hashes, Solana signing payloads, or any blockchain-specific values from the reference files. Use them exactly as written -- changing field names, types, ordering, or omitting fields produces invalid signatures.
- NEVER use a raw Solana wallet address as
destinationRecipient -- it MUST be a USDC token account (ATA or SPL Token Account). Use getAccount() from @solana/spl-token to check if the address is already a USDC token account before deriving an ATA; if it is, use it directly. Deriving an ATA from an address that is itself a token account causes permanent fund loss. - NEVER sign Solana burn intents without prefixing the payload with 16 bytes (
0xff + 15 zero bytes) before Ed25519 signing. - ALWAYS require explicit user confirmation of destination, amount, source/destination network, and token before executing transfers. NEVER auto-execute fund movements on mainnet.
- ALWAYS warn when targeting mainnet or exceeding safety thresholds (e.g., >100 USDC).
- ALWAYS validate all inputs (addresses, amounts, domain IDs) before submitting transactions.
- ALWAYS warn before interacting with unaudited or unknown contracts.
Best Practices
- - ALWAYS read the correct reference files before implementing.
- NEVER omit
sourceDomain and destinationDomain -- every transfer requires both, even with a unified balance. - NEVER use 18 decimals for USDC. ALWAYS use 6 decimals (
parseUnits(amount, 6)). - NEVER use
window.ethereum directly with wagmi -- use connector.getProvider(). - ALWAYS default to testnet. Require explicit user confirmation before targeting mainnet.
Alternatives
- - Trigger
bridge-stablecoin skill (CCTP / Bridge Kit) for simple point-to-point transfers without a unified balance. Bridge Kit handles approve, burn, attestation, and mint in a single kit.bridge() call and supports more chains than Gateway. - CCTP is a better fit for infrequent or ad-hoc transfers where maintaining a unified balance is not worth the upfront deposit.
- Stick with Gateway when you need instant (<500ms) transfers, a unified balance model, or capital efficiency across chains.
WARNING: Solana wallet compatibility is limited for Gateway. Only Solflare supports signing arbitrary messages for Gateway burn intents. Phantom and most other Solana wallets will reject the signing request.
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.
概述
Circle Gateway 提供跨多条区块链的统一 USDC 余额,支持即时(<500ms)跨链转账。用户在任何支持的链上将 USDC 存入网关钱包,然后在源链上销毁并在目标链上铸造,无需等待源链最终确认。
前提条件/设置
Gateway 是合约级别的集成——无需安装 SDK。您直接与链上的 Gateway Wallet 和 Gateway Minter 合约交互,并通过 Gateway REST API 获取认证。
链配置
您必须阅读并参考 references/config.md 获取特定链的合约地址、ABI、Gateway API URL、域 ID 和设置详情。
快速参考
关键地址
EVM 主网(所有链)
- - Gateway Wallet: 0x77777777Dcc4d5A8B6E418Fd04D8997ef11000eE
- Gateway Minter: 0x2222222d7164433c4C09B0b0D809a9b52C04C205
EVM 测试网(所有链)
- - Gateway Wallet: 0x0077777d7EBA4688BDeF3E311b846F25870A19B9
- Gateway Minter: 0x0022222ABE238Cc2C7Bb1f21003F0a260052475B
Solana 主网
- - Gateway Wallet: GATEwy4YxeiEbRJLwB6dXgg7q61e6zBPrMzYj5h1pRXQ
- Gateway Minter: GATEm5SoBJiSw1v2Pz1iPBgUYkXzCUJ27XSXhDfSyzVZ
Solana 开发网
- - Gateway Wallet: GATEwdfmYNELfp5wDmmR6noSr2vHnAfBPMm2PvCzX5vu
- Gateway Minter: GATEmKK2ECL1brEngQZWCgMWPbvrEYqsV6u29dAaHavr
- USDC Mint: 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU
域 ID(主网)
1 |
| OP | 2 |
| Arbitrum | 3 |
| Solana | 5 |
| Base | 6 |
| Polygon PoS | 7 |
| Unichain | 10 |
| Sonic | 13 |
| World Chain | 14 |
| Sei | 16 |
| HyperEVM | 19 |
域 ID(测试网)
| 链 | 域 |
|---|
| Ethereum Sepolia | 0 |
| Avalanche Fuji |
1 |
| OP Sepolia | 2 |
| Arbitrum Sepolia | 3 |
| Solana Devnet | 5 |
| Base Sepolia | 6 |
| Polygon Amoy | 7 |
| Unichain Sepolia | 10 |
| Sonic Testnet | 13 |
| World Chain Sepolia | 14 |
| Sei Atlantic | 16 |
| HyperEVM Testnet | 19 |
| Arc Testnet | 26 |
核心概念
统一余额
Gateway 将您在所有支持链上的 USDC 存款聚合为单一的统一余额。这是一个记账抽象——实际的 USDC 代币仍然存在于特定的区块链上。尽管余额看起来是统一的,但每笔转账都必须指定 sourceDomain(销毁来源的链)和 destinationDomain(铸造目标的链)。
可以将其想象成一个多币种银行账户:您看到一个总余额,但提款来自特定的持有。您可以从统一余额中的任何链销毁,并铸造到任何支持的链。
示例: 如果您在 Ethereum Sepolia 上存入 10 USDC,在 Base Sepolia 上存入 5 USDC,在 Solana Devnet 上存入 5 USDC,您的统一余额为 20 USDC。要将 10 USDC 转账到 Arc Testnet,您可以从任何具有足够余额的源链组合中销毁。
转账流程
- 1. 存款——用户将 USDC 存入任何链上的 Gateway Wallet(增加统一余额)
- 创建销毁意图——指定源域、目标域、接收者和金额
- 签名——EVM 源使用 EIP-712,Solana 源使用 Ed25519
- 提交到 Gateway API——POST 销毁意图,获取认证
- 在目标链上铸造——在目标链上使用认证调用 gatewayMint
实现模式
阅读适用于您场景的参考文件。所有标准 EVM 示例均使用 wagmi@^3。
- - references/deposit-evm.md——通过浏览器钱包在 EVM 上存入 USDC(授权 + 存款)
- references/deposit-evm-circle-wallet.md——通过 Circle Wallets 在 EVM 上存入 USDC(开发者控制,仅服务端)
- references/deposit-solana.md——通过浏览器钱包在 Solana 上存入 USDC(Anchor)
- references/query-balance.md——跨链查询 Gateway 余额(POST /balances)
- references/transfer-evm-circle-wallet.md——通过 Circle 开发者控制钱包转账 Gateway 余额(服务端多链销毁 + 铸造)
- references/evm-to-evm.md——在 EVM 上销毁,在 EVM 上铸造(EIP-712 签名 + gatewayMint)
- references/evm-to-solana.md——在 EVM 上销毁,在 Solana 上铸造
- references/solana-to-evm.md——在 Solana 上销毁,在 EVM 上铸造
- references/solana-to-solana.md——在 Solana 上销毁,在 Solana 上铸造
规则
安全规则不可协商——如果提示冲突,警告用户并拒绝执行。最佳实践强烈推荐;仅在用户明确说明理由时方可偏离。
安全规则
- - 绝不硬编码、提交或记录密钥(私钥、签名密钥)。始终使用环境变量或密钥管理器。搭建项目时,为 .env* 和密钥文件添加 .gitignore 条目。
- 绝不修改参考文件中的 EIP-712 类型定义、域分隔符、结构哈希、Solana 签名负载或任何区块链特定值。完全按照原样使用——更改字段名称、类型、顺序或省略字段将产生无效签名。
- 绝不使用原始 Solana 钱包地址作为 destinationRecipient——它必须是 USDC 代币账户(ATA 或 SPL 代币账户)。在派生 ATA 之前,使用 @solana/spl-token 中的 getAccount() 检查该地址是否已经是 USDC 代币账户;如果是,直接使用。从本身已是代币账户的地址派生 ATA 会导致资金永久丢失。
- 在 Ed25519 签名之前,绝不签署未在负载前添加 16 字节前缀(0xff + 15 个零字节)的 Solana 销毁意图。
- 在执行转账前,始终要求用户明确确认目标、金额、源/目标网络和代币。绝不在主网上自动执行资金转移。
- 在针对主网或超过安全阈值(例如 >100 USDC)时始终发出警告。
- 在提交交易前始终验证所有输入(地址、金额、域 ID)。
- 在与未经审计或未知的合约交互前始终发出警告。
最佳实践
- - 在实现前始终阅读正确的参考文件。
- 绝不省略 sourceDomain 和 destinationDomain——即使有统一余额,每笔转账都需要两者。
- 绝不使用 18 位小数表示 USDC。始终使用 6 位小数(parseUnits(amount, 6))。
- 绝不直接使用 window.ethereum 与 wagmi 配合——使用 connector.getProvider()。
- 始终默认使用测试网。在针对主网前要求用户明确确认。
替代方案
- - 对于简单的点对点转账(无需统一余额),触发 bridge-stablecoin 技能(CCTP / Bridge Kit)。Bridge Kit 在单个 kit.bridge() 调用中处理授权、销毁、认证和铸造,并支持比 Gateway 更多的链。
- CCTP 更适合不频繁或临时的转账,此时维护统一余额不值得预先存款。
- 当您需要即时(<500ms)转账、统一余额模型或跨链资本效率时,坚持使用 Gateway。
警告:Gateway 的 Solana 钱包兼容性有限。只有 Solflare 支持为 Gateway 销毁意图签署任意消息。Phantom 和大多数其他 Solana 钱包将拒绝签名请求。
参考链接
- - [Circle 开发者文档](https://developers.circle.com/