Learn how to bridge USDC to Arc via CCTP with Bridge Kit
Cross-Chain Transfer Protocol
(CCTP) is a
permissionless onchain utility that facilitates USDC transfers securely
between supported blockchains via native burning and minting. For more info,
visit the CCTP docs.
This tutorial walks you through bridging USDC to Arc Testnet with
Bridge Kit. Select the tab that
matches your adapter setup.
In this step, you create developer-controlled wallets on Arc Testnet and the
source chain, then fund them for the bridge flow. If you already have funded
wallets on Arc Testnet and your source chain, skip to
Step 3.
If you’re calling the API directly, you’ll need to make two requests: one to
create the wallet set and one to create the wallet. Be sure to replace the
Entity Secret ciphertext and the idempotency key in your request. If you’re
using the SDKs, this is handled automatically for you.
Create an index.ts file in the project directory and add the following code.
Pick the source chain that matches the wallet you funded. Each example uses the
exact Bridge Kit chain identifier accepted by the SDK.
In this step, you fund both wallets used in the bridge flow. If you already have
a funded Solana wallet and a funded Arc Testnet wallet, skip ahead to the bridge
step.
Create an index.ts file in the project directory and add the following code.
This example bridges USDC from Solana_Devnet to Arc_Testnet.For other supported chains, refer to the
SDK blockchain reference.
TypeScript
// Import Bridge Kit, the Solana adapter, and the Viem adapterimport { BridgeKit } from "@circle-fin/bridge-kit";import { createSolanaKitAdapterFromPrivateKey } from "@circle-fin/adapter-solana-kit";import { createViemAdapterFromPrivateKey } from "@circle-fin/adapter-viem-v2";import { inspect } from "util";// Initialize the SDKconst kit = new BridgeKit();const bridgeUSDC = async () => { try { const solanaAdapter = createSolanaKitAdapterFromPrivateKey({ privateKey: process.env.SOLANA_PRIVATE_KEY as string, }); const evmAdapter = createViemAdapterFromPrivateKey({ privateKey: process.env.EVM_PRIVATE_KEY as string, }); console.log("---------------Starting Bridging---------------"); const result = await kit.bridge({ from: { adapter: solanaAdapter, chain: "Solana_Devnet" }, to: { adapter: evmAdapter, chain: "Arc_Testnet" }, amount: "1.00", }); console.log("RESULT", inspect(result, false, null, true)); } catch (err) { console.log("ERROR", inspect(err, false, null, true)); }};void bridgeUSDC();
In this step, you fund the source wallet and the Arc Testnet destination wallet
used in the bridge flow. If you already have both wallets funded, skip ahead to
the bridge step.
Obtain testnet USDC from the Circle Faucet and the
source chain’s native token from a public faucet so you can approve and burn
USDC on the source chain.
Create an index.ts file in the project directory and add the following code.
Pick the source chain that matches the EVM wallet you funded. Each example uses
the exact Bridge Kit chain identifier accepted by the SDK.For other supported chains, refer to the
SDK blockchain reference.
Save the index.ts file and run the script in your terminal:
npm run start
For blockchains other than Arc, you will need native tokens to pay for gas.
The approve and burn steps require gas fees in the native token of the
source chain, while the mint step requires gas fees in the native token of
the destination chain.
After the script finishes, locate the returned steps array in the terminal
output. Each transaction step includes an explorerUrl field. Use that URL to
verify that the USDC amount matches the amount you transferred.The following example shows how all four steps (Approve, Burn, Fetch
Attestation, Mint) might look like in the terminal output. The values shown are
for demonstration purposes only and don’t represent a real transaction: