How can we use Timestamps in Multichain ?

+2 votes
I am actually using Data Streams for my project. There is a point where i need to timestamp the items that i am publishing to the stream.

as far as i know, each Multichain transaction is timestamped.

However, i need the timestamp to be appended to the metadata of my stream item. so i have 2 questions;

1. How exactly does Multichain ascertain the accuracy of a timestamp ? does it use the PC's time, which can be unreliable and can easily be hacked. or does it use some internet time protocol ? Please elaborate

2. How can a develop access the timestamp at the time of PUBLISHING the item to the stream ? so that we can use it in our steam item's metadata ?

Please let me know at the earliest
asked Jun 1, 2019 by Yasir

1 Answer

0 votes

Timestamping in blockchains is based on the *block* in which an item is confirmed, not the time of creating the transaction. This timestamp is added by the node ("miner") that generated the block and verified by all other nodes as being reasonably close to their own timestamps (within the scale of a few minutes).

If you want to timestamp individual stream items, you would add this information as part of the stream item itself. Then when reading these timestamps within stream items could be verified against the block timestamps, to check they are reasonable, i.e. within a few minutes. Or you could use a smart filter (stream filter) to do this automatically, by comparing against the last block's timestamp via getlastblockinfo().time

Of course in this scenario a node could still fake the time a few minutes in either direction. For more strict timestamping, you would need to use one or more trusted timestamping services, and include signed attestations from those services regarding the time. These could also be included in stream items and verified using a stream filter using verifymessage.

answered Jun 2, 2019 by MultiChain
...