Skip to main content

CCTP Router

A Synapse Router bridge module which uses Circle's Cross-Chain Transfer Protocol to natively mint & burn USDC.

originChaindestChainApp / SDKWalletCircle
User assets are sent to a Circle contract, moved to the destChain, and returned to the user.

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.

tip

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.

StateDescription
PendingInitiated on origin chain, and pending attestation
AttestedWaiting for submission on destination chain
SubmittedConfirmed on destination chain
CompleteCompleted on destination chain

Configure

CCTP Relayers require a YAML configuration file path to be provided at run time.

cctp_type
  • synapse (recommended): Uses events & metadata from Synapse CCTP contracts, and synapse_cctp_address when configuring chains.

  • circle (USDC to USDC only): Uses raw TokenMessenger events, and token_messenger_address when configuring chains.

Parameters

  • cctp_type: Determines which event types and contracts are used.
  • chains: chain_id list
  • base_omnirpc_url: OmniRPC service base URL
  • unbonded_signer: Signer serviceshould be a mounted secret
  • port: 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.

  1. docker run ghcr.io/synapsecns/sanguine/cctp-relayer:latest --config /path/to/config.yaml

From Source

Requires Go 1.21 or higher

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.

  1. git clone https://github.com/synapsecns/sanguine --recursive
  2. cd sanguine/services/cctp-relayer
  3. 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.

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.