<p>The other answer seems to be out of date, even at the time it was answered. The following seems to be a more up to date explanation:
From <a href="https://bitcointalk.org/index.php?topic=141200.msg1504768#msg1504768" rel="nofollow">https://bitcointalk.org/index.php?topic=141200.msg1504768#msg1504768</a></p>

<ul>
<li>0: Validate all block headers + compare (by hash) to blocks on disk for the last -checkblocks blocks</li>
<li>1: In addition, verify (standalong) validity of those -checkblocks blocks</li>
<li>2: In addition, verify that undo data matches checksums</li>
<li>3: In addition, check that the current chainstate matches can reasonably be the result of the last N blocks, where N is limited by both -checkblocks and the amount of in-memory cache (-dbcache); typically it's around 150.</li>
<li>4: In addition, for the last N blocks (see above), do full validation (including signature checks).</li>
</ul>

<p>Note that the new default (3) is in fact a stronger check than the previous highest level (6).</p>

CC BY-SA 3.0
2016-02-22T04:32:06.167Z
2016-02-22T04:32:06.167Z
mmortal03
<p>Check comments in this commit 
<a href="https://gitorious.org/bitcoin/luke-jr-bitcoin/commit/4538e45c46d3829a21aed7685e6fbac7e8aafad3" rel="nofollow">https://gitorious.org/bitcoin/luke-jr-bitcoin/commit/4538e45c46d3829a21aed7685e6fbac7e8aafad3</a></p>

<pre><code>Add -checklevel and improve -checkblocks

-checkblocks now takes a numeric argument: the number of blocks that must be verified at the end of the chain. Default is 2500, and 0 means all blocks.

-checklevel specifies how thorough the verification must be:

    0: only check whether the block exists on disk
    1: verify block validity (default)
    2: verify transaction index validity
    3: check transaction hashes
    4: check whether spent txouts were spent within the main chain
    5: check whether all prevouts are marked spent
    6: check whether spent txouts were spent by a valid transaction that consumes them
</code></pre>

CC BY-SA 3.0
2014-05-24T19:16:16.420Z
2015-05-19T08:28:07.590Z
2015-05-19T08:28:07.590Z
Farghaly
<p>The standard bitcoin-qt/bitcoind client has an option <code>-checklevel</code> which purports to perform various checks on the block data stored on disk.  Is there current documentation (other than the source) describing specifically what is checked at the different levels?</p>

<p>The function <code>VerifyDB</code> in the source has brief comments describing the levels:</p>

<pre><code>// check level 0: read from disk
// check level 1: verify block validity
// check level 2: verify undo validity
// check level 3: check for inconsistencies during memory-only disconnect of tip blocks
</code></pre>

<p>It would be nice to see these explained in terms of the Bitcoin protocol.  For example, are block hashes verified?  Do we check that all the blocks in the chain correctly link back to one another?  Are transaction signatures verified?  Et cetera.</p>

<blockchain><bitcoind><bitcoin-core><verification>
What exactly is checked at various -checklevel's?
Nate Eldredge
# What exactly is checked at various -checklevel's?

(Asked by: username_0 on 2013-11-27)

The standard bitcoin-qt/bitcoind client has an option `-checklevel` which purports to perform various checks on the block data stored on disk. Is there current documentation (other than the source) describing specifically what is checked at the different levels?

The function `VerifyDB` in the source has brief comments describing the levels:

```
// check level 0: read from disk
// check level 1: verify block validity
// check level 2: verify undo validity
// check level 3: check for inconsistencies during memory-only disconnect of tip blocks

```

It would be nice to see these explained in terms of the Bitcoin protocol. For example, are block hashes verified? Do we check that all the blocks in the chain correctly link back to one another? Are transaction signatures verified? Et cetera.

**Tags:** blockchain, bitcoind, bitcoin-core, verification


---

## 2 answers

### Answer by username_1 on 2016-02-22. Score: 4

The other answer seems to be out of date, even at the time it was answered. The following seems to be a more up to date explanation:
From <https://bitcointalk.org/index.php?topic=141200.msg1504768#msg1504768>

* 0: Validate all block headers + compare (by hash) to blocks on disk for the last -checkblocks blocks
* 1: In addition, verify (standalong) validity of those -checkblocks blocks
* 2: In addition, verify that undo data matches checksums
* 3: In addition, check that the current chainstate matches can reasonably be the result of the last N blocks, where N is limited by both -checkblocks and the amount of in-memory cache (-dbcache); typically it's around 150.
* 4: In addition, for the last N blocks (see above), do full validation (including signature checks).

Note that the new default (3) is in fact a stronger check than the previous highest level (6).


---

### Answer by username_2 on 2014-05-24. Score: 3

Check comments in this commit
<https://gitorious.org/bitcoin/luke-jr-bitcoin/commit/4538e45c46d3829a21aed7685e6fbac7e8aafad3>

```
Add -checklevel and improve -checkblocks

-checkblocks now takes a numeric argument: the number of blocks that must be verified at the end of the chain. Default is 2500, and 0 means all blocks.

-checklevel specifies how thorough the verification must be:

    0: only check whether the block exists on disk
    1: verify block validity (default)
    2: verify transaction index validity
    3: check transaction hashes
    4: check whether spent txouts were spent within the main chain
    5: check whether all prevouts are marked spent
    6: check whether spent txouts were spent by a valid transaction that consumes them

```


---

