<p>You would be wasting your energy, because the network will simply ignore your blocks.</p>

<p>The rule in Bitcoin is that the best(*) <em>valid</em> chain is to be accepted by nodes in the network. If you add a block that contains an invalid transaction, nodes will discard your block (and any potential successors built on top of that block, even if those contain only valid transactions).</p>

<p>(*) best is defined as maximal sum of difficulties across all blocks in the chain. In case of ties, the first-received tip is used to pick a winner.</p>

CC BY-SA 4.0
2020-03-31T19:28:03.863Z
2020-03-31T19:28:03.863Z
Pieter Wuille
<p>Sorry, if the question may seem trivial but it is bothering me for a while now. I understood how the proof of concept works when one tries to change an old block. But how that will work for the case of the latest block?</p>

<p>For example, say I am an attacker who continuously mines blocks. Every time when I get a request for a new block, I will add a fraudulent transaction to it even before trying to find the hash. And I do that every time I get a request for a new block. If I was not able to successfully find a new block before someone it's okay, I will just discard my current work on the fraudulent block, will accept the honest block and again will repeat the same with the new block.</p>

<p>After a while, I ought to be lucky and my fraudulent block will be the first one that is published into the network. When that happens my block will be part of the honest chain and there will be no way to find out about this. </p>

<p>How Blockchain prevents this kind of attack?    </p>

<mining-theory><protocol><proof-of-work>
How proof of work works in Blockchain?
samarendra chandan bindu Dash
# How proof of work works in Blockchain?

(Asked by: username_0 on 2020-03-31)

Sorry, if the question may seem trivial but it is bothering me for a while now. I understood how the proof of concept works when one tries to change an old block. But how that will work for the case of the latest block?

For example, say I am an attacker who continuously mines blocks. Every time when I get a request for a new block, I will add a fraudulent transaction to it even before trying to find the hash. And I do that every time I get a request for a new block. If I was not able to successfully find a new block before someone it's okay, I will just discard my current work on the fraudulent block, will accept the honest block and again will repeat the same with the new block.

After a while, I ought to be lucky and my fraudulent block will be the first one that is published into the network. When that happens my block will be part of the honest chain and there will be no way to find out about this.

How Blockchain prevents this kind of attack?

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


---

## 1 answers

### Answer by username_1 on 2020-03-31. Score: 3 | Accepted answer

You would be wasting your energy, because the network will simply ignore your blocks.

The rule in Bitcoin is that the best(\*) *valid* chain is to be accepted by nodes in the network. If you add a block that contains an invalid transaction, nodes will discard your block (and any potential successors built on top of that block, even if those contain only valid transactions).

(\*) best is defined as maximal sum of difficulties across all blocks in the chain. In case of ties, the first-received tip is used to pick a winner.


---

