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

<blockquote>
  <p>"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."</p>
</blockquote>

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

CC BY-SA 4.0
2019-08-13T15:31:43.260Z
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.
Pieter Wuille
CC BY-SA 4.0
2019-08-14T00:23:33.013Z
@PieterWuille Thank you for the confirmation!
craigpastro
CC BY-SA 4.0
2019-08-17T12:00:51.490Z
@PieterWuille I assume the chain state does include a checksum as part of the consistency check, which would basically detect any accidental corruption?
Jannes
CC BY-SA 4.0
2019-08-17T14:54:11.420Z
@Jannes It's a LevelDB database, which has checksums internally.
Pieter Wuille
CC BY-SA 4.0
2018-11-15T05:16:27.073Z
2018-11-15T05:16:27.073Z
craigpastro
<p>I tried to search for answers to my questions, but didn't find any, but please forgive me if this is a duplicate question.</p>

<p>Suppose somehow <code>.bitcoin/chainstate</code> 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?</p>

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

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

<p>Thank you.</p>

<bitcoin-core><blockchain><utxo>
What happens to a node if .bitcoin/chainstate is corrupted?
craigpastro
# What happens to a node if .bitcoin/chainstate is corrupted?

(Asked by: username_0 on 2018-11-09)

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.

**Tags:** bitcoin-core, blockchain, utxo


---

## 1 answers

### Answer by username_0 on 2018-11-15. Score: 1 | Accepted answer

I found an answer by username_1 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.

> **Comments:**
> **username_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.  
> **username_0**: @PieterWuille Thank you for the confirmation!  
> **username_2**: @PieterWuille I assume the chain state does include a checksum as part of the consistency check, which would basically detect any accidental corruption?  
> **username_1**: @username_2 It's a LevelDB database, which has checksums internally.  

---

