Cross Chain Swap on top of 1inch Fusion+. EVM ↔Cosmos(Injective) w gasless UX& live tracking using
Cosmic-Link is a trustless atomic cross-chain swap protocol that enables seamless asset exchanges between EVM-compatible chains (Ethereum) and Cosmos ecosystem chains (Injective). Unlike traditional bridges that require trust in centralized operators or validators, our protocol guarantees atomic execution - either both sides of the trade complete successfully, or the entire transaction reverts with no funds lost.
Trustless & Atomic: Uses Hash Time-Locked Contracts (HTLCs) with 1inch Fusion+ EVM smart contracts and Cosmos-side (Injective) escrow mechanisms to ensure that swaps either complete fully on both chains or fail completely - no partial executions or stuck funds.
Gasless User Experience: Users swapping from Injective to EVM pay zero gas fees on the Injective side thanks to our resolver-funded fee grant system (utilizing the fee grant module from Cosmos SDK). The resolver covers all transaction costs, making it completely frictionless.
🔍 Real-Time Transparency: Features a live swap explorer that tracks every step of the cross-chain process, providing clickable links to view transactions on both BuildBear (EVM) and Injective explorers.
🔄 Bidirectional Swaps: Supports both directions: EVM → Cosmos: USDC on Ethereum → INJ on Injective Cosmos → EVM: INJ on Injective → USDC on Ethereum (gasless)
How It Works Order Creation: User creates a cross-chain swap order specifying source and destination assets Escrow Deployment: Smart contracts deploy escrow contracts on both chains with hash locks Atomic Execution: Funds are locked with cryptographic proofs that ensure simultaneous release Resolver Network: resolvers facilitate the swap execution and earn fees Settlement: Once preimages are verified, funds are released to users on both chains The protocol is powered by 1inch Fusion+ infrastructure, providing battle-tested cross-chain swap mechanics with additional atomic swap contracts on Cosmos.
Cross-Link is built on 1inch Fusion+ as its core atomic swap infrastructure, providing battle-tested cross-chain mechanics that I've extended with custom Cosmos ecosystem integration and dual-wallet connectivity. The protocol leverages 1inch's CrossChainOrder SDK to create hash time-locked contracts (HTLCs) that are deployed on both chains - 1inch EscrowFactory contracts on the Ethereum side and custom CosmWasm HTLC contracts on the Injective side - guaranteeing atomic execution across EVM and Cosmos chains, requiring MetaMask wallet integration for Ethereum-side transactions and Keplr wallet for Cosmos-side operations. My implementation uses the 1inch EscrowFactory contracts on the Ethereum side, which deploy individual escrow contracts for each swap with cryptographic hash locks that users sign through MetaMask's typed data signing, while simultaneously deploying corresponding HTLC contracts on the Injective chain with matching hash locks. The resolver system monitors both chains and facilitates swap completion when the user provides the secret to unlock funds simultaneously on both sides. I've integrated this with Ethers.js v6 for EVM interactions and extended the standard 1inch flow with custom callback mechanisms that provide real-time transaction updates to users as they approve transactions through their connected wallets.
The Injective Protocol integration represents the technically sophisticated aspect of the system, particularly my implementation of gasless transactions using CosmWasm smart contracts and Injective's native fee grant mechanism accessed through Keplr wallet. My custom CosmWasm contracts on Injective handle the Cosmos-side escrow logic, accepting INJ deposits with hash locks that mirror the EVM side, while users interact through Keplr's seamless transaction signing interface. I used a gasless transaction architecture: when users swap from Injective to EVM, my resolver automatically grants them fee allowances using Injective's authz module, allowing users to execute complex multi-step swaps without holding any INJ for gas - they simply connect Keplr and approve transactions with zero gas costs. This required building custom API endpoints that handle server-side transaction signing while maintaining security through time-limited, amount-capped fee grants that work transparently with Keplr's user interface. The resolver economics are designed to be sustainable - resolvers earn fees from successful swaps that cover both the EVM gas costs and the Injective fee grants they provide to users.
The frontend application is built with Next.js 14 and implements a dual-wallet connection system alongside real-time swap tracking that bridges blockchain operations with modern web UX expectations. Users must connect both MetaMask (for Ethereum/EVM operations) and Keplr (for Injective/Cosmos operations) wallets simultaneously, with the interface dynamically detecting network configurations and prompting users to switch to BuildBear testnet when necessary. I developed a custom callback-driven architecture where the core executeCrossChainSwap function communicates progress updates directly to a React-based swap explorer sidebar, showing wallet interaction steps like token approvals, transaction confirmations, and balance updates in real-time. The technical challenge was synchronizing blockchain state changes across two different wallet providers with React state management - I solved this using a window-based message passing system that enables sub-second UI updates as transactions are submitted through MetaMask and Keplr across different chains. The entire system is deployed on BuildBear's dedicated EVM testnet environment, which provides enhanced developer tooling and custom explorer integration for optimal testing and user experience.