Interpreting the UTXOSwap light paper: How to define the new paradigm of Bitcoin DeFi?

CN
PANews
Follow
1 year ago

ChainCatcher News: BiFi's new protocol UTXOSwap has released a light paper and plans to start public testing at the end of May. The UTXOSwap team won first place in the CKB ecosystem at the Bitcoin Devcon hackathon competition and has now reached a strategic cooperation with CKB Eco Fund.

UTXOSwap is a decentralized exchange (DEX) protocol based on CKB, aiming to define a new paradigm for Bitcoin Finance transactions. UTXOSwap adopts an intent-based trading model, leveraging the advantages of the UTXO programming model. It currently supports the trading of RGB++ and CKB ecosystem assets, and plans to expand in the future to include other BTC ecosystem assets such as Ordinals and Runes.

UTXOSwap has implemented an intent-based hybrid trading model, supporting both automated market maker (AMM) mechanism and off-chain order book matching. Additionally, leveraging CKB's underlying technologies such as cryptographic primitives and chain-level design, UTXOSwap offers nearly zero gas swap transactions, accepts payment in any token, supports user-customized AMM curves and fee rates, and is compatible with dApps native multi-chain wallets and L1/L2 seamless operations.

The following content is from the "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, aiming to provide users with a better trading experience and improved execution prices through intent-based trading. Currently, UTXOSwap supports the trading of RGB++ and CKB ecosystem assets, with plans to expand support to other BTC ecosystem assets such as Runes in the future.

Common DEX models include order book and automated market maker (AMM). Order book DEX is limited by high on-chain transaction costs and has not achieved the same success as centralized exchanges, while AMM has gained wider acceptance due to its simple and direct trading concept. However, with the surge in on-chain transaction volume and liquidity, issues with AMM have become apparent, such as low efficiency, gas fee competition, and MEV. As a result, intent-based trading models, which integrate the advantages of order book and AMM, have emerged to maximize the experience and benefits for users and market makers. UTXOSwap adopts an intent-based model as its core, leveraging the advantages 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, allowing access to liquidity providers beyond AMM during the matching phase; in terms of performance, the parallel nature of UTXO can significantly improve transaction efficiency; in terms of gas fees, no gas fees are incurred for unmatched intents, and the gas fees for normal transactions are low enough to be negligible. If certain trading pairs become too popular, a local fee model can isolate their impact on other trading pairs.

UTXOSwap is a crucial infrastructure in the BTC ecosystem, effectively addressing the current issues of poor liquidity and high transaction costs, reducing the cost of asset issuance and trading, and providing new possibilities. UTXOSwap will explore the unique characteristics of Bitcoin Finance based on the UTXO model, aiming to become a liquidity infrastructure for the Bitcoin ecosystem and promote its prosperity.

Technical Implementation

Interpreting the UTXOSwap Light Paper: How to Define a New Paradigm for Bitcoin DeFi?

On UTXOSwap, when users engage in swap transactions, the process mainly involves the following three steps:

  1. Intent Expression: Users express their trading intent by signing a message containing transaction asset types, amounts, and other parameters.
  2. Aggregation and Matching: The aggregator collects all user trading intents, searches for on-chain and off-chain liquidity resources, and matches intents.
  3. Transaction Submission: The aggregator assembles all eligible transactions and submits them to the chain.

The liquidity sources that the aggregator can utilize include:

  • Directly matched user intents
  • AMM cells (various AMM liquidity pools built on the CKB chain)
  • Liquidity provided by third-party market makers

Intent Cell

The intent cell is used to record user trading intents and ensure that they meet specific conditions when consumed. For AMM operations, intents can be categorized into three types: Swap, AddLiquidity, and RemoveLiquidity.

When using UTXOSwap, users need to initiate a CKB transaction and detail their trading intent in the intent cell. For example, when users set slippage and select a specific liquidity pool for trading, these parameters will be written into the intent cell. When the intent cell is unlocked, the script will verify whether the assets returned to the user in the output meet the slippage requirements and check for the presence of the specified liquidity pool cell.

Interpreting the UTXOSwap Light Paper: How to Define a New Paradigm for Bitcoin DeFi?

