All transactions in one block are considered to happen at the same time, butThe Bitcoin protocol requires transactions can only be added to the transaction set, onceappear in topological order in the miner determines that they are validblockchain. Thus, both transactionGiven two transactions A and B can be included in the same block, but they will always stand in the chronological order.where B spends an output of A:
- Both A and B may be included in the same block.
- A must precede B in the transaction list.
B can not be validatedColloquially, a miner will never include a transaction in a block beforetemplate until the transaction's requirements are met. Since B spends an output of A was validated, as B uses unspent outputs that are only created byis not valid until A has created said output. To satisfy this dependency, thus the outputs would not be there toB can only be spent beforeincluded after A is validatedwas included.
Also see: Can multiple transactions transferring the same bitcoin be done in one block?