Flash Bounty: Miners
Do certain miners prefer mining blocks with lower transaction count? Do certain miners only mine blocks with high transaction count?
1. Blocks
Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data. This prevents fraud, because one change in any block in history would invalidate all the following blocks as all subsequent hashes would change and everyone running the blockchain would notice. To ensure that all participants on the Ethereum network maintain a synchronized state and agree on the precise history of transactions, we batch transactions into blocks. This means dozens (or hundreds) of transactions are committed, agreed on, and synchronized all at once. By spacing out commits, we give all network participants enough time to come to consensus: even though transaction requests occur dozens of times per second, blocks on Ethereum are committed approximately once every fifteen seconds. To preserve the transaction history, blocks are strictly ordered (every new block created contains a reference to its parent block), and transactions within blocks are strictly ordered as well. Except in rare cases, at any given time, all participants on the network are in agreement on the exact number and history of blocks, and are working to batch the current live transaction requests into the next block. Once a block is put together (mined) by some miner on the network, it is propagated to the rest of the network; all nodes add this block to the end of their blockchain, and mining continues. The exact block-assembly (mining) process and commitment/consensus process is currently specified by Ethereum’s “proof-of-work” protocol.
2. Organization of This Study
In this bounty, the behavior of miners in mining blocks in Ethereum blockchain is investigated. This study is aimed to find out if miners prefer to create blocks lower transaction count or not. The “ethereum.core.fact_blocks” table was employed to extract the data on mined blocks on Ethereum blockchain. Several parameters have been selected to provide detailed insight about the issue. In section 3.1, an overview of the problem will be given. It will be shown how many blocks are mined for each transaction count. Also in this section, the difficulty, gas limit, the ratio of gas used to gas limit and number of unique miners as a function of transaction count are given. In section 3.2, a quantitative definition of low and high transaction count will be given. Then the number miners who prefer to mine blocks in low or high transaction count shall be addressed. In section 3.3, the results found in section 3.2 will be subjected to more in-depth evaluation to find why miners prefer to mine blocks in low or high transaction count.
3. Results
3.1. The Overview
The number of blocks mined for each transaction count are given in figure 1. It is found that there are 1632557 blocks with zero transaction count. An overall decreasing trend can be identified as transaction count increases. For very high numbers of transaction count (greater than 1000), the number of mined blocks is constant in average with some fluctuations. These results reveal that miners prefer mainly to mine blocks in lower transaction counts.
The arithmetic average of difficulty parameter which gives a measure of required computing power to verify transactions was calculated for each transaction count and plotted in figure 2. First, there is a sharp increase in difficulty to about tx_count = 50. Then, difficulty remains almost constant till tx_count = 200. After that, an uptrend can be identified in difficulty till tx_count = 400. For tx_count greater 400, although there are some strong fluctuations, but one may claim that for this range of transaction count, difficulty is almost saturated and does not increase more.
Figure 3 depicts the average gas limit for each transaction count. This parameter has similar trend as difficulty. Except for transaction count greater than 715, it completely saturates to 30M. This means that for very high transaction counts, gas limit does not increase and miners may not expect more transaction fee if they mine blocks with higher transaction count. This finding is in close agreement with those found in figure 1.
The ratio of gas used to gas limit (gas rate) gives a good idea about transaction fee earned by miners. The average gas rate for each transaction count is given in figure 4. It is clearly visible that around tx_count = 200, the gas rate saturates and does not increase more as transaction count increases. One may claim that, miners would mainly prefer to mine blocks around transaction count of 200. This issue will be examined in more detail in next sections.
The number of unique miners for each transaction count have been extracted and demonstrated in figure 5. It is shown that as transaction count increases the number of unique miners decrease. For transaction count greater than 1000, the number of unique miners is constant in average. Both number of mined blocks and unique miners have similar pattern against transaction count.
3.2. Preference of Miners
There levels of low, medium and high transaction counts were considered in this study. Each level has sublevels as follows:
Low:
A1) tx_count <= 200
A2) 200 < tx_count <= 400
A3) 400 < tx_count <= 600
Medium:
B1) 600 < tx_count <= 800
B2) 800 < tx_count <= 1000
High:
C1) 1000 < tx_count <= 1200
C2) 1200 < tx_count <= 1400
C3) 1400 < tx_count
First, transaction count of each block mined by each miner were determined. Then, the average of transaction count has been calculated which gives the preference of miners for mining the blocks. For example, when the average transaction count of blocks mined by a miner is 150, this means this miner mainly prefer to mine blocks in sublevel A1 as defined earlier. It should be noted that, this miner might have mined some blocks with transaction count in other sublevels. But, since its average transaction count is 150, it can be categorized as a miner who prefer to mine blocks in lower transaction count.
Then, the minimum and maximum transaction counts of blocks mined by each miner have been extracted. If the minimum and maximum transaction counts of a miner are placed in a sublevel, that miner only mines blocks in mentioned sublevel. For example, the minimum and minimum transaction count of a miner is 430 and 545 respectively. As a result, this miner has mined all its blocks in sublevel A3 and it can be said it only mine blocks with low transaction counts.
Figure 6 gives the results for categorizing the miners according to above mentioned reasoning. As it was expected, most of miners mine their blocks in low transaction counts. There are 4816 miners who have mined blocks only in sublevel A1. As displayed, there is one miner which prefer to mine blocks in sublevel C2.
To give more insight about the issue, the transaction counts of blocks mined by the miner who prefer to mine blocks in high transaction count (sublevel C2), are provided in table 1. Except two block numbers of 13332803 and 13332305 which have 286 and 962 transaction counts respectively, the other blocks mined by this miner have transaction count more than 1200. Also, the block number 13331492 mined by this miner has 1413 transaction count which is out of sublevel C2. In brief, there are just 3 out of 13 blocks mined by this miner with transaction count out of sublevel C2. Since the average transaction count of this miner is 1128.4, it can be categorized as someone who prefer to mine blocks at sublevel C2 of high transaction counts.
3.3. Why Do Miners Mainly Mine Blocks in Lower Transaction Counts?
One may ask, why miners mine blocks mainly in low transaction counts. To find the answer, the average and total transaction fee of blocks for each transaction count have been evaluated. Given the block number in “ethereum.core.fact_blocks” table, the transaction fee of each transaction in blocks were found from “ethereum.core.fact_transactions” table in ETH. Using “ethereum.core.fact_hourly_token_prices” table, the transaction fees have been converted to USD. Finally, the average transaction fee and total fee paid by users for all blocks of a transaction count were calculated. Figure 7 shows the average transaction fee for each transaction count. As shown, the transaction fee minimizes around transaction count of 200 for low transaction counts level. For high transaction counts, the average transaction fee has very strong fluctuations which may lead to difficulty for users to predict their earnings from transaction fee. But in average, the transaction fee in lower transaction counts is greater than higher transaction counts. As a result, if miners mine more blocks in low transaction counts, they will earn more profits than mining blocks in high transaction count.
To prove the accuracy of claim stated for findings in figure 7, total transaction fee earned by miners for all blocks of each transaction count is depicted in figure 8. The results in figure 8 clearly show that by increase in transaction count, the total transaction fee increases and it reached to its maximum around transaction count of 200. After that, the total transaction fee earned by miners decrease as transaction count increases. It should be stated that most of transaction fees are earned by miners who mine blocks in three sublevels of low transaction counts.
4. Conclusion
In this bounty, the blocks mined by miners and effect of transaction count on decision of miners to mine a block or not was subjected to a comprehensive study. The following results can be drawn from this study:
· As the transaction count increases, the number of mined blocks decrease.
· As the transaction count increases, the difficulty and gas limit increase.
· For transaction counts greater than 715, difficulty and gas limit saturate and do not increase more.
· Gas rate increases sharply with increase in transaction count firstly. From transaction count of 200, gas rate increases to more than 95% and gets saturated.
· Most of miners prefer to mine blocks in low transaction counts.
· For three sublevels of low transaction counts, as level increases, the number of miners decrease.
· The earnings of miners from transaction fees maximize around transaction count of 200. This is why most of miners prefer to mine blocks in low transaction counts.