Can bitcoin history be changed?

0

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?

D L

Posted 2017-08-30T13:15:14.483

Reputation: 478

Answers

2

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.

Andrew Chow

Posted 2017-08-30T13:15:14.483

Reputation: 40 910

1However, 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 2017-08-30T13:51:49.817

Yes. The files are append only.Andrew Chow 2017-08-30T13:52:48.617

@NateEldredge how to enable or disable prunning?D L 2017-08-30T14:42:56.987

@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 2017-08-30T16:06:02.610

Bitcoin Core can change on-disk database. Malware? If need, I can prove it. Guys, don't be so homely. Answer to me.D L 2018-06-05T04:16:57.923

I mean HISTORICAL DATA!!!D L 2018-06-05T04:24:30.907

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.D L 2018-06-05T04:32:54.283

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?Andrew Chow 2018-06-05T04:33:47.523

@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!D L 2018-06-05T04:36:34.020

You told that the history is impermanent.D L 2018-06-05T06:20:34.333