StellarFusion+
Trustless atomic swaps for XLM↔ETH between Stellar & Ethereum with zero counterparty risk.
Problem Statement
StellaSwapWhat is StellaSwap?StellaSwap is a revolutionary cross-chain protocol that enables trustless atomic swaps between Stellar and Ethereum blockchains. It allows users to directly exchange assets (like XLM for ETH or ETH for XLM) without relying on centralized exchanges, wrapped tokens, or vulnerable bridge protocols that have lost billions to hacks.The Core Problem We SolveToday's cross-chain trading is fundamentally broken:Centralized exchanges require you to deposit funds and trust the platform (remember FTX?)Traditional bridges create wrapped tokens with counterparty risk and have lost over $2.5 billion to exploitsDirect swaps between different blockchains have been technically impossible... until nowOur Solution: Hash Time-Locked Contracts (HTLCs)StellaSwap implements atomic swaps using Hash Time-Locked Contracts — a cryptographic mechanism that ensures either both parties get what they want, or both get their original funds back. No one can be scammed.How It Works (Simple Version)Alice wants to trade 1000 XLM for 0.5 ETH with Bob (or Bob wants to trade 0.5 ETH for 1000 XLM with Alice)Alice (or Bob) creates a secret and locks her (or his) asset in a Stellar or Ethereum smart contract using a hash of that secretThe counterparty locks their asset in the corresponding smart contract on the other chain using the same hashWhen the initiator reveals the secret to claim the counterparty's asset, the counterparty automatically gets access to the initiator's locked assetIf something goes wrong, both can recover their funds after a timeout periodTechnical ArchitectureFive Key ComponentsMake: Creates swap orders (wants to exchange Asset A for Asset B)Relayer: Broadcasts orders and coordinates the swap processResolver: Takes the other side of trades (provides liquidity)Stellar Contract: Handles XLM/Stellar asset escrow with HTLC logicEthereum Contract: Handles ETH/ERC-20 escrow with HTLC logicThe Complete FlowPhase 1: Order CreationMaker creates a StellaSwap order specifying: "I want to swap 1000 XLM for 0.5 ETH" (or "I want to swap 0.5 ETH for 1000 XLM")Order includes a secret hash and timelock parametersRelayer broadcasts this intent to potential resolversPhase 2: Escrow SetupResolver agrees to take the tradeMaker locks 1000 XLM (or 0.5 ETH) in the corresponding contract with secret hash + 24-hour timelockResolver locks 0.5 ETH (or 1000 XLM) in the contract on the other chain with same hash + 12-hour timelockBoth escrows must be confirmed before proceedingPhase 3: Atomic ExecutionMaker reveals the secret to claim the counterparty’s asset from the Ethereum or Stellar contractThe same secret automatically allows resolver to claim the original asset from the opposite contractBoth transfers happen atomically — if one fails, both failPhase 4: Safety RecoveryIf maker doesn't reveal the secret within timelock, both parties can recover original fundsShorter timelock on second-mover chain protects counterparty from griefing attacksWhy This is RevolutionarySecurity AdvantagesNo custodial risk: You never give up control of your assets to a third partyNo wrapped tokens: Direct native asset transfersNo bridge vulnerabilities: No validators or multisig that can be compromisedMathematical guarantees: Cryptographic proof that swaps are fairEfficiency BenefitsLower fees: ~$0.50 total vs 0.1-1% on traditional bridgesFaster settlement: 2-3 minutes vs hours on some bridgesNo KYC required: Fully decentralized and permissionlessCross-chain composability: Enables new DeFi strategies across ecosystemsLive Demo CapabilitiesOur working prototype demonstrates:Real testnet transactions on both Stellar and EthereumSmart contract deployment with verified source codeCross-chain coordination via our relayer systemBlock explorer verification showing actual fund transfersRecovery mechanisms if swaps need to be cancelledMarket OpportunityCross-chain bridge market: $58 billion in locked valueStellar daily volume: $3+ billionEthereum DeFi TVL: $100+ billionCurrent bridge fees: 0.1–1% (we can do 0.01%)Bridge hack losses: $2.5+ billion (we eliminate this risk)Technical InnovationBuilding on Proven TechnologyExtends 1inch Fusion+ protocol to work across different blockchain architecturesStellar's native smart contracts for efficient asset handlingEthereum's EVM for complex HTLC logicCross-chain event monitoring for seamless coordinationKey DifferentiatorsFirst implementation of atomic swaps between Stellar and EthereumLeverages battle-tested 1inch infrastructure ($50B+ processed)No new consensus mechanisms or validator sets requiredCompatible with existing DeFi protocols on both chainsBusiness ModelRevenue StreamsTransaction fees: 0.01% per successful swapResolver incentives: Market-making rewards for liquidity providersAPI licensing: White-label solutions for other protocolsConservative ProjectionsYear 1: $1M daily volume = $36K annual revenueYear 3: $100M daily volume = $3.6M annual revenueWhy Judges Should CareFor DeFi Enthusiasts: We're solving the biggest problem in crypto — isolated blockchain ecosystemsFor Security-Minded: We eliminate the single biggest attack vector in DeFi (bridge hacks)For Builders: We provide infrastructure that other protocols can build on top ofFor Investors: We're addressing a $58B market with proven technology and clear revenue modelWhat Makes This Demo-ReadyUnlike many hackathon projects that show mockups, StellaSwap is fully functional:Working smart contracts on both Stellar and Ethereum testnetsEnd-to-end atomic swap completion in under 3 minutesReal blockchain transactions you can verify on explorersRecovery mechanisms tested and functionalClean, professional UI for creating and monitoring swapsThis isn't just a concept — it's a working protocol ready for mainnet deployment.StellaSwap represents the future of cross-chain trading: secure, efficient, and truly decentralized. We're not just building another bridge — we're creating the infrastructure for a connected multi-chain future.
Solution
Project Name: StellaSwap Tagline: Trustless atomic swaps for XLM↔ETH between Stellar & Ethereum with zero counterparty risk.What We Built We’ve created a trustless, cross-chain atomic swap protocol that enables seamless token exchanges between Ethereum and Stellar networks — without relying on bridges or centralized custody.Inspired by 1inch Fusion+, our protocol implements Hash Time-Locked Contracts (HTLCs) to ensure atomic execution: either both sides of the trade succeed, or both parties are fully refunded. Think of it as a decentralized escrow system that works across two entirely different blockchain architectures. Users can swap ETH/ERC-20 tokens for XLM/Soroban assets, with mathematical guarantees of security.The Problem We Solved Traditional cross-chain swaps depend on:Bridges — vulnerable to exploits (>$2.5B lost from 2022–2024)Centralized exchanges — custodial risk, KYC frictionWrapped tokens — added complexity and trust assumptionsOur solution eliminates all of the above using atomic swap technology. Inspired by 1inch Fusion+, we provide:Built-in MEV protectionIntent-based Dutch auction fillsTrustless, non-custodial infrastructureHow It Works — Protocol Flow Phase 1: Order Creation & Broadcasting Maker creates a swap order with a secret hash (keeps secret private)Relayer broadcasts the order to potential Resolvers (liquidity providers)Orders are filled using a Dutch auction mechanism (similar to 1inch Fusion+)Phase 2: Dual Escrow Setup Resolver locks ETH/tokens on Ethereum via our EthHTLC.sol contractResolver also locks XLM/assets on Stellar via Soroban HTLC contractBoth contracts use the same secret hash with different timelocks (Stellar expires first)Phase 3: Atomic Execution Resolver reveals the secret to claim funds on one chainRelayer detects the secret and propagates itMaker uses revealed secret to claim funds on the other chainSwap completes atomically — both parties get what they expectedPhase 4: Safety Mechanism If something fails, timelocks allow fund recoveryNeither side can lose funds or get locked in a failed tradeTechnical Architecture Smart Contracts Ethereum Side (EthHTLC.sol)EVM-compatible HTLC with eventsSupports ETH and ERC-20 tokensGas-optimized using custom errorsStellar Side (Rust/Soroban)Full HTLC for XLM and Soroban tokensEvent-rich for relayer syncPanic-safe with robust state handlingOff-Chain Infrastructure Relayer (Node.js / TypeScript)Monitors Ethereum and Stellar in parallelDetects HTLC events + secret revealsPropagates secrets cross-chainCoordinates Dutch auction fillingResolver / Market MakerProvides cross-chain liquidityCompetes in auction fillsManages exposure and riskFrontend (Next.js) Integrated with MetaMask and FreighterReal-time swap status and explorer linksSmooth UX for cross-chain transactionsKey Technical InnovationsDual-Chain HTLC Synchronization Deterministic swap IDs based on hash and order paramsEvent-driven architecture with normalized schemasDifferential timelocks (Stellar expires first) prevent griefingSoroban–Ethereum Bridge Logic Soroban HTLC mirrors EVM semantics with:Native XLM + Soroban token supportCustom error and panic-safe stateGas-efficient storage structuresSecure Secret Management 32-byte SHA-256 hashlockEnforced replay protection via state enumsStrict timed execution windowsWhat Makes This Special Security-First Design No custodial risk — funds stay with users until swap completionMathematical guarantees — all-or-nothing executionMEV-resistance — Dutch auction removes front-runningAudit-ready — well-tested contracts with formal logic structureProduction-Ready Features Bidirectional swaps: ETH→XLM and XLM→ETHMulti-asset support: ERC-20 + Soroban tokensLive on testnets: Sepolia (ETH) + Stellar testnetBlock explorer verification: All contracts and txs are traceable1inch Fusion+ Compatibility StellaSwap adheres to 1inch Fusion+ architecture:Intent-based swapsDutch auction pricingGas-adaptive executionThis allows seamless integration with 1inch aggregation infrastructure and any DEX that supports intent-based routing.The “Hacky” Parts Worth Highlighting Cross-Chain Event Sync Built a custom indexer that maps EVM logs and Stellar ledger entries into a unified schema. This bridges two radically different event models with consistency.Timelock Differentiation Strategy Implemented asymmetric timeouts:Stellar HTLC expires at TEthereum HTLC expires at T + ΔThis guarantees fair recovery and protects against late-claim exploits.Soroban Memory Optimization Soroban contracts are memory-constrained. We:Used bit-packed enumsDesigned compact state machinesRetained full audit trails despite footprint limitationsDemo & Verification StellaSwap is fully functional on public testnets:✅ Verified smart contracts on Sepolia and Stellar testnet✅ Live swap executions with test assets✅ On-chain block confirmations via explorers✅ 24/7 relayer uptime during demoFuture Extensibility The architecture supports:Partial fills for large ordersMulti-resolver auctionsExpansion to additional chainsSupport for advanced order types (e.g., limit, DCA)
Hackathon
ETHGlobal Unite
2025
Contributors
- santhoshkumar0918
22 contributions
- MohamedAshiq09
8 contributions