Overview
The cctp-go SDK provides a comprehensive Go implementation for Cross-Chain Transfer Protocol (CCTP) V2 integration. It offers high-level abstractions for cross-chain USDC transfers with built-in chain configurations, contract bindings, and transfer orchestration.Package Structure
The SDK is organized into several key packages:Core Components
Chain Configuration
Chain Type
The
Chain struct contains all necessary configuration for interacting with CCTP-enabled chains:- Chain metadata (name, ID, domain)
- Contract addresses (TokenMessengerV2, MessageTransmitterV2, USDC)
- RPC endpoints and explorer URLs
- Finality characteristics
chains.go:24
Iris Client
IrisClient
Handles communication with Circle’s Iris attestation service for:
- Fetching attestations for completed burns
- Polling for attestation availability
- Querying transfer fees
client.go:79
Transfer Orchestrator
TransferOrchestrator
Coordinates the complete transfer workflow:
- Balance and allowance checks
- Token approval if needed
- Burn transaction on source chain
- Attestation polling
- Mint transaction on destination chain
transfer.go:83
Contract Bindings
V2 Bindings
Auto-generated Go bindings for CCTP V2 contracts:
- TokenMessengerV2: Handles burn operations
- MessageTransmitterV2: Handles message reception and minting
- IERC20: Standard ERC-20 interface for approvals
Design Principles
Type Safety
Uses Go’s type system to prevent common errors. Contract addresses, chain IDs, and domains are validated at compile time.
Abigen V2
Built on Ethereum’s abigen v2 library for improved contract interaction patterns and better error handling.
Configurability
Allows RPC endpoint customization while providing sensible defaults for all supported chains.
Usage Pattern
A typical integration follows this flow:Next Steps
Chain Configuration
Explore chain lookup functions and configuration
Iris Client
Learn about attestation polling and retrieval
Transfer Orchestrator
Deep dive into transfer workflow execution