How to properly and immutably create a timestamp for a document (using Blockchain technology)
I had written a Math paper which was not good enough to be published in a journal, yet I wanted to have proof of the date I wrote it on so I could post the paper on the web without other people later being able to question who first came up with the idea.
The way I thought was more correct to do this was to publish the paper's sha256 checksum on the Bitcoin blockchain. Posting the SHA on social media (such as x.com) was not enough, as paid members can edit their old posts.
I got in touch with BBRTJ, the maintainer of Bitcoin::Crypto, who was very helpful in teaching me how to use his module and achieving my aim.
The goal, he told me, was to include the SHA256 checksum as the comment (technically the 'NULLDATA') of a small bitcoin transaction.
- I created a BTC address with Perl, using Bitcoin::Crypto
- I transferred a very few dollars worth of BTC to this address
- I found the transaction ID at mempool
- I found the index number of the ouptut of the transaction that got crypto into my address, because this number together with the transaction ID are what form the UTXO
- I used this UTXO as input (funds) in a new transaction that had two outputs: One output was the NULLDATA string (the "comment" that contains the SHA256 checksum of the PDF document), and the other was a "change" address of mine, which would receive the rest of the money from the UTXO (full amount minus transaction fee (around $1)).
Here are these steps in more detail, and with code: