OpenTimestamps: A Step-by-Step Tutorial
This tutorial breaks down the OpenTimestamps protocol into the following granular steps:
1. Calculating the Data File Hash Value
Calculate the hash value associated with the data file to be timestamped; the hash value acts as a digital fingerprint, ‘uniquely’ identifying the unmodified original document. The hash is calculated locally inside the browser without disclosing the document to third parties, preserving privacy; no internet connectivity is required.
2. Submitting the Hash for Attestation
Submit the hash to a selected set of OpenTimestamps public calendar servers (e.g., btc.ots.dgi.io) for attestation of its existence (timestamp) in the Bitcoin blockchain through a Bitcoin transaction; internet connectivity is required. The submission receipt is saved locally.
In time, this hash will be attested in a Bitcoin block header and the submission receipt will become upgradable to attestation proof. The submission receipt is not an attestation proof yet — it cannot be verified immediately, as it takes up to a few hours for the timestamp to be confirmed by the Bitcoin blockchain.
To avoid the inefficiency of one blockchain transaction for every document hash, a calendar server provides aggregation of multiple hashes in a Merkle tree data structure and performs their attestation in a single transaction, effectively attesting only the Merkle tree root, which is itself a hash value.
Compute a hash in step 1 first.
3. Loading the OTS Receipt/Proof From File
Load an existing OTS receipt/proof from a local file; no internet connectivity is required.
4. Displaying the OTS Receipt/Proof Information
Display the information included in the OTS receipt/proof, including the actual commitment operations and attestations (if any); no internet connectivity is required.
Submit a hash (step 2) or load a receipt/proof (step 3) first.
5. Upgrading the OTS Receipt/Proof
Attempt to upgrade the OTS receipt/proof with attestations that might be available from the selected OpenTimestamps calendars; internet connectivity is required.
To be upgraded to proof status, incomplete receipts require the assistance of the remote calendars used for timestamping: each calendar has to provide its attestation as a path to a Bitcoin block header. Upgrading an OTS receipt adds the path(s) to the Bitcoin block header(s), making it a self-contained, calendar-independent OTS proof.
Even proofs can be updated, if a calendar can add its attestation to the ones previously provided by other calendars. Of course, the earliest attestation is the most relevant: subsequent ones do not add relevant information.
Submit a hash (step 2) or load a receipt/proof (step 3) first.
6. Verifying the OTS Receipt/Proof
Verify the attestations included in the OTS receipt/proof (if any); internet connectivity is required.
OTS receipts/proofs can be verified independently from any OpenTimestamps server or facility, using a local Bitcoin Core node; since a web page cannot access the local filesystem, however, this page relies on public block-explorers for verification.
First, an upgraded proof is obtained from the selected calendar servers if available (as in the step above, performed here too to ensure up-to-date information), then the receipt/proof status is displayed below.
Submit a hash (step 2) or load a receipt/proof (step 3) first.