아이콘_설치_ios_웹 아이콘_설치_ios_웹 아이콘_안드로이드_웹_설치

보안 극대화: DeFi에서 MEV 공격을 처리하는 방법

분석5개월 전发布 6086cf...
70 0

Hash of this article (SHA 1): b366289db9b21c3e9b6668c274e4a179be57a463

No.: Lianyuan Security Knowledge No.008

보안 극대화: DeFi에서 MEV 공격을 처리하는 방법

In the past few years, the blockchain economy has experienced exponential growth, especially in 2022, when the locked value of the DeFi ecosystem reached a peak of $300 billion. Web3 has also seen a variety of attack methods and logical security vulnerabilities. Since 2017, the Maximum Extractable Value (MEV) has been at the forefront of the attack methods that cause losses on the ETH chain. The ChainSource Security Team has conducted relevant analysis and sorting on the basic principles and protection methods of MEV, hoping to help readers improve their protection. The ability to ensure the safety of ones own assets.

MEV Basic Principles

보안 극대화: DeFi에서 MEV 공격을 처리하는 방법

MEV, the full name of which is Maximum Extractable Value, was also called Miner Extractable Value in the POW era of Ethereum. After a large number of blockchains switched to POS, it was renamed Maximum Extractable Value. Because block producers are no longer the only ones who decide the order of transactions (currently, the two roles with these two permissions are miners and validators, but previously there were only miners).

MEV refers to a measure of the profit that participants such as validators or sequencers obtain by performing selective operations on transactions (including transactions, sorting transactions, and reordering transactions) within the blocks they produce.

Validators: Participants responsible for validating transactions and producing blocks;

Sequencer: The participant responsible for deciding the order of transactions;

Include transactions: select which transactions will be included in the block;

Exclude transactions: select which transactions will not be included in the block;

Reorder transactions: determine the order of transactions in a block;

Currently, hackers using MEV mainly target wallet addresses that have obtained airdrop snapshot qualifications and whose pledged tokens are about to be unlocked. The prerequisite for hackers to launch such attacks is to obtain the wallet private key, then turn on dynamic Gas monitoring, and wait for the users After the tokens or gas fees are received, a withdrawal transaction is sent in the same block or adjacent blocks, which is called a front-running transaction. We call this type of monitoring robot a Sweeper robot.

보안 극대화: DeFi에서 MEV 공격을 처리하는 방법

Protection methods (taking ETH as an example)

First of all, there are two ideas for this type of protection. Since the goal is to compete with hackers in terms of speed, the first approach is to increase the Gas price and the Nonce of transaction sorting.

Because Ethereums transaction fee = Gas (quantity) * Gas Price (unit price), and the Gas Limit capacity of each Ethereum block is fixed, whoever has a higher Gas Price will have their transaction packaged into the block first. Block confirmation, in addition, nonce in Ethereum represents the number of transactions. This concept should be combined with the fact that Ethereum itself is account-based, so each different account maintains its own nonce, and each transaction of each account in Ethereum Each transaction has a unique nonce, which can prevent replay attacks (the same transaction is processed multiple times) and allow the EVM virtual machine to clarify the order of transactions (for example, if the nonce of a transaction is 5, then in this transaction Before the transaction can be processed, the transaction with nonce 4 in the account must have been processed)

The second idea is to connect to nodes with faster confirmation speed and higher transaction obfuscation

보안 극대화: DeFi에서 MEV 공격을 처리하는 방법

If you want to change the connection node, the first recommended one is the TAICHI network node. This network is a privacy and security solution based on blockchains such as ETH and Solana. It achieves transaction obfuscation and privacy protection by introducing a series of relay nodes. The node is responsible for receiving the users transaction request and mixing it with other transactions to hide the source and purpose of the transaction.

Relay nodes: These nodes are the core of the TAICHI network and are responsible for receiving, mixing, and forwarding transactions;

Transaction mixing: By mixing multiple transactions together, relay nodes are able to effectively hide the source and purpose of individual transactions;

Privacy protection: This method can effectively prevent on-chain data analysis and tracking, protecting user privacy;

Sweeper works by monitoring transaction records in the public memory pool to preempt transactions, but the TAICHI node allows us to submit signed transactions directly to miners without broadcasting through the public memory pool, which means that Sweeper is likely to monitor If it is not available, there is a possibility of front-running Sweeper (the public memory pool refers to the collection of transactions that have been broadcast but not yet packaged into the block).

보안 극대화: DeFi에서 MEV 공격을 처리하는 방법

The second recommended node is FlashProtect. FlashProtect is a solution to the MEV problem in the Ethereum system provided by the FlashBots organization. It works by packaging the users transactions and sending them directly to the miners through Flashbots instead of through the public memory pool. To prevent malicious miners and robots from discovering and exploiting these transactions in the public memory pool to withdraw funds using MEV. Its disadvantage is that the transaction speed is very slow because it uses the Flashbots memory pool, which has far fewer validators than the public memory pool. .

보안 극대화: DeFi에서 MEV 공격을 처리하는 방법

결론

In general, various protection methods are also aimed at maintaining the sorting process of decentralized transactions and ensuring that smart contracts handle transactions in a fair manner, but the most fundamental solution must be to make adjustments from the perspective of miners and validators.

Lianyuan Technology는 블록체인 보안에 중점을 둔 회사입니다. 당사의 핵심 업무에는 블록체인 보안 연구, 온체인 데이터 분석, 자산 및 계약 취약성 구제가 포함됩니다. 당사는 개인 및 기관을 위해 도난당한 많은 디지털 자산을 성공적으로 회수했습니다. 동시에 당사는 산업 조직에 프로젝트 보안 분석 보고서, 온체인 추적성 및 기술 컨설팅/지원 서비스를 제공하기 위해 최선을 다하고 있습니다.

읽어주셔서 감사합니다. 우리는 블록체인 보안 콘텐츠에 계속 집중하고 공유할 것입니다.

This article is sourced from the internet: Maximizing security: How to deal with MEV attacks in DeFi

Related: Circle founder: Why Im more optimistic about crypto than ever before

Original author: Jeremy Allair Original translation: TechFlow Im more bullish on crypto than Ive ever been. @Circle Ive been building for over 11 years and Ive never been more bullish. I also believe that the vast majority of people have an extremely narrow and limited understanding of whats going on. Thats also a reason to be bullish. This article explains why I am so optimistic. My perspective comes from close observation of the life cycle of Internet technology applications over the past 35 years or so. We have seen the emergence of open networks, open protocols, and open software, and the infrastructure on the Internet has emerged in an endless stream, deepening the Internets social and economic utility. Each wave has transformed major industries, improved peoples living standards, disrupted or…

© 版权声명

상关文章