MMetatopics
Foundations

What Is Blockchain and How Does It Work?

A record kept by many independent machines at once, and the mechanism that lets them agree on its contents without a central authority deciding for them.

The short answer

A blockchain is a shared record of transactions that many independent computers store and verify at the same time. Entries are grouped into blocks, each block carries a fingerprint of the one before it, and the network follows a fixed rule to agree which block comes next. Changing an old entry would break every fingerprint after it.

Almost every record you rely on is kept by somebody. A bank keeps the record of your balance. A registry office keeps the record of who owns a building. A shipping company keeps the record of which container left which port. The record is trusted because the institution keeping it is trusted, and because there are consequences if it lies.

That arrangement works well until two parties who do not trust each other need to share a record, and neither will accept the other as its keeper. The usual solution is to appoint a third party that both sides tolerate, and to pay it. A blockchain is an attempt to answer the same problem differently: to let a record be held by everyone involved at once, and to make disagreement about its contents resolvable by arithmetic rather than by authority.

What is blockchain, precisely

A blockchain is an append-only list of records, replicated across many independent machines, where each batch of records carries a cryptographic fingerprint of the batch before it. Three properties in that sentence do the work, and it is worth separating them.

Append-only
Entries are added at the end. There is no instruction that edits or deletes an earlier entry. A mistake is corrected by adding a new entry that reverses it, in the way a bookkeeper corrects a ledger rather than the way a word processor corrects a sentence.
Replicated
Every participating machine holds a full copy and verifies it independently. There is no master copy that others defer to, which means there is no single machine whose compromise rewrites history for everyone.
Chained by fingerprint
Each batch contains a short value derived from the entire content of the previous batch. Change anything in an old batch and that value no longer matches, which is immediately detectable by anyone holding a copy.

Nothing in that description requires a currency, a token, a public network or an open membership. Those are choices made when a particular blockchain is designed, and different systems make them differently.

The four components

Transactions

A transaction is a signed instruction: move this amount from this account to that one, record this document fingerprint, register this certificate. It is signed with a private key, a large secret number held by the person making the instruction. Anyone can verify the signature against the corresponding public key, and nobody can produce a valid signature without the private key. This is what replaces the bank clerk who checks identity at the counter.

Hash functions

A hash function takes an input of any size and produces a fixed-length value, typically shown as a string of letters and digits. Three characteristics matter here. The same input always produces the same output. A change of a single character produces an output with no visible relationship to the previous one. And it is not feasible, given an output, to work backwards to an input that produces it.

A hash therefore acts as a fingerprint. Publishing the hash of a document proves later that the document has not changed, without revealing what the document says.

Blocks

Transactions are gathered into blocks rather than written one at a time, because coordinating agreement is expensive and doing it once per batch is cheaper than doing it once per entry. A block contains the transactions themselves, a timestamp, the hash of the previous block, and a summary hash of all the transactions inside it.

The chain

Because block number one thousand contains the hash of block nine hundred and ninety-nine, which contains the hash of nine hundred and ninety-eight, the blocks form a sequence that cannot be reordered or edited in the middle without detection. That structure is the whole of what the word blockchain describes.

How does blockchain work, step by step

The following sequence is common to almost every design, whatever its consensus rule.

  1. A transaction is created and signed. Software on the sender's device builds the instruction and signs it with the sender's private key. The key itself never leaves the device.
  2. It is broadcast to the network. The signed transaction is sent to a few connected machines, each of which forwards it to the machines it is connected to, until it has spread across the network.
  3. Each machine validates it independently. Is the signature valid for the stated sender? Does the sender hold what the transaction proposes to move? Does the instruction obey the network's rules? An invalid transaction is discarded rather than forwarded.
  4. Valid transactions wait. They sit in a holding area on each machine until one of them is selected to be included in the next block.
  5. One participant is chosen to propose the next block. How the choice is made is the single largest difference between blockchain designs, and is described in the next section.
  6. The proposer assembles and seals the block. It selects transactions from the holding area, computes the summary hash of them, includes the hash of the current final block, and publishes the result.
  7. Everyone else verifies the block for themselves. Each machine re-checks every transaction in it, re-computes the hashes, and confirms the proposer followed the selection rule. A block that fails any check is rejected, and the proposer gains nothing.
  8. The block is appended. Machines that accept the block add it to their copy and begin working on the next one. The transactions inside it are now part of the shared record.

Note what is absent. No participant asks another for permission. No participant accepts a block because of who published it. Every machine reaches the same conclusion by applying the same rules to the same data, which is why the record converges without anyone being in charge of it.

How the network agrees on who proposes

If any machine could publish blocks freely, a determined participant could publish contradictory ones. The mechanism that limits this is called consensus, and two families of it are in general use.

Proof of work

Participants compete to find a number which, when combined with the block contents and hashed, produces an output below a target value. There is no shortcut: the only method is to try enormous quantities of candidate numbers. Finding one is difficult and verifying one is instant, which is the useful asymmetry. The participant who finds it first publishes the block. Rewriting an old block means redoing that work for that block and every block after it, while the rest of the network extends the honest chain in the meantime.

Proof of stake

Participants lock up an amount of the network's own units as a deposit, and the protocol selects a proposer from among them according to a defined rule. A participant that proposes contradictory blocks or signs invalid ones loses part or all of the deposit. Here the cost of misbehaviour is financial and internal rather than physical and external.

