Not1inch
Cross-chain swap between EVM & Sui using 1inch Fusion+ and intent-based atomic swaps.
Problem Statement
This project is a technical extension of the1inch Fusion+ intent-based protocol, designed to enablesecure, decentralized, and composable cross-chain atomic swapsbetweenEVM-compatible chainsand theSui blockchain. On theEVM side, it integrates directly with the1inch Limit Order Protocol, utilizing its existingresolver and settlement infrastructureto ensuretrustless and gas-efficientexecution of intents. On theSui side, we have engineered aparallel implementation from scratchinSui Move, adhering closely to the design principles and flow described in the1inch Fusion+ whitepaper. This includes support forcompetitive Dutch auctions,Merkle Tree–based partial fills, and a highly granularHTLC modelwith multiple independenttimelock phases.To manage escrow lifecycles, we use anEscrowFactorycontract to deterministically deployEscrowSrcandEscrowDstproxies on the respective chains. This ensures consistent address computation, gas efficiency, and compatibility with resolver-based execution logic.By leveragingHashed Timelock Contractson both chains, the system guaranteesatomicity—either both parties reveal thepreimageand finalize the trade, or funds are safelyrefunded. The protocol introduces aresolver competition model, where resolvers commit to filling orders atdecreasing pricesdetermined byauction tick logic. Fragmented orders are supported viaMerkle root commitments, allowing multiple resolvers to claim distinct portions. To further harden execution, resolvers are required to stakesafety deposits, which areslashed and redistributedin the event of abandonment or failure, incentivizing consistent behavior.This architecture establishes amodular and secure foundation for cross-chain liquidity, maintaining alignment with1inch’s trust-minimized modelwhile extending it to theMove ecosystemwith fulltechnical fidelity.For detailed explanation Checkout the Readme.md file
Solution
The project combines the1inch Limit Order Protocolon EVM with acustom Sui Move implementationdesigned to replicate the Fusion+ behavior described in the official whitepaper. At the heart of the system lies abidder-resolver architecturewhere resolvers participate in aDutch auction, competing to fill orders at decreasing prices as time progresses. Orders can either be filled fully or partially, withMerkle Tree–based secret segmentationallowing each partial fill to be cryptographically verified and uniquely associated with its resolver. This logic is managed via aPartialOrderobject, which tracks themerkle_root, afilled_parts_bitmap, and individual resolver fill parameters such astarget_secret_hash,expected_secret_index, and correspondingmerkle_proof.On the EVM side,order signing, announcement, and resolver logicare handled by existing 1inch infrastructure, making use of off-chain orderbooks and signed messages verified on-chain. On the Sui side, we implemented matching logic usingSui Move smart contractsin thesui_htlc_contract::htlcmodule. Resolvers submit bids usingfill_order_partial, triggering the on-chain construction of aHashedTimelockEscrow object. This escrow enforces strictmulti-phase timelocks: starting with afinality lock, followed by aresolver-exclusive unlock, then apublic unlock, and finally cascadingcancellation windowsthat allow recovery of funds in case of failure or abandonment.Each escrow can be claimed only if the correctpreimage (secret)is revealed, ensuring trustless atomicity across chains. The timelock structure is carefully designed to incentivize good behavior: resolvers are required to stakesafety deposits, which can be slashed and redistributed during thepublic cancellation incentivephase if they fail to fulfill obligations. This mechanism is visible in the HTLC state flow diagram, where every phase — from resolver unlock to maker final cancellation — is gated by strict time-based checks and state transitions.All cross-chain interactions are coordinated off-chain via relayers, which monitor on-chain events (likeorder announced,htlc escrow created, orsecret revealed) and propagate corresponding actions to the opposite chain. For example, in aSUI → EVMswap, the user signs and announces the order on Sui, a resolver fills it and locks funds on EVM, and the secret is eventually shared to unlock funds on both chains. Thereverse flow (EVM → SUI)follows the same structure with contracts mirrored between chains.We also implemented a high-fidelitysimulation and test suiteusingTypeScript,pnpm,Jest, andFoundry, covering both standard and partial swap flows. Custom helper functions replicate on-chain logic (likecalculateExpectedSecretIndex) in JS to ensure off-chain actions match the contract’s expectations. Interaction with Sui is handled via theMysten Labs Sui SDK, with all transactions built using the nativeTransactionBlockAPI and signed viaEd25519 keypairs.Overall, the architecture faithfully mirrors the trustless, intent-based swap model defined by Fusion+, while introducing original extensions to handle Merkle-based fills, multi-stage recovery, and cross-chain resolver incentives within the Move smart contract paradigm.
Hackathon
ETHGlobal Unite
2025
Contributors
- anushkasomani
40 contributions
- juSt-jeLLy
36 contributions
- vbrvk
10 contributions
- rharutyunyan
1 contributions