11
2
I just downloaded Bitcoin 0.5 and started downloading the blockchain from scratch. The process was rather fast early on but slowed down noticeably later. That could of course be related to network conditions (or I could be mistaken altogether), but it got me thinking if the cost of block validation (which apparently is the driving factor in determining how long importing new blocks takes) somehow depends on the length of the chain before it?
+1 Is it just the cryptography or is there also the cost of tracking down the ancestry of the transactions in the block (to see if the amounts are valid)? But I suppose that there a single step back would be sufficient, since any previous blocks have already been validated. – Thilo – 2011-11-27T23:09:25.387
4Thilo: exactly, it must a) verify syntactic integrity of the transactions b) find the previous outputs it references (one level deep) c) verify those previous outputs haven't been spent d) verify the signatures. b) and c) require disk seeks, d) requires CPU – Pieter Wuille – 2011-11-27T23:11:17.040
Is step c) dependent on the age of the previous output (i.e. the block chain length) because a sequential search takes place or does the Bitcoin client maintain an index of spent outputs? – Thilo – 2011-11-27T23:33:12.353