NAV Navigation
Shell Java Go JavaScript Ruby Python HTTP

SealAPI

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

The Cryptowerk Seal API is a solution to accelerate and simplify the development of blockchain applications. With the help of this API you can proof the existence of a document or any other kind of data at a certain time without needing a trusted third party. This API supports high data volumes and reduces the cost of using a public blockchain.

Overview

With the The Cryptowerk Seal API fingerprints of any number of digital assets can be stored in one or more blockchains. Fingerprints (i.e. hashes) are stored using the sealing operation and the result contains a unique Retrieval-ID. After the fingerprints have been stored in one or more blockchains, the Retrieval-ID can be exchanged with a seal. The seal contains all information necessary to prove that the fingerprints registered are now part of the chosen blockchains.

The flows supported by this API are:

Hash(es) --> Retrieval-ID --> Seal

The Retrieval-ID for each hash can be found in the response JSON of a sucessful 'register' call.

There are two approaches to retrieve the actual Seal:

Polling

Call /verify in an interval and provide the retrievalID(s) and check for the return value. If you don't have the retrievalID, you can also use the hash originally registered. Note though that there could be duplicates returned. (Hashes are not unique)

Webhook

Specify a callback URL when registering hashes using /register. Once the seal becomes available the Seal API will make a POST request to the URL given. The User-Agent header of the request identifies the Seal Server and is set to Cryptowerk Callback v1.

If the endpoint is unavailable, Seal will re-try after 60 seconds for 12 hours total.

Seals

Seals contain data to allow you to verify the existence of the hashes you registered with the Seal API on the configured blockchains. Technical details can be found on the Cryptowerk homepage.

API Credentials

Authentication is based on providing your API key and signing with the API secret. You can request an API key and secret in the Seal API portal.

In the examples below, the API key and secret is transmitted as custom header X-API-Key. To create a valid value concatenate the API Key and secret separated by a space.

X-API-Key: V....o= A...DRM="
HttpURLConnection con = ...
con.addRequestProperty("X-API-Header", apiKey + " "+ apiSecret);

You can also transmit the information in query parameters as an alternative (see API docs below)

Base URLs:

Email: Cryptowerk Web: Cryptowerk License: Proprietary license.

Authentication

Sealing

Operations related to sealing generic data items.

register

Code samples

# You can also use wget
curl -X POST https://developers.cryptowerk.com/platform/API/v6/register?version=6&hashes=1111111111111111111111111111111111111111111111111111111111111111%2C2222222222222222222222222222222222222222222222222222222222222222 \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

URL obj = new URL("https://developers.cryptowerk.com/platform/API/v6/register?version=6&hashes=1111111111111111111111111111111111111111111111111111111111111111%2C2222222222222222222222222222222222222222222222222222222222222222");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-API-Key": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://developers.cryptowerk.com/platform/API/v6/register", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

var headers = {
  'Accept':'application/json',
  'X-API-Key':'API_KEY'

};

$.ajax({
  url: 'https://developers.cryptowerk.com/platform/API/v6/register',
  method: 'post',
  data: '?version=6&hashes=1111111111111111111111111111111111111111111111111111111111111111%2C2222222222222222222222222222222222222222222222222222222222222222',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-API-Key' => 'API_KEY'
}

result = RestClient.post 'https://developers.cryptowerk.com/platform/API/v6/register',
  params: {
  'version' => 'integer',
'hashes' => 'string'
}, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'X-API-Key': 'API_KEY'
}

r = requests.post('https://developers.cryptowerk.com/platform/API/v6/register', params={
  'version': '6',  'hashes': '1111111111111111111111111111111111111111111111111111111111111111,2222222222222222222222222222222222222222222222222222222222222222'
}, headers = headers)

print r.json()

POST https://developers.cryptowerk.com/platform/API/v6/register?version=6&hashes=1111111111111111111111111111111111111111111111111111111111111111%2C2222222222222222222222222222222222222222222222222222222222222222 HTTP/1.1

Accept: application/json

POST /register

Register hashes

The register command posts a hash of a document or any data for registration on a blockchain. The blockchain entry can later be used as a mathematical proof for the existence of this data at the moment it was posted.

Parameters

