← Back to home

etfusion

Extend 1inch Fusion+ to Tron: Bidirectional ETH↔TRX swaps with HTLC & timelock

Problem Statement

This project extends 1inch's Fusion+ protocol to enable bidirectional token swaps between Ethereum and Tron, preserving hashlock and timelock functionality for secure, atomic cross-chain swaps.Core Innovation:First Fusion+ extension to non-EVM chain (Tron)Dual-chain architecture: Hardhat (Ethereum) + TronWeb (Tron)Cross-chain resolver coordinates both chains seamlesslyPreserves all Fusion+ security features (hashlocks, timelocks, partial fills)Hackathon Requirements Met:✅ Hashlock and timelock functionality preserved for non-EVM (Tron) implementation ✅ Bidirectional swap capability (ETH ↔ TRX) ✅ On-chain execution demonstrated on testnets (Sepolia + Nile) ✅ Partial fills supported via Merkle tree secretsTechnical Architecture:Ethereum Side: Uses 1inch LOP on Sepolia testnetTron Side: Custom HTLC contracts on Nile testnetCross-Chain Resolver: Node.js script coordinating both chainsFusion+ Integration: SDK for order creation and WebSocket monitoringDemo Flow:User creates ETH→TRX swap via 1inch Fusion+ SDKResolver deploys escrows on both chains with same hashlock/timelockAtomic swap executes: secret revealed on both chains simultaneouslyOn-chain verification via block explorersThis demonstrates the first successful extension of 1inch Fusion+ to a non-EVM blockchain while maintaining all security guarantees and enabling true cross-chain interoperability.

Solution

Technology Stack:Smart Contracts: Solidity 0.8.19 (Ethereum) + Solidity (Tron)Development: Hardhat (Ethereum) + TronWeb (Tron)Cross-Chain: Node.js resolver with 1inch Fusion+ SDKTesting: Comprehensive test suite with Chai/MochaKey Technical Components:Dual-Chain Architecture:Ethereum: Hardhat + ethers.js + 1inch LOPTron: TronWeb + custom HTLC contractsCross-chain coordination via Node.js resolverFusion+ Integration:1inch Fusion+ SDK for order creation and monitoringWebSocket API for real-time order trackingMerkle tree secrets for partial fills supportSmart Contract Innovation:EthereumEscrowFactory.sol: Deploys escrows on SepoliaTronEscrowFactory.sol: Deploys escrows on NileBoth implement identical HTLC logic with SHA-256 hashlocksCross-Chain Resolver:Monitors 1inch Fusion+ orders via WebSocketDeploys corresponding escrows on both chainsCoordinates secret submission for atomic swapsHandles partial fills and error recoveryHacky Solutions:Used Gnosis as proxy destination for Tron in 1inch SDK (since Tron not natively supported)Implemented custom TronWeb integration for non-EVM chainCreated dual deployment system: Hardhat for Ethereum, TronWeb for TronBuilt cross-chain secret coordination mechanismPartner Technologies:1inch Fusion+ SDK: Leveraged for order creation and monitoringTronWeb: Used for Tron blockchain interactionHardhat: Ethereum development and testing frameworkSecurity Features:SHA-256 hashlocks on both chainsTimelock-based cancellationReentrancy protectionComprehensive error handlingAtomic swap guaranteesThe project successfully extends 1inch's Fusion+ protocol to Tron while maintaining all security properties and enabling true cross-chain interoperability between EVM and non-EVM chains.

Hackathon

ETHGlobal Unite

2025

Contributors