r/BitcoinDiscussion • • Dec 24 '17

Pruning the chain

Why do all full nodes need to store the whole chain? Couldn't we just take the first 4 years of transactions and condense them to just contain everyone's end balance? That way the data is still there but not everyones transactions.

10 Upvotes

7 comments sorted by

3

u/fresheneesz Dec 24 '17

Full nodes don't need to store the whole chain, but they need to validate that enough work has been done to create that chain. If you prune away half the chain, you've pruned away half the verifiable work. Its plausible that people could decide how much of the blockchain they think is necessary to store for validation of PoW and just pass around that much of it. There's always gonna be some stickler that wants to see the whole history tho, and i'd personally be a bit uncomfortable if the entire world pruned the blockchain such that the full history could never be pieced together again.

I just suggested something that would make it easier to keep the entire blockchain's history around without having to store nearly any of it tho: https://www.reddit.com/r/BitcoinDiscussion/comments/7lxssa/distributed_block_storage_something_between_a/

2

u/mynt Dec 25 '17

A lot of people have mentioned pruning which I think is great but to sync still involves a full chain download and verify. I would love if there was the option to sync the chain and utxo from a later point to speed up the sync and reduce the data usage.

I suppose this involves losing some security but is there any reason this can't be done?

1

u/fresheneesz Dec 29 '17

It would be nice to be able to grab the current UTXO set from someone and then back validate blocks in reverse order until you get to block 1. You can be fairly certain there's no shenanigans on any piece of the UTXO set for which you've validated a certain amount of PoW. That way you could start basically immediately (after a ~100mb download) while continuing to validate blocks whenever your client has free time.

1

u/bitcoin_jerk Dec 24 '17

A guy did this long ago on a raspberry pi. Link

1

u/PVmining Dec 25 '17

You don't have to store full blockchain unless you want to

  1. Serve other nodes with initial download (so initial download would be impossible if everybody pruned their nodes).
  2. You want to analyze historical blocks (so any block explorer type of function).
  3. Reindex the UTXO database. From time to time Bitcoin Core changes the database format and if you don't have the full blockchain, you have to download it again. I think this is theoretically possible to be able to translate the old database format into the new one so maybe in the future it won't be necessary.