1

This is a theoretical question. Assuming that a transaction (TX_A) with me on the receiving end gets added to the blockchain, I should be able to spend the amount I received. So I go on and spend it on another transaction (TX_B). What if TX_A gets orphaned due to forks? What happens to TX_B?

1

What if TX_A gets orphaned due to forks? What happens to TX_B?

It will be considered invalid, and your Bitcoin will not be spent. It will only be considered valid on the other forks, assuming they don't also invalidate the block. Usually the forks, if they are trying to play by the rules of the Bitcoin network, will also invalidate the block because the longest chain is always the valid chain.

Also, this should be referred to as an extinct block, see https://bitcoin.stackexchange.com/a/5869/60443

  • With all these invalidation of transactions, how do wallets even keep track of your available spending? – Larrrrrrrrrry Sep 28 '18 at 14:35
  • First, extinct blocks are not terribly common, though they have and will happen. However, wallets need to account for the possibility of orphaned blocks, if they don't they are putting their users at risk. Also, they typically require a minimum number of confirmations for new transactions before they allow spending. – JBaczuk Sep 28 '18 at 14:37
  • correction, this terminology is confusing, and should be referred to as extinct blocks. orphans are just blocks with an unknown parent, but not necessarily invalid. – JBaczuk Sep 28 '18 at 14:43
  • Thanks for the clarification. From what I read about confirmations, outputs can only be spent if the transaction that outputted them are 6 blocks deep in the blockchain. Does this mean that a block is invalid if a transaction's input cannot be matched with any outputs that are 6 blocks away (in the direction of the genesis block)? – Larrrrrrrrrry Sep 28 '18 at 14:51
  • 1
    The 6 blocks deep is not a rule of Bitcoin, but decided by the wallet or user, so no. – JBaczuk Sep 28 '18 at 15:00

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.