<blockquote>
  <p>My question is, what if a node decides to change transaction data in a
  block and goes throught the process of calulating nonce and then
  finding hash and adding this block to chain. Other node will see that
  this node has correctly solved the puzzle and should allow the newly
  created chain. Right?</p>
</blockquote>

<p>No. Unless you mean changing the order of, or which transactions are included. Any unauthorized modifications to the transaction data itself will invalidate the digital signature. Any blocks with invalid transactions will be rejected by the bitcoin-core software that runs on the nodes on the network. Any work done (for PoW) is therefore wasted if the transactions are tampered with. Also, nodes don't typically mine anymore, it's the miners that do the proof-of-work, and then submit the work to the node for validation. This includes validating all of the transactions along with the proof of work.</p>

<blockquote>
  <p>I understand that miner's role is to validate the block of
  transactions by calculating nonce based on difficulty level and
  finding hash of {block + nonce + hash of previous block} .</p>
</blockquote>

<p>The miners role is not to validate the block of transactions (though it might choose to in order to prevent wasting resources), it is the role of the node. Also, proof of work is done by hashing the block header, which includes: <code>version, previous block hash, merkle root, unix epoch time, difficulty target (bits), and nonce</code>, see <a href="https://en.bitcoin.it/wiki/Block_hashing_algorithm" rel="nofollow noreferrer">Bitcoin Mining Algorithm</a>.</p>

CC BY-SA 4.0
2018-08-02T19:57:02.370Z
2018-08-04T17:14:39.113Z
2018-08-04T17:14:39.113Z
JBaczuk
<blockquote>
  <p>I understand that miner's role is to validate the block of transactions by calculating nonce based on difficulty level and finding hash of {block + nonce + hash of previous block} .</p>
</blockquote>

<p>More accurately: the miner's role is to <em>confirm</em> the block of transactions. Each and every node (and miner) will independently verify the validity of all transactions and blocks. 'Validation' is not just the job of a miner. As mentioned by JBaczuk, the POW blockhash is actually computed on <code>version, previous block hash, merkle root, unix epoch time, difficulty target (bits), and nonce</code>.</p>

<blockquote>
  <p>My question is, what if a node decides to change transaction data in a block and goes throught the process of calulating nonce and then finding hash and adding this block to chain. Other node will see that this node has correctly solved the puzzle and should allow the newly created chain. Right?</p>
</blockquote>

<p>Not quite. Once a transaction is confirmed in a block, any new subsequent block that spends the same UTXO will be invalid (since that UTXO was already spent).</p>

<p>If the miner attempts to re-mine that original block (ie. a new block with the altered transaction, at the same blockheight), this will likely fail and be a waste of their resources. Even if they do find a valid block, the rest of the network will already know about the first version of that block, and the other miners will be working on the next block already (or they will have already found it). So even if your altered block is valid, the network will still ignore it since the network has already accepted a longest (most work) chain, that does not include your block. </p>

<blockquote>
  <p>I don't know and it is not written anywhere that at the point when a node broadcasts that it has solved the puzzle and found hash of tampered transactions, is it the case that the other node has also solved the puzzle and hopefully with the untampered transactions? </p>
</blockquote>

<p>Transactions generally can't be meaningfully 'tampered with'. <a href="https://bitcoin.stackexchange.com/questions/52962/does-segwit-mean-easier-government-monitoring">Transaction malleability</a> is an edge case that could be considered, but otherwise changing the contents of a transaction will make it invalid. When a node verifies the validity of a block, it would catch any invalid transactions, and thus drop the block for being invalid.</p>

<p>Other ways you could change a block's transaction content would include adding or removing certain transactions from the block, changing the ordering of the transaction in the block, or substituting one transaction for another (that spends the same UTXO, see <em>double spend attacks</em>).</p>

<hr>

<p>In short: Since the miners are always incentivized to mine at the chain tip, having a miner work on re-mining an old block to introduce an 'altered' block in some way ultimately doesn't really matter to the rest of the network participants. The network just ignores the altered block, meaning the net outcome is that the miner that made the altered block just wasted their resources.</p>

CC BY-SA 4.0
2018-08-02T22:52:48.590Z
2018-08-02T22:52:48.590Z
chytrik
<p>I understand that miner's role is to validate the block of transactions by calculating nonce based on difficulty level and finding hash of {block + nonce + hash of previous block} .<br>
Then it adds this block in the ledger and broadcasts to all nodes that it has solved the puzzle. Other nodes verify it and allow the that new chain in which block is added.  </p>

<p>My question is, what if a node decides to change transaction data in a block and goes throught the process of calulating nonce and then finding hash and adding this block to chain. Other node will see that this node has correctly solved the puzzle and should allow the newly created chain. Right?  </p>

<p>I don't know and it is not written anywhere that at the point when a node broadcasts that it has solved the puzzle and found hash of tampered transactions, is it the case that the other node has also solved the puzzle and hopefully with the untampered transactions? Because won't it be waster of resources to solve the same puzzle twice? And if other nodes do not solve the puzzle for the second time, how are they able to decide that the malicious node has solved the puzzle with the tampered transaction?</p>

