Front-running Attacks in Hash-Based Transaction Sharding Blockchains

Yusen Wang, Jiong Lou, Zihan Wang, Jie Li · 2024

Sharding is one of the prominent solutions to solve the scalability problem of traditional blockchains. By dividing the blockchain network into independent shards, transactions in different shards can be executed in parallel, improving the throughput of the blockchain. However, sharding also brings security issues. In a hash-based transaction sharding system, the output shard of a transaction is determined by the hash value of the transaction. Unfortunately, we show that this hashbased transaction assignment strategy can be easily exploited by attackers to conduct front-running attacks. Attackers can take advantage of the execution differences between different shards and the extra processing time of cross-shard transactions to make the attacker’s transaction executed and committed before the victim’s transaction, thereby obtaining the benefits that originally belonged to the victim. We also propose a flooding front-running attack, which introduces a single-shard flooding attack to enhance the front-running attack. Specifically, injecting a large number of junk transactions into the shard where the victim’s transaction is located can significantly extend the execution time of the victim’s transaction. We demonstrate the feasibility and practical effects of these two attacks through experiments on RapidChain, which show that a single-shard flooding attack can increase the success rate of a front-running attack by 12%. Finally, we discuss two possible mitigation measures and the cost of two proposed attacks.

Read the paper · More papers on PaperTik