CCTP Router
A Synapse Router bridge module which uses Circle's Cross-Chain Transfer Protocol to natively mint & burn USDC.
Architecture
Contracts
Synapse CCTP contracts overlay Circle CCTP contracts to mint and burn USDC and fulfill CCTP transactions.
Configuration
CCTP can be configured to bridge through any supported liquidity source, such as Uniswap, Curve, Algebra, DAI PSM, and others.
Relayer
CCTP Relayers allow anyone to coordinate on-chain events and stored message states to send native USDC through SynapseCCTP and Circle's CCTP contracts.
While the Synapse CCTP Golang relayer can be run by anyone, and is easily observable, you can also build and run your own relayer permissionlessly in any programming language.
Behavior
CCTP Relayers poll for new transactions and state updates from CCTP contracts on-chain, to store in an off-chain database.
Attestations from the Circle API are submitted to the destination contract, and marked Complete
when a transaction receipt is received.
State | Description |
---|---|
Pending | Initiated on origin chain, and pending attestation |
Attested | Waiting for submission on destination chain |
Submitted | Confirmed on destination chain |
Complete | Completed on destination chain |
Configure
CCTP Relayers require a YAML configuration file path to be provided at run time.
-
synapse
(recommended): Uses events & metadata from Synapse CCTP contracts, andsynapse_cctp_address
when configuringchains
. -
circle
(USDC to USDC only): Uses raw TokenMessenger events, andtoken_messenger_address
when configuringchains
.
Parameters
cctp_type
: Determines which event types and contracts are used.chains
:chain_id
listbase_omnirpc_url
: OmniRPC service base URLunbonded_signer
: Signer service — should be a mounted secretport
: Relayer port (e.g. 8080)host
: Relayer host (e.g. localhost) — do not publicly expose.http_backoff_initial_interval_ms
: Initial backoff interval in milliseconds.retry_interval_ms
: Retry interval between attestation requests in milliseconds — CCTP API Rate Limit.
Example
cctp_type: "synapse"
# prod contract addresses
chains:
- chain_id: 1
synapse_cctp_address: "0x12715a66773BD9C54534a01aBF01d05F6B4Bd35E"
- chain_id: 42161
synapse_cctp_address: "0x12715a66773BD9C54534a01aBF01d05F6B4Bd35E"
base_omnirpc_url: "http://omnrpc-url/"
unbonded_signer:
type: "AWS"
# should be a mounted secret
file: "/config/aws.txt"
http_backoff_initial_interval_ms: 1000
http_backoff_max_elapsed_time_ms: 300000
# submitter config for cctp
submitter_config:
chains:
1:
supports_eip_1559: true
gas_estimate: 1000000
42161:
gas_estimate: 30000000
max_gas_price: 10000000000
supports_eip_1559: true
Run
From Docker
Run the Docker image along with the path to your YAML configuration file.
docker run ghcr.io/synapsecns/sanguine/cctp-relayer:latest --config /path/to/config.yaml
From Source
Not generally recommended for end-users.
Clone the Sanguine repository, then run the main.go file along with the path to your YAML configuration file.
git clone https://github.com/synapsecns/sanguine --recursive
cd sanguine/services/cctp-relayer
go run main.go --config /path/to/config.yaml
With Helm
There is a helm chart available for the CCTP Relayer here, but it is recommended you create your own.
Recommended services
CCTP Relayer uses open telemetry for tracing and metrics. See the Observability page for details. We highly recommend setting up the Submitter Dashboard as well.