Skip to content

Implement Stellar CCTP service layer: burn, attest, and mint flow #183

@grantfox-development

Description

@grantfox-development

Overview

Implement the core service layer that orchestrates the CCTP burn → attest → mint cycle between an external chain (e.g., Ethereum) and Stellar using Soroban smart contracts.

Background

CCTP works in three phases:

  1. Burn – USDC is burned on the source chain and a message is emitted.
  2. Attest – Circle's Attestation API signs the message.
  3. Mint – The signed message is submitted to the destination chain (Stellar) to mint USDC.

Tasks

  • Create CCTPService class under src/modules/cctp/
  • Implement initiateBurn(amount, sourceChain, destinationAddress) — submits burn tx and stores the resulting message hash
  • Implement pollAttestation(messageHash) — polls Circle Attestation API until status: complete
  • Implement mintOnStellar(attestation, messageBytes) — calls the Soroban receiveMessage entry point
  • Persist transfer state transitions to the database (pending → attesting → minting → complete → failed)
  • Add exponential backoff retry logic for attestation polling
  • Integrate with existing WalletService / Stellar RPC client

Acceptance Criteria

  • CCTPService unit-tested with mocked Circle API and Stellar RPC
  • Transfer state correctly persisted and queryable
  • All three phases covered by integration tests against Stellar testnet
  • No secrets or private keys hardcoded — all via env vars

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions