11

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?

11

Validating hashes and signatures for transactions is the most costly process. So the amount of time it takes for CPU to verify a block depends on number of transactions in the block.

Number of transactions per block tends to increase as bitcoin economy grows, therefore it takes longer to verify more recent blocks.

  • +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 Nov 27 '11 at 23:09
  • 4
    Thilo: 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 Nov 27 '11 at 23:11
  • 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 Nov 27 '11 at 23:33
4

There are just more transactions per block. The cost of verifying a block doesn't depend on previous blocks at all.

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.