CardanoSwap+
Atomic swaps between EVM chains & Cardano using 1inch Fusion+ with partial fills & timeout recovery
Problem Statement
CardanoSwap+ - Bridging EVM Chains and Cardano through 1inch Fusion+CardanoSwap+ is a groundbreaking extension of the 1inch Cross-chain Swap (Fusion+) protocol that enables seamless, trustless atomic swaps between any EVM-compatible chains and Cardano. Built upon the solid foundation ofC, our implementation incorporates Fusion+'s Dutch auction model and extends the original design to support partial fills with Merkle tree optimization.By integrating Cardano as a non-EVM target chain into the 1inch Fusion+ infrastructure, we unlock bidirectional DeFi interoperability between the Cardano ecosystem and all supported EVM networks (Ethereum, Polygon, Arbitrum, Base, BSC, and more) without relying on traditional bridges or wrapped tokens.The Problem We SolveCurrent cross-chain solutions between EVM chains and Cardano rely on centralized bridges that introduce custody risks, have suffered billions in hacks, and create friction through wrapped tokens. Users wanting to move value between Cardano and EVM ecosystems (Ethereum, Polygon, Arbitrum, Base, BSC, etc.) face:Bridge custody risks- $2.5B+ lost to bridge exploitsWrapped token complexity- Additional contracts and counterparty riskLimited liquidity- Fragmented across multiple bridge providersPoor UX- Multi-step processes with high failure ratesOur SolutionCardanoSwap+ leverages Hash Time-Locked Contracts (HTLCs) and the proven 1inch Fusion+ infrastructure to create truly atomic cross-chain swaps. Users maintain full custody of their assets throughout the swap process, while professional resolvers compete in Dutch auctions to provide optimal pricing and execution.Key Technical Innovationsπ Enhanced Atomic Swap FoundationBuilding upon CardanoSwap's proven HTLC implementation, we've integrated Fusion+'s sophisticated Dutch auction mechanism. This combines the security guarantees of atomic swaps with the competitive pricing and professional market maker ecosystem of Fusion+, creating optimal execution for users.π³ Advanced Partial Fill MechanismWe've extended the original CardanoSwap design with our Merkle tree-based partial fill system, allowing large orders to be executed incrementally across multiple transactions. This innovation improves capital efficiency, reduces slippage, and makes institutional-size swaps viable across different blockchain architectures.π‘ Robust Timeout ContingencyIf a resolver fails to complete a swap within the specified timelock, our relayer service automatically publishes the necessary secrets to IPFS, enabling public resolution of the swap. This ensures that user funds are never permanently locked, even in edge cases of resolver failure.Architecture Deep DiveCross-Chain Relayer ServiceOur TypeScript-based relayer monitors both EVM chains and Cardano simultaneously, validating order parameters for consistency across different network architectures and managing the cryptographic secrets that enable atomic execution. The relayer ensures that escrow contracts on both EVM and Cardano chains are properly configured before signaling resolvers to proceed.Cardano Smart ContractsBuilt using Plutus V3 and optimized with HarmonicLabs's plu-ts wrapper, our validators implement secure HTLC functionality while integrating seamlessly with Cardano's native token system. The contracts handle both ADA and custom Cardano native assets, with built-in timelock mechanisms for automatic refunds.Resolver NetworkOur resolver implementation participates in Fusion+ Dutch auctions, competing to fill cross-chain orders by providing optimal pricing. Resolvers lock funds in escrow contracts on both chains and receive secrets only after successful validation, ensuring atomic execution.Demonstrated Capabilitiesβ Bidirectional swaps- Any EVM token β ADA and cross-network token swapsβ Multi-chain support- Ethereum, Polygon, Arbitrum, Base, BSC, and all Fusion+ networksβ Hashlock preservation- Cryptographic security maintained across different architecturesβ Timelock functionality- Automatic refunds prevent fund loss across all chainsβ On-chain execution- Live testnet demonstrationsβ Partial fill support- Merkle tree optimization for large ordersβ Timeout recovery- IPFS-based contingency for resolver failuresMarket ImpactCardanoSwap+ opens the $15+ billion Cardano ecosystem to seamless DeFi integration across all major EVM networks while providing Cardano users direct access to liquidity on Ethereum, Polygon, Arbitrum, Base, BSC, and other Fusion+-supported chains. By eliminating bridge risks and maintaining atomic guarantees, we enable a new class of cross-chain DeFi applications that were previously impossible or prohibitively risky.Real-World Use CasesMulti-chain arbitrage- Exploit price differences across Cardano and multiple EVM DEXsCross-ecosystem yield farming- Access opportunities across Cardano, Ethereum, Polygon, and L2sPortfolio rebalancing- Move assets between any supported network without custody riskInstitutional trading- Large-scale swaps across multiple chains with partial fill optimizationTechnical ExcellenceOur implementation showcases deep technical innovation across multiple domains:Protocol Design- Successfully adapted intent-based architecture to UTXO modelSmart Contract Engineering- Robust Plutus V3 contracts with comprehensive error handlingCross-Chain Coordination- Sophisticated relayer logic managing dual-chain stateDeveloper Experience- TypeScript integration bridging Haskell and JavaScript ecosystemsFuture VisionCardanoSwap+ represents just the beginning of true blockchain interoperability. Our architecture provides a foundation for:Multi-asset support- Native tokens beyond ADA across all supported chainsLayer 2 integration- Cardano sidechains and all major Ethereum L2sAdvanced order types- Options, futures, and structured products across networksMobile integration- Wallet SDKs for seamless multi-chain user experienceBy proving that secure, trustless cross-chain swaps are possible between fundamentally different blockchain architectures, CardanoSwap+ paves the way for a truly unified DeFi ecosystem where users can access the best opportunities across Cardano and the entire EVM universe without compromise.
Solution
How It's Made Architecture Overview CardanoSwap+ extends 1inch Fusion+ to support Cardano through a three-component architecture: βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ β EVM Chains β β CardanoSwap+ β β Cardano β β (Multi-chain) β β Relayer β β (Plutus V3) β βββββββββββββββββββ€ βββββββββββββββββββ€ βββββββββββββββββββ€ β Fusion+ Escrow βββββΊβ Dutch Auction βββββΊβ HTLC Validator β β 1inch Settlementβ β Merkle Sum Tree β β Partial Fills β β Multi-resolver β β IPFS Fallback β β Cardano Resolverβ βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ Core ComponentsCross-Chain Relayer (./relayer)Monitors EVM chains and Cardano for swap orders Coordinates Dutch auction between resolvers Validates cross-chain order parameters IPFS secret publishing: After resolver deadline expires, automatically publishes secrets to IPFS for public resolution Manages Merkle sum tree state for partial fillsCardano Validators (./cardano-validator-ts)Plutus V3 smart contracts implementing HTLC with timelock Partial fill support: Uses Merkle sum tree method to track remaining order amounts Escrow contracts for secure ADA and native token custody TypeScript integration layer for seamless dApp interactionCardano Resolver (./cardano-resolver-plu-ts)Participates in Fusion+ Dutch auctions for cross-chain orders Executes atomic swaps between any EVM chain and Cardano Built with HarmonicLabs's plu-ts wrapper for TypeScript compatibilityKey Innovations Merkle Sum Tree Partial Fills: Instead of simple Merkle trees, we use Merkle sum trees to efficiently track remaining order amounts across partial executions, enabling precise fill tracking with minimal on-chain storage.IPFS Timeout Recovery: When resolvers fail to complete swaps within the timelock window, our relayer automatically publishes the necessary secrets to IPFS, allowing anyone to resolve the swap and prevent fund lockup.Plutus V3 Integration: Leveraged latest Cardano smart contract capabilities for enhanced performance and developer experience.Technology Stack1inch Fusion+ SDK: Cross-chain swap infrastructure and resolver network Plutus V3: Latest Cardano smart contract platform HarmonicLabs plu-ts: TypeScript wrapper for Plutus development Blockfrost API: Cardano blockchain data provider IPFS: Decentralized storage for timeout contingency TypeScript/Node.js: Unified development stack*Reference: Used CardanoSwap as technical reference for HTLC patterns### Technology Stack & Integration PointsCore Infrastructure1inch Fusion+ SDK: Foundation for cross-chain swap orchestration CardanoSwap Base: Starting point for atomic swap contract logic Fusion+ Cross-chain Protocol: Intent-based architecture and resolver network
Hackathon
ETHGlobal New Delhi
2025
Contributors
- ahsueh1996
38 contributions
- ehsueh
29 contributions