Verifying the authenticity of the files
The API provides two methods of verifying if a file has been or is being notarized by the notary service:
Verify a file by sending it to the notary service. The file cannot be larger than 1 GiB. The service does not upload this file to the notary storage but only calculates the SHA-256 hash value of the file contents.
Verify a file by sending a pre-calculated hash value of its contents to the notary service. This method is faster and more secure because no file data is transferred over the network. Also, the file can be of any size.
The API also provides the same verification methods with possibility to verify multiple files or hashes. Refer to “Verifying the authenticity of multiple files by their hashes” or “Verifying the authenticity of multiple files by sending them to the notary service”.
After calculating or receiving a hash value of the file contents, the service searches this value in all notarization certificates stored in the service and provides the notarization certificate that matches provided notarization certificate ID and the hash value to the API.
After you receive the notarization certificate, you can verify the authenticity of the file against the notarization certificate information in the following steps:
Check that the hash of the Merkle Tree root is stored in the blockchain by opening the transaction details on https://etherscan.io/tx/{txid}, and checking that the Data field in the Logs tab is equal to the value of the
merkle_root
key.Check that the Merkle Tree contains the file hash by using the following command line utility https://github.com/acronis/notary-verifyhash.