<p>The arrow-of-time in bitcoin is achieved through the blockchain. The whole point of proof-of-work is to arrange transactions in chronological order, to prevent double-spending.</p>

<p>Under this light, transactions in the same block cannot be put in strict chronological order; the time each miner saw an unverified transaction varies depending on their view of the network. The only certain order is that transactions in a future block happened after transactions in a past block (a parent block) on the blockchain.</p>

<p>You can order transactions heuristically if you want, but this is not cryptographically secure. One way to do it is to look at when they first appeared on the network, e.g. on blockchain.info or some other such service.</p>

CC BY-SA 3.0
2014-09-07T11:22:24.447Z
Very true, wouldn't have said it better myself. It is important to realize the relativeness of time in general, especially when considering distributed systems. Even if nobody cheated (a naive assumption), the "chronological ordering" by the time record is not objective. You can see the Blockchain as a heartbeat providing the base frequency, and one block as an elementary time step, just like Planck time in the real world. It makes no sense to ask about the order of inner transactions, as this is the finest granularity you can technically get.
knaperek
CC BY-SA 3.0
2014-09-07T13:48:49.223Z
There's a minor case where correct ordering is guaranteed: If transaction Y spends coins from transaction X, and if they're both included in a single block, then X must be listed somewhere before Y in the block.
theymos
CC BY-SA 3.0
2014-08-08T10:43:49.850Z
2014-08-08T10:43:49.850Z
dionyziz
<p>Process the raw transaction and look at the time that the transaction hit the network (the epoch time).</p>

<p>Do you need a pointer of how to do that?</p>

CC BY-SA 3.0
2014-01-08T15:05:59.800Z
Does blockchain.info use the epoch time?  for example https://blockchain.info/address/192NZPzSXSqXEuNJJDbQrSyy4rsmRLvour?format=json .   I don't see the time field defined anywhere.
jimmy
CC BY-SA 3.0
2014-01-08T15:09:49.290Z
I'm not exactly sure what they use because its a closed sourcecode but I would assume they use epoch time at least to record each new transaction coming in the rawmempool.
Joe White
CC BY-SA 3.0
2014-01-08T15:12:33.577Z
Where else can I get the epoch time of a transaction?
jimmy
CC BY-SA 3.0
2014-01-08T15:22:49.750Z
Get the txid, next get the raw transaction id from bitcoind, then use decoderawtransaction to see the transaction details.
Joe White
CC BY-SA 3.0
2014-02-07T20:33:47.683Z
Transactions do no have a time stamp. You need to see when you first heard about it (which bitcoind only tracks for wallet transactions).
Pieter Wuille
CC BY-SA 3.0
2014-01-08T15:01:22.863Z
2014-01-08T15:01:22.863Z
Joe White
<p>Is there any way to chronologically sort transactions within a block?  </p>

<blockchain>
Chronologically sorting transactions within a block
jimmy
# Chronologically sorting transactions within a block

(Asked by: username_0 on 2014-01-08)

Is there any way to chronologically sort transactions within a block?

**Tags:** blockchain


---

## 2 answers

### Answer by username_1 on 2014-08-08. Score: 4

The arrow-of-time in bitcoin is achieved through the blockchain. The whole point of proof-of-work is to arrange transactions in chronological order, to prevent double-spending.

Under this light, transactions in the same block cannot be put in strict chronological order; the time each miner saw an unverified transaction varies depending on their view of the network. The only certain order is that transactions in a future block happened after transactions in a past block (a parent block) on the blockchain.

You can order transactions heuristically if you want, but this is not cryptographically secure. One way to do it is to look at when they first appeared on the network, e.g. on blockchain.info or some other such service.

> **Comments:**
> **username_2**: Very true, wouldn't have said it better myself. It is important to realize the relativeness of time in general, especially when considering distributed systems. Even if nobody cheated (a naive assumption), the "chronological ordering" by the time record is not objective. You can see the Blockchain as a heartbeat providing the base frequency, and one block as an elementary time step, just like Planck time in the real world. It makes no sense to ask about the order of inner transactions, as this is the finest granularity you can technically get.  
> **username_3**: There's a minor case where correct ordering is guaranteed: If transaction Y spends coins from transaction X, and if they're both included in a single block, then X must be listed somewhere before Y in the block.  

---

### Answer by username_4 on 2014-01-08. Score: 0

Process the raw transaction and look at the time that the transaction hit the network (the epoch time).

Do you need a pointer of how to do that?

> **Comments:**
> **username_0**: Does blockchain.info use the epoch time?  for example https://blockchain.info/address/192NZPzSXSqXEuNJJDbQrSyy4rsmRLvour?format=json .   I don't see the time field defined anywhere.  
> **username_4**: I'm not exactly sure what they use because its a closed sourcecode but I would assume they use epoch time at least to record each new transaction coming in the rawmempool.  
> **username_0**: Where else can I get the epoch time of a transaction?  
> **username_4**: Get the txid, next get the raw transaction id from bitcoind, then use decoderawtransaction to see the transaction details.  
> **username_5**: Transactions do no have a time stamp. You need to see when you first heard about it (which bitcoind only tracks for wallet transactions).  

---