Both families answer the same question, which is how to make it expensive to lie, and both leave the same job to the rest of the network: verify everything independently and reject anything that fails. Permissioned networks, where every participant is a known and identified organisation, often use neither, because the membership itself limits who may propose. Which mechanism a given network uses is a design decision with consequences for its energy use, its speed and its failure modes, and it is a poor proxy for how good the system is.

Why an old entry is hard to change

Suppose an entry in block nine hundred is inconvenient and someone wishes to alter it. Changing it changes the summary hash of block nine hundred, and therefore the hash of block nine hundred itself. Block nine hundred and one contains the old hash, so it no longer refers to a block that exists. To repair that, block nine hundred and one must be rebuilt, which changes its hash, which breaks nine hundred and two, and so on to the end of the chain.

The attacker must therefore rebuild every block from the alteration onwards, satisfy the consensus rule for each of them, and do it faster than the entire honest network is producing new blocks, because participants follow the chain that has the most accumulated work or the most attested weight behind it. On a large network this is not merely difficult but continuously difficult: the target moves every time an honest block is published. This is the sense in which the record is described as immutable, and it is a statement about cost, not about physical impossibility.

Public, private and permissioned networks

Comparison of blockchain network types
PropertyPublic networkPermissioned network
Who may hold a copyAnyone who runs the softwareApproved organisations only
Who may propose blocksAnyone meeting the consensus requirementA defined set of named participants
Identity of participantsPublic keys, not legal identitiesKnown legal entities under agreement
Source of confidenceCost of rewriting the chainContracts and the membership rules
Typical purposeOpen settlement between strangersShared record between organisations that already know each other

The two are often discussed as though one were a weaker version of the other. They answer different questions. A permissioned network gives up open participation and gains speed, privacy and a straightforward way to correct governance failures. A public network gives up all three and gains the property that no participant can be excluded.

What the structure guarantees, and what it does not

Being precise about this prevents most of the confusion around the subject.

It guarantees integrity
An entry, once accepted and buried under later blocks, has not been altered since. Anyone can verify this without asking anyone.
It guarantees authorship
The entry was signed by the holder of a particular private key. Whether that person is who they claim to be is a separate question the chain cannot answer.
It does not guarantee truth
If a false statement is recorded, the chain preserves the false statement faithfully. A certificate registered on a ledger is exactly as trustworthy as the body that issued it.
It does not guarantee privacy
On a public network every entry is visible to everyone forever. Pseudonymous addresses are not anonymity, and patterns of use are frequently enough to connect them to a person.
It does not guarantee reversibility
There is no administrator with the power to undo a valid, correctly signed instruction. This is a design property, not a defect, and it is the reason key handling matters so much.

Terms as they appear in Japanese material

Introductory material in Japan and technical documentation in English often use different words for the same idea, which makes the subject harder than it needs to be. The correspondences below cover the terms that recur most often.

English and Japanese terminology
EnglishJapaneseMeaning in this article
BlockchainThe chained, replicated record itself
Distributed ledgerThe broader category a blockchain belongs to
Hash valueThe fixed-length fingerprint of a piece of data
Private keyThe secret number that produces valid signatures
Public keyThe value others use to verify those signatures
NodeOne machine holding and verifying a copy
Consensus algorithmThe rule deciding who proposes the next block
Smart contractCode stored on the chain that runs when conditions are met

Where the structure is actually used

Outside currency, the pattern appears wherever several organisations need one version of a record and none of them will accept another's system as authoritative. Shipping documentation passes through carriers, ports, customs authorities and insurers, each of whom has historically kept a separate file. Academic and professional certificates can be published as hashes, so that an employer can verify a document without contacting the issuing institution. Manufacturers reconciling components across a supply chain use a shared ledger to avoid arguing about whose spreadsheet is correct.

In each case the value is not novelty but the removal of reconciliation work. It is also worth saying that most problems do not have this shape, and that a shared database with agreed permissions is the better answer whenever the parties do trust one another.

Common questions

What is blockchain in simple terms?

A list of records that many independent computers keep at the same time, where each batch of records is sealed with a fingerprint of the batch before it. Because everyone holds the whole list and checks it against the same rules, no single party decides what it says.

Is a blockchain the same thing as a cryptocurrency?

No. A blockchain is a way of keeping a shared record; a cryptocurrency is one thing that can be recorded in it. Certificate registers, supply documentation and inter-company reconciliation use the same structure with no currency involved.

Who controls a public blockchain?

Nobody controls it in the sense of being able to change the record. Software developers propose changes to the rules, participants choose whether to run software implementing them, and a change takes effect only when enough of the network adopts it. That is influence, not control.

What happens if two participants propose a block at the same moment?

The network temporarily holds two candidate continuations. Participants build on whichever they received first, and within a short period one branch is extended further than the other. The shorter branch is discarded and its transactions return to the waiting area. This is why entries are considered settled only after several further blocks have been added.

Does the record last forever?

It lasts as long as participants continue to store and verify it. A chain nobody runs is a set of files, not a network. Durability is a property of continued participation rather than of the data structure itself.

About this article

This article explains how a technology is constructed. It does not recommend, rate or value any asset, network, product or provider, and it is not investment, financial, legal or tax advice. It was written and edited by Hicran Secgin for Metatopics, published by SECGİN İÇERİK MEDYA ANONİM ŞİRKETİ in İstanbul, Türkiye. Corrections are welcome at contact@metatopics.org and are made in the text itself.