A comprehensive explanation of the native cross-chain exchange protocol Chainflip

CN
PANews
Follow
1 year ago

E2M Researcher: Shawn (January 2024)

Currently, with the popularity of various Bitcoin script protocols, more and more users are starting to use Bitcoin on-chain wallets for transactions. As Bitcoin itself does not support smart contracts, it is not possible to exchange tokens like on Ethereum using smart contracts. This has created a demand for native Bitcoin cross-chain exchanges, such as exchanges between native BTC and ETH. The advantage of this exchange method is that users can complete transactions directly between their own wallets without transferring assets to an exchange. Although this market is still in its early stages, it is expected to experience significant growth in the coming years as technology advances and more people adopt it.

Currently, the main projects focusing on native cross-chain exchanges are Thorchain, Maya Protocol, and Chainflip. Maya Protocol is a forked version of Thorchain, both of which are built on the Cosmos SDK application chain. Chainflip, on the other hand, is built on the Substrate framework of Polkadot, and this article mainly introduces the Chainflip protocol.

Introduction

Chainflip is a native cross-chain exchange protocol that aims to create a method for exchanging digital assets without centralized exchanges. By using Chainflip, users can directly exchange assets on their respective blockchain networks without the need for intermediaries or trusted third parties. This method enhances transaction security and efficiency while reducing transaction costs.

The core idea of Chainflip is to use MPC (multi-party computation), especially TSS (threshold signature scheme), to create an aggregate key held by a permissionless network of 150 validators.

These validators simultaneously control smart contracts/wallets on multiple blockchains (referred to as Vaults), forming a fully decentralized "settlement layer." It is paired with an "accounting layer" that uses a Substrate-based application chain (referred to as the Chainflip state chain) to track balances, process events, and execute instructions. These systems produce a fully decentralized universal cross-chain exchange protocol.

Its structure is illustrated in the following diagram:

A comprehensive explanation of the native cross-chain exchange protocol Chainflip

Source: https://docs.chainflip.io/concepts/system-overview

Advantages of native cross-chain value conversion include:

  • Value conversion is independent of chains and wallets. Chainflip supports users to perform value conversions on any chain using regular wallets.

  • Value conversion does not involve any wrapped assets, synthetic assets, or other assets. Users only need to submit a regular transaction to perform the exchange, and after the exchange, users will not face any other asset risks.

  • Chainflip does not require additional deployment or execution of other protocols on specific chains, providing higher compatibility and universality, and minimizing the computational process off-chain to reduce user gas consumption.

Features

Decentralization

A notable feature of Chainflip is its decentralized nature, primarily reflected in the design of its validation nodes. The Chainflip protocol consists of 150 validators who collectively control and protect critical information within the protocol. In a decentralized design, this number of nodes significantly enhances system security and reduces the risk of single point of failure. Its main features include:

  • Up to 150 validators can simultaneously participate in the protocol's permission set. They collectively operate almost all functions of the protocol and jointly control all funds in the system.

  • All validator slots are completely permissionless, and any validator operator with sufficient $FLIP can become a member of the permission set after winning an auction with a higher bid than others.

  • Each individual validator has its own set of private keys for participating in the consensus of the state chain and generating secrets for TSS key generation and signing.

  • Each validator simultaneously monitors all supported external chains for witnessing, which is functionally equivalent to the network being its own decentralized inbound oracle.

  • In collaboration with other validators and external blockchains using the TSS protocol, validators also broadcast transactions to send funds outside the protocol. Similarly, the network acts as its own decentralized relayer.

JIT (Just In Time Liquidity) AMM

