Blockchain consensus protocols use cryptography to achieve distributed agreement on transaction history without a trusted central authority. Cryptographic primitives enable: (1) authenticity (digital signatures prove senders), (2) integrity (hash functions detect tampering), (3) consensus (proof-of-work uses computational puzzles; proof-of-stake uses signatures and slashing), (4) finality (cryptographic sortition, BFT protocols). Advanced protocols (proof-of-authority, proof-of-history) add efficiency or additional guarantees. Cryptographic security of blockchains is crucial: compromised signatures, hash collisions, or consensus protocol flaws can enable theft or double-spending. Understanding the cryptographic foundations of consensus is essential for evaluating blockchain security.
Blockchains are distributed systems solving the consensus problem: achieving agreement on a canonical ledger (transaction history) among many participants, some of whom may be adversarial. Cryptography is essential at multiple levels.
Cryptographic Primitives:
1. Digital Signatures: Validate transactions. Only the holder of a private key can authorize spending.
2. Hash Functions: Create immutable chains. Changing any transaction invalidates all subsequent blocks.
3. Merkle Trees: Efficient integrity checking. A block contains a Merkle root of transactions; changing one invalidates the root.
4. Commitment Schemes: Secret commitments revealed later (useful in multi-round protocols like PoS).
Consensus Models:
1. Proof-of-Work (PoW): Participants compete to solve computational puzzles. The winner (first to find a hash below target) proposes the next block and receives a reward. Consensus emerges because extending the honest chain is most profitable. Attacks require >50% hash power, costing enormous energy.
2. Proof-of-Stake (PoS): Validators are chosen to propose blocks proportional to stake. Validators are penalized (slashed) if they equivocate (sign conflicting blocks). Attacks require >33% stake but face economic penalties. Cryptographic signatures prove equivocation.
3. Byzantine Fault Tolerance (BFT): Direct consensus protocols (PBFT, HotStuff) where validators communicate multiple rounds. Consensus is guaranteed if <1/3 validators are Byzantine. Requires strong cryptographic assumptions (unforgeable signatures).
Security Properties:
1. Liveness: The chain continues to grow (new blocks are finalized).
2. Safety: The history is immutable; once a block is finalized, reversing it is prohibitively expensive.
3. Finality: Transactions are irreversible after sufficient time/depth.
Cryptographic security enables safety and finality; consensus protocol design (economic incentives) enables liveness.
Advanced Topics:
Attacks & Vulnerabilities:
1. 51% Attack: Attacker controls majority hash power (PoW) or stake (PoS), enabling double-spending or censorship.
2. Double-Spending: Attacker authorizes same funds to multiple recipients, exploiting insufficient finality.
3. Long-Range Attacks: Rewriting old history with low-stake PoS (if stakes are lost).
4. MEV (Maximal Extractable Value): Reordering transactions to profit unfairly, exploiting protocol specifics.
Blockchain security is a complex interplay of cryptography, distributed systems, and game theory. Understanding the cryptographic foundations is essential for evaluating blockchain claims and designing robust systems.
No topics depend on this one yet.