Defining Distributed Consensus & Challenges in achieving it

Bitcoin’s Key Challenge

  • Key Technical challenge of a distributed eCash System is Distributed consensus

Why distributed consensus? 

  • Reliability required in distributed systems. 10 or 15 different nodes, all of them record the action or none of the nodes should record it. If we were able to build a distributed key value store it would enable a lot of applications
  • Examples
    • Distributed domain name system
      • IP address to domain name
    • Public Key directory
      • Email address to Public Key
    • Stock Trades
      • Who has transferred money to whom

Solutions to related problems ; Altcoins are built on bitcoin like principles to achieve slighty different goals

Defining distributed consensus

  • Fixed number of nodes n each having an input value
  • Protocol should terminate
  • All correct nodes should decide on the same value
  • Value agreed must have been proposed by some correct node

Bitcoin is a peer to peer system

  • When Alice wants to pay Bob
    • Transaction contains
      • Alice’s signature
      • Hash function: Way for Alice to link together this transaction or coin to the receipt of the coin from someone else
      • Public Key of Bob (his address)
      • Bob’s computer is nowhere in the picture, his listening is not necessary for him to receive the coin

What consensus were required? 

  • Which transactions were broadcasted?
  • Order in which transactions occurred?

How consensus could work? 

  • All nodes have a sequence of blocks of transactions they’ve reached consensus on
  • Each node has a set of outstanding transactions it’s heard about
  • p2p network is not perfect
  • Ok to select any valid block, even if proposed by only one node (left out transaction would get added in a later block)
  • Nodes might crash or become malicious

Why consensus is hard? 

  • Nodes may crash or be malicious
  • Network is imperfect
    • Not all pairs of nodes connected
    • Faults in network
    • Latency (No notion of global time)
      • Take the node that sent the first message in Step 1 and have that node do something in Step 2. Which node sent the first message in Step 1?

Many impossibility results

  • Byzantine generals problem
  • Some well known protocols: Paxos
    • Protocol can get stuck & fail to make progress
    • Never produces inconsistent results
  • Understanding impossiblity results
    • Bitcoin consensus works better in practice than in theory
    • But theory is important, can help predict unforeseen attacks and help provide strong guarantees on the nature of consensus and security
    • What bitcoin does differently? 
      • Incentive: Possible only because it is a currency
      • Embraces Randomness:  Does away with the notion of a specific end -point
        • Probability of transaction being includes keeps going higher
        • Probabilistic guarentee

Leave a comment