3. The register nobody can rewrite
The notebook with glued pages
Picture a notebook where each page, as soon as it is written, is signed and glued to the previous one. To change page 2 you would have to tear off pages 3, 4 and all the others, and everyone holding a copy of the notebook would notice.
A blockchain is exactly that: a register where entries are grouped in blocks, each block contains the fingerprint of the previous one, and many independent computers keep a copy. Only those with the right credentials may write; anyone may read. Once written, data is not edited: at most a new line is added to correct it, and the old one stays visible.
We use a test network (Polygon Amoy): it works like the real one but with worthless coins, ideal for learning.
The fingerprint of a document
A hash is a digital fingerprint of a file: a program reads the whole document and produces a fixed-length string of letters and digits. Two rules: the same document always gives the same fingerprint; if even one comma changes, the fingerprint changes completely. And you cannot rebuild the document from its fingerprint.
Example with the sha256 algorithm on two almost identical texts:
acidita 0.2 becomes
a65f4491f8a94984e9992a249393423c32d511f7ff15ee7bf83663c663ee54da
acidita 0.3 becomes
801251e0ce82939caa01ea32b7958cf57ecdac51422051fcff26c21d165b20c1
One character differs and the two fingerprints look nothing alike. That is why writing the fingerprint of the laboratory report on the chain is enough: if someone altered the PDF, the fingerprint would no longer match.
Try it yourself
On a Linux or Mac computer open the terminal and type: printf 'acidita 0.2' | sha256sum (on Mac: shasum -a 256). You must get exactly the first fingerprint above. Then change one character and see what happens.
What you learned
- A blockchain is a shared register where each page is tied to the previous one.
- A hash is a file's fingerprint: same file, same fingerprint.
- Changing one comma changes the whole fingerprint, so tampering shows.