<blockquote>
<p><strong>Pruning Blockchain, what does it remove?</strong></p>
</blockquote>
<p><strong>What</strong></p>
<p>Raw block data for blocks older than a given height.</p>
<p>If we look at <a href="https://bitcoincore.org/en/releases/0.11.0/" rel="noreferrer">https://bitcoincore.org/en/releases/0.11.0/</a>, it says</p>
<blockquote>
<p>This release supports running a fully validating node without maintaining a copy of the raw block and undo data on disk. To recap, there are four types of data related to the blockchain in the bitcoin system: the raw blocks as received over the network (blk???.dat), the undo data (rev???.dat), the block index and the UTXO set (both LevelDB databases). The databases are built from the raw data.</p>
<p>Block pruning allows Bitcoin Core to delete the raw block and undo data once it’s been validated and used to build the databases. At that point, the raw data is used only to relay blocks to other nodes, to handle reorganizations, to look up old transactions (if -txindex is enabled or via the RPC/REST interfaces), or for rescanning the wallet. The block index continues to hold the metadata about all blocks in the blockchain.</p>
</blockquote>
<p>So if raw block data and undo data are deleted that presumably leaves the block index and the UTXO set as the two of the &quot;four types of data&quot; that are unaffected by pruning.</p>
<blockquote>
<p>...<br />
Modified RPC calls:</p>
<p><strong>getblockchaininfo</strong> now includes whether we are in pruned mode or not.<br />
<strong>getblock</strong> will check if the block’s data has been pruned and if so, return an error.<br />
<strong>getrawtransaction</strong> will no longer be able to locate a transaction that has a UTXO but where its block file has been pruned.</p>
</blockquote>
<p>So some RPC calls return an error for pruned data.</p>
<p><strong>When</strong></p>
<p>However the most recent 288 blocks are kept (approx 2 days worth) regardless of whether all their transaction outputs have been spent.</p>
<p>There are some additional details about the timing of deletion of files that contain multiple blocks that are individually marked for deletion. I don't think this substantially affects this answer but it may be something that you should study - depending on what you are trying to achieve.</p>
<hr />
<blockquote>
<p><strong>Would it interfere with rpc calls to show info on a transaction/block?</strong></p>
</blockquote>
<p>Obviously, if the block has been pruned it would hamper the ability of the node to report on it. As mentioned above, some RPC calls will return an error if a block has been pruned.</p>
<blockquote>
<p><strong>a full explorer?</strong></p>
</blockquote>
<p>Ditto.</p>
<hr />
<blockquote>
<p><strong>Does it interfere with showing transaction histories?</strong></p>
</blockquote>
<p>It may interfere with showing the history of arbitrary transactions but you should still be able to view all transactions that were created by this wallet/node.</p>
<p>I think you wouldn't always be able to immediately retrieve full details of the sources of transaction inputs back through prior transactions all the way back to the &quot;coinbase&quot; transaction that created the money currently being controlled by the pruning node.</p>
<p>So it may depend what you mean by history?</p>
<ul>
<li>transactions previously <em>created</em> by this node</li>
<li>historical transactions <em>referred to</em> by own &quot;live&quot; transactions directly or indirectly.</li>
</ul>
<p><strong>I think the intent of a pruning node is that it should be <em>fully functional</em> as a <em>personal wallet</em> but require much less disk storage space.</strong></p>
<p>If you are using it as something other than a personal wallet you may find that there are significant disadvantages you have to explicitly work around. I guess it depends on the precise details of the intended usage.</p>
<hr />
<p>See</p>
<ul>
<li><a href="https://bitcoin.stackexchange.com/q/96254/13866">How do I get old blocks while running a pruned node?</a></li>
</ul>

