Finance · Fintech · Crypto — explained

Bitfolio

An independent explainer desk · No ads · No affiliate links

TechExplainer

How does a blockchain work, and why is it so hard to change?

A blockchain is a shared record book that thousands of computers keep in sync without a boss. Here is how the pieces fit together, from a single transaction to a chain of blocks.

Three large interlocking chain links resting on a wooden surface
Photo: “Chain links” by Yandle, CC BY 2.0, via flickr.com · Edited: duotone, cropped.

The short answer

A blockchain is a shared ledger copied across many computers. Transactions are grouped into blocks, and each block carries a fingerprint (hash) of the block before it. A consensus rule decides which block comes next, so changing an old record would mean redoing every later block.

Key takeaways

  1. A blockchain is a ledger, a list of transactions, that many independent computers (nodes) store and check for themselves.
  2. Transactions are batched into blocks, and each block includes the hash of the previous block, which is what links them into a chain.
  3. Editing an old block changes its hash and breaks every link after it, so tampering is easy to spot.
  4. A consensus mechanism, such as proof of work or proof of stake, decides who adds the next block and which version of the chain counts.
  5. Hard to change is not the same as impossible to change, and a blockchain cannot tell whether the data put into it was true.

What is a blockchain, in plain English?

Think of a blockchain as a notebook of transactions that thousands of people keep a copy of at once. When someone wants to add a line, everyone checks it against their own copy, and only lines that pass are written in. No one owns the notebook, and no one can quietly tear out a page.

The U.S. National Institute of Standards and Technology (NIST) puts it more formally: blockchains are digital ledgers that are tamper evident and tamper resistant, run in a distributed way without a central repository and usually without a central authority2. A ledger is simply a record of transactions. What is new is who keeps it: not one bank, but a network of independent computers called nodes.

Chaining records is older than crypto: NIST notes that in 1991 a signed chain of information was used as a ledger proving a set of documents had not been altered2. The ideas were applied to electronic cash in a 2008 paper by the pseudonymous Satoshi Nakamoto, and the Bitcoin network followed in 20092. Nakamoto announced the paper to a cryptography mailing list on 31 October 20085, and Bitcoin Core's code dates the very first block, the genesis block, to 3 January 2009 (18:15 UTC)6.

Figure · From signed documents to programmable chains

From signed documents to programmable chains1991Signed chain usedas a documentledgerOct 2008Bitcoin paperannounced bySatoshi Nakamoto3 Jan 2009Bitcoin genesisblock minedJul 2015Ethereum launches(Frontier)Sep 2022Ethereum switchesto proof of stake
  1. 1991Signed chain used as a document ledger
  2. Oct 2008Bitcoin paper announced by Satoshi Nakamoto
  3. 3 Jan 2009Bitcoin genesis block mined
  4. Jul 2015Ethereum launches (Frontier)
  5. Sep 2022Ethereum switches to proof of stake

What is inside a block?

A transaction is an interaction between parties; with a cryptocurrency it is usually a transfer of coins from one user to another2. Rather than add transactions one at a time, the network gathers them into batches called blocks. Ethereum's documentation explains why: batching lets every participant stay in sync and agree on one precise history3.

Each block has two parts. The body holds the list of transactions. The header is a short summary. NIST lists the typical header fields as the block number, the hash of the previous block's header, a hash that represents all the data in the block, a timestamp, the block size and a nonce, a number used in mining2.

Typical block header fields and what they do (based on NIST IR 8202) Source: [2]

FieldWhat it holdsWhy it matters
Block number (height)Position of the block in the chainGives every block a clear order
Previous block hashFingerprint of the block beforeCreates the link that forms the chain
Data hash (e.g. Merkle root)One hash summarising all transactionsAny edited transaction changes it
TimestampApproximate time the block was madeHelps order events
NonceA number miners change while searchingUsed in proof-of-work puzzles

How do hashes chain the blocks together?

A hash function turns any input into a short, fixed-length output called a digest. NIST describes three key properties: you cannot work backwards from the digest to the input, and it is computationally infeasible to find a second input with the same digest, or any two inputs that share one2.

Worked example

One character, a totally different fingerprint

Using the SHA-256 hash function (the one named in the Bitcoin paper1), the text Alice pays Bob 5 produces a digest beginning 66ed59eb…. Change the 5 to a 6 and the digest begins 08155743…. Nothing about the second digest hints that the inputs were almost identical. (Illustrative example computed for this page.)

Now the clever part. Every block stores the hash of the previous block's header2. If someone edits a transaction in an old block, that block's hash changes. The next block still points to the old hash, so the link breaks, and so does every link after it. NIST notes that this makes altered blocks easy to detect and reject2.

Figure · Why editing an old block breaks the chain

Why editing an old block breaks the chain01Block 100hash A02Block 101stores hash A,makes B03Block 102stores hash B,makes C04Edit block 100hash A becomes X05Link fails101 stillexpects hash A
  1. 01Block 100hash A
  2. 02Block 101stores hash A, makes B
  3. 03Block 102stores hash B, makes C
  4. 04Edit block 100hash A becomes X
  5. 05Link fails101 still expects hash A

Who decides which block comes next?

