# Blockchain

> A shared record book, copied on many computers, where old pages can't be quietly changed.

- Level: Basic
- Topics: Security, Software
- URL: https://tidbit.legios.com.ar/blockchain/
- In Spanish: [Blockchain](https://tidbit.legios.com.ar/es/blockchain/)

A **blockchain** is a way of keeping a record, a **ledger**, that many parties share without having to trust a single owner. Entries, such as "Ana sent 5 units to Ben", are grouped into **blocks**. Each block also stores the **hash** of the previous block: a short fingerprint calculated from its contents. That chains the blocks together, because if someone edits an old block, its fingerprint changes and no longer matches the one stored in the next block, so the tampering is obvious.

The second idea is that the ledger is not kept in one place. Thousands of computers, called **nodes**, each keep a full copy and follow the same rules to agree on which block comes next. That agreement is called **consensus**. In Bitcoin, the first blockchain, described in 2008 by someone using the name Satoshi Nakamoto, nodes compete to solve a costly math puzzle (**proof of work**); newer systems such as Ethereum let nodes that lock up funds as a deposit take turns adding blocks (**proof of stake**). Rewriting history would require outvoting or outspending most of the network.

Blockchains are best known for cryptocurrencies, but the structure can record anything: ownership of digital items, steps in a supply chain, or small programs called **smart contracts** that run automatically when conditions are met. The trade-offs are real: they are slower and more expensive than an ordinary database, mistakes are hard to undo, and proof of work uses a lot of electricity. When one trusted organization keeps the records, a normal database is usually the better tool.

## An analogy

A notebook that a whole neighborhood keeps in copies, where each new page starts by quoting the last line of the previous page. Tearing out or rewriting a page would not match everyone else's copy, so nobody gets away with it.

## Keep in mind

- Each block stores the hash of the previous one, so edits break the chain.
- Many computers keep copies and agree on new blocks through consensus rules.
- Proof of work and proof of stake are the two main ways to reach consensus.
- Useful when parties don't trust a single keeper; otherwise a database is simpler.

## Go deeper

- [Blockchain Technology Overview (NIST)](https://csrc.nist.gov/pubs/ir/8202/final)
- [Bitcoin: the original 2008 paper](https://bitcoin.org/bitcoin.pdf)
- [Blockchain on Wikipedia](https://en.wikipedia.org/wiki/Blockchain)

## Related terms

- [Hashing](https://tidbit.legios.com.ar/hashing/): A one-way fingerprint of data: easy to compute, not meant to be reversed.
- [Database](https://tidbit.legios.com.ar/database/): An organized store of data that programs can search and update safely.
