Verifying Assets and Events with Simple Hash

Ensure Asset and Event Data Has Not Changed

Verifying your Simple Hash events provides an additional layer of assurance to your data, so you can ensure the information you have at a given time has not changed.

To verify your data, you may use the DataTrails Simple Hash tool, available on GitHub.

Please note that with Simple Hash, Events are committed to the DataTrails blockchain as a batch. Events with the blue tick have been committed to the blockchain as part of a batch, and will have a Transaction ID. With the free tier of DataTrails, Simple Hash batched commits happen every 30 days by default. For Public Assets, batched commits happen each day. If the tick mark is grey, your event has been confirmed in the system but not yet committed to the blockchain. Your event(s) must have a blue tick for transaction details to be available for data verification.

Step-by-Step Guide for Using the Simple Hash Tool

  1. Retrieve your transaction information. This will give you the inputs you need in later steps to check the hash for that batch of Events.
For Public Assets, retrieve the transaction information from the public view of the Asset and Events, or from the Public Assets Endpoint.

Select Audit/Filters from the sidebar and select a Transaction from the Events Overview List.


Copy the start time and end time from the Simple Hash Details. These will be used as inputs to the DataTrails Simple Hash tool.

Simple Hash Details

The Blockchain API allows you to fetch transactions for an Event. See instructions for creating your BEARER_TOKEN_FILE here.

Using the Event ID as a parameter, run the following command:

curl -v -X GET \
     -H "@$HOME/.datatrails/bearer-token.txt" \<asset-id>/events/<event-id>

This will return a list of matching blockchain transactions, as well as the simple_hash_details. Copy the start_time and end_time values to be used as inputs to the DataTrails Simple Hash tool.

  1. Use the DataTrails Simple Hash tool to generate the hash of your Events.

Use Python pip utility to install the datatrails-simplehash package. This package is supported for Python versions 3.7, 3.8, 3.9, and 3.10.

python3 -m pip install datatrails-simplehash

You may then use the code to recreate the hash, using your BEARER_TOKEN_FILE as the auth_token and the start_date and end_date copied in the last step:

from datatrails_simplehash.v1 import (

with open("credentials/token", mode="r", encoding="utf-8") as tokenfile:
    auth_token =

    simplehash = anchor_events(
except SimpleHashError as ex:
    print("Error", ex)

    print("simplehash=", simplehash)

Run your Python file to return the hash value.

Note: SimpleHashClientAuthError is raised if the auth token is invalid or expired.

Enter the query information you copied in the last step and run the command. See instructions for creating your BEARER_TOKEN_FILE here.

Commands can be executed anywhere using a virtual environment and published wheel. Credentials are stored in files within the credentials directory.

Using an auth token directly:

python3 -m venv simplehash-venv
source simplehash-venv/bin/activate
python3 -m pip install -q datatrails_simplehash

datatrails_simplehashv1 \
    --auth-token-file "credentials/token" \
    --start-time "2022-11-16T00:00:00Z" \
    --end-time "2022-11-17T00:00:00Z"

rm -rf simplehash-venv

Using a Client ID and Client Secret:

python3 -m venv simplehash-venv
source simplehash-venv/bin/activate
python3 -m pip install -q datatrails_simplehash

CLIENT_ID=$(cat credentials/client_id)
datatrails_simplehashv1 \
    --client-id "${CLIENT_ID}" \
    --client-secret-file "credentials/client_secret" \
    --start-time "2022-11-16T00:00:00Z" \
    --end-time "2022-11-17T00:00:00Z"

rm -rf simplehash-venv
Note: If you are using an environment other than, add the URL with the --fqdn option. For example, --fqdn "".
  1. Compare the hash from your Transaction Details to the hash generated by the tool. If they match, your Event history has not changed.