How to make crosschain transfers
This recipe demonstrates how to perform crosschain transfers between different Chromia blockchains using EVM keys with FT4. This enables asset transfers across the multichain Chromia ecosystem.
- JS/TS client
Prerequisites
- Node.js
- FT4 client
- Postchain client
- Account registration on both source and target chains
- Crosschain asset must be registered on the target chain
Demo dapp
Key Features
This recipe includes examples for:
- Multi-chain connectivity - Connecting to multiple Chromia blockchains through directory service
- EVM key integration - Using EVM key pairs for crosschain authentication
- Asset transfer orchestration - Managing transfer state across multiple blockchains
- Event monitoring - Tracking transfer progress through signed, init, and hop events
Architecture Overview
The recipe demonstrates crosschain transfer using FT4:
Transfer Components
- Source chain - The blockchain where assets originate and the transfer begins
- Target chain - The destination blockchain where assets will be received
- Directory service - Provides connectivity and routing across multiple chains
- FT4 orchestrator - Manages the transfer process and state transitions
JavaScript Client
- Multi-chain session - Creates authenticated sessions across different blockchains
- Transfer initiation - Uses
crosschainTransfer
function to start the process - Progress tracking - Monitors transfer events for completion confirmation
Transfer Process
The crosschain transfer follows this workflow:
- Account setup - Configure EVM key pair and account credentials
- Chain configuration - Define source and target blockchain identifiers
- Asset specification - Specify the asset to transfer and amount
- Transfer initiation - Execute the
crosschainTransfer
operation - Event monitoring - Track transfer progress through event handlers
- Transfer completion - Confirm successful transfer on target chain
Required Information
To perform a crosschain transfer, you need:
- Source chain RID - Blockchain identifier where assets currently exist
- Target chain RID - Blockchain identifier for the destination
- Account credentials - EVM private/public key pair and account ID
- Asset details - Asset ID and amount to transfer
- Directory service - URL for multi-chain connectivity
Transfer Configuration
When configuring a crosschain transfer, specify:
- Chain identifiers - Source and target blockchain RIDs
- Account information - Your account ID on both chains
- Asset parameters - Asset ID and transfer amount
- Network settings - Directory node URL for multi-chain access
Event Monitoring
The transfer process provides real-time feedback through events:
- Signed event - Transaction has been signed and submitted
- Init event - Transfer has been initialized on the source chain
- Hop event - Transfer is progressing through intermediate chains
- Completion - Transfer has successfully reached the target chain
Prerequisites for Success
Before attempting crosschain transfers:
- Asset registration - The asset must be registered on the target chain
- Account existence - Your account must exist on both source and target chains
- Sufficient balance - You must have enough assets to cover the transfer and fees
- Network connectivity - Stable connection to directory services
Use Cases
Crosschain transfers are essential for:
- Multi-chain applications - Apps operating across multiple Chromia blockchains
- Asset arbitrage - Moving assets between chains for trading opportunities
- Ecosystem participation - Accessing services on different Chromia chains
- Portfolio management - Distributing assets across multiple chains
- Cross-chain DeFi - Participating in DeFi protocols on different chains
Learn more
- FT4 client documentation — covers FT4 operations and crosschain functionality.
- Cross-chain transfers — detailed guide on crosschain transfer mechanics.
- Cross-chain assets — understanding crosschain asset management.
- JavaScript/TypeScript client — covers setup, connection, and usage patterns.