解读Neo侧链:用dBFT+密封交易抵抗恶意MEV
星球君的朋友们
2024-02-26 10:29
本文约2827字,阅读全文需要约11分钟
以更去中心化的方式解决“用户交易被夹”的问题。

The year 2024 has already been two months, and the cryptocurrency market is showing positive trends. Many mainstream cryptocurrencies, led by Bitcoin and Ethereum, have experienced continuous price increases. Bitcoin reached $52,000 during the Spring Festival, while Ethereum briefly surpassed the $3,000 mark, getting closer to its all-time high.

A few days ago, the Uniswap Foundation released a new proposal to allocate protocol fees to holders of staked UNI tokens, triggering a boom in the DeFi market. Not only did leading DeFi projects see a surge in value, but other projects like Frax Finance also consider introducing token staking rewards similar to Uniswap.

According to the data provider DeFi Llama, the total value locked (TVL) on blockchain-based DeFi platforms has grown by around 40% since November 2023, reaching approximately $60 billion, the highest level since August 2022. The future of the DeFi market in 2024 looks promising. In the context of the thriving DeFi market, it becomes crucial to build a fair and secure environment for users.

DeFi Retail Investors Have Long Been Afflicted by MEV

For on-chain users, especially retail investors frequently impacted by DeFi, MEV has become a well-known concept. MEV stands for Maximal Extractable Value, referring to the maximum profit amount that miners or validators can extract by reordering transactions within the mempool of the same block.

There are several types of MEV, including frontrunning, frontrunning sandwich attacks, and sandwich attacks. Frontrunning refers to MEV arbitrageurs taking advantage of their anticipation of price changes to buy or sell ahead of other transactions in the mempool, thereby profiting from price movement. Frontrunning sandwich attacks are the opposite, where MEV arbitrageurs place their trades after known transactions to profit from them. Sandwich attacks involve MEV arbitrageurs executing buy and sell activities before and after a large impending transaction, exploiting price fluctuations for profit.