Uniswap v3 introduced the concept of range orders to the AMM world, bringing many improvements in capital efficiency and user experience. As a cross-chain product, Chainflip does not have the same execution environment assumptions as typical AMMs, requiring additional functionality to prevent front-running from negatively impacting users. Unlike in a single-chain environment, Chainflip must address the following issues:

  • Due to the risk of chain reorganization outside of Chainflip, the protocol must wait for several blocks to confirm external chain deposits. As a decentralized and programmatic system, if this occurs, transactions cannot be manually reordered, requiring multiple block confirmations to operate safely. Given the delay in confirming incoming Swap deposits and their location on public chains, all market participants will know the trades to be executed before the Swap occurs, making the protocol susceptible to various forms of front-running.

  • Additionally, confirmation times also lead to significant delays in pricing and arbitrage, resulting in long-term price discrepancies compared to market index prices.

  • Finally, new features proposed by AMMs have largely gone untested, as existing AMM designs were not built with custom execution environments in mind, leaving few protocol examples with similar attributes for study.

As a result, Chainflip has proposed the JIT AMM protocol, with two core functions:

  1. Faster range order updates than Swap transactions - range orders can be updated before known Swaps are executed, allowing market makers to actively respond to incoming trade flows.

  2. Swap batching - Swaps are grouped together and executed regularly, eliminating significant slippage and making front-running unprofitable.

Its main working principle is as follows:

Each liquidity pool has a fixed liquidity fee (most pools range from 5 to 30 basis points), and market makers obtain these liquidity fees by adjusting their liquidity positions to market prices. Market prices are determined by the immediate liquidity availability on independent primary and secondary markets (including centralized exchanges, derivative markets, and any other liquidity sources) before the swap is executed. By opening hedge positions or obtaining existing liquidity in other markets, market makers can fully obtain liquidity fees if they bear more price risk than all other liquidity providers. After executing a Swap, market makers can update their range orders again to rebalance their positions for the next batch of Swaps.

As long as a few market makers compete with each other for Delta, this protocol design ensures that users executing Swaps always receive market pricing or better than market pricing at execution, with reliable fees and minimal slippage. Depending on the level of competition among market makers, capital efficiency in this protocol should surpass all other existing AMM designs.

A typical example is as follows:

Suppose a user exchanges USDC (ERC20) for DOT (Native), and market makers A, B, and C compete to win liquidity fees from the trade. The pool has a 25 basis point liquidity fee.

  1. The user (DOT buyer) generates a quote and creates a unique deposit address associated with their target address. The user initiates the exchange by depositing 10,000 USDC into their quote address.

  2. The Ethereum blockchain includes the USDC deposit in the next block. Market makers observe that the deposit has occurred and track other upcoming USDC deposits. There are also DOT sellers making deposits on the Polkadot chain. Although it takes multiple Ethereum and Polkadot blocks to identify transactions on the Chainflip state chain, market makers can simultaneously monitor the Polkadot and Ethereum chains to calculate the overall direction of the next batch of Chainflip transactions before execution.

  3. Chainflip requires 6 Ethereum blocks to consider deposit transactions as "final." It also processes exchanges in batches of 6 Ethereum blocks (or approximately 18 Polkadot blocks), resulting in a delay of at least 6 blocks on the Ethereum blockchain between exchange deposits and exchanges executed on Chainflip. This means market makers have approximately 90 seconds to precisely know what the Swap is, obtain liquidity, calculate risks in other markets, and adjust their range orders through state chain transactions.

  4. In this scenario, users are waiting for 6 to 12 Ethereum blocks to execute the batch. In this example, the batch consists of 10 transactions with a total volume of $280,000, but only $90,000 worth of DOT is being purchased in this volume. Therefore, to ensure that everyone's transactions in the batch are completed, a total of approximately $170,000 worth of DOT needs to be sold in the batch. To charge up to 25 basis points on the total transaction volume of $280,000 (approximately $700), market makers now need to provide the best possible price for $170,000 worth of DOT within a 6-block delay window. This is where the name "Just In Time (JIT)" comes from, as they need to obtain liquidity sources and push some "just in time" liquidity purchases to win.

  5. Market makers can use risk model calculations to determine the best trading price by having additional capital float in other CEX. Based on the calculations, they update range orders and move the USDC in the USDC-DOT pool to that price. For example, market maker A moves its USDC range order to concentrate $170,000 of USDC liquidity at $23.45 per DOT, while market maker B moves its $170,000 of USDC to concentrate at $23.47 per DOT.

  6. The Chainflip network executes the batch. Even users who are buying will not suffer unnecessary slippage, as market makers obtain liquidity from external sources to naturally align the pool price with the market index price. Market maker B receives 100% of the liquidity fee, assuming their quote is ahead of all other market makers. Market makers who did not execute trades will not be charged any fees, nor will there be any impermanent loss.

  7. Market maker B knows they have won the liquidity fee and just purchased a certain amount of DOT, so they continue to sell $170,000 worth of DOT at $23.47 per DOT or higher in other markets. If managed properly, market makers can earn $700 or more in profit in a batch of trades, with only 6 seconds of price risk. These opportunities arise with each batch execution, occurring every few minutes for each pool.

  8. The Chainflip validator network now sends the funds to the user, who will receive native DOT at a reasonable exchange rate.

  9. Market maker B may now withdraw or deposit their LP position to rebalance their portfolio and prepare for future batch opportunities, while market makers A and C prepare to seize batch opportunities in the near future.

