6

I am building my Bitcoin expertise, and want to verify my understanding on a specific point: at what point(s) do all full nodes verifies a new transaction?

Here is my understanding in a nutshell, please confirm or correct:

[1] Upon receiving each new transaction, every full node fully verifies it before adding the transaction to the its own mempool

[2] Upon receiving each new block, every full node fully verifies each transaction in the block before accepting the block

If the above understanding is correct, then every full node verifies each new transaction TWO TIMES: once when the shiny-new transaction is unconfirmed, and again a few minutes later when the transaction is included in a block.

I recognize the above is somewhat of an abstraction ... is it an ACCURATE abstraction?

Thanks in advance.

4

It is an accurate abstraction.

However, the most computationally expensive part of transaction verification is ECDSA signature verification. And the results of verification are cached and reused when they're done a second time. We don't cache the rest of transaction verification as it is subject to many parameters (new softfork rules can have been activated, height, locktime, ...), and it's relatively cheap anyway. We do however cache transaction verification failures.

  • Thanks much for the quick reply. You mention that "the results of verification are cached and reused when they're done a second time". Two clarifying questions:[1] that second time is when the full node receives a new block and is running through all of the transactions in that block? [2] every full node maintains its own "verification cache"? – Pressed250 Jan 23 '16 at 17:56
  • [1] Yes. [2] Yes. – Pieter Wuille Jan 23 '16 at 18:46

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.