Learn / How a fingerprint ends up in Bitcoin

Lesson

How a log fingerprint ends up in Bitcoin

Each hour of logs gets a short fingerprint. That fingerprint is timestamped in Bitcoin, so nobody can quietly change the hour later. Here is the path, one hop at a time.

Step 1

A fingerprint is a hash

A hash function turns any text into a short fixed-length code. The same text always gives the same code. Change one character and the code is completely different.

You cannot work backwards from the code to the text. That makes it a good fingerprint: it identifies the text without revealing it.

The function is SHA-256. The lab below runs it live in your browser.

card A admittedcard B admittedhash9f2c41d7a0…e07b93c15d…One letter apart, nothing alike (example values)
Step 2

An hour becomes one root

Every log line is hashed. Pairs of hashes are hashed together, then pairs of those, until one hash is left. That last hash is the Merkle root of the hour.

Change any line and its hash changes. Every hash above it changes too, all the way to the root. One short root stands for the whole hour.

line 1line 2line 3line 4hash 1+2hash 3+4Root of the hour
Step 3

The root goes out behind a random nonce

The root is combined with a random nonce (a throwaway number) before it is sent. The calendars only see the combined hash. They never see the root itself or anything about the logs.

Four public calendar servers receive it. Each one collects fingerprints from many senders and folds them into one tree. Once in a while a calendar puts that tree's single root into one Bitcoin transaction. Thousands of fingerprints share one transaction, so the cost per fingerprint is tiny.

Hour root+ random nonceCalendar 1Calendar 2Calendar 3Calendar 4One Bitcointransaction
Step 4

The proof is a path of hashes

You get back a small file, a .ots proof. It records the path: your root, the nonce step, the calendar's tree, the Bitcoin transaction, and finally the block header that holds it.

At first the file is pending. It holds only the calendar's promise. After the transaction is confirmed in a block, the proof is upgraded to the full path, and it no longer depends on the calendar at all.

Your rootNonce hashCalendar treeBitcoin txBlock headerPending: only the calendar's promiseConfirmed: full pathThe proof is upgraded once the transaction is in a block
Step 5

Check it yourself, against your own node

Anyone can verify a proof with the standard ots tool. It follows the path and compares the result with a Bitcoin block header. Point it at your own Bitcoin node and the answer does not depend on any website.

A calendar can be slow, or go offline. It cannot forge a proof, because the block header is fixed by Bitcoin and the path must lead to it.

Once a day there is a second, independent record. The owner's own Bitcoin node publishes an OP_RETURN transaction carrying the text RPOW and the day's root. That anchor does not use any calendar.

.ots proofots verifyYour nodeblock headersmatch: unchangedDaily anchorOP_RETURN "RPOW"+rootown node, no calendar
Try it

Change one character, watch the path

Your browser computes real SHA-256. Your text becomes one log line, joined with three fixed demo lines into a four-line mini hour. The mock block header at the bottom holds the root.

Your line-
Demo line 2-
Demo line 3-
Demo line 4-
Hash 1+2-
Hash 3+4-
Root-
Mock block header-
Hashes changed
-
Against the original
-

Edit the line above.

Change one character in any line and every hash up the path changes, so the root no longer matches the one in Bitcoin.

Terms: fingerprint = hash (SHA-256); root = Merkle root; calendar = OpenTimestamps calendar server; the daily anchor is an OP_RETURN transaction. See also Sealed logs.