1/5
## Circle's Cross-Chain Transfer Protocol (CCTP) CCTP is a protocol that facilitates the transfer of USDC across different blockchains. It uses a burn and mint mechanism instead of a traditional lock and unlock mechanism. Here are the steps involved in a standard CCTP transfer: 1. **Initiation:** A user initiates a transfer using a CCTP enabled app and specifies their recipient address on the destination chain. 2. **Burn the Tokens:** The specified USDC amount is burned on the source chain. 3. **Instant Attestation:** Circle's attestation service attests to the burn event (after soft finality) and issues a signed attestation. 4. **Fast Transfer Allowance Backing:** The burned USDC amount is backed by Circle's Fast Transfer allowance until hard finality is reached. This acts as a buffer to protect against reorgs. The Fast Transfer allowance is temporarily debited by the burn amount. 5. **Mint the Tokens:** The app fetches the signed attestation from Circle and uses it to trigger the minting of USDC on the destination chain. An on-chain fee is collected during this process. 6. **Fast Transfer Allowance Replenishment:** Once hard finality is reached, the amount is credited back to Circle's Fast Transfer allowance. 7. **Completion:** The recipient wallet receives the newly minted USDC on the destination chain and the transfer is complete. **CCTP V2 (Fast Transfer)** CCTP V2 offers a faster transfer option that's currently available on testnet. Here are the steps involved: 1. **Initiation:** A user initiates a transfer using a CCTP V2 enabled app and specifies their recipient address on the destination chain. 2. **Burn the Tokens:** The specified USDC amount is burned on the source chain. 3. **Instant Attestation:** Circle's attestation service issues a signed attestation after "soft finality." 4. **Fast Transfer Allowance Backing:** While waiting for hard finality, the burned USDC amount is backed by Circle's Fast Transfer allowance. 5. **Mint the Tokens:** The signed attestation is fetched. USDC is minted to the recipient. An on-chain fee is collected. 6. **Fast Transfer Allowance Replenishment:** Once hard finality is reached, the amount is credited back to the Fast Transfer Allowance. 7. **Completion:** The recipient wallet receives the newly minted USDC on the destination chain. **Code Example** Here's a code example demonstrating the process using ethers.js: ```javascript const ethers = require("ethers"); const dotenv = require("dotenv"); const tokenMessengerAbi = require("../abis/cctp/TokenMessenger.json"); const messageAbi = require("../abis/cctp/Message.json"); const usdcAbi = require("../abis/usdc.json"); const messageTransmitterAbi = require("../abis/cctp/MessageTransmitter.json"); dotenv.config(); const main = async () => { const ethProvider = new ethers.providers.JsonRpcProvider( process.env.TESTNET_ETH_RPC ); const baseProvider = new ethers.providers.JsonRpcProvider( process.env.BASE_TESTNET_RPC ); // Wallets const ethWallet = new ethers.Wallet(process.env.ETH_PRIVATE_KEY, ethProvider); const baseWallet = new ethers.Wallet( process.env.BASE_PRIVATE_KEY, baseProvider ); // Testnet Contract Addresses const ETH_TOKEN_MESSENGER_CONTRACT_ADDRESS = "0x9f886793C72Fef59B4F889444E4156f7b70AA5"; const USDC_ETH_CONTRACT_ADDRESS = "0x1c7D4B196C68b014743fBc611692397987238"; const ETH_MESSAGE_CONTRACT_ADDRESS = "0x80537e4de8AD72D819bba3a81B45ACa087C9"; const BASE_MESSAGE_TRANSMITTER_CONTRACT_ADDRESS = "0x78657A51FC2D6b369d2C0f932eF7AEe91088BEFD"; // Initialize contracts const ethTokenMessenger = new ethers.Contract( ETH_TOKEN_MESSENGER_CONTRACT_ADDRESS, tokenMessengerAbi, ethWallet ); const usdcEth = new ethers.Contract( USDC_ETH_CONTRACT_ADDRESS, usdcAbi, ethWallet ); const ethMessage = new ethers.Contract( ETH_MESSAGE_CONTRACT_ADDRESS, messageAbi, ethWallet ); const baseMessageTransmitter = new ethers.Contract( BASE_MESSAGE_TRANSMITTER_CONTRACT_ADDRESS, messageTransmitterAbi, baseWallet ); const baseDestinationDomain = 6; const destinationAddressInBytes32 = await ethMessage.addressToBytes32( process.env.RECIPIENT_ADDRESS ); const amount = process.env.AMOUNT; // Convert recipient address to bytes32 const mintRecipient = await ethMessage.addressToBytes32( process.env.RECIPIENT_ADDRESS ); // Approve const approveTx = await usdcEth.approve( ETH_TOKEN_MESSENGER_CONTRACT_ADDRESS, amount ); await approveTx.wait(); console.log("ApproveTxReceipt:", approveTx.hash); // Burn USDC const burnTx = await ethTokenMessenger.depositForBurn( amount, baseDestinationDomain, destinationAddressInBytes32, USDC_ETH_CONTRACT_ADDRESS ); await burnTx.wait(); console.log("BurnTxReceipt:", burnTx.hash); // Retrieve message bytes const receipt = await ethProvider.getTransactionReceipt(burnTx.hash); const eventTopic = ethers.utils.id("MessageSent(bytes)"); const log = receipt.logs.find( (l) => l.topics[0] === eventTopic ); const messageBytes = ethers.utils.defaultAbiCoder.decode( ["bytes"], log.data )[0]; console.log("MessageBytes:", messageBytes); const messageHash = ethers.utils.keccak256(messageBytes); console.log("MessageHash:", messageHash); // Fetch attestation signature let attestationResponse = { status: "pending" }; while (attestationResponse.status !== "complete") { const response = await fetch( `https://iris-api-sandbox.circle.com/attestations/${messageHash}` ); attestationResponse = await response.json(); await new Promise((r) => setTimeout(r, 2000)); } const attestationSignature = attestationResponse.attestation; console.log("Signature:", attestationSignature); // Receive funds on BASE const receiveTx = await baseMessageTransmitter.receiveMessage( messageBytes, attestationSignature ); await receiveTx.wait(); console.log("ReceiveTxReceipt:", receiveTx.hash); }; main().catch(console.error); ``` **Security Features** CCTP incorporates several security features to enhance reliability: 1. **Attestation Verification:** Every transaction is verified through the attestation process, ensuring the minted USDC is genuine. 2. **Minter Allowance Limits:** CCTP imposes limits for burning and minting. Circle sets a minter allowance, which specifies the maximum amount of USDC that can be minted. This limit can only be increased by Circle, preventing the burning of USDC on the source chain that cannot be minted on the destination chain. This limit can be queried from the TokenMinter smart contract. 3. **Public Burn Limit Per Message:** CCTP provides a public burn limit per message mapping that can be queried to determine the allowed burn limit for each message. **Use Cases** CCTP enables a number of use cases: * **Fast and Secure Cross-Chain Rebalancing:** Market makers and exchanges can move USDC across chains to optimize liquidity, reduce costs, and react to market shifts. * **Composable Cross-Chain Swaps:** Users can swap assets across blockchains by routing through USDC. * **Programmable Cross-Chain Purchases:** CCTP V2 includes hooks for post-transfer actions after minting occurs, such as purchasing an NFT or staking tokens. **Further Information** For more information on CCTP, please refer to their documentation.
A comprehensive guide to Circle's Cross Chain Transfer Protocol or CCTP. The lesson covers the basics of CCTP, a solution for moving USDC across different blockchains, the two transfer methods, standard and fast, as well as the security features of this protocol.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
Advanced smart contract development
How to develop a stablecoin
How to develop a DeFi protocol
How to develop a DAO
Advanced smart contracts testing
Fuzz testing
Manual verification
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Security researcher
$49,999 - $120,000 (avg. salary)
Guest lecturers:
Juliette Chevalier
Lead Developer relations at Aragon
Nader Dabit
Director of developer relations at Avara
Ally Haire
Developer relations at Protocol Labs
Harrison
Founder at GasliteGG
Last updated on March 11, 2025
Solidity Developer
Advanced FoundryDuration: 36min
Duration: 3h 06min
Duration: 5h 02min
Duration: 6h 02min
Duration: 2h 47min
Duration: 1h 23min
Duration: 4h 28min
Duration: 1h 19min
Duration: 1h 10min
Course Overview
About the course
Advanced smart contract development
How to develop a stablecoin
How to develop a DeFi protocol
How to develop a DAO
Advanced smart contracts testing
Fuzz testing
Manual verification
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Security researcher
$49,999 - $120,000 (avg. salary)
Guest lecturers:
Juliette Chevalier
Lead Developer relations at Aragon
Nader Dabit
Director of developer relations at Avara
Ally Haire
Developer relations at Protocol Labs
Harrison
Founder at GasliteGG
Last updated on March 11, 2025
Testimonials
Read what our students have to say about this course.
Chainlink
Chainlink
Gustavo Gonzalez
Solutions Engineer at OpenZeppelin
Francesco Andreoli
Lead Devrel at Metamask
Albert Hu
DeForm Founding Engineer
Radek
Senior Developer Advocate at Ceramic
Boidushya
WalletConnect
Idris
Developer Relations Engineer at Axelar