← Development log

What Is Prime? Part 2: Fingerprints for Paper

In Part 1, we said a prime is a registered original capture, and that anyone can check a copy against it by recomputing its fingerprint. That raises a fair question. How can a short string of letters and numbers vouch for a whole page of handwriting, or a 300-page court record?

The answer is a tool computer scientists call a cryptographic hash. You use them every day without noticing. This post explains how they behave, with no math required.

A fingerprint, not a photograph

A hash function takes any file, of any size, and produces a short, fixed-length code from it. Primmortal's prototype uses SHA-256, a hash function standardized by the U.S. National Institute of Standards and Technology in FIPS 180-4. Whatever you feed it, a one-line note or a gigabyte of scans, it returns 64 characters.

Here is the SHA-256 fingerprint of the sentence "We hold these truths to be self-evident."

a9253cfc207729c6800248a0cb2e979f7bcdc7e1b5d3dd1f39fbb9bb5f01dda5

The word "fingerprint" fits well. A fingerprint identifies a person without being a picture of them. You can't look at one and tell someone's height, voice, or eye color. A hash works the same way. It identifies a file without containing it, and there is no practical way to run it backward and rebuild the document from those 64 characters.

One change, a whole new fingerprint

Now change just the period at the end of that sentence to an exclamation point.

d725da1e7b53ca5a2485b93e443cc20e0c0437b2d02727974453ee10c62825ca

One character changed, and the fingerprint is unrecognizable. Not a little different, not different only near the end, but completely different. That's by design. A good hash function scrambles its input so thoroughly that any change, however small, produces what looks like a brand-new random code.

The same is true for images. Brighten one pixel in a scan of a newspaper page, and its fingerprint changes completely. That's why a hash is so useful for checking copies. There is no "close enough." Either the file in front of you has exactly the same bits as the one that was registered, or it doesn't.

Three promises a hash makes

A hash function earns the word "cryptographic" by keeping three promises.

  • Same input, same output. Hash the same file today, next year, or in a century, on any computer, and you get the same 64 characters. That's what lets a stranger check a copy without asking anyone's permission.
  • No working backward. The fingerprint reveals nothing useful about the file's contents. Publishing a prime's fingerprint gives away nothing that isn't already public.
  • No look-alikes. It should be practically impossible to find two different files that share a fingerprint. The number of possible SHA-256 codes is 78 digits long, so stumbling onto a match by accident isn't a realistic worry. Building one on purpose is the real test.

That last promise is where hash functions are tested hardest, and occasionally fail. In 2017, researchers at Google and the CWI research institute in Amsterdam produced two different PDF files with the same SHA-1 fingerprint, proving that the older SHA-1 function could no longer be trusted for this job. No one has done the same to SHA-256. Still, an archive meant to last centuries has to plan for the day a function weakens. So the Primmortal design fingerprints every file twice, with SHA-256 and a second, independent function, and records which functions it used. If one ever weakens, the consortium can add fresh fingerprints from a stronger function without overwriting the originals.

Fingerprinting the file, not the paper

Here's an important subtlety. A hash fingerprints a file, not the physical page.

Scan the same letter twice, and you will almost certainly get two different fingerprints. The light shifts a little, the paper sits a fraction of a millimeter to one side, and the camera sensor records slightly different values. To a person, the two scans look identical. To a hash function, they are two different files.

That's why the prime matters. Primmortal doesn't try to fingerprint the paper itself, which no one can do. It fingerprints one specific capture, records who made it and when, and treats that capture as the fixed reference. A later, better scan of the same letter becomes a new record linked to the first, not a replacement for it.

What a matching fingerprint tells you

When the fingerprint of your copy matches a prime's, you know one thing with great confidence. You are holding exactly the bits a steward registered, with no recompression, no cropping, no retouching, and no quiet edits.

A match doesn't tell you the document is true, that the scan was faithful to the paper, or who wrote the original. As Part 1 put it, a prime is a fixed point, not a verdict. But a fixed point is what a citation needs. When a footnote says "this document," everyone can now check that they're looking at the same one.

Next: chain of custody

A fingerprint tells you a file hasn't changed since it was registered. It doesn't tell you where the paper was before that. Part 3 looks at chain of custody, the archival tradition of tracking who held a document and when, and what a shared ledger can add to it.

The technical design behind this series is laid out in the Primmortal white paper (draft v0.2.1, PDF).