According to ChainCatcher, BiFi's new protocol UTXOSwap has released a light paper and plans to start public beta testing in late May. The UTXOSwap team won the first place in the Bitcoin Devcon hackathon and has reached a strategic cooperation with 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 transaction model, taking advantage of the UTXO programming model. It currently supports transactions 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, supporting both the automated market maker (AMM) mechanism and off-chain order book matching. In addition, by using CKB underlying technologies, 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 pay with any token, supporting 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 a decentralized exchange (DEX) protocol based on the BTC ecosystem, which 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 mainly include order books and automated market makers (AMMs). 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, intent-based trading models began to emerge, which combine 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 model, 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, no gas fee will be generated if 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 realization

On UTXOSwap, when users conduct swap transactions, there are mainly three steps:

  1. Intent Expression: Users express their trading intent by signing a message that includes the type of trading asset, amount, and other parameters.

  2. Aggregation and matching: The aggregator collects the transaction intentions of all users, searches for on-chain and off-chain liquidity resources, and matches the intentions.

  3. Transaction submission: The aggregator assembles all eligible transactions and submits them to the chain.

Sources of liquidity that aggregators can tap include:

  • Directly matching 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 consumed. 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 cells support a variety of transaction forms. In addition to standard swap transactions, they 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.

Another unique feature of Bitcoin is that it 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

The AMM cell is responsible for all verification logic related to the 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 the intention of each transaction to ensure that user needs are met. At the same time, it also checks whether the state change of the liquidity pool strictly follows the preset AMM curve to ensure the security of the entire capital pool.


Product advantages

Intent-based hybrid transaction 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 quote 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 trade-off between the two; from the perspective of market makers, passive market making in the creation of a liquidity pool will bring about impermanent losses and loss of pricing power, while active transactions will bring about uncertainties such as slippage and MEV.

In order to solve the above problems, the intent-based trading model has emerged. In this model, users no longer passively accept prices, but actively give their 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 one 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 logic similar to the Dutch auction: the price decreases 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 custom curves and fee 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. For example, a curve type curve can be used 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 off-chain calculation characteristics of UTXO, 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 the state space occupation, and the required CKB. Users can use any token to pay these costs without any feeling. UTXOSwap will automatically convert the tokens paid by users and help users pay gas fees or create new cells.

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 only belongs 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 unified.

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 simultaneously support the corresponding wallets.