A cross chain swap between cosmos chain and EVM chain using minimal setup
Cross-Chain Swap Between Cosmos and EVM Chains via Fusion+ Inspired Escrow Design Overview This project extends the capabilities of 1inch’s Fusion+ SDK, which currently supports cross-chain transfers between EVM-compatible chains using hash timelock logic, by enabling interoperability with non-EVM chains—specifically the Cosmos ecosystem. The core innovation lies in replicating the behavior of Fusion+'s Escrow contract on the Cosmos side, allowing seamless asset bridging with minimal additional infrastructure or setup.
Objective To enable secure and verifiable cross-chain swaps between a Cosmos-based chain and any EVM-based chain by mimicking the escrow lifecycle and hashlock logic of 1inch Fusion+, facilitating atomic transfers with no reliance on third-party relayers or heavy off-chain logic.
Core Architecture EVM Side: Relies on the native Fusion+ escrow contract to lock funds.
Cosmos Side: Implements a lightweight smart contract module that emulates the Fusion+ escrow functionality using CosmWasm.
Communication Bridge: Uses hashlock-based coordination for synchronizing secret revelation and timeouts between both chains, avoiding complex message-passing protocols. use websocket for quick relay of messages between parties
User Flow User Creates an Order The process begins when a user initiates a swap request through the interface or client application.
Resolver Deploys Escrow (Cosmos Side) The designated resolver (or relayer) sets up an escrow contract on the Cosmos chain that mirrors the one on EVM, including the hashlock, token details, amount, and timeout window.
User Approves Funds to Escrow (Cosmos) The user validates the escrow details and approves the tokens (e.g., via IBC or native token allowance mechanisms) to be pulled by the escrow.
Escrow Pulls Funds and Sets deployed_at Timestamp Upon approval, the Cosmos escrow pulls the tokens and records the deployed_at timestamp, establishing the start of the timeout window and allowing both chains to track the lifecycle deterministically.
User Checks Escrow Details The user verifies the deployed_at value and confirms that funds are locked correctly. This is a checkpoint before revealing the preimage of the hash.
User Shares the Secret The user (or a relayer, depending on trust assumptions) reveals the secret (preimage) associated with the hashlock to both escrows. This secret must match on both sides for the swap to proceed.
Completion of Swap Ceremony With the secret revealed, the escrow contracts release funds to the recipient on both chains. If the timeout expires before secret revelation, funds are returned to the original sender, ensuring safety.
Key Innovations Cosmos Compatibility: Built from scratch a Cosmos-side escrow that mirrors EVM’s behavior without introducing complex IBC bridging or intermediary layers.
Hashlock Logic Alignment: Ensures full compatibility with Fusion+’s hashlock workflow using deterministic state transitions and timeouts.
Minimal Setup Philosophy: The entire swap lifecycle requires no off-chain agents beyond the resolver and no global registry or message relaying infrastructure.
Benefits Non-EVM Interoperability: Paves the way for Cosmos-EVM cross-chain DEX functionality.
Trust-Minimized: Relies on cryptographic commitments (hashlocks), not third parties.
Extensible: Architecture can be generalized to other non-EVM ecosystems like Solana, Polkadot, etc.
🧱 Cosmos Side (Rust + CosmWasm) Written in Rust using CosmWasm.
Mimics EVM escrow logic with deployed_at, hashlock, secret verification, and timeout-based fund release.
Validates secret and handles fund refund on timeout.
Tested locally with wasmd.
💻 Frontend (React + TailwindCSS) Built with React and styled using TailwindCSS.
Supports order creation, escrow inspection, and secret submission.
Connects to MetaMask (EVM) and Keplr (Cosmos) for wallet interaction.
Minimal UI focused on clear, step-by-step flow.

