back to lessons
$ ~/learn/how-blockchains-work cat
7 min read
// 02 · fundamentals

How blockchains work

A blockchain is a database with an unusual property: no one is in charge, yet everyone agrees on what's true.

> The data structure

A blockchain is a sequence of blocks. Each block contains a batch of transactions plus a cryptographic hash of the previous block. Changing any past block would invalidate every block that follows, which is what makes the ledger tamper-evident.

> Consensus

Because there's no central server, participants need a rule for agreeing on which chain is canonical. The two dominant rules are proof-of-work (spend energy to propose blocks) and proof-of-stake (lock up capital as collateral). Both make dishonest behavior economically expensive.

> Nodes and mining

A 'full node' independently verifies every transaction and block. Miners (or validators) are a subset of nodes that also propose new blocks. Anyone in the world can run either — that permissionless participation is the point.

> Smart contracts

Some blockchains, most famously Ethereum, run programs called smart contracts. These are pieces of code that execute exactly as written, allowing developers to build financial products, marketplaces, and organizations that don't need a trusted operator.