14

I understand that Bitcoin scales in several meanings (Scalability), and pruning is one important concept of it (SE Question). I also understand that a "Simplified Payment Verification" (SPV) needs to trust a lot the peer he is obtaining the block chain from.

A very conservative pruning (e.g. transactions older than six month and spent) wouldn't do much harm, especially when it would be only a configuration option for bitcoin-qt. That way the default is the full node, but it's easy to have a "small node".

But I don't see it coming anyhow soon. Is there a reason? Is it so important to have full nodes at the moment that the devs say "either you go for all or nothing"? Or is the development effort the bottleneck? IMHO a large network of non-SPV nodes is more important than a small network of full nodes.

Edit: Let's put it more concrete: Is there a major security issue of not having the complete transaction history of the world back to the genesis block?

12

Pruning is being considered, in fact, it was taken into account when designing the 0.8 database format. The unspent transaction outputs (which is the only essential piece of data necessary for validation) are already kept in a separate database, so technically removing old blocks is perfectly possible. It'll likely require some small changes to make sure the code doesn't break when block data that doesn't exist anymore is requested, but this is easy.

The reason it's not implemented is because of the effect on the network as a whole. If a large amount of nodes starts pruning old block data away, it will become harder for new nodes starting up to find the historic data to verify. This is not a problem as such - I expect enough copies will remain that this is not a true problem - but we need a discovery mechanism so nodes don't need to arbitrarily try peers until they happen to reach one that has the blocks they need. In fact, there's a discussion going on on the bitcoin-development mailing list about this right.

EDIT: Pruning was implemented in Bitcoin Core 0.11, and is fully functional since 0.12.

  • 2
    So the current problem to solve is on the network level! Nodes have find nodes - with certain information! DHT sound very promising to me to solve this. – Borph May 31 '13 at 8:53
  • Extra question: Imagine we really would loose the historic data. Would it stop Bitcoin? Or would be a, hum, "consensus on the assets, although we don't know how we came here". – Borph May 31 '13 at 8:56
  • Presumable, nodes offering full history would be more expensive to maintain than nodes that have been pruned. What is the incentive for anyone to run nodes with full history? – snapfractalpop Mar 26 '15 at 17:29
  • What is the incentive to make anyone's full node accessible to others at all? – Pieter Wuille Jun 25 '15 at 8:58
-1

AFAIK, all the transaction outputs are purged from the database when they are spent. Not from the bock database, though, but it just does not make too much sense to remove it from the block database, since it would only worsen the node's performance.

And you cannot purge unspent outputs, now matter how old they are, for quite an obvious reasons.

  • I think you might be misunderstanding the question. It does make sense to remove some/all transactions from the client's copy of the blockchain (i.e. "block database") as it would save a lot of disk space for the clients. The protocol specifically allows for these partially purged clients (SPV clients), that's why the protocol uses a merkle root of the transactions and not a simple list of the transactions. But SPV isn't part of the standard client at this time and this question is really about why that doesn't seem to be a priority. – David Ogren May 24 '13 at 15:16
  • Well, considering that the entire blockchain is now barely 8GB, we obviously have a different understanding of what a lot of disk space is. Moreover, if you remove transactions from your database, you won't be able to serve blocks anymore, so you won't be able to act as an actual node. – Gigi May 24 '13 at 15:36
  • That 8GB isn't a lot of block space for current desktops and laptops might not be a bad answer. (I somewhat agree with that. Although it's really the downloading and verifying that seems to cause the most issues, not the disk space itself.) My comment was more that your answer was addressing something not asked, i.e. purging from the lookup databases when the question was pretty specifically about the blockchain itself and SPV clients. (Also, someone who uses a laptop with a single 128GB SSD might disagree with your assessment that 8GB isn't a lot.) – David Ogren May 24 '13 at 15:59
  • Oh, I thought SPV clients are even just interested in the headers and their transactions, opposed to a pruning node which has all unspent transactions. – Borph May 24 '13 at 16:01
  • @Gigi: yes, when you throw away old spent transaction, the world would forget about them when really all nodes behave like this. But what is considered to be "unable to act as a node"? – Borph May 24 '13 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.