<p>A blockchain is not intrinsically immutable. What prevents malicious people propagating altered data in the blockchain is that all nodes validate received blocks. </p>

<p>In particular they check the checksums and they check the signatures match the public keys. They check the references (hashes of prior blocks) and they examine the length of competing branches to decide which blocks to trust.</p>

<p>The integrity depends on there being a large number of nodes with no central trusted authority and with no one person or organisation controlling a majority of the computing power.</p>

<p>If you only have a handful of nodes, the blockchain may not be inherently trustworthy.</p>

CC BY-SA 4.0
2018-08-23T10:10:41.627Z
so to validate if changes happend i have to iteratete through each block inside blockchain and calculate hash again?
CreatingDED
CC BY-SA 4.0
2018-08-23T10:12:45.300Z
@CreatingDED: Essentially yes. You can cache stuff locally and securely for later reuse.
RedGrittyBrick
CC BY-SA 4.0
2018-08-24T23:23:54.087Z
@CreatingDED That is not the only way to do it, but that is one way to do it. You want, somehow, to arrange it such that every machine relying on the data to be immutable verifies that every proposed change to the data is permitted by the system's rules such that no honest node that correctly executes the system's rules itself can ever be tricked into accepting data that is not valid according to the system's rules.
David Schwartz
CC BY-SA 4.0
2018-08-23T09:32:58.013Z
2018-08-23T09:32:58.013Z
RedGrittyBrick
<p>I want to do simple blockchain implementation on golang, i have mongodb database with user info (Name, cardID, etc.) i want to store several information inside blockchain, and to put it inside another database BoltDB. But idk how to make this data immutable I mean how to make changes visible, for example I insert one user with (Name: Jhon, CardId: '777845') inside blockchain and after some time another guy will change this User's fileds (Name: 'Jhon', CardId: '1111'), and inside my blockchain it still will be (Name: Jhon, CardId: '777845') </p>

CC BY-SA 4.0
2018-08-23T06:59:58.480Z
A blockchain's data is immutable by definition. What are you trying to do that's not working?
Raghav Sood
CC BY-SA 4.0
2018-08-23T07:10:02.083Z
I have one database (MongoDb) from that db I am fetching New coming users, and store it 'in a blockchain' another DB (BoltDb) -> i did it exactly like here https://github.com/Jeiwan/blockchain_go, my issue is it possible to check for changes in mongodb. if  someone will change data inside MongoDb, but i have already stored this data inside my second db, i want to see what have changed
CreatingDED
CC BY-SA 4.0
2018-08-23T07:17:16.527Z
A blockchain has nothing to do with mongodb. As long as your data is in the chain, it is not possible to retroactively edit it. You can add new blocks with other data, but the existing blocks are immutable. You should be able to compare the data in existing blocks with the data in your mongodb to check if it has changed
Raghav Sood
<bitcoin-core><blockchain>
How to make data inside blockchain immutable
CreatingDED
# How to make data inside blockchain immutable

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

I want to do simple blockchain implementation on golang, i have mongodb database with user info (Name, cardID, etc.) i want to store several information inside blockchain, and to put it inside another database BoltDB. But idk how to make this data immutable I mean how to make changes visible, for example I insert one user with (Name: Jhon, CardId: '777845') inside blockchain and after some time another guy will change this User's fileds (Name: 'Jhon', CardId: '1111'), and inside my blockchain it still will be (Name: Jhon, CardId: '777845')

**Tags:** bitcoin-core, blockchain

> **Comments:**
> **username_1**: A blockchain's data is immutable by definition. What are you trying to do that's not working?  
> **username_0**: I have one database (MongoDb) from that db I am fetching New coming users, and store it 'in a blockchain' another DB (BoltDb) -> i did it exactly like here https://github.com/Jeiwan/blockchain_go, my issue is it possible to check for changes in mongodb. if  someone will change data inside MongoDb, but i have already stored this data inside my second db, i want to see what have changed  
> **username_1**: A blockchain has nothing to do with mongodb. As long as your data is in the chain, it is not possible to retroactively edit it. You can add new blocks with other data, but the existing blocks are immutable. You should be able to compare the data in existing blocks with the data in your mongodb to check if it has changed  

---

## 1 answers

### Answer by username_2 on 2018-08-23. Score: 0 | Accepted answer

A blockchain is not intrinsically immutable. What prevents malicious people propagating altered data in the blockchain is that all nodes validate received blocks.

In particular they check the checksums and they check the signatures match the public keys. They check the references (hashes of prior blocks) and they examine the length of competing branches to decide which blocks to trust.

The integrity depends on there being a large number of nodes with no central trusted authority and with no one person or organisation controlling a majority of the computing power.

If you only have a handful of nodes, the blockchain may not be inherently trustworthy.

> **Comments:**
> **username_0**: so to validate if changes happend i have to iteratete through each block inside blockchain and calculate hash again?  
> **username_2**: @username_0: Essentially yes. You can cache stuff locally and securely for later reuse.  
> **username_3**: @username_0 That is not the only way to do it, but that is one way to do it. You want, somehow, to arrange it such that every machine relying on the data to be immutable verifies that every proposed change to the data is permitted by the system's rules such that no honest node that correctly executes the system's rules itself can ever be tricked into accepting data that is not valid according to the system's rules.  

---

