09 - Consensus

Wooclap

  • Which of the following units is in use for Bitcoin payments?

    • Satoshi
  • In Bitcoin the block (mining) reward

    • WRONG is halved every 105.000 transactions
    • is right-shifted every 210.000
  • Transaction fee is

    • the difference between input and output

    • input is always higher than output

  • An account address is

    • a b58 encoding of pk hash with checksum and version

PoW and hash

  • PoW: solve a hard puzzle
    • this hard puzzle it is made by a nonce + hash + difficulty
    • you must find a value (nonce), a random value that if found must leads to a number beginning with {difficulty}rest_of_the_hash
  • how can we optimize finding a good nonce?
    • we can’t store the results that starts with 00000 for example if diff=5 because the block header changes everytime
    • … but we can if we use a divide et impera approach
      • by splitting workload on blocks
  • retarget is the action to keep the difficulty more of than equal distributed by blocks, by changing the difficulty once every two weeks (it should takes 20160 minutes)
  • ASICS are computers without disks, just memory to evaluates these kind of calculations. They are way less inexpensive for this reason. They need computational power.
  • Stale blocks are created when two miners found the solution at the same time
    • longest chains are confirmed
    • if they have the same chains, then who arrives before