Blockchain Fundamentals

Master the core concepts of blockchain technology, cryptography, and distributed systems.

Course Navigation

Cryptography Fundamentals

2 lessons

Hash Functions and Digital Fingerprints

25 min

Understanding Hash Functions

Hash functions are mathematical algorithms that convert input data of any size into a fixed-size string of characters.

Key Properties:

  • Deterministic: Same input always produces same output
  • Fixed Output Size: Always produces same length hash
  • Avalanche Effect: Small input change = drastically different output
  • One-way Function: Easy to compute forward, impossible to reverse
  • Collision Resistant: Extremely difficult to find two inputs with same hash

Common Hash Functions:

  • SHA-256: Used in Bitcoin, produces 256-bit hash
  • Keccak-256: Used in Ethereum
  • Blake2: Fast and secure, used in various blockchains

Blockchain Applications:

  • Block identification and linking
  • Transaction verification
  • Merkle tree construction
  • Proof of Work mining
  • Digital signatures
interactive

Digital Signatures and Authentication

30 min

Digital Signature Cryptography

Digital signatures provide authentication, integrity, and non-repudiation for digital messages.

How Digital Signatures Work:

  1. Key Generation: Create public/private key pair
  2. Signing: Use private key to sign message hash
  3. Verification: Use public key to verify signature

Elliptic Curve Cryptography (ECC):

Most blockchains use ECC for efficient digital signatures:

  • secp256k1: Used by Bitcoin and Ethereum
  • Ed25519: Used by Solana for faster verification
  • Smaller keys: 256-bit keys vs 2048-bit RSA
  • Faster operations: Efficient signing and verification

Blockchain Applications:

  • Transaction authorization
  • Wallet authentication
  • Smart contract execution
  • Multi-signature schemes
interactive

Consensus Mechanisms

2 lessons

Proof of Work (PoW)

35 min

Proof of Work Consensus

PoW requires miners to solve computationally expensive puzzles to validate transactions and create new blocks.

How PoW Works:

  1. Transaction Collection: Miners gather pending transactions
  2. Block Creation: Form a block with transactions and metadata
  3. Nonce Search: Find a nonce that makes block hash meet difficulty target
  4. Block Broadcast: Share valid block with network
  5. Verification: Other nodes verify and accept the block

Mining Process:

Block Hash = SHA256(
  Previous Block Hash +
  Merkle Root +
  Timestamp +
  Difficulty Target +
  Nonce
)

// Goal: Find nonce where hash starts with required zeros
// Example: 0000a1b2c3d4e5f6... (4 leading zeros = difficulty)

Advantages:

  • Proven security model
  • Decentralized and permissionless
  • Resistant to attacks
  • Simple to understand and verify

Disadvantages:

  • High energy consumption
  • Slow transaction throughput
  • Mining centralization risks
  • Environmental concerns
theory

Proof of Stake (PoS)

30 min

Proof of Stake Consensus

PoS selects validators to create new blocks based on their stake (ownership) in the network.

How PoS Works:

  1. Staking: Validators lock up tokens as collateral
  2. Selection: Algorithm chooses validator based on stake and randomness
  3. Block Creation: Selected validator creates and proposes block
  4. Attestation: Other validators vote on block validity
  5. Finalization: Block becomes final after sufficient attestations

Validator Selection Methods:

  • Randomized Block Selection: Higher stake = higher probability
  • Coin Age Selection: Considers how long tokens have been staked
  • Delegated Proof of Stake: Token holders vote for delegates

Slashing Conditions:

Validators lose staked tokens for malicious behavior:

  • Double signing (creating two blocks at same height)
  • Surround voting (contradictory attestations)
  • Offline penalties for extended downtime

Advantages:

  • Energy efficient (99% less than PoW)
  • Faster finality
  • Economic security through slashing
  • Scalable to higher throughput
theory

Distributed Systems Concepts

1 lessons

CAP Theorem and Trade-offs

25 min

CAP Theorem

The CAP theorem states that distributed systems can only guarantee two of three properties simultaneously.

The Three Properties:

  • Consistency (C): All nodes see the same data simultaneously
  • Availability (A): System remains operational and responsive
  • Partition Tolerance (P): System continues despite network failures

Blockchain Trade-offs:

  • Bitcoin (CP): Prioritizes consistency and partition tolerance over availability
  • Ethereum (CP): Similar to Bitcoin, eventual consistency model
  • Some DeFi protocols (AP): May sacrifice consistency for availability

Network Partitions in Blockchain:

When network splits occur:

  • Different parts of network may have different views
  • Consensus mechanisms handle partition recovery
  • Longest chain rule resolves conflicts
  • Some transactions may be reversed (reorganization)

Practical Implications:

  • Transaction finality takes time
  • Higher confirmation counts = higher security
  • Network upgrades require careful coordination
  • Emergency procedures for major partitions
theory

Blockchain Economics and Tokenomics

1 lessons

Token Economics and Incentive Design

40 min

Tokenomics Fundamentals

Tokenomics combines token design with economic incentives to create sustainable blockchain ecosystems.

Token Types:

  • Utility Tokens: Access to network services (ETH for gas)
  • Governance Tokens: Voting rights in protocol decisions
  • Security Tokens: Represent ownership or debt
  • Stablecoins: Price-stable cryptocurrencies
  • NFTs: Non-fungible tokens for unique assets

Supply Mechanisms:

  • Fixed Supply: Bitcoin's 21M cap creates scarcity
  • Inflationary: New tokens minted for rewards
  • Deflationary: Token burning reduces supply
  • Elastic: Supply adjusts based on demand

Incentive Alignment:

  • Staking Rewards: Encourage network security
  • Transaction Fees: Prevent spam and reward validators
  • Liquidity Mining: Bootstrap DeFi protocols
  • Governance Participation: Reward active community members

Economic Security:

The cost of attacking the network must exceed potential gains:

  • PoW: Cost of 51% hash power
  • PoS: Cost of 33% stake + slashing penalties
  • Economic finality through stake at risk
theory