Mesh a Gas-free Platform for Safe and secure swaps between Ethereum and Sui
Mesh is a cross-chain atomic swap protocol that enables seamless token swaps between Ethereum and Sui blockchains. The protocol eliminates gas fees for users by implementing the 1inch Fusion+ pattern, where resolvers compete to execute trades and pay gas costs.
Key Features:
Gas-free trading: Users create orders off-chain, resolvers pay all gas fees Atomic security: Hash-Time Lock Contracts (HTLC) ensure trustless swaps Bidirectional swaps: Support for both ETH → SUI and SUI → ETH directions Partial fills: Orders can be filled incrementally by multiple resolvers 1inch Fusion+ integration: Leverages proven infrastructure for order matching How it works:
User creates a swap order off-chain (no gas required) Resolvers compete to fill the order using Dutch auction mechanism Cross-chain coordination via relayer service ensures atomic execution Hash locks and time locks guarantee security without trusted parties Users receive tokens on destination chain without paying any gas fees
Architecture:
Ethereum Contracts (Solidity/Foundry): Integration with 1inch Fusion+ protocol Sui Contracts (Move): Custom HTLC implementation for non-EVM chain Relayer Service (TypeScript/Node.js): Cross-chain event monitoring and coordination Frontend (React/Vite): User interface for creating and tracking swaps Technical Implementation:
Ethereum Side:
SuiResolver.sol: Main resolver contract implementing IResolverExample interface FusionResolver.sol: Manages cross-chain swap state and escrow coordination Integrates with official 1inch contracts: IEscrowFactory, IOrderMixin Uses EscrowSrc/EscrowDst pattern for atomic swap security Sui Side:
cross_chain_escrow.move: Core Move contract implementing HTLC pattern Modular design with separate hash_lock.move and time_lock.move utilities Global registry prevents secret reuse across different escrows Factory pattern for centralized escrow management Cross-Chain Coordination:
Event-driven relayer monitors both chains simultaneously Deterministic secret generation ensures consistent hash locks Automatic retry mechanisms for failed transactions Real-time status updates and swap completion tracking Notable Technical Decisions:
Gas Optimization: Leveraged 1inch Fusion+ to eliminate user gas costs entirely Security: Implemented global secret registry on Sui to prevent replay attacks Modularity: Separated hash/time lock logic into reusable utility modules Atomic Safety: Used proven HTLC pattern with coordinated timeouts across chains Partner Technologies:
1inch Fusion+: Provides gas-free infrastructure and proven order matching Sui Move: Enables safe smart contract development with built-in security features Foundry: Comprehensive testing framework ensuring contract reliability