2

I tried to search for answers to my questions, but didn't find any, but please forgive me if this is a duplicate question.

Suppose somehow .bitcoin/chainstate gets corrupted, e.g., a UTXO is deleted. I suppose that this node will then try to reject any blocks that contains a transaction that tries to use the deleted UTXO?

Or will the node somehow detect that its chainstate has been corrupted, and rescan the blockchain? If this is the case, how would the node detect this?

Finally, suppose all of the node's chainstate was corrupted in exactly the same way, a UTXO was deleted. Then is this UTXO effectively gone, even though it remains in the blockchain.

Thank you.

1 Answer 1

1

I found an answer by Pieter Wuille to another question that seems to be relevant here. The relevant part states:

"Please don't go download a chainstate from a random place on the Internet though. They can introduce arbitrarily many coins assigned to themselves, and your client would accept them. If many people started running nodes using the same chainstate 'copy' such transactions could even get into blocks, and cause forks in the best case, and theft in the worst case."

So, this seems to indicate that a node will simply not realize that its chainstate is modified.

4
  • 1
    That's correct. A consistency check is done at startup comparing the UTXO with the last few blocks, but if the corruption occurs in a UTXO that was not touched by those blocks, you're out of luck. Aug 13, 2019 at 15:31
  • @PieterWuille Thank you for the confirmation! Aug 14, 2019 at 0:23
  • @PieterWuille I assume the chain state does include a checksum as part of the consistency check, which would basically detect any accidental corruption?
    – Jannes
    Aug 17, 2019 at 12:00
  • 1
    @Jannes It's a LevelDB database, which has checksums internally. Aug 17, 2019 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.