Gasless & Automated Cross-Chain Transfers Powered by Gelato

Gelato Team

Nov 30, 2023

Tl;dr

  • Circle’s CCTP facilitates permissionless USDC transfers via native burning and minting

  • Native burning and minting involves a transaction on the source and destination chain which requires gas and manual user interaction

  • Gelato enables gasless and automated cross-chain transfers in which the USDC itself covers the transaction fee

  • Builders can leverage the new Gasless CCTP SDK for effortless integration into their applications

Moving tokens between chains is a crucial component in achieving blockchain interoperability, allowing users to utilize their assets on multiple networks and access various ecosystems. However, existing lock-and-mint bridges fragment liquidity and pose security concerns regarding the backing of their synthetic tokens.

Circle’s Cross-Chain Transfer Protocol addresses these limitations by enabling permissionless USDC transfers between chains via native burning and minting. Nevertheless, a barrier of entry remains—the need for native tokens to facilitate transactions on both the source and destination blockchains. By combining Gelato’s Functions and Relay service with Circle’s CCTP, this process is streamlined while remaining trust-minimized.

Workflow

  1. Quick Start Guide

  2. How CCTP works

  3. Vision

  4. Gasless & Automated CCTP

  5. Integration

  6. Conclusion

Quick Start Guide

An example implementation is available on GitHub along with quick start instructions and documentation. The repository demonstrates a cross-chain transfer of 10 USDC from Avalanche to Arbitrum: github.com/gelatodigital/gasless-cctp

import { ethers } from "ethers";
import { transfer, ChainId } from "./src/cctp-sdk";

const PRIVATE_KEY = "••";

const main = async () => {
  const wallet = new ethers.Wallet(PRIVATE_KEY);
  const taskId = await transfer(
    wallet.address,
    ethers.parseUnits("100", 6),
    ethers.parseUnits("1", 6),
    ethers.parseUnits("1", 6),
    ChainId.Arbitrum,
    ChainId.Avalanche,
    wallet.signTypedData.bind(wallet)
  );
  console.log("https://api.gelato.digital/tasks/status/" + taskId);
};

Note: We bind the ethers signed typed data method so that “this” refers to the wallet.

How CCTP works

  1. USDC is burned on the source chain, emitting an event

  2. Circle observes this event and signs an attestation authorizing minting on the destination chain

  3. USDC is then minted on the destination chain using the provided attestation

Limitations: steps 1 and 3 require on-chain transactions with native tokens for fees. Step 2 can take ~13 minutes, requiring user presence to finalize. Once transferred, users again need native tokens to use their USDC on the destination chain.

Vision

Imagine moving USDC between chains while paying all associated costs with USDC itself. Users wouldn’t need ETH/AVAX or other native tokens. USDC would become a universal interoperability and payment layer, abstracting away gas complexities.

Gasless & Automated CCTP

Gelato Functions + Relay enable fully automated transfers with fees covered in USDC. Relayers incur gas and are compensated either via 1Balance or synchronously in USDC. Web3 Functions index requests, fetch attestations, and relay final minting transactions. Forwarder contracts deployed on each CCTP-compatible chain facilitate fee payments.

  1. Users sign three off-chain signatures upfront: two ERC-3009 approvals for transfer and one ERC-2771 meta-tx signature with fee limits and destination intent.

  2. Relay burns USDC on the source chain, emitting events.

  3. Web3 Function fetches attestations from Circle.

  4. Relay mints USDC on the destination chain using the attestation.

Note: Gasless means no native tokens are needed by the user; relayers still pay gas and are reimbursed in USDC.

Integration

The Gasless CCTP SDK packages all logic for easy integration. Bridges and dApps can adopt it to enable gasless USDC transfers. Example frontend: github.com/gelatodigital/gasless-cctp-frontend

await transfer(
  owner,       // owner account address
  amount,      // total amount including fees
  srcMaxFee,   // max fee on source chain
  dstMaxFee,   // max fee on destination chain
  srcChainId,  // source chain ID
  dstChainId,  // destination chain ID
  signTypedData // callback for typed data signing
);

Conclusion

Gasless CCTP enables seamless, secure, gas-token-agnostic asset transfers. With Gelato Relay + Functions, USDC itself pays fees, simplifying interoperability. The Gasless CCTP SDK makes this available for developers immediately.

About Gelato

Gelato is a Web3 Cloud Platform empowering developers to create automated, gasless, and off-chain-aware Layer 2 chains and smart contracts. Over 400 projects rely on Gelato to power millions of DeFi, NFT, and gaming transactions.

  • Gelato RaaS: Deploy ZK or OP L2s in one click with Account Abstraction and Gelato middleware baked in.

  • VRF: Fast, on-chain verifiable randomness for blockchain apps.

  • Functions: Serverless, event-driven automation for blockchain transactions.

  • Relay: Robust gasless transaction infrastructure via simple API.

  • Account Abstraction SDK: Built with Safe, combining Gelato’s gasless transactions with the most secure smart contract wallet.

Subscribe to our newsletter and follow Gelato on Twitter for the latest updates. Explore career opportunities at gelato.cloud/careers.

Ready to build?

Start with a testnet, launch your mainnet in days, and scale with industry-leading UX.

Ready to build?

Start with a testnet, launch your mainnet in days, and scale with industry-leading UX.

Ready to build?

Start with a testnet, launch your mainnet in days, and scale with industry-leading UX.

Ready to build?

Start with a testnet, launch your mainnet in days, and scale with industry-leading UX.