Selfish Mining in Ethereum

Selfish Mining in Ethereum

Selfish Mining in Ethereum Jianyu Niu and Chen Feng School of Engineering, University of British Columbia (Okanagan Campus), Kelowna, Canada {jianyu.niu, chen.feng}@ubc.ca Abstract—As the second largest cryptocurrency by market sharp contrast, selfish mining in Ethereum has not received capitalization and today’s biggest decentralized platform that much attention. Ethereum differs from Bitcoin in that it runs smart contracts, Ethereum has received much attention provides the so-called uncle and nephew rewards in addition from both industry and academia. Nevertheless, there exist very few studies about the security of its mining strategies, to the (standard) block rewards used in Bitcoin [9]. This especially from the selfish mining perspective. In this paper, complicates the analysis. As a result, most existing research we aim to fill this research gap by analyzing selfish mining results on Bitcoin cannot be directly applied to Ethereum. in Ethereum and understanding its potential threat. First, we introduce a 2-dimensional Markov process to model the B. Objective and Contributions behavior of a selfish mining strategy inspired by a Bitcoin In this paper, we aim to fill this research gap by an- mining strategy proposed by Eyal and Sirer. Second, we derive the stationary distribution of our Markov model and compute alyzing selfish mining in Ethereum and understanding its long-term average mining rewards. This allows us to determine potential threat. To achieve this goal, we first introduce a the threshold of computational power that makes selfish mining 2-dimensional Markov process to model the behavior of a profitable in Ethereum. We find that this threshold is lower selfish mining strategy inspired by [3]. We then derive the 25% than that in Bitcoin mining (which is as discovered by stationary distribution of our Markov model and compute Eyal and Sirer), suggesting that Ethereum is more vulnerable to selfish mining than Bitcoin. long-term average mining rewards. This allows us to deter- mine the threshold of computational power which makes selfish mining profitable in Ethereum. We find that this I. INTRODUCTION threshold is lower than that in Bitcoin. In other words, selfish A. Motivation mining poses a more serious threat to Ethereum due to the The Proof-of-Work (PoW) is the most widely adopted presence of uncle and nephew rewards. We finally perform consensus algorithm in blockchain platforms such as Bitcoin extensive simulations to verify our mathematical results and [1] and Ethereum [2]. By successfully solving math puzzles obtain several engineering insights. involving one-way hash functions, the winners of this PoW Although our mining strategy is similar to that proposed competition are allowed to generate new blocks that contain by Eyal and Sirer [3], our analysis is different from theirs as many outstanding transactions as possible (up to the block in two aspects. First, our Markov model is 2-dimensional size limit). As a return, each winner can collect all the whereas their model is 1-dimensional. Second, our analysis transaction fees and earn a block reward (if its new block is tracks block rewards in a probabilistic way whereas their accepted by other participants). This economic incentive en- analysis tracks rewards in a deterministic way. It turns out courages participants to contribute their computation power that our 2-dimensional model, combined with the probabilis- tic tracking, enables us to characterize the effect of uncle and arXiv:1901.04620v4 [cs.CR] 11 Jul 2021 as much as possible in solving PoW puzzles—a process often called mining in the literature. nephew rewards, which is impossible with the 1-dimensional If all the miners follow the mining protocol, each miner model and deterministic tracking. The main contributions of will receive block rewards proportional to its computational this paper are summarized as follows: power [1]. Interestingly, if a set of colluding miners deviate • We develop a mathematical analysis that can capture from the protocol to maximize their own profit, they may the impact of uncle and nephew rewards with selfish obtain a revenue larger than their fair share. Such behavior mining in detail. We believe that our analysis can is called selfish mining and has been studied in a seminal be extended to study more advanced selfish mining paper by Eyal and Sirer in the context of Bitcoin mining [3]. strategies. The selfish mining poses a serious threat to any blockchain • Using our theoretical results, we evaluate the threshold platform adopting PoW. If colluding miners occupy a ma- of making selfish mining profitable under different ver- jority of the computational power in the system, they can sions of Ethereum proposals with a particular focus on launch a so-called 51% attack to control the entire system. EIP100 (which is adopted by the released Byzantium Selfish mining in Bitcoin has been well studied with [9]). We find that the threshold is lower than that in various mining strategies proposed (e.g., [4]–[6]) and nu- Bitcoin, suggesting that Ethereum is more vulnerable merous defenses mechanisms suggested (e.g., [7], [8]). In to selfish mining than Bitcoin. Block 4 The rest of the paper is organized as follows. Section II Prevhash provides some necessary background for our work. Sec- ... Block 1 Block 2 Block 3 tion III introduces a selfish mining strategy for Ethereum Transactions Prevhash Prevhash Prevhash inspired by Eyal and Sirer. Section IV gives the mathemat- ... ... ... Block 4 ical analysis and results. Section V presents our simulation Transactions Transactions Transactions results. Section VI discusses how to improve the security Prevhash of Ethereum. Related work are discussed in Section VII. Common Blockchain ... Finally, Section VIII concludes the paper. Transactions II. APRIMER ON ETHEREUM Figure 2. An illustration of a forked blockchain. Ethereum is a distributed blockchain-based platform that runs smart contracts. Roughly speaking, a smart contract is a set of functions defined in a Turing-complete environment. B. PoW and Mining The users of Ethereum are called clients. A client can issue transactions to create new contracts, to send Ether In order for a miner to produce a new valid block in PoW, (internal cryptocurrency of Ethereum) to contracts or to other it needs to find a value of the nonce such that the hash value clients, or to invoke some functions of a contract. The valid of the new block is below a certain threshold depending on transactions are collected into blocks; blocks are chained the difficulty level—a system parameter that can be adjusted. together through each one containing a cryptographic hash This puzzle-solving process is often referred to as mining. value of the previous block. Intuitively, the mining difficulty determines the chance of There is no centralized party in Ethereum to authenticate finding a new block on each try. By adjusting the mining the blocks and to execute the smart contracts. Instead, a difficulty, the blockchain system can maintain stable chain subset of clients (called miners in the literature) verify growth. the transactions, generate new blocks, and use the PoW Once a new block is produced, it will be broadcast to the algorithm to reach consensus, receiving Ethers for their entire network. In the ideal case, a block will arrive at all effort in maintaining the network. clients before the next block is produced. If this happens A. Blockchain to every block, then each client in the system will have the same chain of blocks. In reality, the above ideal case Each block in the Ethereum blockchain contains three doesn’t always happen. For example, if a miner produces a components: a block header, a set of transactions, and new block before he or she receives the previous block, a some reference links to certain previous blocks called uncle fork will occur where two “child” blocks share a common blocks (whose role will be explained in Sec. III-B) [9]. The “parent” block. See Fig. 2 for an illustration. In general, block header includes a Keccak 256-bit hash value of the each client in the system observes a tree of blocks due previous block, a timestamp, and a nonce (whose role will to the forking. As a result, each client has to choose a be explained shortly). See Fig. 1 for an illustration in which main chain from the tree according to certain rules (e.g., the blocks are linked together by the hash references, forming longest chain rule in Bitcoin and the heaviest subtree rule in a chain structure. the GHOST protocol)2. The common prefix of all the main Such a chain structure has several desirable features. chains is called the system main chain—a key concept that First, it is tamper-free. Any changes of a block will lead will be used in our analysis. to subsequent changes of all later blocks in the chain. Second, it prevents double-spending. All the clients will eventually have the same copy of the blockchain1 so that C. Ethereum Milestones any transactions involving double-spending will be detected and discarded. Ethereum has four milestones: Frontier, Homestead, Block 1 Block 2 Block 3 Metropolis, and Serenity. We are now in the third milestone Prevhash Prevhash Prevhash Timestamp Timestamp Timestamp where the mining difficulty level depends not only on the Nonce Nonce Nonce growth of the system main chain but also on the appearance Uncle blocks' Uncle blocks' Uncle blocks' header header header of uncle blocks, as suggested in EIP100 which is adopted by the released Byzantium [9]. By contrast, the mining Transactions Transactions Transactions difficulty level of Bitcoin only depends on the growth of the system main chain. Such a difference motivates our work. Figure 1. An illustration of the blockchain structure in Ethereum. 1More precisely, all the clients will have a “common prefix” of the 2Although Ethereum claimed to apply the heaviest subtree rule [11], it blockchain [10].

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    15 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us