InterchainX is an infrastructure for cross-chain swaps between Eth and Cosmos by leveraging 1inch.
InterchainX is a robust and secure cross-chain atomic swap bridge designed to facilitate seamless and trustless asset exchanges between the Cronos blockchain (Cosmos SDK-based with CosmWasm support) and the Ethereum blockchain. Leveraging the principles of Hash Time-Locked Contracts (HTLCs) and enhanced with advanced trading features like Dutch auctions, partial fills, and Limit Order Protocol (LOP) integration, InterchainX aims to provide a highly efficient and flexible solution for interchain liquidity.
This project addresses the growing need for interoperability in the decentralized finance (DeFi) space, enabling users to swap assets between two distinct blockchain ecosystems without relying on centralized intermediaries. By utilizing the Inter-Blockchain Communication (IBC) protocol for secure asset transfers and an intelligent off-chain relayer, InterchainX ensures atomicity, security, and a superior user experience.
InterchainX operates on a two-sided escrow model, where assets are locked on both the source and destination chains until the swap conditions are met. An off-chain relayer acts as the orchestrator, facilitating communication and ensuring the atomic execution of swaps.
Core Components: Cronos Chain (CosmWasm Side): SourceEscrow: Manages assets locked by the Maker on Cronos when it's the source chain. DestinationEscrow: Manages assets locked by the Taker on Cronos when it's the destination chain. EscrowFactory: Deploys new instances of escrow contracts deterministically. EscrowResolver: The primary interface for the relayer and users to interact with the CosmWasm escrow system, integrating Dutch auction and partial fill logic. DutchAuction: CosmWasm contract implementing the dynamic pricing logic for auctions. PartialFill: Logic integrated within escrow contracts to handle partial fulfillment of orders. IBCHandler (Conceptual): A CosmWasm contract to manage IBC packet handling related to asset transfers.
Ethereum Chain (EVM Side): Escrow.sol: Manages assets locked by the Maker/Taker on Ethereum. EscrowFactory.sol: Deploys new instances of Escrow.sol. Resolver.sol: The primary interface for the relayer and users to interact with the EVM escrow system, similar to the 1inch resolver. IBCHandler.sol: A Solidity contract acting as an interface to an IBC client on Ethereum, handling incoming and outgoing IBC transfers.
Go Relayer Service (Off-chain): Monitors SwapCreated events on both chains. Relays order details and secrets between chains. Manages the Dutch auction pricing and partial fill states. Interacts with IBC relayers for cross-chain asset movements. Provides a RESTful API for status monitoring and management. IBC Relayer (External): A dedicated, off-chain IBC relayer (e.g., Hermes, ibc-go's relayer) is required to relay IBC packets between the Cronos and Ethereum IBC clients. This component is external to this project's codebase but essential for the bridge's operation.
With the above architecture initially it was complex to study the structure since most of the chains had trouble in deployment and it took a alot of trials and errors with different chains in identifying which build and configuration would go with 1inch's requirements.