Skip to content

Releases: ChainSafe/canton-middleware

v0.2.1

07 Jan 14:28
c8c0a77

Choose a tag to compare

Merge pull request #46 from ChainSafe/salindne/fix-reconcile-balance-bug

fix: reconciliation no longer overwrites user balances

v0.2

18 Dec 22:01
f1f6476

Choose a tag to compare

Release Notes v0.2

Overview

This release introduces the ERC-20 API Server as a new service and includes significant improvements to the Relayer.


New: ERC-20 API Server

A new JSON-RPC 2.0 API server providing ERC-20-like interface for Canton-based tokens.

Features

  • Token Metadata Methods (public):

    • erc20_name - Get token name
    • erc20_symbol - Get token symbol
    • erc20_decimals - Get token decimals
    • erc20_totalSupply - Get total supply from cache
  • Authenticated Methods (require JWT or EVM signature):

    • erc20_balanceOf - Get user balance
    • erc20_transfer - Transfer tokens between registered users
    • user_register - Register new user with EVM signature

Architecture

  • Issuer-centric model: All users share the relayer party, differentiated by fingerprint mapping
  • Balance caching system: PostgreSQL-backed cache with periodic reconciliation
  • Whitelist support: Address-based registration whitelist
  • Graceful shutdown: Configurable timeout with proper cleanup

Configuration

New configuration file: config.api-server.docker.yaml


Relayer Improvements (since v0.1.7)

Features

  • Issuer-centric model support - Aligns with API Server architecture
  • Docker local testing setup - Full end-to-end testing with auto package ID detection
  • Docker build and release workflow - Automated GHCR publishing
  • JWT renewal for Canton streamer - Automatic token refresh
  • Bridge activity sorting - Events ordered newest to oldest
  • Deposit idempotency - Prevents duplicate deposits

Fixes

  • Withdrawal balance cache - Now correctly uses EVM address
  • Package ID extraction - Updated for v2 packages
  • Fingerprint lookups - Fixed cache updates
  • Transfer pattern - Uses Burn+Mint instead of non-existent Transfer choice
  • DepositReceipt tracking - Properly tracked in raw events
  • Healthcheck - Uses GET instead of HEAD
  • Streamer error handling - Fixed lastOffset usage and error responses

Maintenance

  • Updated canton-erc20 submodule to v2 with renamed packages
  • Removed legacy Canton bridge methods
  • Dynamic DAR discovery with version 1.0.2 support
  • Eliminated DAR build warnings
  • Cleaned up deprecated test scripts
  • Simplified .dockerignore

Breaking Changes

  • Package IDs updated for refactored Daml packages (v2)
  • Removed legacy Canton bridge methods - use new API patterns

Upgrade Notes

  1. Update configuration files with new package IDs
  2. Rebuild DAR files with updated canton-erc20 submodule
  3. Run database migrations for API Server balance cache tables
  4. Configure relayer_party for issuer-centric model

Docker Images

# Relayer
docker pull ghcr.io/chainsafe/canton-middleware:v0.2

# API Server
docker pull ghcr.io/chainsafe/canton-erc20-api:v0.2

v0.1.7

15 Dec 17:25
v0.1.7
2af60de

Choose a tag to compare

Canton-Ethereum Token Bridge - Release Notes v1.0

Overview

A centralized token bridge connecting CIP-56 tokens on Canton Network with ERC-20 tokens on Ethereum Mainnet, enabling bidirectional cross-chain transfers.

Core Features

Relayer Service

  • Go-based relayer node running as a sidecar to Canton Network Partner Node
  • Bidirectional event streaming from both Canton and Ethereum
  • Persistent offset tracking with PostgreSQL for crash recovery
  • Automatic reconciliation of pending transfers (every 5 minutes)
  • Readiness probes for Kubernetes deployment

Deposit Flow (EVM → Canton)

  • Monitors Deposit events on Ethereum bridge contract
  • Creates PendingDeposit on Canton via Ledger API
  • Resolves user fingerprint mapping and processes deposit
  • Unlocks/mints tokens to Canton user's holding

Withdrawal Flow (Canton → EVM)

  • Streams WithdrawalEvent contracts from Canton
  • Submits withdrawFromCanton transaction on Ethereum
  • Marks withdrawal complete on Canton for reconciliation
  • Idempotency protection via Canton tx hash tracking

Smart Contracts

  • Ethereum: Solidity bridge contract for ERC-20 lock/unlock and wrapped token mint/burn
  • Canton: DAML contracts for CIP-56 token management and bridge operations

Operational Scripts

  • bootstrap-bridge.go - Initialize Canton bridge contracts
  • register-user.go - Register user fingerprint mappings
  • query-holdings.go - Query Canton token holdings
  • initiate-withdrawal.go - Initiate Canton→EVM withdrawals
  • cleanup-withdrawals.go - Reconcile incomplete withdrawals

Configuration

  • YAML-based configuration with environment variable overrides
  • Support for local, devnet, and mainnet environments
  • Docker Compose deployments included

Observability

  • Prometheus metrics for pending transfers
  • Structured logging with zap
  • Health/readiness endpoints