Source: CKB Chinese UTXOSwap implements an intention-based hybrid trading model, supporting both the automated market maker (AMM) mechanism and off-chain order book matching. According to ChainCatcher, BiFi's new protocol UTXOSwap has released a light paper and plans to start public testing in late May. The UTXOSwap team won the first place in the CKB ecosystem in the Bitcoin Devcon hackathon competition and has now reached a strategic cooperation with the CKB Eco Fund.
It is reported that UTXOSwap is a decentralized exchange (DEX) protocol based on CKB, which aims to define a new paradigm for Bitcoin Finance transactions. UTXOSwap adopts an intent-centric trading model, taking advantage of the UTXO programming model. Currently supports the trading of RGB++ and CKB ecological assets, and plans to expand to other BTC ecological assets including Ordinals and Runes in the future.
UTXOSwap implements an intent-based hybrid trading model, while supporting the automatic market maker (AMM) mechanism and off-chain order book matching. In addition, by utilizing CKB's underlying technology, such as chain-level designs such as cryptographic source language, UTXOSwap has the advantages of almost 0 Gas for Swap transactions and the ability to use any token for payment, support for user-defined AMM curves and handling fee rates, and dApp native compatibility with multi-chain wallets and L1/L2 seamless operations.
The following content comes from "UTXOSwap Light Paper", original link:
https://utxoswap.gitbook.io/zh
UTXOSwap Light Paper: Defining a New Paradigm for Bitcoin Finance Transactions
UTXOSwap Overview
UTXOSwap is based on BTC The decentralized exchange (DEX) protocol of the ecosystem aims to provide users with a better trading experience and better transaction prices through intent-based transactions. Currently, UTXOSwap will support the trading of assets in the RGB++ and CKB ecosystems, and will expand support for other BTC ecosystem assets such as Runes in the future.
Currently, common DEXs are mainly in the form of order books and automated market makers (AMMs). Among them, order book DEXs are limited by the high cost of on-chain transactions and have not achieved the same success as centralized exchanges. AMMs have gained wider recognition with their simple and direct trading concepts. However, with the explosion of on-chain transaction volume and liquidity, problems with AMMs have gradually emerged, such as inefficiency, gas fee competition, and rampant MEV. As a result, the intent-based trading model began to emerge, which combines the advantages of order books and AMMs to maximize the experience and benefits of users and market makers. UTXOSwap uses the intent-based model as its core and takes advantage of UTXO programming to design a new DEX.
Thanks to the characteristics of UTXO, UTXOSwap has many innovations and advantages: in terms of trading mode, UTXOSwap can achieve off-chain matching and on-chain verification, so that liquidity providers outside AMM can be connected during the matching stage; in terms of performance, the parallel characteristics of UTXO can also increase transaction efficiency exponentially; in terms of gas fee, there is no intention to trade, and the gas for normal transactions is so low that it can be ignored. If some trading pairs are too popular, the local fee model can be used to isolate their impact on other trading pairs.
UTXOSwap is a very important infrastructure for the BTC ecosystem. It can effectively solve the current problems of poor liquidity and high transaction costs of BTC ecosystem assets, reduce the cost of asset issuance and transactions, and provide more new ways to play. UTXOSwap will explore the unique characteristics of Bitcoin Finance based on the UTXO model, and is committed to becoming the liquidity infrastructure of the Bitcoin ecosystem and promoting the prosperity of the Bitcoin ecosystem.
Technical Implementation
On UTXOSwap, when users conduct swap transactions, they mainly include the following three steps:
Intent Expression: Users express their trading intentions by signing a message containing the transaction asset type, amount, and other parameters.
Aggregation and matching: The aggregator collects all users' transaction intentions, searches for liquidity resources on and off the chain, and matches the intentions.
Transaction submission: The aggregator assembles all eligible transactions and submits them to the chain.
The sources of liquidity that aggregators can use include:
Directly matched user intent
AMM cells (various AMM liquidity pools built on the CKB chain)
Liquidity provided by third-party market makers
Intent Cell
Intent cells are used to record the user's transaction intentions and ensure that they meet specific conditions when consuming. For AMM operations, intents can be divided into three types: Swap, AddLiquidity, and RemoveLiquidity.
When using UTXOSwap, users first need to initiate a CKB transaction and record their transaction intentions in detail in the intent cell. For example, when a user sets slippage and selects a specific funding pool for trading, these parameters will be written to the intent cell. When the intent cell is unlocked, the script verifies whether the assets returned to the user in the output meet the slippage requirements and checks whether the specified funding pool cell is included.
Intent cell supports multiple transaction forms. In addition to standard swap transactions, it will also support limit order and twap (time-weighted average price) transactions. This enables the UTXOSwap platform to meet users' complex transaction needs and enhance strategy flexibility. Users can precisely control the conditions and timing of transaction execution and optimize transaction efficiency and results by setting the parameters in the intent cell in detail.
Bitcoin also has a unique feature that supports PSBT (partially signed Bitcoin transactions), which allows multiple parties to participate in the construction of the same transaction through partial signatures. In CKB, the corresponding PSBT extension function is Open Transaction. After UTXOSwap integrates Open Transaction, users can directly construct transaction intentions through off-chain signatures, and others can satisfy these intentions by supplementing inputs and outputs, which can provide a better trading experience.
AMM Cell
AMM cell is responsible for all verification logic related to AMM, including verification of intended transactions, management of assets in the liquidity pool, and generation and destruction of liquidity certificates.
During the transaction execution process, the AMM cell verifies each transaction intention to ensure that user needs are met. At the same time, it also checks whether the state changes of the liquidity pool are strictly in accordance with the preset AMM curve to ensure the security of the entire capital pool.
Product Advantages
Intent-based Hybrid Trading Model
In the traditional AMM trading model, only two trading roles, the user and the liquidity pool, participate in each transaction. If the user wants to trade, he can only accept the quotation of the current liquidity pool. From the user's perspective, although this model improves the convenience of trading, it loses the possibility of obtaining a better transaction price. Users can only make a choice between the two; from the perspective of market makers, creating a liquidity pool for passive market making will bring impermanent loss and loss of pricing power, while active transactions will have uncertainties brought by slippage, MEV, etc.
In order to solve the above problems, an intent-based trading model has emerged. In this model, users no longer passively accept prices, but actively give their own trading intentions, such as "exchange 10 A Tokens for at least 20 B Tokens". The liquidity supply side has also changed. The AMM liquidity pool is only an option for liquidity supply. If it is profitable, the market maker can directly trade according to the user's intention; even if there is no market maker matching, if the price of the AMM liquidity pool meets the user's intention range, the transaction can be completed smoothly, and the transaction process at this time becomes a limit order mode.
UTXOSwap uses the characteristics of on-chain verification in the UTXO programming model to achieve off-chain matching and on-chain transactions, and well implements the above-mentioned intention-based hybrid trading model. In the future, we will also expand the ability of users to express their intentions, such as implementing a logic similar to the Dutch auction: the price drops over time within a certain range, and in this process, market makers compete with each other based on their own costs, and finally the AMM can make a guaranteed transaction.
Support for custom curves and handling rates
In the AMM model of UTXOSwap, the creator of the trading pair can customize the pricing curve according to the characteristics of the asset, such as a curve type curve for stablecoin trading pairs. In addition, the trading pool has some optional handling fee rates, which allow different LPs to choose freely and maximize their profits.
Ultra-low Gas Fee, payable with any token
The gas fee cost of a single UTXOSwap transaction is about 1/10000 CKB, which is less than 0.000002 (two millionths) of a dollar at the current CKB price, which is almost negligible. In addition, thanks to the characteristics of UTXO off-chain calculation, the user's transaction intention can be verified off-chain. If the transaction cannot be completed, it will not be put on the chain, and the user does not need to pay the handling fee.
On the other hand, thanks to the design of UTXOSwap, users do not need to be aware of the gas fee or state space occupation, and the required CKB. Users can use any token to pay these costs without feeling. UTXOSwap will automatically convert the token paid by the user and help the user pay the gas fee or create a new cell.
Compatible with multi-chain wallets, L1/L2 seamless operation
UTXOSwap users do not need to download and use a dedicated CKB wallet, but can directly use the familiar BTC wallet to complete L1/L2 Leap, L2 transactions and transfers. In terms of experience, the user's BTC address will correspond to a fixed CKB address, and the control of the CKB address belongs only to this BTC address. This correspondence is at the chain level, so in other CKB applications that are compatible with multi-chain wallets, the CKB address corresponding to the same BTC address can also remain consistent.
In addition to BTC, technically it can also support direct use of multiple mainstream public chain wallets such as ETH/Solana/Tron. If there are corresponding asset collaboration scenarios in the future, such as cross-chain from CKB to Solana, we will also support the corresponding wallets simultaneously.