<bitcoin-core><miner-configuration><nodes>
Problem in understanding other miners validating puzzle solving miner's claim
AkshayM
# Problem in understanding other miners validating puzzle solving miner's claim

(Asked by: username_0 on 2018-08-02)

I understand that miner's role is to validate the block of transactions by calculating nonce based on difficulty level and finding hash of {block + nonce + hash of previous block} .  
Then it adds this block in the ledger and broadcasts to all nodes that it has solved the puzzle. Other nodes verify it and allow the that new chain in which block is added.

My question is, what if a node decides to change transaction data in a block and goes throught the process of calulating nonce and then finding hash and adding this block to chain. Other node will see that this node has correctly solved the puzzle and should allow the newly created chain. Right?

I don't know and it is not written anywhere that at the point when a node broadcasts that it has solved the puzzle and found hash of tampered transactions, is it the case that the other node has also solved the puzzle and hopefully with the untampered transactions? Because won't it be waster of resources to solve the same puzzle twice? And if other nodes do not solve the puzzle for the second time, how are they able to decide that the malicious node has solved the puzzle with the tampered transaction?

**Tags:** bitcoin-core, miner-configuration, nodes


---

## 2 answers

### Answer by username_1 on 2018-08-02. Score: 0 | Accepted answer

> My question is, what if a node decides to change transaction data in a
> block and goes throught the process of calulating nonce and then
> finding hash and adding this block to chain. Other node will see that
> this node has correctly solved the puzzle and should allow the newly
> created chain. Right?

No. Unless you mean changing the order of, or which transactions are included. Any unauthorized modifications to the transaction data itself will invalidate the digital signature. Any blocks with invalid transactions will be rejected by the bitcoin-core software that runs on the nodes on the network. Any work done (for PoW) is therefore wasted if the transactions are tampered with. Also, nodes don't typically mine anymore, it's the miners that do the proof-of-work, and then submit the work to the node for validation. This includes validating all of the transactions along with the proof of work.

> I understand that miner's role is to validate the block of
> transactions by calculating nonce based on difficulty level and
> finding hash of {block + nonce + hash of previous block} .

The miners role is not to validate the block of transactions (though it might choose to in order to prevent wasting resources), it is the role of the node. Also, proof of work is done by hashing the block header, which includes: `version, previous block hash, merkle root, unix epoch time, difficulty target (bits), and nonce`, see [Bitcoin Mining Algorithm](https://en.bitcoin.it/wiki/Block_hashing_algorithm).


---

### Answer by username_2 on 2018-08-02. Score: 1

> I understand that miner's role is to validate the block of transactions by calculating nonce based on difficulty level and finding hash of {block + nonce + hash of previous block} .

More accurately: the miner's role is to *confirm* the block of transactions. Each and every node (and miner) will independently verify the validity of all transactions and blocks. 'Validation' is not just the job of a miner. As mentioned by username_1, the POW blockhash is actually computed on `version, previous block hash, merkle root, unix epoch time, difficulty target (bits), and nonce`.

> My question is, what if a node decides to change transaction data in a block and goes throught the process of calulating nonce and then finding hash and adding this block to chain. Other node will see that this node has correctly solved the puzzle and should allow the newly created chain. Right?

Not quite. Once a transaction is confirmed in a block, any new subsequent block that spends the same UTXO will be invalid (since that UTXO was already spent).

If the miner attempts to re-mine that original block (ie. a new block with the altered transaction, at the same blockheight), this will likely fail and be a waste of their resources. Even if they do find a valid block, the rest of the network will already know about the first version of that block, and the other miners will be working on the next block already (or they will have already found it). So even if your altered block is valid, the network will still ignore it since the network has already accepted a longest (most work) chain, that does not include your block.

> I don't know and it is not written anywhere that at the point when a node broadcasts that it has solved the puzzle and found hash of tampered transactions, is it the case that the other node has also solved the puzzle and hopefully with the untampered transactions?

Transactions generally can't be meaningfully 'tampered with'. [Transaction malleability](https://bitcoin.stackexchange.com/questions/52962/does-segwit-mean-easier-government-monitoring) is an edge case that could be considered, but otherwise changing the contents of a transaction will make it invalid. When a node verifies the validity of a block, it would catch any invalid transactions, and thus drop the block for being invalid.

Other ways you could change a block's transaction content would include adding or removing certain transactions from the block, changing the ordering of the transaction in the block, or substituting one transaction for another (that spends the same UTXO, see *double spend attacks*).

---

In short: Since the miners are always incentivized to mine at the chain tip, having a miner work on re-mining an old block to introduce an 'altered' block in some way ultimately doesn't really matter to the rest of the network participants. The network just ignores the altered block, meaning the net outcome is that the miner that made the altered block just wasted their resources.


---

