header-langage
简体中文
繁體中文
English
Tiếng Việt
Scan to Download the APP
Partnered With:

Four types of review attacks for understanding smart contracts: forking, dodging, jamming, and quickattack

Read this article in 8 Minutes
Many cryptographic security incidents are related to smart contract attacks. Learn four types of review attacks against smart contracts and what to do about them.

How does viewpoint | prevent censorship attacks on smart contracts?

By Ed Felten

IAN LIU & Ah jian, ethereum fan


In the design of intelligent contract system, a common pattern is to require the client to take some behavior before a certain time node. If the client fails to respond beyond this point in time (for example, a block height), the smart contract takes some alternative action, usually to the disadvantage of the late client.


In this article, I focus on a similar pattern used by the interactive Rollup protocol -- an "assertion" is made by one party and can be challenged by others during the "challenge window" if they find the assertion problematic; This assertion is considered valid if no challenge is made during the challenge period.


The problem with this design pattern in practice is a censorship attack, in which an attacker blocks others from challenging a given time window. In the interactive Rollup protocol, an attacker may make false "assertions" while preventing others from challenging during the window period, ultimately making false assertions legal.

We also assume that the attacker has to invest a certain amount of money, and if the attack fails, it loses that money; In this way, we don't need to have zero probability of a successful attack on the system, but just make sure that the probability of a successful attack is small enough that no one wants to try to attack the whole system.


Below, I'll summarize my knowledge of censorship attacks and how to combat them, and give my view of the risks.


Review the type of attack


There are four main types of censorship attacks:

Bifurcation: miners collude (or are bribed) to discard blocks containing normal challenges and, by bifurcation, allow another block chain containing no challenges to be accepted.

Dodge: miners plot (or are bribed) not to pack normal challenges on the way out.

Interference: an attacker USES a traditional denial of service (DoS) attack to prevent others from issuing a challenge (unable to issue a transaction containing a challenge).

Quick attack: an attacker makes a large number of chain assertions in a very short time, leaving no time for others to check and challenge all assertions in a time window.


Let's talk about it one by one.


Bifurcation attack


Bifurcation attacks are where an attacker obtains most of the mining forces on a PoW block chain and USES these forces to isolate the block containing the challenge as required.

Because this kind of attack requires the attacker to control most of the computation, it is difficult to launch -- if the attacker can easily obtain most of the computation, the block chain itself has a big problem. Or to put it another way, a cartel that controls the vast majority of mining power, on the one hand, leads to distrust of their blockchain, and on the other, may have a way to squeeze oil out of the system faster than censorship attacks.


You might say, wait! A power monopolist may not be loud, but secretive about censorship; If attackers have the ability to do so, they may be able to forked their attacks without compromising the credibility of the entire blockchain.


Which brings us to the first question: are censorship attacks easy to spot for onlookers? To prove that forking attacks are obvious, I simulated forking. Suppose the attacker controls 60% of the calculation force. In the first 30 blocks, there are three bifurcated chains with lengths of 1, 6 and 5. This is completely different from a typical blockchain. I did another simulation, this time with the attacker controlling 55% of the force, where an earlier fork could be as long as 48 blocks. According to the simple mathematical model, when 60% of the computational force is monopolized, a bifurcation will occur for every 2.5 blocks, and the average length of the solitary chain caused by bifurcation is 5. When 55% of the force is monopolized, a bifurcation occurs for every 2.2 blocks, resulting in an average length of 10 isolated chains.


It can be seen that the frequency of bifurcation and the length of solitary chain increase with the decrease of the calculation power of monopoly. But whatever the length of the split, what they have in common is this: the first block on an isolated branch must contain a valid challenge, while the branch that ends up as the main chain never does - and the person who poses the challenge will find it! (an attacker may try to branch further away to avoid the first piece of commonality, but this can lead to branches that are too long, and ultimately isolated branches that still contain the challenge.) So censorship attacks, when they happen, are bound to be discovered.


I don't know about you, but I would be very concerned if I found out that there was a power monopoly in the block chain, and that the monopolists used power to interfere with the application layer protocol from time to time. If others share this concern, the entire blockchain will no longer be trusted by users -- and any 51% attack will result.


