<p>A block with an invalid transaction is an invalid block, regardless of the proof of work.</p>

<p>When it is broadcast, other full nodes will ignore it as spam, and typically disconnect from the node that sent it.  A bad block is unlikely to propagate very far on the network.</p>

<p>When other miners see it, they will also ignore it.  If they mine on top of it, they will be wasting their hashing power.  This also means that the miner who did the proof of work on the invalid block has wasted their own hashing power.  This is why it's important that miners validate the transactions they include in blocks.</p>

CC BY-SA 4.0
2018-07-13T03:42:30.153Z
if a block with any invalid transaction will be considered as an invalid block, can we say that whenever a peer commits a block into the ledger, this block is guaranteed to be a valid block?
Qi Zhang
CC BY-SA 4.0
2018-07-13T15:25:06.723Z
I would agree that's a correct a statement, just so long as you understand that "the ledger" is an agreed upon version.  There can be ledgers that barely anyone agrees are the correct one.  It's probably more accurate to say that any block that miners are mining on top of is considered valid by those miners.
Jestin
CC BY-SA 3.0
2017-07-06T19:45:03.137Z
2017-07-06T19:45:03.137Z
Jestin
<p>What happens if a miner (accidentally or maliciously) publishes a block with correct proof of works, which contains an invalid transaction (e.g., a double spending one)? Is the block ignored by the network?</p>

<transactions><blockchain>
What happens if a miner publishes a block which contains an invalid transaction?
Tail of Godzilla
# What happens if a miner publishes a block which contains an invalid transaction?

(Asked by: username_0 on 2017-07-06)

What happens if a miner (accidentally or maliciously) publishes a block with correct proof of works, which contains an invalid transaction (e.g., a double spending one)? Is the block ignored by the network?

**Tags:** transactions, blockchain


---

## 1 answers

### Answer by username_1 on 2017-07-06. Score: 4 | Accepted answer

A block with an invalid transaction is an invalid block, regardless of the proof of work.

When it is broadcast, other full nodes will ignore it as spam, and typically disconnect from the node that sent it. A bad block is unlikely to propagate very far on the network.

When other miners see it, they will also ignore it. If they mine on top of it, they will be wasting their hashing power. This also means that the miner who did the proof of work on the invalid block has wasted their own hashing power. This is why it's important that miners validate the transactions they include in blocks.

> **Comments:**
> **username_2**: if a block with any invalid transaction will be considered as an invalid block, can we say that whenever a peer commits a block into the ledger, this block is guaranteed to be a valid block?  
> **username_1**: I would agree that's a correct a statement, just so long as you understand that "the ledger" is an agreed upon version.  There can be ledgers that barely anyone agrees are the correct one.  It's probably more accurate to say that any block that miners are mining on top of is considered valid by those miners.  

---

