Powered by the Runes Exchange Environment (REE), RichSwap is directly compatible with Bitcoin’s UTXO-based structure. Unlike previous solutions, REE needs no changes to Bitcoin core or any other extension of Bitcoin such as nonstandard opcodes. REE’s Turing-complete compute environment offers developers the tools to replicate EVM, Solana and other common DeFi concepts on Bitcoin.
RichSwap operates as an ICP canister, essentially functioning as a smart contract on the Internet Computer Protocol (ICP). Within the Runes Exchange Environment (REE) framework, it is referred to as an Exchange. At its core, RichSwap maintains multiple pools, which correspond to the liquidity pools found in traditional AMM protocols. Each pool is associated with a single UTXO (typically, it binds a bunch of Rune assets) on the Bitcoin network. The unlocking condition for this UTXO is tied to the ICP Chain Key signature, meaning the UTXO can only be spent with the authorization of the ICP Chain Key.
User interactions with RichSwap are primarily divided into three key actions, as is typical for AMM protocols: adding liquidity, withdrawing liquidity, and swapping. These operations are facilitated through Partially Signed Bitcoin Transactions (PSBT).
Here’s how the process works:
There is no need for cross-chain transfers or bridging, ensuring a seamless and secure experience while leveraging the unique capabilities of ICP and REE. This design not only simplifies the user experience but also enhances the security and efficiency of decentralized trading on Bitcoin.