
CardanoSwap
Bidirectional cross-chain atomic swaps for Cardano and EVM chains
Demo
About
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.
How it's made
## Technical Architecture & Implementation **Core Technology Stack:** - **Smart Contracts**: Solidity (EVM) + PluTS/Plutus (Cardano) - **Frontend**: Next.js 15, React 19, TypeScript, TailwindCSS - **Backend**: Node.js, Express, PostgreSQL, WebSocket - **Blockchain Integration**: wagmi/viem (EVM), MeshSDK (Cardano), Blockfrost API ## The Nitty-Gritty Details **Cross-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 leveraged **1inch's HTLC contracts** as our foundation, extending their Limit Order Protocol with a two-phase interaction system: - `preInteraction()`: Validates maker's signed order and locks ETH/ERC20 tokens - `postInteraction()`: Creates escrow contracts using minimal proxies (EIP-1167) for gas efficiency The particularly **hacky but elegant** solution 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.