What is a cut node
It is always recommended to run a full node if we want to support Bitcoin and keep the system decentralized. This not only helps the network, but also has other benefits for the participants.
But since the Bitcoin blockchain is constantly growing, according to Coinmarketrate.com, it has reached the point where its overall size has become significant. This makes it difficult to maintain a full node for everyone.
There are lightweight SPV, mobile and hardware wallets, but nothing beats managing a basic wallet. The problem is the resources needed, especially storage space and bandwidth.
Currently, the Bitcoin blockchain weighs almost 390 GB, which is too much for most people who do not have this amount of additional storage.
One way to reduce this requirement is to use so-called trimmed nodes, which allows users to run the main wallet without worrying about space.
In this guide, we’ll look at how it works, and how you can make your own if you’re worried about space.
How a cut node works
The Bitcoin blockchain contains the history of all transactions made daily on the Bitcoin network, from the moment of its creation to the present.
Given that the block size is approximately 1 MB and that they occur every 10 minutes, it is logical to assume that the growth of the entire blockchain will only grow and grow.
Bitcoin block size history. Source: Blockchain.com
To solve the problem when people want to maintain a Bitcoin node, but do not have free space to perform this task, the developers of the Bitcoin core released in version 0.11.0 a feature called “trimming block files”.
This function allows us to run the node, but in its smallest version. This is achieved by deleting old information that is not needed when downloading the latest one from the blockchain.
This way we can use some Bitcoin Core features, such as a wallet, without having all the old transactions.
Before reducing the block size on the node
But before you start pruning the size of a running node, you need to know a few important things:
- Cutting does not make the security of the wallet less reliable. This is practically the same as launching a full node wallet.
- After enabling this mode, it is not possible to re-scan the wallet, since it is necessary to download the entire blockchain again.
- Cutting will only take a few seconds or minutes. But keep in mind that this is a one-way trip. If we want to restart the entire node, then we have to download the entire blockchain again.
- Although we can set a limit on the size of the blockchain we want to keep, it will be exceeded as there are files such as the state of the chain and the index database that also need to be saved. However, they don’t take up too much space.
- By default, this functionality is enabled when you first install Bitcoin Core, and it can be easily disabled in the installation menu or later.
Remember that a lot of CPU will be used during the pruning task, and there will also be a very high load on the drive, since it has to read, write and delete many files at the same time.
It is recommended that no other important tasks are running on the computer during this process, especially if not many resources are available.
How to use the cutting function in BITCOIN CORE?
The command used to reduce the space occupied by the blockchain is “prune=N”, where N is the size in MB that we want the blockchain to be maximum.
- prune=0: the mode is disabled.
- prune=1: allows manual cutting via RPC.
- prune=550: automatically deletes the previous blocks so as not to exceed this value.
Here are the steps you need to follow if you want to enable prune mode in the Bitcoin Core client.
In case we install Bitcoin Core for the first time:
- We open Bitcoin Core, and it tells us how much free space we have and how much we need. This option is enabled by default and is called “Limit block chain storage to”, the value 2 GB is selected as the parameter. We can disable it or increase or decrease the space depending on what we want.
- Finally, click “OK” to start syncing the blocks.
In case we already have Bitcoin Core installed and we are not opening the application for the first time:
- Open the wallet and click “Settings” and then “Options”, which will take us to the options panel.
Activating cutting in Bitcoin Core step 2
- There we click on the checkbox next to “Prune block storage to” and select the size in GB.
We can also activate it by opening the “Open Configuration File” and typing the commands we saw above “prune=N”. Although this option is not recommended if you are not an experienced user.
- After entering the value, click OK.
- Finally, we have to close the client and open it again so that the entered configuration can be processed.
Is it necessary to download the full blockchain?
The cut node mode offered by Bitcoin Core is an interesting option, especially if we have limited space or we don’t want to use it completely for this.
But the question arises whether it is necessary to download the entire blockchain or it is better to use a trimmed node with the most recent blocks.
Although this option allows us to save space on our storage, we still have to use a lot of bandwidth to be able to load old and new blocks.
It is true that you will have to download the entire block chain if you are using Bitcoin Core for the first time. In this case, you will have no choice but to download the blockchain to a computer that allows it (for example, a friend’s computer), and then transfer it to a computer that will act as a node.
But if size is our problem, then the pruning option is life-saving. Because he will load all the blocks, but will delete the oldest ones, since he no longer needs them.
We will have to download a lot of data, which can be a bit annoying if we don’t have a good connection, but if we set the maximum, for example, 25 GB, it will always remain below this value.
It is for this reason, even if it takes up less space, we will not be able to make synchronization faster. In the end, we will still have to download the entire blockchain.
Block cutting s a feature of some clients that allows you to delete old information so that the node takes up less space. We have to synchronize the entire blockchain, although blocks will be deleted as new ones are loaded.
Synchronization with the Bitcoin blockchain is improving every year, and as a result, information is downloaded much faster.
Some people were looking for websites or torrents where you can download full files, thereby saving time. But in fact, this option is quite unsafe and is not recommended. It is always preferable to use the client, especially taking into account the optimizations that it has received.