<p>Transactions have no order <em>until</em> they are included in a valid block. That is the entire function of the blockchain: to act as a distributed timestamp server for transactions.</p>
<blockquote>
<p>can miners reverse the chronological order when packing block ?</p>
</blockquote>
<p>A miner can order transactions in a block however they would like (assuming that the block remains valid otherwise, of course). Saying things like 'what is the chronological order of unconfirmed transactions?' doesn't make any sense. There are simply unconfirmed transactions, and then there are confirmed (and thus ordered) transactions that are a part of the blockchain record.</p>
<p>There are some cases where the ordering of transactions will matter though, for example if you create two transactions, and the second transaction spends an output that was created by the first transaction. In that case, the second transaction would only be valid if the first transaction is included ahead of it, since the second transaction would otherwise be spending a non-existent output.</p>
<blockquote>
<p>If (1) is true, as a payment system, you can't get the correct timeline when backtracking, is this a design flaw?</p>
</blockquote>
<p>As mentioned above, the explicit ordering of transactions is defined by their inclusion in the blockchain record. Building a system that attempts to order unconfirmed transactions wouldn't be very useful in many cases.</p>

CC BY-SA 4.0
2022-01-18T08:41:47.697Z
2022-01-18T08:41:47.697Z
chytrik
<p>Bitcoin uses a UTXO model – all bitcoin exists in the form of unspent transaction outputs (UTXOs). So there are a number of different scenarios depending on how many UTXOs you have and what you do with them:</p>
<ol>
<li><p>You have a single* UTXO of 1 BTC. You create a single transaction paying 0.2 BTC to Alice, 0.2 BTC to Bob and 0.6 BTC back to yourself. A transaction is atomic, so miners cannot in any way separate the payment to Alice from the payment to Bob.</p>
</li>
<li><p>You have a single* UTXO of 1 BTC. You create a transaction paying 0.2 BTC to Alice and 0.8 BTC to yourself, and then another transaction spending that 0.8 BTC, paying 0.2 BTC to Bob and 0.6 BTC to yourself. Because the latter transaction is dependent on the former, it cannot be confirmed (mined) before the former is confirmed. They may be mined within the same block, but they must have a correct order within that block.</p>
</li>
<li><p>You have two UTXOs of 0.5 BTC each. You create two transactions each paying Alice and Bob respectively 0.2 BTC and 0.3 BTC to yourself. Broadcasting them to the network in a specific order doesn't guarantee that they will be confirmed in that order.</p>
</li>
</ol>
<p>* Or multiple smaller UTXOs that you will be spending together in one transaction.</p>

CC BY-SA 4.0
2022-01-18T08:36:48.753Z
2022-01-18T08:36:48.753Z
Vojtěch Strnad
<p>Suppose I have 1 bitcoin, I give Alice 0.2 bitcoin first, then Bob 0.2 bitcoin immediately, both transactions are legal</p>
<ol>
<li>can miners reverse the chronological order when packing block ?</li>
<li>If (1) is true, as a payment system, you can't get the correct timeline when backtracking, is this a design flaw?</li>
</ol>

<transactions><transaction-verification>
Can the order of transactions not strictly follow the chronological order?
KHJUAF403456ZS3K564WAEF
# Can the order of transactions not strictly follow the chronological order?

(Asked by: username_0 on 2022-01-18)

Suppose I have 1 bitcoin, I give Alice 0.2 bitcoin first, then Bob 0.2 bitcoin immediately, both transactions are legal

1. can miners reverse the chronological order when packing block ?
2. If (1) is true, as a payment system, you can't get the correct timeline when backtracking, is this a design flaw?

**Tags:** transactions, transaction-verification


---

## 2 answers

### Answer by username_1 on 2022-01-18. Score: 3

Transactions have no order *until* they are included in a valid block. That is the entire function of the blockchain: to act as a distributed timestamp server for transactions.

> can miners reverse the chronological order when packing block ?

A miner can order transactions in a block however they would like (assuming that the block remains valid otherwise, of course). Saying things like 'what is the chronological order of unconfirmed transactions?' doesn't make any sense. There are simply unconfirmed transactions, and then there are confirmed (and thus ordered) transactions that are a part of the blockchain record.

There are some cases where the ordering of transactions will matter though, for example if you create two transactions, and the second transaction spends an output that was created by the first transaction. In that case, the second transaction would only be valid if the first transaction is included ahead of it, since the second transaction would otherwise be spending a non-existent output.

> If (1) is true, as a payment system, you can't get the correct timeline when backtracking, is this a design flaw?

As mentioned above, the explicit ordering of transactions is defined by their inclusion in the blockchain record. Building a system that attempts to order unconfirmed transactions wouldn't be very useful in many cases.


---

### Answer by username_2 on 2022-01-18. Score: 2

Bitcoin uses a UTXO model – all bitcoin exists in the form of unspent transaction outputs (UTXOs). So there are a number of different scenarios depending on how many UTXOs you have and what you do with them:

1. You have a single\* UTXO of 1 BTC. You create a single transaction paying 0.2 BTC to Alice, 0.2 BTC to Bob and 0.6 BTC back to yourself. A transaction is atomic, so miners cannot in any way separate the payment to Alice from the payment to Bob.
2. You have a single\* UTXO of 1 BTC. You create a transaction paying 0.2 BTC to Alice and 0.8 BTC to yourself, and then another transaction spending that 0.8 BTC, paying 0.2 BTC to Bob and 0.6 BTC to yourself. Because the latter transaction is dependent on the former, it cannot be confirmed (mined) before the former is confirmed. They may be mined within the same block, but they must have a correct order within that block.
3. You have two UTXOs of 0.5 BTC each. You create two transactions each paying Alice and Bob respectively 0.2 BTC and 0.3 BTC to yourself. Broadcasting them to the network in a specific order doesn't guarantee that they will be confirmed in that order.

\* Or multiple smaller UTXOs that you will be spending together in one transaction.


---

