<p>When a new block is received by a node, it is validated. This validation includes verifying the validity of each individual transaction, constructing the merkle tree and the merkle root, verifying the merkle root against the block header, verifying the PoW in the block header, and finally verifying the hash itself.</p>

<p>After this validation is completed, the block is saved into the node's local chain database.</p>

<p>If you were to go and modify the stored data, it would have little effect - no other nodes will see your modified data, and all you will achieve is a broken local state if you run a <code>reindex</code> or <code>reindex-chainstate</code>.</p>

CC BY-SA 4.0
2019-08-30T21:21:19.513Z
Thanks for your answer, so, if this change go viral on many nodes (more than 51%) then wallet balances can be affected until a reindex its executed on all affected nodes? (i know that in bitcoin its almos imposible, but think in a private blockchain fork, that its my concern)
Gonzalo
CC BY-SA 4.0
2019-08-31T04:05:00.567Z
If the data is modified on any N nodes, it will not affect their wallets, as wallet txs are indexed and stored separately. If you modify the wallet data, future transactions might fail with invalid inputs, or result in absurd fees/change values, but would be pretty easy to catch for someone paying attention. As soon as a node realizes its data is bad, it will simply download the correct data again
Raghav Sood
CC BY-SA 4.0
2019-08-29T06:06:07.440Z
2019-08-29T06:06:07.440Z
Raghav Sood
<p>If i only manually change the data on the block without touching/modifing the already calculated hash, then hash on the block its still valid because its already saved and was not touched ... so,  </p>

<p>When the blockchain revalidate the hash with the content of the block? ... </p>

<p>In every paper that i read i see that all the security and inmutability of the blockchain its based on the already calculated hash, so, its like its easy to change data without touching hash so block still be valid in all the merkle tree and chain... how this modification its protected?</p>

<blockchain><hash>
When changing transaction data in a block change the hash of previous block?
Gonzalo
# When changing transaction data in a block change the hash of previous block?

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

If i only manually change the data on the block without touching/modifing the already calculated hash, then hash on the block its still valid because its already saved and was not touched ... so,

When the blockchain revalidate the hash with the content of the block? ...

In every paper that i read i see that all the security and inmutability of the blockchain its based on the already calculated hash, so, its like its easy to change data without touching hash so block still be valid in all the merkle tree and chain... how this modification its protected?

**Tags:** blockchain, hash


---

## 1 answers

### Answer by username_1 on 2019-08-29. Score: 1 | Accepted answer

When a new block is received by a node, it is validated. This validation includes verifying the validity of each individual transaction, constructing the merkle tree and the merkle root, verifying the merkle root against the block header, verifying the PoW in the block header, and finally verifying the hash itself.

After this validation is completed, the block is saved into the node's local chain database.

If you were to go and modify the stored data, it would have little effect - no other nodes will see your modified data, and all you will achieve is a broken local state if you run a `reindex` or `reindex-chainstate`.

> **Comments:**
> **username_0**: Thanks for your answer, so, if this change go viral on many nodes (more than 51%) then wallet balances can be affected until a reindex its executed on all affected nodes? (i know that in bitcoin its almos imposible, but think in a private blockchain fork, that its my concern)  
> **username_1**: If the data is modified on any N nodes, it will not affect their wallets, as wallet txs are indexed and stored separately. If you modify the wallet data, future transactions might fail with invalid inputs, or result in absurd fees/change values, but would be pretty easy to catch for someone paying attention. As soon as a node realizes its data is bad, it will simply download the correct data again  

---

