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?

Denis Leonov
  • 945
  • 12
  • 28

1 Answers1

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.

Ava Chow
  • 70,382
  • 5
  • 81
  • 161