How to achieve an AMM trading experience similar to Uniswap on the Bitcoin network without relying on smart contracts?
Written by: Web3 Farmer Frank
Imagine that as a BTC holder, you can initiate a transaction on the Bitcoin network to achieve a decentralized exchange of native BTC and stablecoins without needing to cross-chain to an EVM network or Bitcoin L2, and without relying on CEX. What an experience that would be!
As we know, users have previously found it difficult to directly achieve AMM trading or similar swap experiences on the Bitcoin network. They often had to first cross-chain BTC in the form of wrapped assets (such as WBTC, cbBTC, etc.) to Ethereum or other smart contract networks, and then participate in on-chain DeFi scenarios like swaps through ecosystem coupling.
Although most BTC remains idle, many OGs or Maxis are not motivated or willing to take the risk of cross-chaining it to Ethereum or other ecosystems due to the relatively sufficient security margin compared to other altcoins. This has led to a long-term slumber of most BTC, and the scale of BTCFi has remained stagnant.
From this perspective, if a decentralized trading experience similar to AMM could be satisfied on Bitcoin, it would undoubtedly revitalize the dormant BTC. TerpLayer, which has been focused on developing the Bitcoin protocol stack, has built a cross-chain interoperable and highly secure liquidity network based on the UTXO model and technologies like TPUSD and TAS, allowing for a decentralized trading experience on the Bitcoin network and completely opening up the imagination space for BTC as a DeFi niche asset globally.
TerpLayer: Bitcoin Decentralized Liquidity Protocol
According to DeFiLlama data, as of November 13, 2024, the total locked value on the Ethereum chain exceeded $60 billion, a significant increase of about 160% compared to January 2023 ($23 billion). In contrast, the Bitcoin ecosystem, which began to gain momentum alongside the Ordinal wave during the same period, has not been able to keep pace with the expansion speed of the Ethereum ecosystem, despite BTC's market cap and price growth far exceeding that of ETH.
It is important to note that even if 10% of BTC liquidity is released, it would create a market as high as $180 billion. If it could reach a TVL ratio similar to ETH (on-chain TVL/total market cap, currently about 16%), it would release approximately $300 billion in liquidity, enough to drive explosive growth in the BTCFi ecosystem, and even has the potential to surpass the broader EVM networks, becoming the largest super-chain financial ecosystem.
This gap is primarily based on the composability advantages of the Ethereum ecosystem—thanks to decentralized trading protocols like Uniswap and Curve, Ethereum can not only provide highly flexible on-chain liquidity solutions but also further derive various DeFi applications and specific scenarios based on liquidity exchanges, promoting the prosperity of its on-chain ecosystem.
In contrast, the Bitcoin network has inherent limitations that prevent it from directly achieving a DEX experience similar to AMM trading through smart contracts, resulting in BTC liquidity not being fully released to this day, and thus failing to provide the liquidity infrastructure environment for numerous DeFi projects to emerge.
Even when wrapped as cross-chain assets like WBTC, Bitcoin only serves as an asset class in DeFi scenarios on Ethereum and other networks, but the liquidity of native BTC remains unreleased (and wrapped Bitcoin often carries custody risks, as WBTC has recently drawn community attention due to controversies surrounding BitGo), thereby limiting the potential of the native Bitcoin DeFi space and causing the BTCFi ecosystem to lag behind Ethereum.
In response to this limitation, TerpLayer's new solution has emerged, which is based on the UTXO mechanism of the Bitcoin network, creating a trading experience similar to Ethereum's AMM trading without relying on smart contracts: BTC holders can directly complete native BTC-TPUSD decentralized exchange transactions within the Bitcoin network without cross-chain operations.
In the testing environment, we can actually experience TerpLayer's trading model, which features a product page similar to Uniswap and other DEXs, including three main functional modules:
- Trade: Exchange tBTC (testnet BTC, which will directly be BTC upon mainnet launch) and TPUSD;
- Pool: Add/remove liquidity of BTC and TPUSD;
- Node: Display node data;
By linking the UniSat wallet to the testnet, users can utilize tBTC and TPUSD on the Bitcoin test network to perform regular swap and pool (group LP add/remove liquidity) operations, enjoying a DeFi experience similar to that of the Ethereum ecosystem.
For example, in the "Trade" interface, we can exchange 0.01 tBTC for TPUSD: after entering the desired amount of BTC to exchange, the system automatically calculates the current TPUSD exchange rate and related transaction information (slippage, transaction fees, network fees) for user confirmation.
At the same time, by clicking on "Standard" below, users can freely choose from three different network fee standards: slow, standard (default), and fast, or set custom options.
Finally, by clicking "Swap," users can double-check the transaction information and complete the signature in their wallet to exchange for 873 TPUSD.
Additionally, the LP liquidity addition and removal on the "Pool" page are similar to those of Uniswap and other AMM DEXs, allowing users to add BTC and stablecoins to earn liquidity mining rewards.
In short, TerpLayer breaks the liquidity bottleneck of the Bitcoin network, providing an AMM trading model without smart contract support, allowing BTC holders to enjoy a liquidity experience similar to that of the Ethereum ecosystem without leaving the Bitcoin network, thus becoming the largest liquidity provider protocol in the BTC ecosystem and providing infrastructure for future on-chain innovations in BTCFi.
This will not only fully release the native liquidity of BTC while maintaining the security and decentralization advantages of the Bitcoin network but also has the potential to transform Bitcoin from a "store of value" into a decentralized financial platform, bringing unprecedented application scenarios and market opportunities to the BTCFi ecosystem.
TerpLayer: Core Technical Architecture Based on UTXO
So why can TerpLayer achieve an AMM trading experience similar to that of Ethereum and other networks on Bitcoin without relying on smart contracts?
TerpLayer primarily leverages Bitcoin's UTXO mechanism and utilizes its unique TerpLayer Atomic Swap (TAS) technology and the Runes protocol stablecoin TPUSD to achieve this effect.
TPUSD: Runes Protocol Stablecoin Pegged to USDT/USDC
First, we need to understand TPUSD, which is a Runes protocol stablecoin specifically designed for the Bitcoin network, pegged 1:1 to USDT/USDC on EVM networks, allowing users to directly cross-chain USDT/USDC from EVM to the Bitcoin ecosystem.
The entire issuance logic of TPUSD is also quite simple:
- Users deposit USDT/USDC from the EVM network into a designated smart contract, which manages and issues TPUSD in ERC20 form at a 1:1 ratio;
- The ERC20 TPUSD is then cross-chained to generate Runes TPUSD on the Bitcoin network through the Terp Runes Adapter;
The destruction process is the reverse: users transfer Runes TPUSD to the project's multi-signature treasury, where Runes Indexers synchronize the token information, and upon confirmation, TPUSD is destroyed at a 1:1 ratio through the Terp Runes Adapter, releasing an equivalent amount of ERC20 USDT/USDC.
It is worth mentioning that the Runes Indexers service launched by TerpLayer provides efficient and convenient Runes asset indexing support for Bitcoin developers, enabling them to quickly access and manage Rune asset data, significantly improving development efficiency and further strengthening TerpLayer's technical strength and influence in the field of decentralized applications on Bitcoin.
Constructing a Swap Transaction from a Transfer Based on the UTXO Model
As we know, compared to Ethereum, the Bitcoin network based on the UTXO model does not have the concept of "accounts," which is its unique "chain nature": UTXO, as an "unspent transaction output," records the output state of each transaction, meaning that the Bitcoin balance at any address is composed of a set of UTXOs, and it also allows multiple users to transact assets within a single transaction.
Therefore, although Bitcoin lacks a smart contract system like Ethereum, the UTXO model gives it a natural parallel advantage in fund programming (especially in PayFi scenarios like payments and transactions)—when a user initiates a transaction, it consumes one or more UTXOs and generates new UTXOs as outputs, which are used in subsequent transactions.
This "input-output" model allows for a highly parallelized Bitcoin transaction process. At the same time, since TPUSD is a Runes protocol asset, its issuance and transfer rely on the native transaction mechanism of the Bitcoin network, binding it to every actual transaction on the Bitcoin network.
This also means that when users issue and transfer TPUSD, they are actually synchronously conducting a UTXO transfer, and both the input and output parties can simultaneously cover both buyers and sellers. Therefore, each generation and transfer of TPUSD can be constructed as a BTC-TPUSD exchange transaction:
When a user initiates a BTC transfer on the Bitcoin network, the system automatically generates/transfers the corresponding amount of TPUSD through specific contract logic and uses it as the consideration for the transaction (i.e., the asset used for exchange), thus completing a BTC-TPUSD transaction.
Taking an actual BTC-TPUSD buy-sell transaction recorded on the Bitcoin network as an example, we can clearly break down how a UTXO transfer completes the asset exchange between BTC and TPUSD—the address in the red box is the "BTC seller," and the two yellow box addresses are the corresponding "TPUSD sellers" (i.e., liquidity providers).
In this UTXO transfer, there are three inputs:
- First input: from the "BTC seller," amounting to 0.06796785 BTC;
- Second input: from "TPUSD seller A," amounting to 100 TPUSD;
- Third input: from "TPUSD seller B," amounting to 100 TPUSD;
At the same time, this UTXO transfer has four outputs:
- First output: sent to the "BTC seller," amounting to 200 TPUSD, as the consideration for the BTC-TPUSD exchange;
- Second output: sent to "TPUSD seller A," amounting to 0.00155 BTC, as a reward for providing liquidity;
- Third output: sent to "TPUSD seller B," amounting to 0.001388 BTC, as a reward for providing liquidity;
- Fourth output: returned to the "BTC seller," amounting to 0.06503025 BTC, as a partial refund of the original BTC;
Through this dual transfer operation (including the input and output of both BTC and TPUSD), both parties can complete the swap exchange of BTC and TPUSD in a single transaction—the BTC seller receives 200 TPUSD, while TPUSD sellers A and B receive corresponding BTC rewards, and the excess BTC is returned to the BTC seller as change.
Interestingly, this also utilizes the characteristics of UTXO to achieve a "binary circuit" style transaction confirmation logic: each transaction goes on-chain when conditions are met; if conditions are not met, it does not go on-chain, ensuring that the execution of the transaction is either completely successful (on-chain) or completely failed (not on-chain), avoiding uncertainties and cost losses caused by the execution of buy and sell orders.
Atomic Swap (TAS) + Berachain-based AMM and Oracle Architecture
However, the execution of BTC-TPUSD transactions on the Bitcoin network is actually just the last step of the swap process, meaning the Bitcoin network only serves as the settlement layer.
Imagine if you initiated an on-chain swap, what key steps must be experienced throughout the entire lifecycle from transaction creation to final confirmation?
First, it naturally involves price feeds from oracles, such as ChainLink, to provide fair and reliable exchange rates; then liquidity is needed, such as DEX pools with sufficient depth to ensure low slippage for completing exchanges. In short, every on-chain transaction requires support from price data and liquidity depth.
In TerpLayer's design mechanism, Berachain is used as the liquidity center and price discovery center, achieving efficient and decentralized transaction settlement through cross-chain information transmission and atomic-level exchanges:
TerpLayer encapsulates Bitcoin transactions involving adding/removing liquidity and swaps into a Bitcoin layer message, and then uses TerpLayer Atomic Swap (TAS) technology to cross-chain call and execute these transaction requests with smart contracts on Berachain, thus achieving cross-chain atomic swaps.
This means that the liquidity funds of LPs (BTC and TPUSD) and the funds exchanged by traders do not need to leave the Bitcoin network, but Berachain has a dynamically adjusted "virtual pool" with a 1:1 mapping, providing real-time liquidity and exchange rate data through cross-chain information transmission (liquidity pools, ChainLink, and Pyth price feeds each account for 30%, while Curve's price feed accounts for 10%, weighted for calculation).
Whenever a user initiates a transaction on the Bitcoin network, the system will complete the final BTC-TPUSD transfer transaction on the Bitcoin network using TAS technology based on real-time exchange rates and liquidity conditions on Berachain.
This design is somewhat similar to how the Bitcoin Lightning Network operates—where the Lightning Network processes micropayments through offline channels and only records the settlement results of transactions on-chain. Similarly, TerpLayer also views the Bitcoin network as a settlement layer, utilizing the exchange rate and liquidity references provided by Berachain, executing actual UTXO transactions on the Bitcoin chain only when necessary through the TAS mechanism.
This also involves key roles such as node operators, LPs, and trading users:
- Node Operators: Convert transaction/liquidity requests on the Bitcoin network into Bitcoin layer messages and connect them to smart contract calls on Berachain through TAS, ensuring the correct transmission of cross-chain information. In the future, node operators will need to stake TerpLayer tokens to ensure economic security and can earn certain fees or rewards by executing cross-chain transactions and maintaining network stability (currently temporarily operated by the official team);
- Liquidity Providers (LP): Similar to LPs in traditional DEXs, they lock BTC and TPUSD on the Bitcoin network as liquidity funds and can earn profits from transaction fees in the liquidity pool. Additionally, after the LP's funds are transferred to the exchange node, Cobo manages the private keys and requires over-collateralization of TerpLayer tokens as a risk control measure to ensure the security and risk resistance of the liquidity pool;
- Trading Users: Conduct decentralized trading between BTC and TPUSD without worrying about the additional risks brought by cross-chain operations;
On this basis, the funds of both trading parties can remain highly secure within the Bitcoin network, while leveraging Berachain to provide liquidity and price discovery functions, enabling the entire system to have efficient cross-chain interoperability.
Starting from BTC-TPUSD, Beyond the Bitcoin Ecosystem
Although the market share of DEXs in the Ethereum ecosystem has dropped to $20.8 billion, significantly lagging behind the $40 billion scale of lending protocols, it is undeniable that decentralized liquidity protocols have significantly improved the capital efficiency of on-chain assets, providing the foundational liquidity support for applications including lending and derivatives.
Through the decentralized trading solution of BTC-TPUSD, TerpLayer also provides a foundational framework for the Bitcoin network that can efficiently utilize assets and activate dormant BTC, allowing more BTC holders to safely participate in on-chain liquidity activities and confidently place large amounts of dormant BTC into DeFi liquidity pools for exchange or earning yields.
Moreover, TerpLayer is not just a BTC-TPUSD exchange tool; its cross-chain liquidity architecture can effectively connect stablecoin assets (such as USDT, USDC) in EVM networks with BTC assets on the Bitcoin network, greatly expanding the DeFi application scenarios for BTC and opening up a larger imaginative space that other multi-chain DEXs cannot reach:
In addition to BTC holders, all users on EVM-compatible networks can directly exchange their stablecoins (in ERC20 form) for native BTC with lower operational thresholds and higher security.
The specific implementation logic relies on the cross-chain issuance/destroying mechanism of TPUSD, which ensures a deep liquidity connection between Bitcoin and EVM networks from ERC20 TPUSD to Runes token TPUSD. Additionally, since the construction and adjustment of the BTC-TPUSD liquidity pool are mapped on Berachain, it means that Berachain can serve as the liquidity center.
For example, liquidity pools for ERC20 TPUSD and other stablecoins (USDT/USDC) can be directly established on Berachain, allowing users to exchange stablecoins (USDT/USDC) scattered across various EVM chains into ERC20 TPUSD via Berachain, and then cross-chain generate Runes token TPUSD on the Bitcoin network through the Terp Runes Adapter, ultimately achieving seamless exchange with native BTC through TerpLayer.
Thus, TerpLayer not only activates the native liquidity of Bitcoin but also maximizes the liquidity depth of BTC and TPUSD, endowing Bitcoin with the potential to serve as a "decentralized financial settlement layer," meeting the exchange needs of all EVM-compatible networks regarding Bitcoin/stablecoin, further achieving seamless exchange with native BTC through TerpLayer.
For instance, if DeFi protocols on other chains (such as lending protocols) include BTC-TPUSD in their asset pools or collateral, they can remotely call liquidity from the Bitcoin network during liquidation processes without needing to establish liquidity pools on their local chains. This design not only improves the capital efficiency of the Bitcoin network but also broadens the application scenarios of BTC as a cross-chain financial tool.
In simple terms, this essentially means using the Bitcoin network as the settlement layer for cross-chain stablecoins and native BTC, with Berachain serving as the cross-chain liquidity center, while TerpLayer becomes the main protocol for unified management and execution of BTC and cross-chain stablecoin exchanges, capable of managing stablecoin/native BTC exchange operations across multiple chains.
From this perspective, TerpLayer's "unified liquidity" architecture brings a unique competitive advantage to the Bitcoin network, providing end users with secure and convenient cross-chain Bitcoin exchange services, making TerpLayer and the growth of the Bitcoin ecosystem mutually reinforcing, sharing the benefits brought by the expansion of the BTC and TPUSD ecosystems.
Summary
It is foreseeable that as Bitcoin assets gradually awaken from dormancy, native BTC is likely to become a new DeFi asset class with a scale reaching hundreds of billions of dollars, becoming a key lever for building a prosperous on-chain ecosystem.
TerpLayer, by introducing secure and convenient decentralized trading services into BTC, the highest quality and most in-demand asset class, will not only unleash the ecological potential of the Bitcoin network but may also become the core bridge for BTCFi and the entire DeFi ecosystem:
Building diverse financial product forms and DeFi scenarios centered around BTC, redefining the role of BTC in the entire DeFi field.
The human demand for quality assets is eternal. From this perspective, TerpLayer's decentralized Bitcoin trading solution opens a new engine for the long-term development of Bitcoin. Whether BTC can achieve a critical turning point in its deep integration into the DeFi field is worth looking forward to.
免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。