In other words, the problem with this attack is not that someone is going to censor your application-level transactions, but that there is a power monopolist in your blockchain that can break the rules for profit. For any blockchain application, whether or not it adopts the window-period design pattern, the emergence of this power monopoly is a devastating blow.


If you are in a blockchain where there is a potential forking attack, you should consider moving to another blockchain.


Dodge attacks


If the power monopolist does not use the easy - to - find bifurcated attack, what other trick? Yes, it's a dodge attack. A malicious miner can simply refuse to package a deal that contains a challenge when it comes to getting out; The attack can be successful by ensuring that the blocks produced during the challenge window are produced by malicious miners.


How likely is a dodge attack to succeed? It can be explained as follows: when the force ratio controlled by the monopolist is f, and the challenge window period is n blocks, the attack success rate is f n. For example, if the monopolist controls 90% of the computing power and the challenge window period is 50 blocks, the attack success rate will be 0.5% (if 95% of the computing power is controlled, the attack success rate will be maintained at 0.5%, and the window period will be increased to 100 blocks). If the attacker has to pay a large fine for the failure of the attack - as the rolluo agreement was designed to do - they will not attack with impunity; And if the money is returned to the victims, people will be happy to see these attempted attacks.


Therefore, the way to deal with dodging attacks is to ensure that the challenge window is long enough so that the probability of attack success is low enough to be acceptable to users. Assuming that the attack success rate you can accept is r and the attacker can control f at most, the challenge window period for security is log(r)/log(f) blocks.


This suggestion is also realistic; Assuming the attacker is able to monopolise 99% of the power and that the attack success rate is as low as 0.1%, the challenge window needs to be at least log(0.001)/log(0.99) = 687 blocks, which is less than three hours for ethereum.


Interfere with the attack


In the case of interference attacks, attackers use "traditional denial-of-service attacks" to prevent others from issuing challenges. This means "DoS censorship attacks."


The problem with jamming attacks is that the attacker must block "all" of the participants who might submit a challenge, and if there are enough of them, jamming attacks are unlikely to succeed.The bad news for attackers is that other stakeholders may hire a spy -- an intermediary who watches the protocol run, stepping in to challenge invalid assertions when the participants are too late or have difficulty issuing a challenge. Attackers have no way to identify these sleeper agents and can't launch DoS against them.


In summary, jamming attacks do not seem to be a good option for attackers.


fast


A quick attack is when an attacker releases so many assertions that others don't have time to check them all in the challenge window.


Any Rollup protocol needs to have a mechanism to defend against quick attacks, one of which is to limit the frequency of assertions to ensure that the whole network has sufficient capability to check for pending assertions or challenges at any point during the set challenge window.


Such mechanisms impose a "speed limit measure" on the processing power of smart contracts on a Rollup blockchain -- even if there is someone who can make a lot of assertions quickly, he will eventually have to slow down to make sure other normal participants follow.

So to measure the scalability of a Rollup system, one of the most important indicators is its maximum speed limit on the premise of security; Speed limit refers to the rate at which a system can safely process transactions, not the limit rate at which an actor can produce assertions.


conclusion


In summary, there are three types of censorship attacks that can be avoided by sound design or practice.


Prevent dodging attacks: assess the attacker's resources and risk tolerance, and establish a reasonable challenge window. Guard against interference attacks: hire your own (or through trusted authorities) stalkers who can take your place and challenge you when you go wrong. Guard against quick attack: more detailed design of the Rollup protocol.


Censorship attacks on forked types are hard to analyze; Because, to some extent, a successful forked attack leaves clear evidence that there are computational monopolists on the chain, and that these computational monopolists are more willing to take other, more quickly profitable, attacks -- such as double-flower. Any blockchain with a monopoly on computing power is too sick to worry about censorship attacks in this case.


The originalAddress:https://mp.weixin.qq.com/s/ScOM8pR61p98MolokOFlpA



Welcome to join the official BlockBeats community:

Telegram Subscription Group: https://t.me/theblockbeats

Telegram Discussion Group: https://t.me/BlockBeats_App

Official Twitter Account: https://twitter.com/BlockBeatsAsia

Choose Library
Add Library
Cancel
Finish
Add Library
Visible to myself only
Public
Save
Correction/Report
Submit