<p>This is called pruning.</p>

<p>From <a href="https://bitcoin.stackexchange.com/a/38847/4334">here</a>:</p>

<blockquote>
  <p>Since Bitcoin-Core 0.11.0 you can prune (trim) the blockchain in
  Bitcoin-Qt. But not from the UI. You need to add <code>-prune=550</code> to your
  bitcoin.conf file and restart Bitcoin-Qt.</p>
  
  <p><strong>Explanation:</strong> <code>-prune=&lt;target in MiB&gt;</code> will tell bitcoin-core to remove blocks which are older than oldest block that can be kept with
  a chainsize (sum of block-sizes) of <code>&lt;target&gt;</code> (min. 550MiB as example
  above shows). A minimum of 550MiB ensures to keep at least 288 blocks
  (~2 days). 
  <em>(simple explanation not including undo-data)</em></p>
  
  <p><strong>Restriction:</strong> <code>-prune</code> does disable all wallet functions in version 0.11 (will work with a wallet in version 0.12).</p>
</blockquote>

<p>Obviously, as a full node you can't serve historical blocks you don't have, so you're more like a P2P leecher.</p>

CC BY-SA 3.0
2016-09-23T19:28:05.520Z
2016-09-23T19:28:05.520Z
Geremia
<p>Full nodes keep all blocks by default, but this is not necessary to achieve full node security. Full nodes validate the complete blockchain and enforce all consensus rules regardless of whether a full history is kept.<br>
Keeping all blocks is a service to the network, as you'll be able to provide all blocks for synchronizing nodes or requests of thin clients.</p>

<p>If keeping the full blockchain is a problem, you can reduce the storage-footprint by running Bitcoin Core in pruning mode. Just add <code>prune=&lt;n&gt;</code> to your <code>bitcoin.conf</code>, where <code>&lt;n&gt;</code> is the amount of youngest blocks you want to keep in terms of mebibytes storage. The minimum is 550 MiB.</p>

CC BY-SA 3.0
2016-09-23T19:36:16.237Z
Can I just delete the older *.dat files in ~/.bitcoin manually, or do I need to be in pruning mode for it to handle that?
Geremia
CC BY-SA 3.0
2016-09-23T19:36:53.607Z
Will my transactions in pruned blocks still appear in Bitcoin-Qt's list of transactions?
Geremia
CC BY-SA 3.0
2016-09-23T19:37:11.763Z
@Geremia: You need to turn on pruning and let Core sort it out. Otherwise, Core will discover that there are files missing.
Murch
CC BY-SA 3.0
2016-09-23T19:38:12.550Z
Yes. The chain-state database and UTXO set are kept intact and completely. As Core has validated the full blockchain, it knows about the old transactions and stores the relevant UTXO data. It will also keep all information related to its own addresses.
Murch
CC BY-SA 3.0
2016-09-24T05:12:17.337Z
"_it knows about the old transactions and stores the relevant UTXO data_." That's stored in the `chainstate` directory (currently about 1.6 GB), right? So, I could technically delete the `blocks` directory; but if I want traction info, I have to keep the `chainstate` one?
Geremia
CC BY-SA 3.0
2016-09-24T07:40:15.743Z
I don't get what you're asking. If you want to reduce the storage-footprint, just start with pruning mode. You'll still need the blocks directory, as you'll keep at least 550 MiB. I haven't tried, but I'd expect Core to start redownloading all blocks if you just delete the directory manually.
Murch
CC BY-SA 3.0
2016-09-25T06:00:26.437Z
"_I haven't tried, but I'd expect Core to start redownloading all blocks if you just delete the directory manually._" Yes, that's what happened when I tried it.
Geremia
CC BY-SA 3.0
2016-09-27T15:23:15.857Z
@Geremia: Thank you for your commitment to science. ;)
Murch
CC BY-SA 3.0
2016-09-27T19:26:47.140Z
Yes, reproducibility seems lacking these days. ☺
Geremia
CC BY-SA 3.0
2016-09-23T19:28:56.620Z
2017-03-11T11:34:18.750Z
2017-03-11T11:34:18.750Z
Murch
<p>Do I need to keep all blocks, from block 0 up to the current one, when running Bitcoin Core, either as a full node or not? Or can I just keep the more recent blocks to save space?</p>

