Level 0 — Foundations · Lesson 2 of 6
What a blockchain is
A shared ledger copied on many computers, with pages linked by digital fingerprints. Try a hash yourself and see why history cannot be changed in secret.
Educational content, not investment advice. The full disclaimer
What you will learn
- Describe a blockchain as a shared ledger made of blocks linked to each other.
- Explain what a hash is and why a tiny change gives a completely different fingerprint.
- Understand why a change in the past is noticed, without believing a blockchain is infallible.
A ledger copied on many computers
In the last lesson we reached a question: can a shared ledger be kept without a single organiser? A blockchainA shared ledger, copied on many computers, where transactions are grouped into blocks linked by hashes, so a change in the past is noticed at once.Example: Bitcoin uses a blockchain to keep track of every bitcoin transfer. is an attempt at an answer. It is a ledgerA record where it is written down who owns what and what happened, in the order it happened.Example: A bank statement is a part of a ledger kept by the bank. of transactions with two features. It does not sit in one place but is copied on many computers called nodeA computer that is part of a blockchain network, keeps a copy of the ledger and checks that transactions follow the rules.Example: Thousands of nodes can independently check the same new block.. And the entries are grouped into blockA group of verified transactions put together on one "page" of a blockchain's ledger, linked to the previous page.Example: A Bitcoin block holds many transactions, plus the hash of the block before it., linked to each other like the links of a chain.
Think of a record book where transfers are noted. We do not start a new book for every transfer: we add pages. Each page (block) holds a group of transactions and a link to the page before it. Each node keeps a copy of the book and checks whether the new pages follow the rules. If a page breaks the rules, it rejects it.
The digital fingerprint: what a hash is
The link between pages is made with a hashA fixed-length fingerprint computed from any text or data: the same data always gives the same fingerprint, and a tiny change gives a completely different one.Example: SHA-256 turns "Hello" into a string of 64 characters; "hello" (lowercase) gives an entirely different one.. A hash is a fixed-length fingerprint computed from any data. A function used in many systems, Bitcoin among them, is called SHA-256 and always produces a string of 64 characters (digits and letters from a to f), however short or long the input text is. Three simple rules: the same data always gives the same fingerprint; from the fingerprint you cannot, in practice, rebuild the data; and a tiny change in the data completely changes the fingerprint.
Try it yourself. In the demonstration below your text is turned into a hash right in your browser, with the browser's own SHA-256 function. Nothing is sent anywhere. Change a single letter or add a full stop and watch almost the whole fingerprint change, not just a corner of it.
Type anything. The text stays on this page: it is computed in your browser and sent nowhere. Do not type passwords or personal data here.
SHA-256 hash (64 characters)
Change the text (or press "Change one letter") to see how much the fingerprint changes.
How the blocks are linked
Each block holds, among other things, the hash of the previous block. If someone changes a transaction in an old block, that block's hash changes. But the next block still holds the old hash, so it no longer matches. To repair it, it too would have to be rebuilt, then the one after it, and so on to the end of the chain. That is why changes in the past are noticed.
In networks such as Bitcoin there are also network rules, plus the work done by participants to add blocks (more on that in the next lesson). Together they make an attack on the ledger's history very expensive and very visible. The Bitcoin.org source says the rules prevent old blocks from being changed, because that would invalidate every block after them.
Why we care
The basic idea is that many independent participants can keep the same record and check for themselves that nobody cheated, instead of trusting a single organiser. The price is that the system is more complicated, slower and more expensive than an ordinary database. The Bank of England itself notes that platforms of this kind are very secure but also very expensive to run. For many things, an ordinary database kept by someone trustworthy remains the more suitable choice.
Check what you learned
4 questions, one right answer each. After every choice you see whether you got it right, with the explanation. It counts for nothing but you.
Done with the lesson?
Terms in this lesson
- ledger
- A record where it is written down who owns what and what happened, in the order it happened.
- blockchain
- A shared ledger, copied on many computers, where transactions are grouped into blocks linked by hashes, so a change in the past is noticed at once.
- block
- A group of verified transactions put together on one "page" of a blockchain's ledger, linked to the previous page.
- hash
- A fixed-length fingerprint computed from any text or data: the same data always gives the same fingerprint, and a tiny change gives a completely different one.
- node
- A computer that is part of a blockchain network, keeps a copy of the ledger and checks that transactions follow the rules.