2

As far as I know, to prevent double-spend attack and to confirm that a specific transaction is valid, miners have to go through all blocks in the blockchain and check the sender's history of transactions. until now, the blockchain has over 700,000 blocks. Isn't it computationally hard for miners as the blockchain grows?

1
  • "to confirm that a specific transaction is valid" -- note that in Bitcoin "confirmation" is producing a block containing a transaction or producing a block on top of such a block. That is very different from checking that a transaction is valid. All nodes validate, only miners confirm. Dec 30, 2021 at 19:54

1 Answer 1

5

Bitcoin nodes keep track of what's called the UTXO set – the set of all unspent transaction outputs. Every valid transaction must only spend existing and not previously spent outputs, so this is enough to prevent double-spending. The UTXO set can also be stored in a way to allow efficient (constant-time) lookups, so verifying transactions doesn't require more computing power as the UTXO set grows.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.