Notarizations with the Bitcoin Blockchain
Continued working on an art project this weekend and got to thinking about copyright. I know very little about copyright, but I do know a little about bitcoin. I recalled seeing a project called “Proof of Existence” (today it’s the 2nd result if you google “blockchain notarization”) and felt it might be something useful.
While attempting to use the service however I realized that there was no open source method for verifying that the hashes actually get written. And there is no point in using such a service without that, because then I have no idea if these people are taking my hard-earned bitcoins and storing the hashes somewhere odd. I mean, they could be storing hashes in steganographically encoded family photos hosted on imgur for all I know!
So I endeavored to learn a little more about storing things on the blockchain. I already knew this was hijacking an existing system, that the blockchain currently stands at ~50gb(?), and that I’d have to spend $$$ to store anything.
Then after some reading, I imagined a basic notarization scheme, which I describe here.
Appending to the Blockchain there is a 20-char limit if you want to use addresses to encode the data; this has to do with the fact that 20 ascii characters hash to 34 characters in hex (which is the length of a bitcoin address). So, to naively append notary data using wallet addresses,
Hash the file you’d like to notarize with SHA-256: the resulting hash should be 64 chars.
Chunk the 64-char hash into 4 strings as follows:
# First string. "1:<first 14 characters>" # Second string. "2:<next 18 characters>" # Third string. "3:<next 18>" # Fourth string. "4:<next 14>----"
Convert each 20-char string into a hexadecimal string (34 chars).
Find each of the 4 addresses you need to pay:
- Send the minimum # of bitcoins to each address; message will show up in the blockchain when the transaction gets mined. Note that this kind of transaction use is generally frowned upon.
The details of how to verify are still kind of unclear as my understanding of the bitcoin spec is murky at best, but it should just be a matter of searching through the downloaded blockchain for your 4 hex strings. If they exist (presumably as transactions from 1 sender) then that should be a pretty firm indication that your file existed at the time, effectively notarizing it.
If I have some free time maybe I’ll try building a simple implementation of this.