2

My question is - let's say a miner has control over a certain number of bitcoin addresses. He creates a block containing small transactions to and fro from these accounts ahead of time in advance and also calculates the golden nonce for that block should it be introduced in the chain in the future.

Can he introduce this block in the chain at a particular instant of time and get the mining reward, considering that he can determine all the variables that would affect nonce calculation in advance. Also my understanding says that this block won't be rejected by other nodes as all the transactions will be valid with proper signatures(the miner controls all those bitcoins and will only try to spend them at that particular instant). What would prevent such a situation from happening? This way miners could make bitcoins for themselves out of thin air. What am I missing here?

1
  • Even if they could, why would it matter? He's entitled to the block reward for finding a block of the appropriate difficulty. Commented Jan 18, 2020 at 0:37

3 Answers 3

13

This will not work, because a block's content includes the previous block's hash which means that a valid block can only be mined after the previous block is known.

The dummy transactions would not yield a reward to the miner, because the transaction fees are just going from the miner's left pocket to the miner's right pocket. The miner will only gain the newly minted coins, which they would have collected anyway, even with an empty block that included no transactions except for the coinbase transaction. In fact, the miner is suffering an opportunity cost, because they could have collected fees from other transactions instead.

6
  • When you say "previous block is known", do you mean "publicly known"? Not that I recommend this, but is it possible to withhold a winning block and know the hash? (The idea being to get a head start vs. the world on subsequent blocks, but at the risk that your first won block might be lost to someone else who finds the right calculation and, as typical, doesn't wait.)
    – TOOGAM
    Commented Jan 18, 2020 at 13:03
  • @TOOGAM Yes, that is possible. And Bitcoin is a libertarian free market. Anything that is possible is recommended, including cheating :) Commented Jan 18, 2020 at 15:17
  • @TOOGAM block withholding is known as a ‘Finney attack’
    – chytrik
    Commented Jan 18, 2020 at 21:42
  • @chytrik: A Finney attack is a special form of doublespend attack which uses block withholding to guarantee success in a doublespend attack against a merchant that accepts zeroconf transactions.
    – Murch
    Commented Jan 18, 2020 at 22:14
  • Toogam is here more talking about a selfish-mining strategy.
    – Murch
    Commented Jan 18, 2020 at 22:15
4

What prevents this is the requirement to have the hash of the previous block's header in the new block header which is then put through Proof-of-Work. The hash of the previous block's header cannot be known until it is created, making it impossible to compute the work ahead of time. The miner cannot just pick any old block header to base his new block on as they will not produce the longest valid chain.

2
  • so effectively, that miner will have to mine with his dummy transactions within that 10 minute window? I guess he won't be at any significant advantage then. He will be equally better off calculating nonce for actual transactions. Cool... Commented Jan 17, 2020 at 19:58
  • 2
    Yeah. Miners do sometimes create almost empty blocks (containing only a coinbase transaction). This is because when a new block is found, it takes some seconds to collect its transactions from the mempool and craft a new block template. During those few seconds, the miner doesn't sit idly, but they just perform PoW without transactions in the block, and although the probability is low that it will be mined in that time, it has happened.
    – Mark H
    Commented Jan 17, 2020 at 20:04
0

Something not mentioned in the other answers, and which your question implies you are unaware of, is that there is no requirement that one have any transactions at all. If you want to mine a block that consists of nothing except you getting the block reward, that is a perfectly valid block. This is something that has happened, although it was more common in the early days.

The reason it usually doesn't happen is that transactions generally have a transaction fee. This is where the person sending bitcoins includes in the transaction that the person who creates the block with the transaction in it gets a portion of the sent bitcoin. This isn't mandatory, but obviously it creates an incentive for people to include your transaction. If you were to create a block consisting only of transactions between your own wallets, then you wouldn't get any transaction fees (even if the transactions included fees, the fees would be paid from yourself to yourself, so no net benefit).

So what you're proposing would provide no benefit over just publishing an empty block (unless you wanted to make tracing bitcoin more complicated or something), and publishing an empty block is in turn worse than publishing a block with transactions that have transaction fees (unless you're trying to create a fork or something).

This way miners could make bitcoins for themselves out of thin air.

Yes ... that's what "mining" means. When someone mines a block, they get a block reward. Perhaps you mean "this way miners can get bitcoins without providing any benefit to the network". As I've explained, this is already possible with empty blocks (although I suppose one could argue that empty blocks still provide benefits to the network: for instance, by having more blocks after the blocks that do have transactions, those transactions are more secure).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.