Because there is no central operator, the network needs a rule for agreeing on the next block. That rule is the consensus mechanism. NIST describes several models, including proof of work, proof of stake, round robin, proof of authority and proof of elapsed time2. The two you will meet most often are the first two, compared in our explainer on proof of work vs proof of stake.

How a transaction gets onto Bitcoin's chain (simplified from the Bitcoin paper)

  1. 1

    Broadcast

    A new transaction is sent out to the network's nodes1.

  2. 2

    Collect

    Each node gathers waiting transactions into a candidate block1.

  3. 3

    Compete

    Nodes race to find a proof of work for their block, a puzzle that takes many guesses to solve1.

  4. 4

    Announce

    A node that solves it broadcasts the block to everyone1.

  5. 5

    Verify and build

    Other nodes accept the block only if every transaction is valid and not already spent, then start building the next block on top of it1.

If two versions of the chain appear, Bitcoin nodes treat the longest chain as correct1. Bitcoin also adjusts the puzzle's difficulty every 2,016 blocks so that blocks arrive roughly once every ten minutes2. Ethereum now uses proof of stake, with time split into 12-second slots in which one validator is chosen to propose a block3.

Why is a blockchain so hard to change?

To rewrite history on a proof-of-work chain, an attacker would have to redo the work for the edited block and every block after it, and then overtake the honest network as it keeps adding blocks. The Bitcoin paper shows that the attacker's chance of catching up falls exponentially as the number of blocks to catch up grows1, provided honest participants control most of the computing power1.

That proviso matters. NIST lists a "51% attack" as a known risk: someone who gains enough computing power (proof of work) or enough staked funds (proof of stake) could in principle control which blocks are accepted2. NIST also stresses that changing a recorded transaction is extremely difficult but not technically impossible2.

Public versus private blockchains (NIST's terms: permissionless and permissioned) Source: [2]

PermissionlessPermissioned
Who can add blocksAnyone, without asking permissionOnly participants approved by an authority
Who can readTypically anyoneCan be restricted
GatekeeperNone: rules are enforced by the softwareThe authority that grants permission

Participants differ too. A full node stores the whole chain and checks transactions; a lightweight node keeps no full copy and relies on full nodes to relay its transactions2. Our guide to crypto wallets and keys explains what a wallet app actually stores.

What do beginners get wrong about blockchains?

Common beginner mistakes

  1. Thinking "on the blockchain" means "true"

    A blockchain proves that a record has not been changed since it was added. It cannot prove the record was accurate in the first place.

  2. Calling it impossible to hack

    The chain's links are hard to forge, but wallets, apps, exchanges and the code running on top can still fail or be attacked.

  3. Assuming all blockchains are public

    Some are permissioned, with a gatekeeper deciding who can write or even read2.

  4. Treating "blockchain" and "Bitcoin" as the same thing

    Bitcoin is one blockchain network. Ethereum and many others use the same basic structure with different rules and features, such as smart contracts.

Risk warning

A secure ledger does not make an asset safe

Strong record-keeping says nothing about whether a token is a sound investment or whether a platform holding it for you is trustworthy. Crypto-assets can lose most or all of their value. Read our risk disclosure before acting on anything you learn here.

Frequently asked questions

Is a blockchain the same as a database?

It is a kind of database, but a shared one. Instead of one organisation controlling the records, many independent nodes keep copies and follow common rules about what can be added.

Can a blockchain be deleted or switched off?

A public blockchain keeps running as long as nodes around the world keep running its software. A permissioned blockchain run by a small group can be shut down by that group.

Why do blockchains use so much energy?

Proof-of-work chains make computers race to solve puzzles, which NIST notes consumes significant electricity and computing resources2. Proof-of-stake chains replace that race with funds locked up as collateral.

What is a fork?

A fork is a change to a blockchain's rules. NIST distinguishes soft forks, which older software still accepts, from hard forks, which require everyone to upgrade and can leave two versions of the chain running side by side2.

The bottom line

A blockchain is a shared ledger in which each block carries the hash of the one before, so any edit to the past breaks the chain in plain sight. A consensus rule lets thousands of strangers agree on the next block without a central referee. The design makes records hard to alter, not impossible, and it guarantees nothing about whether the data or the assets recorded on it are sound.

Sources

  1. Bitcoin: A Peer-to-Peer Electronic Cash System — Satoshi Nakamoto (whitepaper hosted at bitcoin.org), 2008 Primary source
  2. NIST IR 8202: Blockchain Technology Overview — National Institute of Standards and Technology, U.S. Department of Commerce, 2018 Primary source
  3. Blocks (Ethereum developer documentation) — ethereum.org Primary source
  4. The history of Ethereum (network upgrades) — ethereum.org Primary source
  5. Bitcoin P2P e-cash paper (mailing list announcement) — Satoshi Nakamoto, Cryptography mailing list (metzdowd.com), 2008 Primary source
  6. Bitcoin Core source code: src/kernel/chainparams.cpp (genesis block parameters) — Bitcoin Core project (GitHub bitcoin/bitcoin), 2026 Primary source

How we checked this page: every figure above links to the numbered source it came from. Spotted an error? Tell the desk — see our editorial policy.

Read next