← Back to home

CardanoSwap

Bidirectional cross-chain atomic swaps for Cardano and EVM chains

Problem Statement

A trustless atomic swap protocol enabling seamless token exchanges between EVM networks and Cardano. Our solution implements Hash-Time-Locked Contracts (HTLCs) with sophisticated safety mechanisms including resolver deposits, timelock cascades, and public withdrawal periods. The system features two swap flows: EVM→Cardano using Limit Order Protocol integration, and Cardano→EVM with AuthVault pre-authorization. Built with Solidity smart contracts, PluTS validators, and a React frontend with real-time WebSocket monitoring. Users enjoy "fire-and-forget" swaps while resolvers facilitate cross-chain liquidity with economic incentives ensuring honest behavior and atomic execution guarantees.

Solution

Technical Architecture & ImplementationCore Technology Stack:Smart Contracts: Solidity (EVM) + PluTS/Plutus (Cardano)Frontend: Next.js 15, React 19, TypeScript, TailwindCSSBackend: Node.js, Express, PostgreSQL, WebSocketBlockchain Integration: wagmi/viem (EVM), MeshSDK (Cardano), Blockfrost APIThe Nitty-Gritty DetailsCross-Chain Challenge Solution:The biggest technical hurdle was bridging two fundamentally different blockchain architectures - EVM's account model vs Cardano's eUTXO model. We solved this by implementing dual HTLC systems that speak each chain's "native language" while maintaining atomic execution guarantees.EVM Implementation:We leveraged1inch's HTLC contractsas our foundation, extending their Limit Order Protocol with a two-phase interaction system:preInteraction(): Validates maker's signed order and locks ETH/ERC20 tokenspostInteraction(): Creates escrow contracts using minimal proxies (EIP-1167) for gas efficiencyThe particularlyhacky but elegantsolution was using CREATE2 for deterministic escrow addresses. Resolvers can pre-calculate escrow addresses off-chain and pre-fund safety deposits before the contract exists - solving a chicken-and-egg problem.Cardano Innovation:Built custom PluTS validators implementing HTLCs in Cardano's functional paradigm. The breakthrough was creating an "AuthVault" system enabling "fire-and-forget" user experience on Cardano - users lock funds once, then resolvers can execute swaps using only off-chain signatures.Real-Time Coordination:Implemented a WebSocket-based monitoring service that watches both chains simultaneously, automatically sharing secrets when both escrows are detected. This required building custom blockchain event parsers for both UTXO and account-based transaction models.Partner Technology Benefits:Using 1inch HTLC contracts provided battle-tested security primitives and gas-optimized implementations. Their modular design allowed us to extend functionality without reinventing core HTLC logic, significantly reducing development time and security risks.

Hackathon

ETHGlobal Unite

2025

Prizes

  • 🏆

    Extend Fusion+ to Cardano1st place

    1inch

Contributors