Developer API

This API allows developers to integrate their systems with proofofexistence's functionality. You can access all of the app's features through an HTTP interface.

It consists of the following two calls:

Let's explain the API using an example:

First we compute the SHA256 checksum hexdigest for a file we want to certify on the blockchain:
shasum -a 256 somefile.txt
15db6dbff597875ea13246e1c166802b690663c4e0635bfca78049d5a8762832  somefile.txt
Checking the status for a digest which was never submitted will give "success": false, as follows:
curl -k -d d=15db6dbff597875ea13246e1c166802b690663c4e0635bfca78049d5a8762832 http://www.proofofexistence.com/api/v1/status; echo
{
  "success": false,
  "reason": "nonexistent"
}
So, first, we want to register the document's digest in proofofexistence. This will return a bitcoin payment address, and the minimum price (in satoshi, 0.00000001 BTC = 1 satoshi) to be paid to that address in order to get the document proof inserted in the blockchain.
curl -k -d d=15db6dbff597875ea13246e1c166802b690663c4e0635bfca78049d5a8762832 http://www.proofofexistence.com/api/v1/register; echo
{
  "success": true,
  "digest": "15db6dbff597875ea13246e1c166802b690663c4e0635bfca78049d5a8762832",
  "pay_address": "1JP4ymzPo9rWmjzRazhRwJ4zYCJupqnTTJ",
  "price": 500000
}
If we now check the document's digest status, we get it is "registered". We want to get it from "registered" to "pending" after that.
curl -k -d d=15db6dbff597875ea13246e1c166802b690663c4e0635bfca78049d5a8762832 http://www.proofofexistence.com/api/v1/status; echo
{
  "success": true,
  "status": "registered"
}
After making payment to indicated address (1JP4ymzPo9rWmjzRazhRwJ4zYCJupqnTTJ) for a minimum value of 500000 satoshis:
curl -k -d d=15db6dbff597875ea13246e1c166802b690663c4e0635bfca78049d5a8762832 http://www.proofofexistence.com/api/v1/status; echo
{
  "success": true,
  "status": "pending"
}
This indicates the address received payment and you now have to wait for the certifying transaction (that stores the proof permanently in the blockchain) to be broadcasted. After payment was processed and the certifying transaction created, the status should change to "confirmed" (takes 1 minute on average):
curl -k -d d=15db6dbff597875ea13246e1c166802b690663c4e0635bfca78049d5a8762832 http://www.proofofexistence.com/api/v1/status; echo
{
  "success": true,
  "status": "confirmed",
  "transaction": "9dcb4b3a6ffa2106dc552f4699ad15073d1a7cca5413ebd4fae0c736bbe1946c"
}

As you can see, the status messages for confirmed documents also include the certifying bitcoin transaction id (txid).

That's it! If you have any questions/feedback/problems, drop me an email!

Calculating the SHA256 digest

Here are ways in which you can calculate your document's SHA256 digest. Of course you can also implement your own, these are here for reference.