<p>In your example, if block 99 actually did hash to the same exact value (infinitesimally unlikely), then there is nothing that distinguishes it from the actual block 99, so it would not be considered fake, and would not be propagated because it already exists in the <a href="https://en.bitcoin.it/wiki/Protocol_documentation#Inventory_Vectors" rel="nofollow noreferrer">inventory vector</a>. The property of the hashing functions used to create the block hash would prevent this because without the same exact data, it will not result in the same block hash. See <a href="https://en.wikipedia.org/wiki/Cryptographic_hash_function" rel="nofollow noreferrer">Digital Fingerprinting</a>.</p>

<p>The block hash is created by creating a hash of all of the transactions (using a merkle tree), and hashing that along with the other meta data in the block header. Changing a transaction (even just the order of the transactions) will change the merkle root, and thus change the block hash. See <a href="https://en.bitcoin.it/wiki/Block_hashing_algorithm" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Block_hashing_algorithm</a></p>

CC BY-SA 4.0
2019-08-22T14:00:29.477Z
The fact that it is infinitesimally unlikely, doesn't make it 100% unlikely to happen. If it happens, the blockchain will have two variations. How will wallets know which one is the correct in order to calculate balances?
evannemo
CC BY-SA 4.0
2019-08-22T14:08:35.920Z
the block would be ignored because another block with the same hash was already seen by the nodes. Updated my answer, see https://bitcoin.stackexchange.com/a/38385/60443
JBaczuk
CC BY-SA 4.0
2019-08-22T14:12:55.083Z
Just answer me this and you get the correct answer mark. If they have the same hash, how does the network know which one is the valid one? If the attacker runs a full node, he can make a copy of the blockchain which includes the spoofed #99 block. He can then make a website where others will download the blockchain copy and if the original block #99 and the spoofed #99 one have the same hashes, then the spoofed one will pass any validation checks if sent to other honest nodes. Am I wrong?
evannemo
CC BY-SA 4.0
2019-08-22T14:20:14.480Z
No, that is correct. As I mentioned, it is indistinguishable from the correct block unless that node has already seen a block with the same hash. But, as I mentioned, a SHA256 collision is basically impossible, and would not happen given billions and billions of years, so it is assumed that it will never happen.
JBaczuk
CC BY-SA 4.0
2019-08-22T13:56:02.363Z
2019-08-22T14:08:11.100Z
2019-08-22T14:08:11.100Z
JBaczuk
<p>I will describe my question using an example.</p>

<p>Let's say the network is working on adding block #100 to the blockchain. An attacker recreates block #99 with a combination of transactions that are "legit", meaning that they can be hashed to the same hash that the actual block #99 is using (and there is no double-spend).</p>

<p>Then, he broadcasts the block to the network. How does the network know that this block is fake and rejects it?</p>

<p>I think it has something to do with PoW, but I'm not 100% sure. Can someone explain to me the process of rejection with a detailed explanation?</p>

<p>Thanks in advance for any answers!</p>

<network><proof-of-work>
A question about Proof-of-Work(PoW)
evannemo
# A question about Proof-of-Work(PoW)

(Asked by: username_0 on 2019-08-22)

I will describe my question using an example.

Let's say the network is working on adding block #100 to the blockchain. An attacker recreates block #99 with a combination of transactions that are "legit", meaning that they can be hashed to the same hash that the actual block #99 is using (and there is no double-spend).

Then, he broadcasts the block to the network. How does the network know that this block is fake and rejects it?

I think it has something to do with PoW, but I'm not 100% sure. Can someone explain to me the process of rejection with a detailed explanation?

Thanks in advance for any answers!

**Tags:** network, proof-of-work


---

## 1 answers

### Answer by username_1 on 2019-08-22. Score: 0 | Accepted answer

In your example, if block 99 actually did hash to the same exact value (infinitesimally unlikely), then there is nothing that distinguishes it from the actual block 99, so it would not be considered fake, and would not be propagated because it already exists in the [inventory vector](https://en.bitcoin.it/wiki/Protocol_documentation#Inventory_Vectors). The property of the hashing functions used to create the block hash would prevent this because without the same exact data, it will not result in the same block hash. See [Digital Fingerprinting](https://en.wikipedia.org/wiki/Cryptographic_hash_function).

The block hash is created by creating a hash of all of the transactions (using a merkle tree), and hashing that along with the other meta data in the block header. Changing a transaction (even just the order of the transactions) will change the merkle root, and thus change the block hash. See <https://en.bitcoin.it/wiki/Block_hashing_algorithm>

> **Comments:**
> **username_0**: The fact that it is infinitesimally unlikely, doesn't make it 100% unlikely to happen. If it happens, the blockchain will have two variations. How will wallets know which one is the correct in order to calculate balances?  
> **username_1**: the block would be ignored because another block with the same hash was already seen by the nodes. Updated my answer, see https://bitcoin.stackexchange.com/a/38385/60443  
> **username_0**: Just answer me this and you get the correct answer mark. If they have the same hash, how does the network know which one is the valid one? If the attacker runs a full node, he can make a copy of the blockchain which includes the spoofed #99 block. He can then make a website where others will download the blockchain copy and if the original block #99 and the spoofed #99 one have the same hashes, then the spoofed one will pass any validation checks if sent to other honest nodes. Am I wrong?  
> **username_1**: No, that is correct. As I mentioned, it is indistinguishable from the correct block unless that node has already seen a block with the same hash. But, as I mentioned, a SHA256 collision is basically impossible, and would not happen given billions and billions of years, so it is assumed that it will never happen.  

---

