Bidirectional cross-chain atomic swaps for Cardano and EVM chains
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.
Core Technology Stack:
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 tokenspostInteraction()
: Creates escrow contracts using minimal proxies (EIP-1167) for gas efficiencyThe 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.