BTC
ETH
HTX
SOL
BNB
View Market
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt

A "One Deal" Victory

NEST爱好者
特邀专栏作者
This article is about 2067 words, reading the full article takes about 3 minutes
How to deal with block blocking attacks?
AI Summary
Expand
How to deal with block blocking attacks?

Author: NEST Enthusiast_Nine Chapters Tianwen

Author: NEST Enthusiast_Nine Chapters TianwenIf you ask me what attacks are inevitable on the blockchain, I will answer:Jamming attack and 51% attack.

We will talk about the 51% attack next time, and today we will only talk about the blocking attack.

The so-called blocking attack is to use transactions to occupy blocks, so that other transactions cannot be packaged.Someone compares a jam attack to a block on a blockchainDDOS attack

: Not looking for system loopholes, but occupying resources in a "compliance" manner and shutting down the system. The two do have similarities, which can be abstracted out: one is "compliance", that is, the attack is allowed by the system; the other is non-vulnerability, that is, any system may be attacked, no matter how perfect it is; System resources, others are passively excluded.

Taking a closer look at these features, it seems that it is not a purely technical issue, nor is it a purely security issue. Jamming attack is an economic problem, or a game problem. Taking the Ethereum network as an example, we first study the optimal logic of blocking attacks, and then study the ideas of countering blocking attacks.

Assuming that the upper gas limit of a block is 10 million, and the smallest single transaction is 20,000, there are two options for blocking a block: the first is to block the block with a large number of small transaction areas with high gasprice; the second is Use a large transaction with a high gasprice (here, large and small are measured by the gaslimit, and a large transaction is a transaction that occupies the entire block as much as possible, such as the gaslimit is 10 million) to block. For example, the gasprice is 1000 (the gasprice guaranteed to be packaged quickly is also within 1000 times when the 312 Ethereum network is congested), then the gas cost calculated by the two schemes is the same, which is the result of calculation from our own standpoint .

But from the perspective of miners and competitors, there are differences between the two.Let's start with competitors, that is, traders who want to break through blocking attacks.

If it is a small transaction, the competitor can use a higher gasprice to pack it before the attacker. For example, if you use a gasprice of 2000 to compete, in principle, it must be ranked in front of many small transactions with a gasprice of 1000; but for For a large transaction, competitors may be blocked because miners consider the combination of maximizing gas rather than the transaction with the highest gasprice. This is because the total gas of large transactions is 10 million * 1000, and the gas including small transactions is 20,000 * 2000 + other transactions. The remaining transactions here are optional third-party transactions, and the gasprice is generally lower. In these two transaction combinations, rational miners will choose the combination of large transactions, so that even if competitors have higher gasprice, they will be excluded due to the lower gas of a single transaction. Therefore, in terms of the effectiveness of blocking attacks, large transactions with high gasprice are more advantageous.According to the current transaction situation of the Ethereum network, the handling fee for a large transaction of 1000 times the gasprice is 1000w*1000=10 ETH, since one block is blocked, the cost of blocking for 10 minutes is 500 ETH.If the external incentives are large enough (external incentives are rewards other than the current behavior), blocking for 1 hour is 3000 ETH, which is probably worthwhile.

Note that the 1000 times gasprice is only based on a statistical assumption, not based on an on-chain application.Consider an on-chain application, such as DeFi, whose economy depends on blocks, that is, within N blocks, a transaction needs to be completed, otherwise it will cause a loss of X ETH. If the application does not make any design, according to the previous assumption, a blocking attack of 10*N ETH can cause a loss of X ETH. Here are several situations: 1. The loss of X ETH can become the attacker's gain, then when X>10N, the attack is a completely rational incentive. 2. The loss of X ETH cannot be turned into the attacker's gain, then this situation is the same as X

< 10N, it becomes a malicious act: causing assets to flow out of the application by destroying the validity of the application.

These two situations should be considered separately, but in either case, the core is how to make the blocking attack invalid: there is always a transaction that can be completed before the critical condition is triggered, which is what we call "the victory of a transaction".

For the first case, the application needs to be designed in two ways: first, the size of N should be increased to N1 according to the economic scale or certain abnormal conditions; second, the incentive income for completing a transaction should be increased: for example, the income for completing a transaction is a ETH is upgraded to b ETH, where b>a, and b>10eth, that is, the cost of blocking a block becomes bETH, and the total cost changes from 10*NETH to b*N1ETH, as long as b*N1ETH>X, then The external incentive to attack is invalid.For the second case, the best way to deal with malicious attacks is to arrange ashutdown mechanism, has two meanings:One is the geometric progression of the cost caused by the attack, making it impossible for the attacker to achieve the goal, thus giving up the attack. For example, the beta coefficient design of the NEST system is currently the first built-in shutdown system design in the blockchain industry. We can learn from it , such as allowing the critical block number N to increase in series

. Secondly, the executable of the application is automatically adjusted according to the difficulty of "victory of a transaction". When it becomes very urgent to complete the "victory of a transaction", the application can be temporarily disabled, making the attacker lose the target of attack. These two arrangements require more in-depth classification studies of boundary conditions due to their openness.Of course, the above analysis assumes that miners are completely rational and only consider the packaged gas income, regardless of possible blacklists, voluntarily sacrificing part of their interests to resist blocking attacks, etc.

Through these humanized arrangements, the purpose of attack resistance can also be achieved indirectly, but we prefer to design on the application side.Since the current application on the chain is still in the exploratory period, no one has seriously considered the attack and defense of blocking attacks, which is very unfavorable to the development of future applications. Thinking about the ending of FOMO3D back then, I hope it will not happen in the DeFi industry.

DeFi
智能合约
ETH
Welcome to Join Odaily Official Community