CC BY-SA 4.0
2021-01-03T11:52:11.737Z
thanks for the clarification. if i want to copy my completed blockchain from windows to linux i just copy the blocks and chainstate folders? nothing else?
Derek Hill
CC BY-SA 4.0
2021-01-03T11:56:18.893Z
@Derek. That's a different question. Comments are mainly for suggesting improvements to questions or answers, not for asking new questions. See https://bitcoin.stackexchange.com/a/60807/13866. The search facility here is quite good. I recommend you try it out.
RedGrittyBrick
CC BY-SA 4.0
2021-01-03T11:58:33.400Z
"Does it interfere with showing transaction histories?" No, I think he's referring to one's own transactions.
MCCCS
CC BY-SA 4.0
2021-01-03T12:02:26.410Z
@MCCCS thanks for pointing out that possibility, I'll update accordingly.
RedGrittyBrick
CC BY-SA 4.0
2021-01-03T12:29:20.953Z
I don't think this is correct. Since all consensus data is moved to chainstate (utxo set) you don't really need any blocks after they've been processed once. Prune mode only keeps a minimum of 288 blocks on disk to serve to peers. All older blocks are marked for deletion and when a .blk file contains only marked blocks the file can be deleted.
pinhead
CC BY-SA 4.0
2021-01-03T12:37:13.997Z
@RedGrittyBrick see https://github.com/bitcoin/bitcoin/pull/5863
pinhead
CC BY-SA 4.0
2021-01-03T12:40:44.993Z
@pinhead: OK, thanks for the clarification, updated.
RedGrittyBrick
CC BY-SA 4.0
2021-01-03T12:52:54.030Z
I mean. Whether or not a blocks outputs have been spent is irrelevant (I'm pretty sure). Because that data is in the utxo set, a different data structure. 288 blocks are kept for network service and also reorg data ("undo" blocks)
pinhead
CC BY-SA 4.0
2021-01-03T12:59:08.470Z
@pinhead. I'll convert my answer to community wiki to encourage you to edit it (so I wont gain any rep if you do so). Alternatively, feel free to create a new answer that contains any parts of my answer that you consider useful. If the OP moves the accepted tick mark to a better answer I will be able to delete mine.
RedGrittyBrick
CC BY-SA 4.0
2021-01-03T19:01:39.227Z
The wallet in Bitcoin Core has its own transaction list. Pruning does not interfere with *having* that list in the wallet; it does however interfere with the ability to rescan the chain for old transactions affecting the wallet.
Pieter Wuille
CC BY-SA 4.0
2021-01-03T11:50:00.697Z
2021-01-03T13:44:54.163Z
2021-01-03T13:44:54.163Z
RedGrittyBrick
<p>I am trying to determine if I want to prune but I'm trying to figure out if it would interfere with anything.</p>
<p>Would it interfere with rpc calls to show info on a transaction/block? A full explorer?</p>
<p>Does it interfere with showing transaction histories?</p>
<p>I finally have the full blockchain downloaded and it takes a long time so i want to be sure. I don't need the extra space.</p>

<bitcoind><pruning>
Pruning Blockchain, what does it remove?
Derek Hill
# Pruning Blockchain, what does it remove?

(Asked by: username_0 on 2021-01-03)

I am trying to determine if I want to prune but I'm trying to figure out if it would interfere with anything.

Would it interfere with rpc calls to show info on a transaction/block? A full explorer?

Does it interfere with showing transaction histories?

I finally have the full blockchain downloaded and it takes a long time so i want to be sure. I don't need the extra space.

**Tags:** bitcoind, pruning


---

## 1 answers

### Answer by username_1 on 2021-01-03. Score: 6 | Accepted answer

> **Pruning Blockchain, what does it remove?**

**What**

Raw block data for blocks older than a given height.

If we look at <https://bitcoincore.org/en/releases/0.11.0/>, it says

> This release supports running a fully validating node without maintaining a copy of the raw block and undo data on disk. To recap, there are four types of data related to the blockchain in the bitcoin system: the raw blocks as received over the network (blk???.dat), the undo data (rev???.dat), the block index and the UTXO set (both LevelDB databases). The databases are built from the raw data.
>
> Block pruning allows Bitcoin Core to delete the raw block and undo data once it’s been validated and used to build the databases. At that point, the raw data is used only to relay blocks to other nodes, to handle reorganizations, to look up old transactions (if -txindex is enabled or via the RPC/REST interfaces), or for rescanning the wallet. The block index continues to hold the metadata about all blocks in the blockchain.

So if raw block data and undo data are deleted that presumably leaves the block index and the UTXO set as the two of the "four types of data" that are unaffected by pruning.

> ...  
> Modified RPC calls:
>
> **getblockchaininfo** now includes whether we are in pruned mode or not.  
> **getblock** will check if the block’s data has been pruned and if so, return an error.  
> **getrawtransaction** will no longer be able to locate a transaction that has a UTXO but where its block file has been pruned.

So some RPC calls return an error for pruned data.

**When**

However the most recent 288 blocks are kept (approx 2 days worth) regardless of whether all their transaction outputs have been spent.

There are some additional details about the timing of deletion of files that contain multiple blocks that are individually marked for deletion. I don't think this substantially affects this answer but it may be something that you should study - depending on what you are trying to achieve.

---

> **Would it interfere with rpc calls to show info on a transaction/block?**

Obviously, if the block has been pruned it would hamper the ability of the node to report on it. As mentioned above, some RPC calls will return an error if a block has been pruned.

> **a full explorer?**

Ditto.

---

> **Does it interfere with showing transaction histories?**

It may interfere with showing the history of arbitrary transactions but you should still be able to view all transactions that were created by this wallet/node.

I think you wouldn't always be able to immediately retrieve full details of the sources of transaction inputs back through prior transactions all the way back to the "coinbase" transaction that created the money currently being controlled by the pruning node.

So it may depend what you mean by history?

* transactions previously *created* by this node
* historical transactions *referred to* by own "live" transactions directly or indirectly.

**I think the intent of a pruning node is that it should be *fully functional* as a *personal wallet* but require much less disk storage space.**

If you are using it as something other than a personal wallet you may find that there are significant disadvantages you have to explicitly work around. I guess it depends on the precise details of the intended usage.

---

See

* [How do I get old blocks while running a pruned node?](https://bitcoin.stackexchange.com/q/96254/13866)

> **Comments:**
> **username_0**: thanks for the clarification. if i want to copy my completed blockchain from windows to linux i just copy the blocks and chainstate folders? nothing else?  
> **username_1**: @username_0. That's a different question. Comments are mainly for suggesting improvements to questions or answers, not for asking new questions. See https://bitcoin.stackexchange.com/a/60807/13866. The search facility here is quite good. I recommend you try it out.  
> **username_2**: "Does it interfere with showing transaction histories?" No, I think he's referring to one's own transactions.  
> **username_1**: @username_2 thanks for pointing out that possibility, I'll update accordingly.  
> **username_3**: I don't think this is correct. Since all consensus data is moved to chainstate (utxo set) you don't really need any blocks after they've been processed once. Prune mode only keeps a minimum of 288 blocks on disk to serve to peers. All older blocks are marked for deletion and when a .blk file contains only marked blocks the file can be deleted.  
> **username_3**: @username_1 see https://github.com/bitcoin/bitcoin/pull/5863  
> **username_1**: @username_3: OK, thanks for the clarification, updated.  
> **username_3**: I mean. Whether or not a blocks outputs have been spent is irrelevant (I'm pretty sure). Because that data is in the utxo set, a different data structure. 288 blocks are kept for network service and also reorg data ("undo" blocks)  
> **username_1**: @username_3. I'll convert my answer to community wiki to encourage you to edit it (so I wont gain any rep if you do so). Alternatively, feel free to create a new answer that contains any parts of my answer that you consider useful. If the OP moves the accepted tick mark to a better answer I will be able to delete mine.  
> **username_4**: The wallet in Bitcoin Core has its own transaction list. Pruning does not interfere with *having* that list in the wallet; it does however interfere with the ability to rescan the chain for old transactions affecting the wallet.  

---

