0

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?

5
  • 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
    Nov 17 '19 at 18:47
  • 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. Nov 17 '19 at 20:01
  • 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
    Nov 17 '19 at 20:06
  • 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. Nov 17 '19 at 20:15
  • 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. Nov 20 '19 at 4:58