MEV can serve various purposes, some of which are merely neutral transactions. For example, arbitrage on decentralized exchanges (DEX) can provide better liquidity for small-cap markets or improve liquidation in lending protocols.Efficiency. However, most frontrunning attacks and sandwich attacks are initiated by manipulating MEV robots called Searcher. They review users' transaction content, monitor for additional value, then reorder the transactions and ensure block production and value acquisition by paying high fees to validators. These are malicious MEV attacks. Neutralizingly, MEV is an effective profit mechanism, and neutral MEV behavior constitutes an established market mechanism for profiting through spreads in the DeFi ecosystem, accounting for a significant portion of market activity. However, malicious MEV profits often come at the expense of ordinary users' interests and network performance, causing significant impacts on the entire DeFi ecosystem. 1.

  • According to estimates, on only one chain of Ethereum, malicious MEV generated an annual total revenue of about 400 million US dollars in 2022. Based on this, it can be reasonably estimated that by September 2022, when Ethereum is merged, the accumulated revenue of malicious MEV can reach around 900 million to 1 billion US dollars.

  • The high-frequency and centralized on-chain activities brought by MEV bots raise gas fees and cause network congestion.

  • MEV activities are usually initiated by a small number of miners and validators, and most users cannot participate, which brings great centralization risks to the network. This is contrary to the original intention of decentralization, fairness, and low entry barriers of blockchain networks.

  • MEV solutions often come at the cost of cost and efficiency

    It can be seen that promoting neutrality of MEV innovations and preventing malicious MEV are currently the optimal strategies for tackling MEV behaviors. There are currently two main approaches to prevent malicious MEV:

    1. Building dedicated MEV channels for arbitrageurs

    Flashbots has always provided MEV-related tools for arbitrageurs on Ethereum. Currently, the most discussed is their MEV Boost for the introduction of PoS mechanism. In essence, these tools provide arbitrageurs with independent communication channels with validators, thereby reducing the impact of arbitrageurs obtaining MEV on ordinary users and network performance.

    2. Providing MEV protection for ordinary users

    As users discover that their interactions are often sandwiched, the ability to resist malicious MEV damage has become a consideration for users when choosing dApps. More and more DeFi projects and developers are starting to make improvements to counter MEV. The MEV protection for users is generally achieved in two ways:

    • Off-chain order matching. Many DEXs, including 1inch, Matcha, and Cowswap, reduce the opportunities for arbitrageurs to obtain MEV by implementing some form of off-chain order matching mechanism. However, this mechanism may lead to greater slippage and transaction delay in environments with poor liquidity, and also bring centralization risks.

    • Exclusive trading channel. The MEV Protect developed by Flashbots and some DEXs' exclusive trading services actually help users establish proprietary trading channels, similar to private RPC. Users can pay higher GAS fees to send their transactions directly to validators without going through the mempool.

    It is not difficult to see that there is currently no native MEV solution embedded in the Ethereum network. Ordinary users who want to avoid front-running and sandwich attacks must rely on third-party tools and services. First, you need to do some research and find the right product or install a plugin. On the other hand, using these services often means higher fees and lower transaction efficiency. This is still too high of a barrier and has low cost-effectiveness for most users who occasionally use DeFi.

    Recently, Neo announced the upcoming launch of a native MEV-resistant sidechain. If the Neo sidechain can really achieve native MEV resistance, it may be a choice that is more in line with the original intention of blockchain fairness and decentralization for DeFi projects and the majority of ordinary users.

    Neo Sidechain: Resisting Malicious MEV with dBFT and Sealed Transactions

    Although Neo's sidechain is also an EVM chain, it has a huge difference compared to Ethereum and other EVM chains: it is not PoS but dBFT. Neo has been using the dBFT consensus mechanism since its inception, and the previous announcement confirmed that the new sidechain will also use dBFT. On top of that, the Neo sidechain introduces a new type of transaction called sealed transactions, which remain encrypted until a new block is proposed. This means that no one can see these transactions before they are executed, preventing advanced transaction front-running and arbitrage.

    These two key foundational features give the Neo sidechain the ability to resist malicious MEV at the protocol level. Developers can directly integrate this native function in their dApps, which other chains currently cannot provide. For users, there is no need to understand and estimate costs for different tools and products. Ordinary users can obtain protection against malicious MEV without even realizing it.

    How does Neo sidechain achieve native anti-MEV?

    For those who are interested in understanding the technical characteristics of Neo sidechain's anti-MEV, I have organized the information I have learned from official announcements and media reports, TLDR:

    1. dBFT consensus mechanism

    • Neo Sidechain will continue to use the dBFT (Delegated Byzantine Fault Tolerance) consensus mechanism, which has inherent advantages over PoS chains in preventing time bandit and MEV attacks.

    • After block generation, Neo Sidechain can immediately finalize block confirmation to prevent attackers from reordering submitted transaction sequences.

    • The behavior of consensus nodes is supervised by the community. If block detention exceeds a certain threshold, penalties will be imposed, ensuring the fairness and security of the system.

    2. Encrypted Transactions

    • Neo Sidechain introduces encrypted transactions, allowing transactions to remain encrypted until new blocks are proposed.

    • No one can see the transaction content before it is executed, preventing leakage of pre-transaction intentions and effectively preventing arbitrage.

    • Supports users to send transactions through proxies to maintain anonymity before execution.

    3. Threshold Decryption and Distributed Key Generation (DKG)

    • During encrypted transactions, Neo Sidechain uses "threshold decryption" tools and sets up threshold decryption keys through "distributed key generation".

    • Consensus nodes only hold partial private keys, while all nodes collectively possess a public key.

    • This mechanism ensures the privacy of transactions and ensures that the complete transaction data can only be securely reconstructed when a sufficient number of nodes participate in the cooperation (achieving the consensus of 2/3 of the nodes in the dbFT system).

    4. Separation of MEV-resistant transactions and regular transactions

    • Neo sidechains have dedicated memory pools for storing MEV-resistant transactions separately from regular transactions, ensuring that MEV-resistant transactions do not affect normal transactions.

    • In each block, regular transactions always come after MEV-resistant transactions to combat malicious MEV practices. The senders of encrypted transactions can still set a certain priority fee without worrying about being replaced by others.

    • The memory pool is equipped with additional checks to minimize the impact of potential issues on the entire chain of transactions (such as DoS attacks or decryption failures of outdated MEV-resistant transactions).

    Overall, the Neo main chain has been updated to the third generation, and the ecosystem has been lukewarm. By being compatible with the EVM, Neo hopes to attract more EVM ecosystem applications and users on sidechains. As an old-fashioned public chain that stands tall in the ever-changing ups and downs, it possesses certain appeal and influence. On the other hand, with the unique dBFT and sealed transaction mechanisms, users can obtain a secure and private trading environment at a lower cost, without constantly worrying about their transactions being compromised.

    If these expected designs can be realized, the Neo sidechain may become a more fair and retail-friendly EVM ecosystem, bringing a large influx of fresh blood to the entire ecosystem and community. In addition, the interactive airdrops that accompany the launch of the testnet are also worth looking forward to.

    星球君的朋友们
    作者文库