MoleSwap is a cross-chain swap protocol inspired by the Intent architecture that enables peer-to-peer asset swaps without relying on off-chain servers like relayers. MoleSwap's innovative approach addresses the limitations of existing cross-chain swap solutions and paves the way for a more secure, decentralized, and versatile cross-chain asset exchange ecosystem.
Slide: https://docs.google.com/presentation/d/1fw9OqQkL4qSi_tdxZrQ6iVeRF5npGhMJi8LnM7AclVM/edit?usp=sharing
GitHub Repository: https://github.com/Kourin1996/ethdam-2024
LiveDemo: https://ethdam-2024-ashen.vercel.app/
While existing cross-chain swaps like Stargate and Hop Protocol have reached practical use, they still face challenges such as long swap completion times and limited support for chains and tokens. Additionally, swap solutions based on the lock-mint model carry the risk of asset loss due to smart contract bugs.
MoleSwap introduces a novel swap protocol utilizing the simple concept of account exchange. Leveraging Oasis Sapphire's confidential storage, it generates and manages secret keys, revealing them only upon mutual agreement between parties. Secret keys are shared exclusively with the intended recipient.
Before initiating a swap, keys are generated within Oasis Sapphire, and only their addresses are revealed. Parties deposit the required tokens on their respective chains into the corresponding accounts. They then verify and agree upon each other's account balances. Once mutual agreement is confirmed within the smart contract, each party reveals the key to the other's account, containing assets different from what they originally sent.
At its core, MoleSwap is a key exchange protocol, eliminating the constraints on swappable chains and tokens as it operates without liquidity providers. It also enables purchasing NFTs using tokens from other chains.
Moreover, MoleSwap eliminates the need for cross-chain messaging protocols like relayers, offering the advantage of not relying on centralized off-chain servers.
I successfully implemented a smart contract for key management on Oasis Sapphire and a WebUI using Next.js, demonstrating the feasibility of cross-chain swaps.
Future plans include implementing features such as automatic token deposit notification to Oasis Sapphire via Oasis Privacy Layer and Cellar Inter-chain Messaging to enhance user experience. Additionally, the team aims to explore privacy-enhancing features that prevent the disclosure of swappable tokens and addresses to the public.