Name In Type Required Description
version query integer true Backend API version to use by this call.
name query string false Name of the document
hashes query string true Comma separated hexadecimal representation of the hashes for the data to be registered for proof of existence.
contentType query string false This value describes the content type (mime type) of the data.
callback query string false callback url for the initial registration event in each of the required blockchains.
apiKey query string false Key that identifies the account. It can be provided (1) here as a query parameter or (2) as a header named X-API-Key with apiKey and apiCredential separated by a blank space or (3) by logging in using AWS Cognito.
apiCredential query string false A credential matching a user of an account. It can be provided (1) here as a query parameter or (2) as a header named X-API-Key with apiKey and apiCredential separated by a blank space or (3) by logging in using AWS Cognito. The API credential is only valid together with the API key. It verifies the authenticity of the account access.

Example responses

200 Response

{
  "minSupportedAPIVersion": 0,
  "maxSupportedAPIVersion": 0,
  "documents": [
    {
      "retrievalId": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful response Registration
400 Bad Request Bad request (for example - header field missing, wrong filter, validation failed) None
403 Forbidden Forbidden (insufficient authorization) None
500 Internal Server Error Internal server error None

verify

Code samples

# You can also use wget
curl -X POST https://developers.cryptowerk.com/platform/API/v6/verify?version=6 \
  -H 'Accept: application/json' \
  -H 'X-API-Key: API_KEY'

URL obj = new URL("https://developers.cryptowerk.com/platform/API/v6/verify?version=6");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "X-API-Key": []string{"API_KEY"},
        
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://developers.cryptowerk.com/platform/API/v6/verify", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

var headers = {
  'Accept':'application/json',
  'X-API-Key':'API_KEY'

};

$.ajax({
  url: 'https://developers.cryptowerk.com/platform/API/v6/verify',
  method: 'post',
  data: '?version=6',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'X-API-Key' => 'API_KEY'
}

result = RestClient.post 'https://developers.cryptowerk.com/platform/API/v6/verify',
  params: {
  'version' => 'integer'
}, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'X-API-Key': 'API_KEY'
}

r = requests.post('https://developers.cryptowerk.com/platform/API/v6/verify', params={
  'version': '6'
}, headers = headers)

print r.json()

POST https://developers.cryptowerk.com/platform/API/v6/verify?version=6 HTTP/1.1

Accept: application/json

POST /verify

Verify hashes, check registration

Either (1) check registration status of previously registered hashes or (2) verify a previously issued seal.

Parameters

Name In Type Required Description
version query integer true Backend API version to use by this call.
retrievalId query string false This is the retrievalId that was returned in a previous 'register' call.
retrievalIds query array[string] false Here you can specify more than one 'retrievalId' in order to check more than one previously submitted registration status.
retrievalDocHash query string false Instead of providing a unique 'retrievalId' that specifies exactly one registration, you can lookup matching hashes. Note, though, that this might return many registrations, and not necessarily all yours. An example value would be: 1111111111111111111111111111111111111111111111111111111111111111
provideVerificationInfos query boolean false This provides additional verification information.
verifyDocHashes query string false This is the start of the second group of operations, u.e. to verify a previously issued seal.
seals query string false This is a comma-separated list of seals to check against the hashes.
provideInstructions query boolean false This provides additional instructions to verify the hash(es).
apiKey query string false Key that identifies the account. It can be provided (1) here as a query parameter or (2) as a header named X-API-Key with apiKey and apiCredential separated by a blank space or (3) by logging in using AWS Cognito.
apiCredential query string false A credential matching a user of an account. It can be provided (1) here as a query parameter or (2) as a header named X-API-Key with apiKey and apiCredential separated by a blank space or (3) by logging in using AWS Cognito. The API credential is only valid together with the API key. It verifies the authenticity of the account access.

Detailed descriptions

retrievalDocHash: Instead of providing a unique 'retrievalId' that specifies exactly one registration, you can lookup matching hashes. Note, though, that this might return many registrations, and not necessarily all yours. An example value would be: 1111111111111111111111111111111111111111111111111111111111111111

verifyDocHashes: This is the start of the second group of operations, u.e. to verify a previously issued seal. Note that instead you also can verify that yourself. We provide software in source code for that purpose. This ensures that you don't have to rely on us to be able to prove the existence of a registration to anyone. However, you might want to use this verification service for convenience. This parameter contains a comma-separated list of hex-encoded hashes of the document(s) you want to check against a previous registration. An example value would be: 1111111111111111111111111111111111111111111111111111111111111111,2222222222222222222222222222222222222222222222222222222222222222

Example responses

200 Response

{
  "minSupportedAPIVersion": 0,
  "maxSupportedAPIVersion": 0,
  "documents": [
    {
      "retrievalId": "string",
      "seals": [
        {
          "bundleMethod": "string",
          "operations": [
            {
              "opcode": "DOC_SHA256",
              "docHash": "stringstringstringstringstringstringstringstringstringstringstri"
            }
          ]
        }
      ],
      "name": "string",
      "submittedAt": 0,
      "contentType": "string",
      "hasBeenInsertedIntoAtLeastOneBlockchain": true,
      "hasBeenInsertedIntoAllRequestedBlockchains": true,
      "blockchainRegistrations": [
        {
          "blockChainId": "string",
          "insertedIntoBlockchainAt": 0,
          "numConfirmations": 0,
          "blockChainDesc": {
            "instanceName": "string",
            "generalName": "string"
          }
        }
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful response Inline
400 Bad Request Bad request (for example - header field missing, wrong filter,validation failed) None
403 Forbidden Forbidden (insufficient authorization) None
500 Internal Server Error Internal server error None

Response Schema

Status Code 200

Name Type Required Restrictions Description
minSupportedAPIVersion integer false none API version must be greater or equal to this value on this server
maxSupportedAPIVersion integer false none API version must be less or equal to this value on this server
documents [object] false none Array of documents that were found by the given parameters
retrievalId string false none Unique identifier for the document.
seals [Seal] false none A Seal contains the information required to prove that a document had been registered in a blockchain. I.e., among other things, it contains a (transaction) identifier in one or multiple blockchains, the hash of a document, the conclusive mathematical proof linking the document to the blockchain demonstrating the document's existence at registration time and it not having been tampered with, the time this document was submitted to the server and the time it was submitted to the blockchain.
bundleMethod string false none none
operations [oneOf] false none none

oneOf

Name Type Required Restrictions Description
anonymous object false none none
opcode string false none none
docHash string false none none

xor

Name Type Required Restrictions Description
anonymous object false none none
opcode string false none none
hash string false none none

xor

Name Type Required Restrictions Description
anonymous object false none none
opcode string false none none
hash string false none none

xor

Name Type Required Restrictions Description
anonymous object false none none
opcode string false none none
hash string false none none

xor

Name Type Required Restrictions Description
anonymous object false none none
opcode string false none none
blockchainGeneralName string false none none
instanceName string false none none
blockChainId string false none none
insertedIntoBlockchainAt integer(int64) false none none

xor

Name Type Required Restrictions Description
anonymous object false none none
opcode string false none none
lookupInfo string false none none
name string false none none
contentType string false none none
submittedAt integer(int64) false none none

xor

Name Type Required Restrictions Description
anonymous object false none none
opcode string false none none
data string false none none
metaDataStamps [Seal] false none none

continued

Name Type Required Restrictions Description
name string false none This is the same name that was used for the registration of this document.
submittedAt integer(int64) false none Time stamp when this document/hash was received by the server (milliseconds since 1/1/1970 12:00am UST)
contentType string false none This is the same content type as on registration of the document.
hasBeenInsertedIntoAtLeastOneBlockchain boolean false none This property is true, if the document has been registered with at least one blockchain, otherwise it is false.
hasBeenInsertedIntoAllRequestedBlockchains boolean false none This property is true, if the document has been registered with all requested blockchains, otherwise it is false.
blockchainRegistrations [object] false none none
blockChainId string false none id for the used blockchain.
insertedIntoBlockchainAt integer(int64) false none Time stamp for the blockchain registration of the document bundle that contains this document in the blockchain (milliseconds since 1/1/1970 12:00am UST).
numConfirmations integer false none Number of verifications that witness the document bundle in the blockchain.
blockChainDesc object false none none
instanceName string false none Name of the blockchain instance
generalName string false none General name of the blockchain instance

Enumerated Values

Property Value
opcode DOC_SHA256
opcode APPEND_THEN_SHA256
opcode PREPEND_THEN_SHA256
opcode ANCHOR_SHA256
opcode BLOCKCHAIN
opcode DOCUMENTINFO
opcode SEALEDMETADATA

Schemas

Empty

{}

Empty Schema

Properties

None

Seal

{
  "bundleMethod": "string",
  "operations": [
    {
      "opcode": "DOC_SHA256",
      "docHash": "stringstringstringstringstringstringstringstringstringstringstri"
    }
  ]
}

Properties

Name Type Required Restrictions Description
bundleMethod string false none none
operations [oneOf] false none none

oneOf

Name Type Required Restrictions Description
anonymous object false none none
opcode string false none none
docHash string false none none

xor

Name Type Required Restrictions Description
anonymous object false none none
opcode string false none none
hash string false none none

xor

Name Type Required Restrictions Description
anonymous object false none none
opcode string false none none
hash string false none none

xor

Name Type Required Restrictions Description
anonymous object false none none
opcode string false none none
hash string false none none

xor

Name Type Required Restrictions Description
anonymous object false none none
opcode string false none none
blockchainGeneralName string false none none
instanceName string false none none
blockChainId string false none none
insertedIntoBlockchainAt integer(int64) false none none

xor

Name Type Required Restrictions Description
anonymous object false none none
opcode string false none none
lookupInfo string false none none
name string false none none
contentType string false none none
submittedAt integer(int64) false none none

xor

Name Type Required Restrictions Description
anonymous object false none none
opcode string false none none
data string false none none
metaDataStamps [Seal] false none none

Enumerated Values

Property Value
opcode DOC_SHA256
opcode APPEND_THEN_SHA256
opcode PREPEND_THEN_SHA256
opcode ANCHOR_SHA256
opcode BLOCKCHAIN
opcode DOCUMENTINFO
opcode SEALEDMETADATA

Registration

{
  "minSupportedAPIVersion": 0,
  "maxSupportedAPIVersion": 0,
  "documents": [
    {
      "retrievalId": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
minSupportedAPIVersion integer false none API version must be greater or equal to this value on this server
maxSupportedAPIVersion integer false none API version must be less or equal to this value on this server
documents [object] false none none
retrievalId string false none This ID can be used to verify the existence of a document (see /verify)

Verification

{
  "minSupportedAPIVersion": 0,
  "maxSupportedAPIVersion": 0,
  "documents": [
    {
      "retrievalId": "string",
      "seals": [
        {
          "bundleMethod": "string",
          "operations": [
            {
              "opcode": "DOC_SHA256",
              "docHash": "stringstringstringstringstringstringstringstringstringstringstri"
            }
          ]
        }
      ],
      "name": "string",
      "submittedAt": 0,
      "contentType": "string",
      "hasBeenInsertedIntoAtLeastOneBlockchain": true,
      "hasBeenInsertedIntoAllRequestedBlockchains": true,
      "blockchainRegistrations": [
        {
          "blockChainId": "string",
          "insertedIntoBlockchainAt": 0,
          "numConfirmations": 0,
          "blockChainDesc": {
            "instanceName": "string",
            "generalName": "string"
          }
        }
      ]
    }
  ]
}

Properties

Name Type Required Restrictions Description
minSupportedAPIVersion integer false none API version must be greater or equal to this value on this server
maxSupportedAPIVersion integer false none API version must be less or equal to this value on this server
documents [object] false none Array of documents that were found by the given parameters
retrievalId string false none Unique identifier for the document.
seals [Seal] false none A Seal contains the information required to prove that a document had been registered in a blockchain. I.e., among other things, it contains a (transaction) identifier in one or multiple blockchains, the hash of a document, the conclusive mathematical proof linking the document to the blockchain demonstrating the document's existence at registration time and it not having been tampered with, the time this document was submitted to the server and the time it was submitted to the blockchain.
name string false none This is the same name that was used for the registration of this document.
submittedAt integer(int64) false none Time stamp when this document/hash was received by the server (milliseconds since 1/1/1970 12:00am UST)
contentType string false none This is the same content type as on registration of the document.
hasBeenInsertedIntoAtLeastOneBlockchain boolean false none This property is true, if the document has been registered with at least one blockchain, otherwise it is false.
hasBeenInsertedIntoAllRequestedBlockchains boolean false none This property is true, if the document has been registered with all requested blockchains, otherwise it is false.
blockchainRegistrations [object] false none none
blockChainId string false none id for the used blockchain.
insertedIntoBlockchainAt integer(int64) false none Time stamp for the blockchain registration of the document bundle that contains this document in the blockchain (milliseconds since 1/1/1970 12:00am UST).
numConfirmations integer false none Number of verifications that witness the document bundle in the blockchain.
blockChainDesc object false none none
instanceName string false none Name of the blockchain instance
generalName string false none General name of the blockchain instance