Augusts 21, 2020
Medium min reading
Pruned nodes, a type of full node that allows us to take advantage of their enormous security, but reducing their blockchain storage requirements so that we can run them on practically any device.
Recommended Previous Content
What is a node?
How to set up your Bitcoin node in less than 10 minutes?
Lthe nodes of Bitcoin are the basis of its operation by keeping a copy of the blockchain and perform the various tasks required to run the network, but one problem with them is that they consume a lot of storage. This situation made it impossible for many people to have a node, either because of the disk space they occupied, as well as the speed of Internet connection necessary to start it up. With this problem in mind, the pruned nodes were born.
The pruned nodes, they are a type of node which performs almost all the functions of a full node. In fact, your only exception is that the pruned nodes do not have a complete copy of the blockchain. That is, the pruned nodes only maintain a substantial part of the blockchain, using it to carry out their verification processes like any other full node.
Now, why were the pruned nodes created? How do they work? And more importantly, is a pruned node or a full node better? If you have these and other questions, keep reading and learning with us to get the answers you are looking for.
Pruned nodes Why were they created?
Bitcoin has a database called blockchain that currently occupies more than 290 GB, and is growing by the minute. In that database, all Bitcoin transactions are found, from the first to the last. We are talking about more than a decade of transactions, since the first transaction was made in January 2009, and the network has never stopped working.
A problem that Bitcoin has experienced for several years is the accelerated growth of the size of your blockchain. The blockchain registry went from a few tens of megabytes in its first year to hundreds of Gigabytes today.
Furthermore, as more and more people continue to use Bitcoin, more operations are carried out, and its blockchain continues to increase in size.
The situation quickly led to a problem seeing that many people could not simply keep an entire copy of the blockchain in their possession. And all because the storage space simply exceeded its capacity. In fact, today the blockchain occupies as much storage space as an average hard drive with a value of about € 35. It may not sound like much, but for millions of users around the world, especially in countries with smaller economies that is a lot of money.
Faced with this situation, pruned nodes were created, with which the blockchain can be downloaded to begin its verification process and at the end of the download, a smaller part of it is simply stored. A process that by the way does not endanger the verification capacity of the node and that offers us the possibility of having a complete node to carry out our operations in a more secure way.
Now, surely you wonder if this situation can only be seen in Bitcoin. The reality is that all blockchain and even other technologies based on DAY y DLT they have this same problem. For example in Ethereum it is also possible to deploy pruned nodes, something especially useful if we consider that its blockchain grows by leaps and bounds compared to Bitcoin, already touching 5000 GB.
How does a pruned node work?
Now, how is it possible to "prune" a blockchain and what exactly does prune mean? As well, When we talk about "pruning" we mean reducing the size of the blockchain to a point where we can create a reliable registry with a certain size.
Imagine that the blockchain is a huge tree where its branches and leaves are all related to each other from the newest to the oldest. This relationship allows you to trace all the operations of the blockchain in a temporally coordinated way from the most recent to its genesis or root. However, this tree is gigantic and you cannot store it in its entirety.
Faced with this problem, you decide that you are only interested in the last branches and their information in order to have a reduced but equally valid copy of the entire original tree. So you decide to prune its last branches and use them to create a copy tree that will follow its history from that specific point. In short, you have created a child tree (a copy of the blockchain), whose initial leaves corroborate the history of the parent tree (original blockchain) and continue its history from that point (the original tree and your copy will be exactly the same from the point pruning).
This is precisely what the Bitcoin client does. That is, it downloads the entire tree (the original blockchain), verifies it to know that the download is correct and stores only the part that interests you, discarding the rest. The blockchain that you now have stored on your computer is a child tree, a partial copy of the original blockchain and from that point on, your copy and the original blockchain will be exactly the same and equally valid.
Merkle and Merkle Root trees, the pruning shears for the blockchain
Now why do we refer to the blockchain as a tree in this case, when we always talk about it being a chain? The reason is that the structure that makes it possible to “prune” a blockchain are the merkle trees and merkle root.
In the first place, the Merkle Trees are a basic structure in the formation of the blocks and the hash associated with them. Remember that the purpose of a merkle tree is to synthesize and relate large amounts of information through the use of cryptographic functions. This process of cryptographic synthesis at the end throws up the so-called Merkle Root, a unique and unrepeatable hash whose origin starts from relating all that information. Thanks to this system it is possible to make the transactions of a Bitcoin block intrinsically related to that block.
This structuring also holds the blocks of a blockchain together. This thanks to the fact that the Merkle Root is one of the basic data used to cryptographically link the blocks. In fact, the Merkle Root of each new block has a very close and deterministic relationship with the previous blocks. That is, each new Merkle Root in a block reaffirms and validates the history of previous blocks. In this way, any alteration, however minimal, ends up invalidating the entire history.
That said, we can see in a simpler way what a pruned node in Bitcoin does, simply download the blockchain, verify that the Merkle Roots are correct and at the specified point, cut the blockchain to generate a copy. From that cut-off point, the Merkle Root follows its normal evolution, the same as the complete original blockchain, only in our case we have a smaller and more manageable copy of it.
How can we create our own pruned node?
If you are looking to create your own pruned node to have a wallet Through a node that further supports the security of your transactions, this is easy to do. The easiest way is using the software Bitcoin Core which has this functionality since version 0.11. You can also use ElectrumX by spesmilo, which is a re-implementation of Electrum Server and is compatible with pruning (or blockchain pruning). Outside of these two software, we do not recommend using anything that uses pruning. This is because many developments are not careful with this feature.
Finally, it is important to note that a pruned node must have at least 2 Gigabyte storage for the blockchain copy, which is a reasonable space and will give you the ability to verify a lot of information with your node without great effort.
How much do you know, cryptonuta?
Can pruned nodes apply to any blockchain?
TRUE!
Because the basic operation of cryptocurrencies is identical (they all organize their data on a blockchain using the same basic elements) they can enjoy the benefits of pruning their blockchains and let people with fewer resources run nodes on it. shape. So effectively pruned nodes can be applied in all blockchains as long as the developers implement this function.
Pruned nodes or full nodes Which is better?
The reality is that, at the security level, a pruned node with at least 2 GB and a full node do not have major differences. Both nodes are equally secure and that's a good thing for everyone. What is different in itself are the possibilities of validating transactions at any point in time on the blockchain. Remember that a pruned node has a limited history, while the full node has the entire copy of the blockchain. This, however, does not prevent you from using other full nodes to verify the information. So it cannot be seen as a danger weakness.
Where there is a difference is that a full node can serve as a starting point for other newer nodes on the network. It can even be the genesis of the network in case something very bad happens. These are two tasks that a pruned node cannot do for obvious reasons: you do not have the complete history of the blockchain so you cannot synchronize from its genesis to other nodes, and you cannot restart the network from its point of origin in case of as needed.
That said, both nodes are excellent, but we recommend that if you want a node for personal use (even if it is for mining) and you do not want to dedicate a lot of resources to it, a pruned node will suffice for you and at the same time you will help the network in its security. If, on the other hand, you have the resources to run a full node, then go ahead. With this, you will not only have an extremely secure node but you will also help the network to maintain its security and decentralization. In either case, the decision between a pruned node and a full node is based on the resources you can have to install one.
Continue the journey in ...
What is a seed node?
Share this article!
Author
Jose Segura
Engineering Department Coordinator
José Segura works as a problem solver in Bit2Me's IT team, where he started as Lead Engineering Manager and currently coordinates the entire department.
Read more