Executive Summary
Fusion+ Aptos Extension is a comprehensive implementation of cross-chain atomic swaps between Ethereum and Aptos blockchains that eliminates gas fees for users while enabling trustless, decentralized token exchanges. Built for a hackathon, this project demonstrates how to create a production-ready cross-chain DEX aggregator that rivals centralized exchanges in user experience while maintaining complete decentralization.
What This Project Is
Core Concept
This is a gasless cross-chain swap protocol that allows users to trade tokens between Ethereum and Aptos without paying any gas fees. Users can swap WETH on Ethereum for APT on Aptos (or vice versa) by simply signing a message - no ETH or APT needed for transaction fees.
Key Innovation: True Gasless Experience
Unlike traditional DEXs where users must:
Hold native tokens (ETH/APT) for gas
Approve tokens with separate transactions
Pay gas for every transaction
This system enables users to:
Sign once - just authorize the swap with a signature
Pay zero gas - resolvers sponsor all transaction costs
Get instant execution - automated cross-chain coordination
Maintain custody - funds never leave user control until swap completes
Real-World Problem Solved
Problem: Cross-chain trading is complex, expensive, and risky
Users need native tokens on both chains for gas
Bridge protocols require trust and long waiting periods
DEX aggregators don't work across different blockchains
Technical complexity barriers prevent mainstream adoption
Solution: This project creates a seamless cross-chain trading experience
Users interact with one simple interface
No gas fees, no complex bridging, no technical knowledge required
Atomic swaps ensure funds cannot be lost or stolen
Competitive pricing through resolver auction mechanism
Four-Phase Atomic Swap Protocol
-
Announcement Phase
- User creates an intent with a cryptographic commitment (hash of secret).
-
Deposit Phase
- Resolver creates escrows on both chains, each locked with the hash.
-
Withdrawal Phase
- Revelation of the secret allows atomic withdrawal on both chains.
-
Recovery Phase
- If the swap fails, funds can be recovered after a timelock expiration.
Smart Contract Implementation
Ethereum (Solidity):
- Implements EIP-712 for typed data signing and meta-transactions.
- Supports partial fills using Merkle tree validation.
- Integrates OpenZeppelin’s ReentrancyGuard and SafeERC20.
- Manages WETH transfers with no required user gas.
Key Features:
- Dutch auction with configurable price range.
- Order validation and state persistence.
Resolver Service
- Multiple resolver instances, various execution strategies.
- Monitors order engine via WebSocket for new orders.
- Executes cross-chain transactions automatically.
- Manages sponsorship of gas on both chains.
Relayer Service
- Coordinates secret management between chains.
- Verifies finality (Ethereum: 64 blocks ≈ 15 min; Aptos: instant).
- Ensures secret is not revealed until escrow is finalized.
Cross-Chain Communication Flow
- User signs intent (off-chain).
- Order broadcast to resolvers.
- Resolver creates destination escrow.
- Resolver creates source escrow using meta-tx.
- Relayer verifies finality on both chains.
- User reveals secret to relayer.
- Resolver uses secret to withdraw on both.
- Swap is completed atomically.
Technical Stack
- Frontend: React 18.2, TypeScript 4.9.5, Web3Modal, Aptos Wallet Adapter, Socket.IO Client.
- Backend: Node.js (Express.js), TypeScript, Zod, Socket.IO.
- Blockchain SDKs: Ethers.js v6.9.0, Aptos SDK v1.39.0, custom transaction builders.
- Development Tools: Hardhat, Aptos CLI, Jest, Docker.
Security Model
- Cryptography: Hashed Timelock Contracts (HTLCs)
- Secret S: 32 bytes, Hash H: Keccak256(S)
- Atomic property: same S required on both chains
- Timelock enables refunds
Attack Mitigation:
- Front-running: Secret commitment hides S.
- Chain reorg: Finality checked before secret reveal.
- Griefing: Optional safety deposits incentivize completion.
- Signature replay: Nonce tracking.
Gasless Transaction Mechanisms
- Ethereum: EIP-712 data signing, permit pattern for WETH, meta-transaction relaying.
- Aptos: Multi-agent with fee payer, sponsored transactions, dynamic gas estimation.
Partial Fill Support
- Order splitting via Merkle tree of secret hashes.
- Each leaf = partial fill secret.
- Tracks cumulative fills.
- Allows parallel resolver execution.
Dutch Auction Mechanism
- Price spread: +3% to -3% from market price.
- Linear price decay every 15 sec.
- Resolver competition for best price.
- Orders matched automatically.