Understanding Bitcoin and Cryptocurrencies

Jul 30, 2024

Understanding Bitcoin and Cryptocurrencies

Introduction

  • Bitcoin: A fully digital currency with no central authority (e.g., government or banks).
  • Objective: Understand how Bitcoin works by creating a simplified version of it step-by-step.
  • Goal: Understand what it means to have a Bitcoin and grasp the technical details.
  • Context: Recent hype and investment in cryptocurrencies.

Concept of a Communal Ledger

  • Communal Ledger: A record of payments amongst friends to avoid physical cash exchanges.
  • Example Transactions: Alice pays Bob $20; Bob pays Charlie $40.
  • Protocol: Public ledger, end of the month settlement, tracking who owes and receives money.

Issues with a Public Ledger

  • Problem: Trust issues, anyone can add fraudulent transactions (e.g., Bob adding "Alice pays Bob $100").

Digital Signatures

  • Solution: Digital signatures to verify transactions.
  • Concept: Using a public key-private key pair to prove transaction authenticity.
  • Private Key (SK): Known only to the owner.
  • Public Key (PK): Available to everyone to verify signatures.
  • Signature Details: Dependent on the message and private key; changes with message changes.
  • Verification Function: Confirms if a signature was made by the proper private key.

Unique Transaction IDs

  • Preventing Duplicates: Add unique IDs to transactions to avoid reusing the same signature.

Relying on Digital Ledgers

  • Limitations: Trusting people to settle up debts in cash.
  • Potential Solution: Prevent excessive spending by limiting how much more one can spend than received.
  • Ledger Dollars (LD): A separate system abstracted from physical cash, transferable in exchange for real money.

Distributed Ledger System

  • Decentralization: Everyone maintains a copy of the ledger.
  • Transaction Broadcasting: Transactions are broadcasted and recorded by everyone.
  • Challenge: Ensure all copies of the ledger remain identical and ordered correctly.
  • Bitcoin's Solution: Trust the ledger with the most computational work - requiring proof of work (PoW).

Proof of Work (PoW)

  • Hash Function (e.g., SHA256): Converts any message to a fixed-length, seemingly random string of bits.
  • Property: Slight change in input results in an unpredictable, entirely different output.
  • Reverse Computation: Infeasible without guessing and checking due to the complexity of reversing a hash.
  • Proof of Work: A special number that makes the hash have a prefix of zeros, indicating significant computation.

Blockchain

  • Blocks: Transactions grouped into blocks, each with its PoW.
  • Chain of Blocks: Each block contains the hash of the previous block, forming a chain (blockchain).
  • Validity: Only blocks with PoW are valid.

Mining and Blocks

  • Miners: Individuals who create blocks using PoW and are rewarded with new currency (block reward).
  • Block Reward: New currency generated with each block, introducing new currency into the system.
  • Protocol: Trust and adopt the longest chain (most work) to ensure a cohesive system.

Example of Fraud Prevention

  • Fraudulent Block: If someone tries to fool the system, it requires immense computational resources.
  • Decentralized Consensus: The majority of the network's computing power ensures the longest chain remains trustworthy.

Bitcoin's Protocol Specifics

  • Difficulty Adjustment: Number of zeros required in PoW adjusted to maintain a 10-minute block interval.
  • Payment Confirmation: Wait several blocks to ensure a transaction is legitimate and part of the longest chain.
  • Maximum Supply: Capped at 21 million Bitcoin, with halving events reducing the block reward over time.
  • Transaction Fees: Encourage miners to include transactions.
  • Economic Impact: High transaction fees due to limited transaction capacity per block.

Conclusion

  • Understanding Fundamentals: Essential before investing or using cryptocurrencies.
  • Acknowledgement: Thanks to supporters and the importance of sharing helpful information.