project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5

TotalFusion

1inch Fusion+ multi-chain extension: atomic swaps with TEE security & Chain Signatures

TotalFusion

Created At

Unite Defi

Winner of

NEAR

NEAR - Best 1inch Fusion+ Solver Built with NEAR's Shade Agent Framework

Project Description

A comprehensive 1-inch Fusion+ extension that enables atomic cross-chain swaps between Ethereum and multiple blockchains (NEAR, Cosmos, Bitcoin, etc) using TEE (Trusted Execution Environment) security with Intel TDX attestation and NEAR Chain Signatures MPC for decentralized transaction signing. The implementation features a modular adapter architecture for universal blockchain support, production-ready escrow contracts with real token settlements, and a complete TEE solver deployed on NEAR Shade Agent Framework. Key innovations include triple-mode signing (TEE hardware → Chain Signatures MPC → private key fallback), remote attestation verification, and hardware entropy generation. The system demonstrates live atomic swaps on Sepolia testnet with real token transfers, cryptographic hashlock coordination, and economic security through safety deposits, making it ready for mainnet deployment and bounty submission.

How it's Made

We built this multi-chain atomic swap system by combining Solidity-based smart contracts on Ethereum with secure signing mechanisms and cross-chain coordination infrastructure. On the Ethereum side, we used Solidity 0.8.19 with strict compiler settings and deployed contracts via Hardhat. Security best practices were enforced through OpenZeppelin’s libraries. A key feature was the use of deterministic contract deployment, allowing us to precompute escrow addresses using CREATE2. For NEAR integration, we used the NEAR SDK and CLI to manage contracts and transactions. Signing on NEAR with its MPC, Chain Signatures, which offered decentralized and fault-tolerant authorization.

We deployed a TEE-secured infrastructure that allowed us to perform secure operations like key generation using hardware entropy and verify execution through remote attestation. The system uses SHA-256 hashlocks and time-based locks to coordinate atomic swaps between chains, with WebSocket connections enabling real-time quote processing.

Our architecture was designed for modularity and extensibility. A unified chain adapter interface allowed us to add support for new blockchains without changing core contracts. This was critical in enabling scalable support for multiple chains. We also implemented a triple-mode signing strategy: TEEs were used when available, Chain Signatures served as a reliable backup, and private key signing was a last-resort fallback.

Some of the more engineering challenges included serialization of large integers in JavaScript, which required custom logic to handle BigInt values during WebSocket communications correctly. For testing, we developed a mock Web3 provider to simulate Ethereum environments without relying on live blockchain connectivity, enabling compatibility with external SDKs like 1inch. We implemented and demonstrated complete token settlement, including movement from user wallets into escrow and final delivery to the counterparty, completing the full lifecycle of a swap.

We integrated with 1inch’s Fusion+ system by using its ITakerInteraction and IOneInchEscrowFactory interfaces, which allowed us to plug directly into their production contracts. This gave us access to their resolver network and economic security, ensuring compatibility with existing escrow logic. On the NEAR side, the Chain Signatures technology lets us deterministically derive addresses across multiple blockchains while avoiding single points of failure.

Some unconventional techniques were necessary. We extended incomplete TypeScript interfaces in third-party libraries to ensure compatibility. We also implemented a universal chain ID mapping layer to translate identifiers between NEAR, Ethereum, and 1inch formats. For remote attestation, we verified the integrity of the enclave code by hashing entire Docker images and cross-checking them against the attestation data.

In summary, this system bridges 1inch Fusion+ with non-EVM blockchains through a modular adapter model and secures cross-chain swaps using trusted hardware and decentralized signing, delivering production-grade functionality with an emphasis on extensibility and verifiability.

background image mobile

Join the mailing list

Get the latest news and updates