
NearFusion
Cross-chain atomic swaps between Ethereum/EVM chains and NEAR using HTLCs and TEE security
Demo
About
NearFusion is a trustless cross-chain atomic swap protocol that enables seamless token exchanges between Ethereum and NEAR Protocol. The system uses Hash Time Locked Contracts (HTLCs) to guarantee atomic execution - either both parties receive their desired tokens, or both get refunded automatically. The platform features a modern glass-morphism frontend built with Next.js and TypeScript, supporting bidirectional swaps with real-time pricing and slippage protection. Users can connect their Ethereum and NEAR wallets simultaneously to swap ETH tokens for NEAR tokens and vice versa. Key features include: - Trustless atomic swaps with timelock safety mechanisms - Real-time exchange rate calculation and fee estimation - TEE-secured backend for privacy and verifiability - Comprehensive REST API for frontend integration - Emergency fund recovery and risk management
How it's made
CrossFusion combines smart contracts, modern web technologies, and privacy-preserving backend infrastructure: **Smart Contracts:** Solidity contracts on EVM chains and Rust contracts on NEAR implement Hash Time Locked Contracts (HTLCs) with SHA-256 hashlocks for cross-chain compatibility. The escrow factory pattern creates atomic swap contracts on demand. **Frontend:** Built with Next.js 15, TypeScript, and Tailwind CSS featuring a 1inch-inspired dark theme with NEAR green accents. Uses Wagmi/Viem for EVM wallet connections and NEAR Wallet Selector for NEAR integration. The UI provides an intuitive swap experience with real-time rate calculations. **Backend Solver:** Node.js/TypeScript service using NEAR's Shade Agent Framework and Trusted Execution Environment (TEE) for privacy-preserving swap coordination. **Security Features:** TEE attestation ensures code integrity, hardware-protected private keys prevent unauthorized access, and timelock mechanisms enable automatic refunds. The atomic nature of HTLCs eliminates counterparty risk..