<p>No, if you <em>manually</em> delete these files, Bitcoin Core will notice the missing files and abort.</p>
<p>However, Bitcoin Core does have functionality to discard blocks after validating them: pruning. You can enable pruning by setting <code>prune=&lt;n&gt;</code> in your <code>bitcoin.conf</code> file or by passing <code>-prune=&lt;n&gt;</code> to <code>bitcoind</code> on startup.</p>
<p>Check <code>bitcoind -h</code> for more information, but briefly:</p>
<ul>
<li><code>prune=1</code> allows for manually deleting blocks using the <code>pruneblockchain</code> rpc</li>
<li><code>prune=&lt;some number &gt;= 550&gt;</code> enables your node to automatically delete blocks to keep the size, measured in MiB, less than the number specified</li>
</ul>
<p>A few things to keep in mind when pruning:</p>
<ul>
<li>You cannot run <code>txindex</code> while pruning, so you won't be able to use your node to lookup specific transactions</li>
<li>If you ever want to turn pruning off, you will need to re-download the entire blockchain</li>
</ul>

CC BY-SA 4.0
2023-02-23T15:01:57.360Z
And to be clear: no, you can't just delete the files manually. Bitcoin Core will notice the files are missing and abort.
Pieter Wuille
CC BY-SA 4.0
2023-02-23T08:15:32.643Z
2023-02-23T18:35:01.977Z
2023-02-23T18:35:01.977Z
josie
<p>Since bitcoin validates blockchain by the hash of older blocks recursively; Can I just keep the last blk*.dat file and delete the rest while the bitcoin core is downloading and validating the blockchain?</p>

<bitcoin-core><blockchain><pruning>
Can I delete blk*.dat files?
SReza S
# Can I delete blk*.dat files?

(Asked by: username_0 on 2023-02-23)

Since bitcoin validates blockchain by the hash of older blocks recursively; Can I just keep the last blk\*.dat file and delete the rest while the bitcoin core is downloading and validating the blockchain?

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


---

## 1 answers

### Answer by username_1 on 2023-02-23. Score: 10 | Accepted answer

No, if you *manually* delete these files, Bitcoin Core will notice the missing files and abort.

However, Bitcoin Core does have functionality to discard blocks after validating them: pruning. You can enable pruning by setting `prune=` in your `bitcoin.conf` file or by passing `-prune=` to `bitcoind` on startup.

Check `bitcoind -h` for more information, but briefly:

* `prune=1` allows for manually deleting blocks using the `pruneblockchain` rpc
* `prune== 550>` enables your node to automatically delete blocks to keep the size, measured in MiB, less than the number specified

A few things to keep in mind when pruning:

* You cannot run `txindex` while pruning, so you won't be able to use your node to lookup specific transactions
* If you ever want to turn pruning off, you will need to re-download the entire blockchain

> **Comments:**
> **username_2**: And to be clear: no, you can't just delete the files manually. Bitcoin Core will notice the files are missing and abort.  

---

