3
What if one block contains many more transactions than the other? Wouldn't it be better to pick the block with more transactions? Also, why is a tie ultimately broken randomly, rather than a deterministic way that helps the network?
3
What if one block contains many more transactions than the other? Wouldn't it be better to pick the block with more transactions? Also, why is a tie ultimately broken randomly, rather than a deterministic way that helps the network?
1
Consensus rule dictates that chain work is measured based on the production of a solution which satisfy the difficulty set by consensus. So as long as a produced block satisfy said rule, said produced block would be accepted.
It is technically infeasible to choose base on blocks with more transaction for a variety of reason. First, bitcoin lacks strong consistency (i.e. its impossible for nodes to share a consistent state for its mempools), if block acceptance requires that a block based on the highest number of transaction is accepted, then the blockchain will most likely be orphaned many times as miners compete to produce competing block tips and nodes would discard block tips literally each time a new block with more transactions is received. This results in more partitioning in the network, which leads to a poorer security as less work is focussed on any particular branch of the chain.
Thanks! Perhaps I'm nitpicking, but it seems to me that this explains the first two rules referenced here: http://bitcoin.stackexchange.com/questions/37273/how-is-a-blockchain-split-resolved?rq=1 . Do these same arguments hold if we replace rule #3 to "most transactions", from "block with larger pointer address"?
No. The 3rd rules assertion on randomness would be violated. Pointer addresses are random. Blocks that arrive later would tend to contain more transactions, hence will not satisfy randomness. – renlord – 2016-11-04T04:51:12.240
Blocks that arrive later would get filtered out by th3 second rule, correct? I don't see the reason to make rule #3 random. It wouldn't cause miners to compete on transactions, as we're accepting earlier blocks before applying rule #3 – kanu – 2016-11-04T20:22:48.873
Yes you are right, my apologies. However, the main point here is that there is really fundamentally no difference in terms of work done between a block that contains more transactions and a block that contains no transactions. It is at a miner's discretion to elect whether or not she'd like to include transactions. Miners are simply incentivised to include transactions so that they may reap transaction fees. Besides, random selection is still better, because if you had to compare, you'd have to process both blocks and that takes up valuable time. – renlord – 2016-11-04T23:22:36.707
It definitely makes sense from the miner's incentive perspective- including transactions is completely her discretion. However, is it better for Bitcoin as a system to change rule #3 (perhaps negligibly so, but still better)? Regarding your point about processing time, won't both these blocks already be validated for correctness by the full node prior to adding them to the blockchain? A simple count shouldn't add much overhead. – kanu – 2016-11-05T07:17:58.103
Since it does not break consensus, if you're a benevolent miner, I suppose you can change rule #3 as you've suggested, but I suspect, you'd be worse off in terms of efficiency as you have that extra step of "consideration" which I suspect also isn't cheap in terms of computation. As game theory suggests, miners are simply out there to maximise on their gains and you can see that some miners did in fact mine empty blocks to maximise throughput and efficiency. – renlord – 2016-11-05T07:21:38.750
This was interesting! Meanwhile I'll try to figure out what exactly this would mean for efficiency. Especially considering, as I suspect you suspect, this happening is a rare event – kanu – 2016-11-05T07:37:44.283
I've found that rule #3 is essentially never consulted. Further, it doesn't make sense to change it to number of transactions because that could easily be gamed by dummy transactions. However, it does make sense to change rule #2! – kanu – 2016-11-07T07:29:27.487
1
It makes for a stabler system if we pick the first that we receive.
The whole point of Bitcoin's blockchain is to determine a fixed order for the transactions. Two blocks being discovered at the same height is an unfortunate incident that cannot be circumvented due to the probabilistic nature of mining. It is not something that we want to occur: Two competing blocks defer the certainty of the block order to a later time but we want it to generally become stable as soon as possible.
Thus, the first block that is seen in order re-establish consensus as quickly as possible and to incentivize miners to immediately switch to mining on the successor block instead of trying to oust already existing ordering.
It's incorrect that the system becomes stable by if the protocol is to break ties by the first block received. As I've explained in my answer, this rule could be gamed by a selfish miner. – kanu – 2016-11-07T07:26:59.480
As I explained on your answer, I don't think selfish mining is a rational attack anymore. – Murch – 2016-11-07T09:51:38.750
0
The current protocol rules for breaking ties is explained here. Breaking ties by number/ value of transactions is not only infeasible as other answers here explain, but is also easily gamed. An attacker could simply move his own coins around to have the most number of transactions. Breaking ties based on time received is better, and the third rule is almost never used.
However, here is research that shows breaking ties by time received does not make for a stabler system. This paper on selfish mining explains the idea. To summarize the intuition here:
The paper also shows that even if conditions are extremely unfavorable to the selfish pool, selfish mining would be advantageous to the pool as long it has more than 1/3rd of the total network hash power.
Rule #2 fails here because the selfish pool may set up lots of virtual (dummy) miners whose sole purpose is to peer with other nodes, stop the propagation of honest miners' blocks and instead propagate the selfish pool's blocks when it chooses to publish its private blocks as explained above.
The paper instead proposes that ties should be broken randomly, which would put the selfish pool at a disadvantage (virtual miners and being better connected to the Bitcoin network will not help the selfish pool here).
Since selfish mining requires 1/3 of the hashing power, it's not "easily gamed". Besides with compressed block relay such as FIBRE and Compact Blocks, it would seem to me that withholding blocks will almost exclusively make the attacker the only miner on his chain. That would make selfish mining a losing strategy, though. I've asked a follow-up question here.
I referred to breaking ties by number of transactions as easily gamed, not selfish mining. With selfish mining, haven't pools reached 1/3rd of the hash power many times in the past? As I understand it, 1/3rd of hash power is the threshold if every miner is connected to the same relay network. If miners don't use relay networks at all, the threshold is arbitrarily small. – kanu – 2016-11-07T13:34:29.600
Also, I think you're only considering a private chain with a single block lead over the public chain. If the lead is two or more blocks, the relay network would not help when the pool chooses to publish its private chain. So I'd say the chances of a successful attack have decreased with relay networks but not vanished. – kanu – 2016-11-07T13:42:22.997
Ah sorry, I mixed the two. By number of transactions is easily gamed indeed. While mining pools have reached 33% of the hash rate before, I am not aware that selfish mining has occurred. And to reach a two block lead, the miner first has to decide to withhold a block when he has a one block lead. – Murch – 2016-11-07T14:54:50.907
Selfish mining would be very hard to detect, as mining is probabilistic. I'm not aware of any mechanisms in place to detect it, or even if one can definitely prove that selfish mining has taken place. For your second question, the mechanics of profiting by withholding the first block in the hope for a second are explained in section 4.2 and 4.4 of the paper I've linked above. – kanu – 2016-11-07T15:08:11.430
If two blockchains are of equal height, clients will prefer the one they received first. – Nick ODell – 2016-11-02T20:56:11.623
Also, minor nitpick: nodes use chain work, not chain height. For small forks where the difficulty is the same, the distinction usually doesn't matter, though. – Nick ODell – 2016-11-02T20:57:10.777
Thanks, but that was my real question- why pick the one they received first, or by random? Let's say one block has no transactions but was received first, and another with the same work has many transactions was received later. Why not pick the latter? – kanu – 2016-11-02T23:46:20.947
Ah, that sounds like it's not a duplicate. My apologies. – Nick ODell – 2016-11-03T03:41:00.297