API Documentation

Home / API

Add blockchain integration to your app with BCH Notary

Anchor any file or event to the Bitcoin Cash (BCH) blockchain for an immutable record.

Create a new proof

Description

Post your hash to the Notary API and receive an address and price for including in the BCH blockchain. Returns the price of anchoring (in satoshis), the URL of your anchor, and your payment address. After payment, your file is anchored to the blockchain forever.

Endpoint (POST)

https://notary-api.bitcoin.com/api/v1/proofs

Example (cURL)

curl -X POST "https://notary-api.bitcoin.com/api/v1/proofs" -d "3f772cc2096a317100504d7958ab4c5467729f49205f7ca8bcac703807f71e27"

Example (ReactJS)

const hash = '3f772cc2096a317100504d7958ab4c5467729f49205f7ca8bcac703807f71e27'
fetch('https://notary-api.bitcoin.com/api/v1/proofs', {
  method: 'POST',
  body: hash,
})
  .then(response => response.json())
  .then(
    response => {
      console.log(response);
    },
    err => {
      console.log(err);
    },
  );

  /* Successful response from notary.bitcoin.com
      {
        "status": "ok",
        "url": "https://notary.bitcoin.com/proof/?hash=3f772cc2096a317100504d7958ab4c5467729f49205f7ca8bcac703807f71e27",
        "address": "bitcoincash:qqxzcazdwqgsl6ja8yrcly3kwxmvuyp0xgazj8henh",
        "price": 5000,
        "anchored": false,
      }
  */

Get proof status

Description

Check the status of your blockchain anchor

Endpoint (GET)

https://notary-api.bitcoin.com/api/v1/proofs/<sha256hash>

Example (cURL)

curl "https://notary-api.bitcoin.com/api/v1/proofs/3f772cc2096a317100504d7958ab4c5467729f49205f7ca8bcac703807f71e27"

Example (ReactJS)

const hash = '3f772cc2096a317100504d7958ab4c5467729f49205f7ca8bcac703807f71e27'
fetch(https://notary-api.bitcoin.com/api/v1/proofs/${hash})
.then(response => response.json())
.then(
  response => {
    console.log(response);
  }
  err => {
    console.log(err)
  }
)

/* Sample successful response from notary.bitcoin.com
{
  "status": "ok",
  "data": {
    "id": 3,
    "hash": "3f772cc2096a317100504d7958ab4c5467729f49205f7ca8bcac703807f71e27",
    "address": "127NN3Q4QHLqVMeTMeefCVVNdie3whcbpq",
    "price": 5000,
    "stamp": 1585179532,
    "bcast": null,
    "anchor": [],
    "funds": [],
    "state": "unpaid",
    "balance": 5000
  }
}
*/