The intent cell supports various transaction forms, including standard swap transactions, limit orders, and time-weighted average price (TWAP) transactions. This allows the UTXOSwap platform to meet users' complex trading needs and enhance strategy flexibility. By precisely setting parameters in the intent cell, users can control the conditions and timing of transaction execution, optimizing trading efficiency and outcomes.

Bitcoin also has a unique feature of supporting PSBT (partially signed Bitcoin transactions), which allows multiple parties to participate in constructing the same transaction through partial signatures. In CKB, the corresponding PSBT extension feature is Open Transaction. After integrating Open Transaction into UTXOSwap, users can directly construct transaction intents through off-chain signatures, while others can fulfill these intents by supplementing inputs and outputs, providing a better trading experience.

AMM Cell

The AMM cell is responsible for all validation logic related to AMM, including validating transaction intents, managing assets in liquidity pools, and generating and destroying liquidity certificates.

During transaction execution, the AMM cell verifies each transaction intent to ensure that user demands are met. It also checks whether the state changes in the liquidity pool strictly adhere to the preset AMM curve to ensure the overall security of the liquidity pool.

Product Advantages

Intent-based Hybrid Trading Model

In the traditional AMM trading model, each transaction involves only two roles: users and liquidity pools. Users can only accept the current liquidity pool's quote for trading. From the user's perspective, although this model enhances trading convenience, it sacrifices the possibility of obtaining better execution prices, forcing users to make trade-offs. From the market maker's perspective, passive market making in creating liquidity pools leads to impermanent loss and loss of pricing ability, while active trading introduces uncertainties such as slippage and MEV.

To address the above issues, the intent-based trading model has emerged. In this model, users no longer passively accept prices but actively express their trading intent, such as "exchange 10 A Tokens for at least 20 B Tokens." The liquidity supply side has also changed, with AMM liquidity pools being just one option for liquidity supply. If profitable, market makers can directly execute trades based on user intent. Even without market maker matching, if the price of the AMM liquidity pool aligns with the user's intent range, the transaction can be completed smoothly, turning the transaction process into a limit order mode.

UTXOSwap leverages the on-chain verification feature of the UTXO programming model to achieve off-chain matching and on-chain execution, effectively implementing the intent-based hybrid trading model mentioned above. In the future, we will further expand the user's ability to express intent, such as implementing logic similar to a Dutch auction: the price decreases within a certain range over time, and market makers compete based on their costs, ultimately allowing AMM to ensure a minimum execution.

Support for Custom Curves and Fee Rates

In UTXOSwap's AMM model, creators of trading pairs can customize pricing curves based on the characteristics of the assets. For example, curve-type curves can be used for stablecoin trading pairs. Additionally, the trading pool offers optional fee rates, allowing different LPs to maximize their earnings.

Ultra-Low Gas Fees, Acceptance of Any Token for Payment

The gas fee cost for a single UTXOSwap transaction is approximately 1/10000 CKB, which, based on the current price of CKB, is less than 0.000002 (two millionths) USD, almost negligible. Furthermore, due to the characteristics of off-chain UTXO calculations, the feasibility of a user's trading intent can be verified off-chain, and if it cannot be executed, it will not be recorded on-chain, and the user will not need to pay a fee.

Moreover, thanks to UTXOSwap's design, users do not need to be aware of the required CKB for gas fees or state space usage. Users can use any token to seamlessly pay these costs, and UTXOSwap will automatically convert the token and assist with gas fee payment or the creation of new cells.

Compatibility with Multi-Chain Wallets, Seamless L1/L2 Operations

UTXOSwap users do not need to download and use a dedicated CKB wallet but can directly use familiar BTC wallets to complete L1/L2 leaps, L2 transactions, transfers, and other operations. In terms of user experience, a BTC address corresponds to a fixed CKB address, and the control of the CKB address belongs solely to the BTC address. This correspondence is at the chain level, so in other multi-chain compatible CKB applications, the same BTC address corresponds to a unified CKB address.

In addition to BTC, it is technically possible to support mainstream public chain wallets such as ETH, Solana, and Tron. If there are corresponding asset collaboration scenarios in the future, such as cross-chain transactions between CKB and Solana, we will also synchronize support for the corresponding wallets.

免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。

Share To
APP

X

Telegram

Facebook

Reddit

CopyLink