1

According to the wiki, it appears as if the previous transaction's index is referenced but not the block in which it's in. Why?

How are transactions stored in the database that doesn't make referencing the previous transaction's block index necessary for performance?

3

If it were not this way, transaction generation would be slow and fragile. First, you couldn't form a transaction unless you knew which block all its outputs were in, which would mean you'd have to wait until they get in a block. Worse, if there were a blockchain reorganization, it would be impossible to recover many transactions because recovering their parents would change what block they're in, invalidating their children.

This means that nodes generally keep an efficient table of all unspent outputs, indexed by transaction ID.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy