Trusted timestamps on Stellar blockchain

An example to show how to implement your next trusted timestamp system on Stellar blockchain

Transactions in a blockchain are marked by an unique identifier and a UTC timestamp. Linking a transaction to an external public document means that you can assign a certified timestamp to it.

I made a simple proof-of-concept on the Stellar public blockchain in order to suggest some ideas for a possible fully-automated implementation.

A way to create a reference from a Stellar transaction to a public available file is to compute its md5sum hash and write it, for example, in the MEMO field. In this PoC, I managed to embed the Transaction Sequence Number inside the document itself, before computing md5sum, and that’s quite self-referring.

Additionally, but not required, I also signed the linked document with my GPG key.

You can run an example by yourself, on the public or testnet Stellar blockchain, by using Stellar Laboratory (Transaction Builder) and the following checklist.

  1. Create a text file (check mine here) containing the Transaction Sequence Number (not known yet - it will be placed later), the account (Stellar public address) you are going to use for this transaction and some other info you like.
  2. Open Stellar Laboratory, select the blockchain (test, public or custom) and then select Transaction Builder.
  3. Set the Source Account field with the address of your Stellar account.
  4. Fetch a new Transaction Sequence Number by pressing the related button.
  5. Copy the Transaction Sequence Number in your text file (let’s say, filename.txt) and save it.
  6. Optional: sign the above file by using GPG (e.g.: gpg --clearsign -a filename.txt) - you’ll get the file filename.txt.asc (check mine here).
  7. Compute the md5sum hash of your final text file (signed or not) - on Linux: md5sum filename.txt or md5sum filename.txt.asc.
  8. Copy the 32-character long md5sum hash value.
  9. On Stellar Laboratory set the Memo field as Hash and paste the above md5sum hash in the text field provided - prefix this string with 32 0 characters until the red warning message below the text field disappears.
  10. On Stellar Laboratory, select Operation Type as Set Options.
  11. Complete this transaction by signing with your secret key for the specified account.

And you are done!

In my PoC, I initially got the Transaction Sequence Number 100280644478697712.

The md5sum for my final file is 4cf0a5e75839b76157a84b91b1a5ce99.

You can check my transaction here - you can easily find yours searching by transaction number. More in detail:

  • “Created at” field is our certified timestamp.
  • Fee paid was only 0.00001 XLM : that’s incredibily cheap!
  • “Memo (HASH)” is the reference (md5sum) to our original file - select display in hex format and consider the last 32 characters.

Now your turn, in order to customize this scheme and write some code, according to your needs!