What is blockchain?
Blockchain is a distributed database that stores a list of transactions in "blocks" that are cryptographically linked to each other. Every node (computer) on the network holds a complete copy of the blockchain — there's no central server.
Block structure
- Hash — a unique digital fingerprint of the block
- Previous hash — the hash of the previous block (the chain link)
- Timestamp — when the block was created
- Merkle root — hash of all transactions in the block
- Nonce — a number that's changed until the hash meets the required condition
Consensus mechanisms
- Proof-of-Work (PoW) — miners computationally solve a puzzle (Bitcoin). Energy-intensive but extremely secure.
- Proof-of-Stake (PoS) — validators lock tokens as collateral (Ethereum, Cardano, Solana). ~99% less energy than PoW.
- Delegated PoS (DPoS) — token holders vote for delegates. Faster but less decentralized.
Why is blockchain immutable?
Changing one block changes its hash — which changes the next block's hash — and so on to the top of the chain. To rewrite history, an attacker would need to recalculate all blocks faster than the rest of the network. On Bitcoin, that would require more than 51% of total mining power.
Smart contracts
Ethereum introduced smart contracts — self-executing code that lives on the blockchain. When conditions are met, the code runs automatically without any intermediary. DeFi, NFTs, DAOs and Web3 are all built on this principle.
Public vs private blockchain
Bitcoin and Ethereum are public (permissionless) — anyone can participate. Companies use private blockchains (Hyperledger) for supply chain tracking, where access is controlled.