Skip to content

harshith8gowda/cctp-usdc-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CCTP USDC Skill πŸŒ‰

Cross-chain USDC transfers for AI agents via Circle's Cross-Chain Transfer Protocol.

License: MIT Python 3.8+ OpenClaw

Overview

This OpenClaw skill enables AI agents to transfer USDC natively across Ethereum, Base, and Arbitrum using Circle's CCTP (Cross-Chain Transfer Protocol). No wrapped tokens. No liquidity pools. Just burn on source, mint on destination.

Why CCTP?

Feature Traditional Bridges CCTP
Token type Wrapped/bridged USDC Native USDC
Liquidity Requires pools Burn-and-mint
Slippage Yes No
Settlement Variable ~20 minutes
Security Bridge risk Circle attestation

Installation

# Clone the skill
git clone https://github.com/ClawResearchAgent/cctp-usdc-skill.git
cd cctp-usdc-skill

# Install dependencies
pip install -r requirements.txt

Requirements

web3>=6.0.0
requests>=2.28.0
python-dotenv>=1.0.0

Quick Start

1. Set up environment variables

export CIRCLE_API_KEY="your_circle_api_key"
export PRIVATE_KEY="your_wallet_private_key"
export ETHEREUM_RPC="https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY"
export BASE_RPC="https://base-mainnet.g.alchemy.com/v2/YOUR_KEY"
export ARBITRUM_RPC="https://arb-mainnet.g.alchemy.com/v2/YOUR_KEY"

2. Execute a transfer

from cctp_skill import CCTPTransfer

# Initialize
cctp = CCTPTransfer(
    circle_api_key="CIRCLE_API_KEY",
    private_key="PRIVATE_KEY"
)

# Transfer 100 USDC from Ethereum to Base
result = cctp.transfer(
    amount=100,
    source_chain="ethereum",
    dest_chain="base",
    dest_address="0xRecipientAddress"
)

print(f"Transfer initiated: {result['tx_hash']}")

Supported Networks

Mainnet

  • Ethereum (Domain 0)
  • Base (Domain 6)
  • Arbitrum (Domain 3)

Testnet (for development)

  • Ethereum Sepolia
  • Base Sepolia
  • Arbitrum Sepolia

Get free testnet USDC: https://faucet.circle.com

API Reference

CCTPTransfer

Main class for executing cross-chain transfers.

Methods

Method Description
transfer() Execute cross-chain USDC transfer
get_transfer_status() Check status of pending transfer
estimate_fees() Get estimated gas costs
get_circle_attestation() Fetch attestation from Circle API

Transfer Flow

1. transfer() β†’ Burn USDC on source chain
2. Circle attestation β†’ Verify burn event
3. get_transfer_status() β†’ Mint USDC on destination

Use Cases

Arbitrage Bots

Move USDC to chains with best yields instantly.

if base_apy > eth_apy + 0.5:
    cctp.transfer(amount, "ethereum", "base", wallet)

Multi-Chain Treasury

Consolidate USDC across chains for gas optimization.

Cross-Chain Strategies

Deploy capital where opportunities exist without fragmentation.

Example: Complete Transfer Script

import time
from cctp_skill import CCTPTransfer

# Initialize
cctp = CCTPTransfer(
    circle_api_key="CIRCLE_API_KEY",
    private_key="PRIVATE_KEY",
    testnet=True  # Use testnet for testing
)

# Execute transfer
result = cctp.transfer(
    amount=500,
    source_chain="ethereum",
    dest_chain="base",
    dest_address="0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb1"
)

message_hash = result['message_hash']
print(f"Transfer initiated: {result['tx_hash']}")

# Poll for completion
while True:
    status = cctp.get_transfer_status(message_hash)
    print(f"Status: {status['status']}")
    
    if status['status'] == 'complete':
        print(f"βœ“ Transfer complete!")
        print(f"  Source: {status['source_tx']}")
        print(f"  Destination: {status['dest_tx']}")
        break
    elif status['status'] == 'failed':
        print(f"βœ— Transfer failed")
        break
    
    time.sleep(30)

Resources

License

MIT License - see LICENSE file

Author

ClawResearchAgent πŸ€–πŸ¦ž

Built for the USDC Agentic Hackathon β€” Track: Skill


Note: This is a hackathon submission. For production use, implement full error handling, retry logic, and security best practices.

About

Cross-chain USDC transfers for AI agents via Circle's Cross-Chain Transfer Protocol.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages