<p>Here is what I understand, the step to PoW are:</p>

<p>step 1:Miner select some transactions from its mempool.</p>

<p>step 2:Miner tries to create a block and then broadcasts it if successful.</p>

<p>step 3:Other miners check if the hash of the block with the nonce results in the required hash of the block sent from the previous miner.</p>

<p>step 4:Once other miners verify it is added to the block chain.</p>

<p>What if the miner add a false transaction to a block and then create a nonce for that block. I know that it will be ignored and detected as spam. But how will other miners know that the particular block has an invalid transaction, since other miners only verify the nonce and the hash?</p>

CC BY-SA 4.0
2019-11-17T18:47:27.883Z
Ok I understand that other full nodes will ignore it as spam if it has an invalid transaction, but my question is how will they know in the first place that the block has a false transaction?
A-ar
CC BY-SA 4.0
2019-11-17T20:01:30.503Z
Full nodes verify all transactions and all blocks. If a block contains an invalid transaction, that block is undeniably invalid, and will be ignored by full nodes.
Pieter Wuille
CC BY-SA 4.0
2019-11-17T20:06:12.750Z
So validation of a transaction occurs twice? Once before it is added to the mempool, and again when it is validated in a block?
A-ar
CC BY-SA 4.0
2019-11-17T20:15:53.520Z
Yes, though modern full node implementations do cache the results to avoid redoing work. It's also possible for blocks to contain transactions that were never seen in the mempool.
Pieter Wuille
CC BY-SA 4.0
2019-11-20T04:58:46.843Z
It would be impossible for anyone to add it to the blockchain since it is invalid. An invalid block cannot be added to a blockchain because the rules don't define what an invalid block means or does, only what valid ones do.
David Schwartz
<mining-theory><proof-of-work>
what prevents a miner from adding a false transaction to a block and then adding it to the block chain in PoW?
A-ar
# what prevents a miner from adding a false transaction to a block and then adding it to the block chain in PoW?

(Asked by: username_0 on 2019-11-17)

Here is what I understand, the step to PoW are:

step 1:Miner select some transactions from its mempool.

step 2:Miner tries to create a block and then broadcasts it if successful.

step 3:Other miners check if the hash of the block with the nonce results in the required hash of the block sent from the previous miner.

step 4:Once other miners verify it is added to the block chain.

What if the miner add a false transaction to a block and then create a nonce for that block. I know that it will be ignored and detected as spam. But how will other miners know that the particular block has an invalid transaction, since other miners only verify the nonce and the hash?

**Tags:** mining-theory, proof-of-work

> **Comments:**
> **username_0**: Ok I understand that other full nodes will ignore it as spam if it has an invalid transaction, but my question is how will they know in the first place that the block has a false transaction?  
> **username_1**: Full nodes verify all transactions and all blocks. If a block contains an invalid transaction, that block is undeniably invalid, and will be ignored by full nodes.  
> **username_0**: So validation of a transaction occurs twice? Once before it is added to the mempool, and again when it is validated in a block?  
> **username_1**: Yes, though modern full node implementations do cache the results to avoid redoing work. It's also possible for blocks to contain transactions that were never seen in the mempool.  
> **username_2**: It would be impossible for anyone to add it to the blockchain since it is invalid. An invalid block cannot be added to a blockchain because the rules don't define what an invalid block means or does, only what valid ones do.  

---

## 0 answers