Advantages and Disadvantages of JIT AMM:

Batch processing renders front-runners meaningless, as all traders in the batch receive the same price. However, this also brings the issue that the protocol cannot allow users to determine the final outcome of their exchange in advance.

Capital efficiency will be higher than in general AMM protocols, but for large amounts of single exchanges that exceed or deplete the available liquidity in the pool, market makers may collude instead of compete. One solution is to split large single trades into multiple smaller trades, similar to ThorChain's continuous swap.

Data

The Chainflip mainnet went live on November 16, 2023. It currently only supports exchanges between ETH, USDC, FLIP tokens on Ethereum, and native BTC, native DOT tokens. It will gradually support access to more chains in the future.

Due to the short time since the mainnet launch and low liquidity, the limit for a single exchange is currently around 10,000U. As shown in the following figure, a quote to exchange 4 ETH for BTC yields approximately 0.2366 BTC. At the same time, the exchange ratio for ETH/BTC on Binance is 0.05935, yielding approximately 0.2374 BTC. The prices are very close, and

A comprehensive explanation of the native cross-chain exchange protocol Chainflip

Source: https://swap.chainflip.io/

In comparison, at the same time, Thorswap's price may be even more favorable.

A comprehensive explanation of the native cross-chain exchange protocol Chainflip

Source: https://app.thorswap.finance/

The protocol's TVL and trading volume are both low, with deployed liquidity of approximately $239,000, with the largest liquidity in the BTC/USDC pool at around $100,000. The 7-day trading volume is approximately $300,000, capturing a total of $362 in trading fees over 7 days.

A comprehensive explanation of the native cross-chain exchange protocol Chainflip

Source: https://scan.chainflip.io/pools

Compared to Thorchain during the same period, it is still in a very early stage, with a daily trading volume of approximately $100-200 million and a total liquidity of $293 million (excluding RUNE).

A comprehensive explanation of the native cross-chain exchange protocol Chainflip

Source: https://app.thorswap.finance/dashboard

Financing and Token Information

Chainflip has undergone multiple rounds of financing, with a total financing amount of $23.3 million. Detailed information on all financing is as follows.

A comprehensive explanation of the native cross-chain exchange protocol Chainflip

Source: https://docs.chainflip.io/concepts/token-economics/genesis-tokenomics

At the end of 2020 to February 2021, the financing amount was $3.81 million, with an estimated valuation of approximately $15 million. This round of financing was led by Blockchain Capital, with other well-known institutions including Mechanism Capital, Apollo Capital, CMS Holdings, and DACM.

Shortly thereafter, a major round of financing was conducted, ending in August 2021, raising $5.8 million at a valuation of $45 million. Notable companies leading this round of financing include Framework, Coinbase Ventures, Hypesphere, Delphi, Morningstar Ventures, EdenBlock, MetaCartel, Lemniscap, and Defi Alliance.