CC BY-SA 3.0
2016-09-23T19:30:25.387Z
related: [How can I run bitcoind in pruning mode?](http://bitcoin.stackexchange.com/q/37496/5406)
Murch
<bitcoin-core><block><full-node><storage-footprint><pruning>
Do I need to keep all blocks when running Bitcoin Core?
Geremia
# Do I need to keep all blocks when running Bitcoin Core?

(Asked by: username_0 on 2016-09-23)

Do I need to keep all blocks, from block 0 up to the current one, when running Bitcoin Core, either as a full node or not? Or can I just keep the more recent blocks to save space?

**Tags:** bitcoin-core, block, full-node, storage-footprint, pruning

> **Comments:**
> **username_1**: related: [How can I run bitcoind in pruning mode?](http://bitcoin.stackexchange.com/q/37496/5406)  

---

## 2 answers

### Answer by username_1 on 2016-09-23. Score: 7 | Accepted answer

Full nodes keep all blocks by default, but this is not necessary to achieve full node security. Full nodes validate the complete blockchain and enforce all consensus rules regardless of whether a full history is kept.  
Keeping all blocks is a service to the network, as you'll be able to provide all blocks for synchronizing nodes or requests of thin clients.

If keeping the full blockchain is a problem, you can reduce the storage-footprint by running Bitcoin Core in pruning mode. Just add `prune=<n>` to your `bitcoin.conf`, where `<n>` is the amount of youngest blocks you want to keep in terms of mebibytes storage. The minimum is 550 MiB.

> **Comments:**
> **username_0**: Can I just delete the older *.dat files in ~/.bitcoin manually, or do I need to be in pruning mode for it to handle that?  
> **username_0**: Will my transactions in pruned blocks still appear in Bitcoin-Qt's list of transactions?  
> **username_1**: @username_0: You need to turn on pruning and let Core sort it out. Otherwise, Core will discover that there are files missing.  
> **username_1**: Yes. The chain-state database and UTXO set are kept intact and completely. As Core has validated the full blockchain, it knows about the old transactions and stores the relevant UTXO data. It will also keep all information related to its own addresses.  
> **username_0**: "_it knows about the old transactions and stores the relevant UTXO data_." That's stored in the `chainstate` directory (currently about 1.6 GB), right? So, I could technically delete the `blocks` directory; but if I want traction info, I have to keep the `chainstate` one?  
> **username_1**: I don't get what you're asking. If you want to reduce the storage-footprint, just start with pruning mode. You'll still need the blocks directory, as you'll keep at least 550 MiB. I haven't tried, but I'd expect Core to start redownloading all blocks if you just delete the directory manually.  
> **username_0**: "_I haven't tried, but I'd expect Core to start redownloading all blocks if you just delete the directory manually._" Yes, that's what happened when I tried it.  
> **username_1**: @username_0: Thank you for your commitment to science. ;)  
> **username_0**: Yes, reproducibility seems lacking these days. ☺  

---

### Answer by username_0 on 2016-09-23. Score: 4

This is called pruning.

From [here](https://bitcoin.stackexchange.com/a/38847/4334):

> Since Bitcoin-Core 0.11.0 you can prune (trim) the blockchain in
> Bitcoin-Qt. But not from the UI. You need to add `-prune=550` to your
> bitcoin.conf file and restart Bitcoin-Qt.
>
> **Explanation:** `-prune=<target in MiB>` will tell bitcoin-core to remove blocks which are older than oldest block that can be kept with
> a chainsize (sum of block-sizes) of `<target>` (min. 550MiB as example
> above shows). A minimum of 550MiB ensures to keep at least 288 blocks
> (~2 days).
> *(simple explanation not including undo-data)*
>
> **Restriction:** `-prune` does disable all wallet functions in version 0.11 (will work with a wallet in version 0.12).

Obviously, as a full node you can't serve historical blocks you don't have, so you're more like a P2P leecher.


---

