<p>Yes, Bitcoin Core can and will change the blk*.dat files, which, as has been told to you many times before, can be different for all nodes. Once Bitcoin Core has validated a block, it updates its chainstate database so that it knows what its current blockchain tip is. It also updates that database with the most recent UTXO set. So once this is done, the block can be thrown away as we have now recorded that we validated it. This is what pruning does; it throws away old blocks that we have already validated. Having the correct chainstate (UTXO set and blockchain tip) is all that matters.</p>

CC BY-SA 3.0
2017-08-30T13:51:49.817Z
However, if pruning is not enabled, then AFAIK the most recent blk*.dat file is only appended to, and the older files are never changed at all.  Is that correct?
Nate Eldredge
CC BY-SA 3.0
2017-08-30T13:52:48.617Z
Yes. The files are append only.
Ava Chow
CC BY-SA 3.0
2017-08-30T14:42:56.987Z
@NateEldredge how to enable or disable `prunning`?
Denis Leonov
CC BY-SA 3.0
2017-08-30T16:06:02.610Z
@Denis: It's disabled by default; see https://bitcoin.stackexchange.com/questions/37496/how-can-i-run-bitcoind-in-pruning-mode for how to enable it.
Nate Eldredge
CC BY-SA 4.0
2018-06-05T04:16:57.923Z
Bitcoin Core can change on-disk database. Malware? If need, I can prove it. Guys, don't be so homely. Answer to me.
Denis Leonov
CC BY-SA 4.0
2018-06-05T04:24:30.907Z
I mean HISTORICAL DATA!!!
Denis Leonov
CC BY-SA 4.0
2018-06-05T04:32:54.283Z
Bitcoin Core CAN change on-disk data. All that is stored in \Bitcoin\ directory! Wallet.dat there's too. Think about this! My log make clear the fog.
Denis Leonov
CC BY-SA 4.0
2018-06-05T04:33:47.523Z
Bitcoin Core creates those files and uses them in its normal operation. Of course it can change those files! It isn't malware, its whole job is to modify those files, where do you think they come from?
Ava Chow
CC BY-SA 4.0
2018-06-05T04:36:34.020Z
@AndrewChow those files has historical data. I want to save em and when we invest in BTC, we must know that HISTORY has no way to been modified. That what i mean!
Denis Leonov
CC BY-SA 4.0
2018-06-05T06:20:34.333Z
You told that the history is impermanent.
Denis Leonov
CC BY-SA 3.0
2017-08-30T13:49:02.207Z
2017-08-30T13:49:02.207Z
Ava Chow
<p>It is known that historical database of all bitcoin transactions stored in blk*.dat files. Is it possible for bitcoin-core to change any of this files in any time? Or this database is equal for all bitcoin peers (may be except the last few files)?</p>

<p>I think this files consist non-changable historical data for blockchain. Is it true?</p>

<blockchain><bitcoin-core>
Can bitcoin history be changed?
Denis Leonov
# Can bitcoin history be changed?

(Asked by: username_0 on 2017-08-30)

It is known that historical database of all bitcoin transactions stored in blk\*.dat files. Is it possible for bitcoin-core to change any of this files in any time? Or this database is equal for all bitcoin peers (may be except the last few files)?

I think this files consist non-changable historical data for blockchain. Is it true?

**Tags:** blockchain, bitcoin-core


---

## 1 answers

### Answer by username_1 on 2017-08-30. Score: 2 | Accepted answer

Yes, Bitcoin Core can and will change the blk\*.dat files, which, as has been told to you many times before, can be different for all nodes. Once Bitcoin Core has validated a block, it updates its chainstate database so that it knows what its current blockchain tip is. It also updates that database with the most recent UTXO set. So once this is done, the block can be thrown away as we have now recorded that we validated it. This is what pruning does; it throws away old blocks that we have already validated. Having the correct chainstate (UTXO set and blockchain tip) is all that matters.

> **Comments:**
> **username_2**: However, if pruning is not enabled, then AFAIK the most recent blk*.dat file is only appended to, and the older files are never changed at all.  Is that correct?  
> **username_1**: Yes. The files are append only.  
> **username_0**: @NateEldredge how to enable or disable `prunning`?  
> **username_2**: @Denis: It's disabled by default; see https://bitcoin.stackexchange.com/questions/37496/how-can-i-run-bitcoind-in-pruning-mode for how to enable it.  
> **username_0**: Bitcoin Core can change on-disk database. Malware? If need, I can prove it. Guys, don't be so homely. Answer to me.  
> **username_0**: I mean HISTORICAL DATA!!!  
> **username_0**: Bitcoin Core CAN change on-disk data. All that is stored in \Bitcoin\ directory! Wallet.dat there's too. Think about this! My log make clear the fog.  
> **username_1**: Bitcoin Core creates those files and uses them in its normal operation. Of course it can change those files! It isn't malware, its whole job is to modify those files, where do you think they come from?  
> **username_0**: @AndrewChow those files has historical data. I want to save em and when we invest in BTC, we must know that HISTORY has no way to been modified. That what i mean!  
> **username_0**: You told that the history is impermanent.  

---

