Module 2 / 7

How it works

Blocks, consensus and smart contracts

12 min

Blockchain solves a precise problem (agreeing without trusting each other) through a combination of cryptography, economic incentives and massive replication.

2.1What is a blockchain?

A blockchain is a distributed digital ledger: a database replicated across thousands of computers (the nodes), in which transactions are grouped into blocks chained to one another by cryptography.

Three properties follow: the ledger is shared (no one holds the reference copy), practically tamper-proof (changing a past block would require rewriting the whole chain on the majority of the network) and without a trusted third party (trust is placed in the protocol, not in an institution).

Block 1Block 2Block 3Block 4
Each block references the hash of the previous one: the "chain".

2.2The cryptographic building blocks, step by step

1. The hash function. A hash (for example SHA-256 for Bitcoin) turns any piece of data into a unique fixed-size fingerprint. Changing a single comma changes the whole fingerprint. Each block contains the hash of the previous block: this is the "chain", and any tampering visibly breaks the thread.

2. Keys and signatures. Each user has a pair of keys: a public key (their address, visible to all) and a private key (their secret, which signs transactions). Owning crypto-assets means owning a private key, hence the saying "not your keys, not your coins".

3. Consensus. How do thousands of nodes that do not trust each other agree on the state of the ledger? Two main mechanisms:

  • Proof of Work (Bitcoin): "miners" compete with computing power to validate blocks; cheating would cost more than the expected gain. Robust, but energy-hungry.
  • Proof of Stake (Ethereum since 2022): "validators" lock up funds as collateral (staking); in the event of fraud, their stake is confiscated (slashing). About 2,000 times less energy-hungry.

4. Programmed scarcity. Bitcoin is capped at 21 million units, with issuance halved every four years (the halving): a monetary policy written into the code, the opposite of central bank currencies.

2.3Smart contracts: the programmable blockchain

A smart contract is a program deployed on the blockchain that runs automatically when its conditions are met, with no intermediary and no possible interruption. It is Ethereum's great innovation. On this basis are built:

  • tokens (digital assets issued on an existing chain: ERC-20 standards for fungible tokens, ERC-721 for NFTs, unique tokens);
  • decentralised applications (dApps): exchanges, lending, games;
  • DAOs (organisations whose governance is written into smart contracts);
  • oracles (such as Chainlink), which bring real-world data to contracts, with one limit: the blockchain only guarantees what happens on the chain, not the truth of what is written into it.

2.4The trilemma and the debates: do you really need a blockchain?

Just as LLMs have their sceptics, so does blockchain. Three debates structure the field:

  • The blockchain trilemma (Vitalik Buterin): it is very hard to be decentralised, secure and scalable at the same time. Bitcoin and Ethereum favour the first two; "layer 2" solutions (rollups such as Arbitrum, Optimism or Base) process transactions in bulk off-chain before anchoring them on the main chain.
  • Public vs private. Alongside public blockchains there are permissioned chains (Hyperledger-style), reserved for a consortium of companies, at the cost of a recentralisation that, purists argue, loses most of the point.
  • "Do you really need a blockchain?" For many uses, a classic database is simpler, faster and cheaper. Blockchain only makes sense when several parties who do not trust each other must share a ledger without a central arbiter.
Key takeaway

Its strength (the absence of a central authority) is also its constraint: everything is slower, more expensive and more irreversible than in a centralised system. The whole art is knowing when this trade-off is worth it.

Sources

S. Nakamoto (2008); Ethereum documentation (ethereum.org), including the estimate of the energy reduction from the move to proof of stake; V. Buterin, writings on the trilemma and rollups.

Finished this module?

Your progress is saved on this device.