StellarSwap
Cross chain swapping between EVM and Stellar Soroban powered by 1inch Fusion+
Problem Statement
StellarSwapThis project introduces a bidirectional cross-chain swap protocol that connects EVM-compatible chains with the Stellar network. It extends the architecture of 1inch's Fusion+, allowing the trade of assets between Ethereum and Stellar.The protocol ensures the atomicity and security of swaps through a system of hashlocked and timelocked escrow contracts deployed on both the source and destination chains by implementing low level Rust components equivalent to those of 1inch's Fusion+.This preserves the core security principles required for trustless cross-chain interactions. To achieve optimal and fair pricing, the system incorporates a Dutch auction mechanism, inspired by 1inch Fusion, which dynamically discovers the exchange rate for orders, with the possibility of partial fills.Users receive competitive rates for their cross-chain trades in a decentralized manner, where resolvers can bid for relayed orders signed by makers.
Solution
How it's madeThe project is built with a modular architecture, separating Stellar and EVM environments, and uses a central resolver logic.Stellar Backend:The core of the protocol resides on a set of interconnected Stellar smart contracts written in Rust, that are implemented to follow the 1inch fusion+ logic.AnOrder Protocolcontract, analogous to the 1inch Limit Order Protocol, serves as the main hub for managing swap orders and their execution logic.AnEscrow Factorycontract is responsible for deterministically deploying matchingEscrowSrc(source) andEscrowDst(destination) contracts.TheBase Escrowcontracts implement the fundamental cross-chain logic, utilizing hashlocks and timelocks to secure user funds during the swap process until the secret is revealed or the time expires.ADutch Auction Calculatorcontract is implemented to handle the dynamic price discovery for swaps, mirroring the functionality of 1inch Fusion to provide fair value to users.AResolvercontract acts as the primary entry point, orchestrating the deployment of escrows and the ultimate settlement of the trade across both chains.EVM-side Integration:The project includes a standardFoundrysetup to manage the EVM-side components. These contracts are designed to interact with the 1inch Limit Order Protocol on an EVM chain, initiating the first part of the swap and generating the secret required to unlock the funds on the Stellar side.Client and Deployment:A command-line client was developed usingBunandTypeScriptwith the@stellar/stellar-sdkto facilitate interaction with and demonstration of the deployed Stellar contracts.The entire development and testing environment is automated with adeploy_full_stack.shscript. This script handles starting a local Stellar network via Docker, compiling all Rust contracts and deploying them in sequence with initial configurations.
Hackathon
ETHGlobal Unite
2025
Contributors
- jacksmithinsulander
74 contributions
- MarcusWentz
54 contributions
- Skanislav
47 contributions
- gepng
2 contributions
- rainbowpuffpuff
1 contributions