<p>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.</p>

CC BY-SA 4.0
2020-01-17T19:58:05.873Z
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...
Vaibhav Chopra
CC BY-SA 4.0
2020-01-17T20:04:40.007Z
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
CC BY-SA 4.0
2020-01-17T19:52:52.233Z
2020-01-17T19:52:52.233Z
Mark H
<p>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. </p>

<p>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). </p>

<p>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).</p>

<blockquote>
  <p>This way miners could make bitcoins for themselves out of thin air. </p>
</blockquote>

<p>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).</p>

CC BY-SA 4.0
2020-01-18T20:08:25.697Z
2020-01-18T20:08:25.697Z
Acccumulation
<p>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.</p>

<p>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.</p>

CC BY-SA 4.0
2020-01-18T13:03:06.823Z
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
CC BY-SA 4.0
2020-01-18T15:17:49.083Z
@TOOGAM Yes, that is possible. And Bitcoin is a libertarian free market. Anything that is possible is recommended, including cheating :)
Criticize SE actions means ban
CC BY-SA 4.0
2020-01-18T21:42:59.273Z
@TOOGAM block withholding is known as a ‘Finney attack’
chytrik
CC BY-SA 4.0
2020-01-18T22:14:51.647Z
@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
CC BY-SA 4.0
2020-01-18T22:15:32.660Z
Toogam is here more talking about a selfish-mining strategy.
Murch
CC BY-SA 4.0
2020-01-18T23:24:23.010Z
@Murch ah whoops, I didn't realize the specificity of the Finney attack involving a double spend as well, makes sense though. Thanks for clarifying!
chytrik
CC BY-SA 4.0
2020-01-17T20:03:53.810Z
2020-01-19T00:37:15.117Z
2020-01-19T00:37:15.117Z
Murch
<p>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. </p>

<p>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?</p>

CC BY-SA 4.0
2020-01-18T00:37:36.730Z
Even if they could, why would it matter? He's entitled to the block reward for finding a block of the appropriate difficulty.
David Schwartz
<blockchain><nonce><block-validity>
Can a miner just introduce a block full of valid predetermined transactions in the blockchain and get rewarded?
Vaibhav Chopra
# Can a miner just introduce a block full of valid predetermined transactions in the blockchain and get rewarded?

(Asked by: username_0 on 2020-01-17)

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?

**Tags:** blockchain, nonce, block-validity

> **Comments:**
> **username_1**: Even if they could, why would it matter? He's entitled to the block reward for finding a block of the appropriate difficulty.  

---

## 3 answers

### Answer by username_4 on 2020-01-17. Score: 13 | Accepted answer

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.

> **Comments:**
> **username_5**: 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.)  
> **username_6**: @username_5 Yes, that is possible. And Bitcoin is a libertarian free market. Anything that is possible is recommended, including cheating :)  
> **username_7**: @username_5 block withholding is known as a ‘Finney attack’  
> **username_4**: @username_7: 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.  
> **username_4**: username_5 is here more talking about a selfish-mining strategy.  
> **username_7**: @username_4 ah whoops, I didn't realize the specificity of the Finney attack involving a double spend as well, makes sense though. Thanks for clarifying!  

---

### Answer by username_2 on 2020-01-17. Score: 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.

> **Comments:**
> **username_0**: 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...  
> **username_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.  

---

### Answer by username_3 on 2020-01-18. Score: 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).


---