The most recent round of financing was a $10 million equity financing in May 2022, with investments from Pantera Capital, Framework Ventures, and Blockchain Capital.

Finally, Coinlist users purchased tokens worth $3.78 million in the public sales in August and September 2023.

A comprehensive explanation of the native cross-chain exchange protocol Chainflip

Source: https://docs.chainflip.io/concepts/token-economics/genesis-tokenomics

$FLIP is Chainflip's ERC-20 native token, with an initial supply of 90 million, following a dynamic token supply model. Currently, Chainflip is expected to have an 8% annual token inflation, used to incentivize validation nodes, including authoritative validation nodes (7%) and backup validation nodes (1%).

In addition, Chainflip charges a 0.1% transaction fee for each transaction, which is used to repurchase and burn $FLIP, potentially leading to a deflationary state for $FLIP. FLIP will also be used as gas fees for the state chain, a portion of which will be directly destroyed, but the expected share will be relatively small unless network activity is very high.

The token empowerment of $FLIP is mainly used for staking validation and protocol value capture. According to Coingecko data, the current total circulating market value of FLIP is $96 million, with a fully diluted valuation of $456 million. This valuation is very high compared to the on-chain TVL and real trading volume, mainly due to the relatively small number of players in the field and high market expectations for Chainflip's future growth.

A comprehensive explanation of the native cross-chain exchange protocol Chainflip

Source: https://www.coingecko.com/en/coins/chainflip

Comparing with Thorchain data, the circulating market value is $1.257 billion, which is 13 times that of FLIP. However, the TVL and real trading volume are much higher than Chainflip.

A comprehensive explanation of the native cross-chain exchange protocol Chainflip

Source: https://www.coingecko.com/en/coins/thorchain

Summary

Comparing only the BTC spot trading market data on CEX and DEX, the total trading volume in the past 24 hours is approximately $8.88 billion.

A comprehensive explanation of the native cross-chain exchange protocol Chainflip

Source: https://www.coingecko.com/en/coins/bitcoin

A comprehensive explanation of the native cross-chain exchange protocol Chainflip

Source: https://www.coingecko.com/en/coins/bitcoin

In comparison, the native BTC DEX trading volume is concentrated in Thorchain, with a 24-hour trading volume of only around $48.8 million, accounting for only 0.55% of the total market.

A comprehensive explanation of the native cross-chain exchange protocol Chainflip

Source: https://www.coingecko.com/en/exchanges/thorswap

The DEX trading market share is approximately 5.6%:

A comprehensive explanation of the native cross-chain exchange protocol Chainflip

Source: https://www.coingecko.com/en/exchanges/decentralized

Therefore, both in terms of DEX market share and BTC trading volume, the native BTC cross-chain exchange market still has a lot of room for growth.

At the same time, Thorchain has a strong first-mover advantage and has undergone long-term market testing, optimizing for large trades. From this perspective, it will be difficult for Chainflip to surpass Thorchain in the short term. The best strategy at the moment is not to see Thorchain as a competitor, but to work together to expand the entire native cross-chain exchange market, optimize the experience for large trades, and integrate with more wallets and DeFi protocols. Access chains that Thorchain has not yet integrated, such as Solana, Tron, etc., to capture more trading volume. It is necessary to continue monitoring various indicators of Chainflip, especially trading volume data, as only sufficient trading volume can capture a large amount of trading fees, thereby promoting the rise in the price of the FLIP token.

Reference Articles

  1. https://docs.chainflip.io/

  2. https://blog.chainflip.io/just-in-time-jit/

  3. https://www.panewslab.com/en/articledetails/ph4354siz6kv.html

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

欧易返20%,前100送AiCoin保温杯
链接:https://www.okx.com/zh-hans/join/aicoin20
Ad
Share To
APP

X

Telegram

Facebook

Reddit

CopyLink