← Back to home

StellaFi+

Trustless Ethereum–Stellar swaps using HTLCs, escrow factories, and Dutch auction orders.

Problem Statement

This project implements a Cross-Chain Atomic Swap system between Stellar and Ethereum, using a CrossChain Resolver contract that coordinates with the Limit Order Protocol (LOP) and Hash Time Lock Contract (HTLC) escrow contracts.It enables two parties on Stellar and Ethereum to trustlessly exchange tokens without intermediaries. The resolver contract:Creates and manages cross-chain swapsUses Dutch auction–based price discovery for fair order matchingEnsures atomic settlement—either both parties receive their tokens or neither doesA backend event listener monitors Stellar events, updates Dutch auction prices, and broadcasts swap details to Ethereum. Users can create, fund, match, and claim swaps directly through a browser-based UI, with every step verifiable on-chain.

Solution

This project is built as across-chain atomic swap systemconnecting Ethereum and Stellar usingHashed Timelock Contracts (HTLCs).Smart ContractsEthereum (Solidity)– EscrowFactory and Resolver contracts manage USDC locking and cross-chain coordination.Stellar (Soroban)– Escrow, EscrowFactory, LOP (Limit Order Protocol), and Dutch Auction contracts handle XLM transfers and order execution.FactoriesBoth Ethereum and Stellar usedeterministic factoriesto deploy escrow and LOP contracts with predictable addresses, making cross-chain coordination easier.Cross-Chain ResolverA Node.js/TypeScript integration layer orchestrates swaps by generating secrets, locking assets, and revealing secrets across chains.The same hashlock is used on both chains to ensure atomicity—either both swaps succeed or both are refunded.Testing & ToolingFoundryfor Solidity development and testing on a forked Ethereum network.Stellar CLIfor real contract interaction on Soroban testnet.pnpm + Jestfor TypeScript-based end-to-end tests simulating real swap scenarios.Hacky but Useful PartsWe useddeterministic contract deploymentsto precompute escrow addresses on Stellar and Ethereum, so both sides can prepare before deployment.The tests spin up alocal Ethereum fork with Anvil, fund accounts with USDC, and then useshell scriptsto interact with real Soroban contracts—so it feels like a real-world swap without needing two full live networks.Partner Tech BenefitsSoroban’s CLI + deterministic addresses made it possible to deploy and interact with contracts in a predictable way.

Hackathon

ETHGlobal Unite

2025

Contributors