I want to sort transactions, within a specific tag, in temporal order. In the docs it says:

timestamp : Int timestamp of the transaction. It is important to know that timestamps in IOTA are not enforced.

Is there a convention regarding the time zones to be used? And what's about attachmentTimestamp? On which of the time-related fields, timestamp or attachmentTimestamp, should I relay?


Timestamps in transactions are expected to be unix timestamp. Unix timestamps are timezone independent.

Most importantly, timestamps are set by the client (i.e. the sender) and nothing in the protocol guarantees that they are correct. So relying on timestamp/attachmentTimestamp to re-order the transactions is probably not the best option (unless you have a complete control of the client).

If you need ordered messages, you can look at Masked Authenticated Messaging (aka MAM) were in addition to strict message ordering you can also have (optionnaly) encryption of the data.

Your Answer

