Skip to content

Official repository for Starknet smart contracts used by the Cross-Chain Transfer Protocol

License

Notifications You must be signed in to change notification settings

circlefin/starknet-cctp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Starknet CCTP

Official implementation of Circle's Cross-Chain Transfer Protocol (CCTP) smart contracts for Starknet.

License

Overview

Cross-Chain Transfer Protocol (CCTP) is a permissionless on-chain utility that facilitates the transfer of USDC between blockchain networks. This repository contains the official Starknet implementation of CCTP smart contracts, enabling secure and efficient cross-chain USDC transfers between Starknet and other supported blockchains.

Key Features

  • Native Cross-Chain Transfers: Burn USDC on the source chain and mint native USDC on the destination chain
  • Permissionless: Anyone can transfer USDC cross-chain using CCTP
  • Attestation-Based Security: Leverages Circle's attestation service for secure message verification
  • Composable: Integrate cross-chain USDC transfers directly into your smart contracts
  • Cairo Implementation: Built using Cairo, Starknet's native smart contract language

Architecture

CCTP on Starknet consists of two main contracts:

1. Message Transmitter

  • Handles cross-chain message transmission and verification
  • Manages attestation validation and message replay prevention
  • Ensures message authenticity through signature verification

2. Token Messenger Minter

  • Manages USDC burning on source chains and minting on destination chains
  • Controls token pairs between local and remote domains
  • Enforces burn limits and transfer controls

Getting Started

Prerequisites

Installation

  1. Install toolchain and dependencies
    ./setup.sh

Usage

Building Contracts

# Build all contracts
scarb build --workspace

# Build with release profile
yarn release

Testing

# Run contract tests
snforge test

# Run end-to-end tests
yarn test:e2e

Local Development

  1. Start local Starknet network

    yarn start-network
  2. Deploy contracts

    yarn deploy
  3. Run tests

    yarn test
  4. Stop network

    yarn stop-network

Examples

Check out the examples directory for practical demonstrations of CCTP usage:

# Bridge from Starknet to EVM
npm run bridge-v2 strk2evm -- --amount 100 --fastBurn true

# Bridge from EVM to Starknet
npm run bridge-v2 evm2strk -- --amount 100

Project Structure

starknet-cctp/
├── packages/
│   ├── components/          # Reusable Cairo components
│   ├── interfaces/          # Contract interfaces
│   ├── message/            # Message construction and parsing utilities
│   ├── message_transmitter/ # Message Transmitter contract
│   ├── token_messenger_minter/ # Token Messenger Minter contract
│   └── utils/              # Shared utilities
├── scripts/                # Deployment and management scripts
├── examples/               # Usage examples
├── e2e/                   # End-to-end tests
└── tests/                 # Unit tests

Security

Security is our top priority. If you discover a security vulnerability, please follow our Security Policy.

Resources

License

This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.

About

Official repository for Starknet smart contracts used by the Cross-Chain Transfer Protocol

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published