Estimation of the Probability of Success of a Frontrunning Attack on Smart Contracts
摘要
A frontrunning attack is one of the most common attacks on smart contracts. Its essence is in manipulating the order of transaction inclusion in a block to gain an advantage by altering the transaction processing sequence. This attack poses a particular threat to the conduct of p2p auctions for “green” energy trading. In this article, different types of such attacks are considered, analyzed, and formalized in step-by-step execution algorithms. Next, a model is proposed to estimate the probability of success of such an attack. An explicit formula is derived for the probability of success of a displacement attack and an insertion attack, which are particular cases of a frontrunning attack. The probability of success is shown to depend on network parameters and the ratio between the transaction fees created by an honest and a malicious users. Numerical examples of practical applications of the derived formula are provided, further confirming the correctness of the analytical results.