2
Spending freshly generated coins is prohibited by the protocol until there are at least 100 blocks on top of the block from which they came. This is because the chances of a 100-block reorg is virtually zero.
The chances of a reorg of 1,000 or 10,000 blocks is even lower. If the chainstate data is normalized, then its hash can be included in each block so that messing with it is as impossible as messing with the blockchain itself. Would we then be able to prune off all but the last 10,000 blocks?
I know the transaction history is valuable, but under the assumption that we will never see a reorg larger than a particular number of blocks, I suspect it isn't necessary for mining once the chainstate is protected as well as the entire blockchain has been.
It seems to me that normalizing the chainstate so that it can be hashed and protected (like block headers are) would allow validation and mining without having to save the entire blockchain. That way, only those who really want the history would need to save it.
Am I missing something?
It seems like we could lower the cost of validating it by taking a few measures. For example, 1) the hash of the utxo set could be computed only every 100 blocks, and 2) it could refer to the utxo set from 10 blocks ago, meaning it could be computed in advance. – Nick ODell – 2015-07-26T00:22:47.490
If block N were to contain the hash of block N-1's chainstate, the cost is exactly hashing the chainstate once per block. Does staggering it like that remove the cost problem you mentioned? If not, what did you mean? – Dave Scotese – 2015-07-26T22:44:34.200
Blocks are sometimes found a few seconds apart, so just using the previous block may still affect relay performance significantly for such blocks. You could go back further in time, but that also has costs, as you somehow need to be able to relay old chainstates to new nodes, so they have to be accessible. There has been some work around merkleizing the chainstate itself, so that its root hash can be recomputed on the fly for each update, but this still adds very significant validation costs. – Pieter Wuille – 2015-07-27T01:10:54.373
New nodes need "old" chainstate, but current chainstate will be old as soon as the next block gets solved. Significant chunks of the utxo database will not change. While a new node collects chunks at random, some pieces will be invalidated as new blocks get solved, so it will have to get them again. Eventually, it has complete current chainstate and then it can wait for the next block to validate the whole thing. That leaves only validating the chunks. Torrent files do this already, right? – Dave Scotese – 2015-07-27T02:48:54.013