consens ut blockchain
play

Consens ut & Blockchain S P Suresh Chennai Mathematical In st - PowerPoint PPT Presentation

Consens ut & Blockchain S P Suresh Chennai Mathematical In st itute Formal M eu hods Upd au e Me eu ing IIT Mandi July 17 , 2017 Ti e Bitcoin revolution it upon ut Wh au it Bitcoin ? Bitcoin: an exciting new currency sy st em digital


  1. Consens ut & Blockchain S P Suresh Chennai Mathematical In st itute Formal M eu hods Upd au e Me eu ing IIT Mandi July 17 , 2017

  2. Ti e Bitcoin revolution it upon ut

  3. Wh au it Bitcoin ? Bitcoin: an exciting new currency sy st em digital decentralized Invented by Satoshi Nakamoto in 2008 Elegant solution to the Byzantine Generals problem

  4. Bene fj ts for ti e ut er International currency In st ant transfer with very low transa cu ion fees Shop online while maintaining privacy No risk of in fm ation Fundamentally impossible to counterfeit

  5. How Bitcoin works – overview No central authority Everyone maintains a ledger of all transa cu ions Continuously updated by everyone Some of the updaters get rewarded with new bitcoins – created out of thin air (this is the process of mining ) But there is a cap – 21 million bitcoins , all mined by 2140

  6. Fundamen tb l cha lm enges How to generate money without a central authority How to ensure money is not counterfeit How to prevent double sq ending How to validate transa cu ions

  7. Transa cu ions Some input transa cu ions Some output transa cu ions Un sq ent amount — Comes back to sender Transa cu ion fees — a small percentage Locking and unlocking scripts

  8. S tb te transition sy st em 14c5f8ba:0 2ec6fb08:0 3ce6ab02:1 e23f8761:2 4adfe231:2 Spend: Create: 3ce6ab02:1 bb75a980:1 4adfe231:2 bb75a980:2 Sigs to prove ownership 14c5f8ba:0 2ec6fb08:0 bb75a980:1 e23f8761:2 bb75a980:2

  9. S tb te transition sy st em Apply(S1, TX) —> S2: For each input in TX: 1 . If the referenced UTXO not in S1, return error If the signature does not match the owner of UTXO, return error Sum of inputs less than sum of outputs, return error 2 . Return S2 with all input UTXO removed and all output UTXO 3 . added

  10. Blocks Can st ore up to 1024 transa cu ions Subje cu to revision Hash of all the transa cu ions st ored in the header

  11. Ti e blockchain Ti e Bitcoin ledger Replicated across all users Every transa cu ion is broadca st to everyone New chunks of transa cu ions get added to the ledger in blocks (by miners ), and broadca st to everyone Bitcoin wallets update their copy of the ledger

  12. Ti e blockchain

  13. Is a block valid ? 1. Check if previous block referenced exists 2. Check timestamp greater than timestamp of previous block less than 2 hours into the future 3. Check proof of work 4. Let S[0] be state at the end of previous block 5. If the block has n transactions, do S[i+1] = Apply(S[i], TX[i]) 6. Return S[n]

  14. Concurrent chain management Maintain an ever growing chain Only operation provided is append a new entry to the chain Many users concurrently accessing the chain Centralized — Shared memory Users should agree on the la st node added to the chain Universal data st ru cu ure — Chain is a log of operations

  15. Consens ut obje cu s Each node has details of the operation and a consensus obje cu Users compete for the next node to add to the chain Ti e winner’s node is added Ti e consensus obje cu regulates this competition Implemented using compare-and-set Initialize winner to -1 compare-and-set(winner, -1, processname)

  16. D it tributed consens ut Ti ere is no central controlling node in bitcoin How to achieve consensus? Agents may lie! Byzantine generals problem Heavily st udied in di st ributed computing Achieve consensus by a maximal information protocol Works only when at mo st a third of the users are malicious But … everyone is potentially malicious in the blockchain

  17. Ti e blockchain lottery Miners - run an open-source Bitcoin mining program Miners add new blocks to the ledger a fu er checking corre cu ness of transa cu ions One winner is chosen from all the miners Rewarded with newly minted bitcoins and transa cu ion fees

  18. More on ti e blockchain No central authority to pick a winner Adding a block requires work Winner is the one who fj nishes this task fj r st Sends proof of work to the other miners Others give up trying to add a block and accept the winner — why??

  19. Blockchain forking Sometime two miners can st rike the same gold at the same time! Ti e blockchain has forked Ti ere are two versions of the blockchain now Ti e longer chain is chosen by everyone Eventually consi st ent!

  20. Mining Reward of the blockchain lottery Winner gets both new bitcoins and transa cu ion fees One new block is added to the ledger every 10 minutes Each miner adds one block once in 8 months Di ffi culty of task is calibrated (dynamically) to account for increase in computing power

  21. Mining For the fj r st 210 , 000 blocks, reward was 50 BTC Ti e reward halves for each chunk of 210 , 000 blocks Ti e reward is now 12 . 5 BTC One block added per 10 minutes, so roughly four years for 210 , 000 blocks By about 2140 , almo st all mining would be done Ti e only incentive is the transa cu ion fees a fu er that point

  22. Bitcoin mining – ti e process

  23. Bitcoin mining – ti e process Relay nodes check the validity of transa cu ions Within seconds, a transa cu ion arrives at all mining nodes Mining nodes colle cu a batch of transa cu ions and add it to the ledger a fu er solving the block Within ten minutes of a transa cu ion, a block containing the transa cu ion is added to the ledger by some miner (usually one lucky winner) New block is broadca st to all nodes within seconds

  24. Mining – sol v ing a block Solving a block is the central idea in bitcoin A block consi st s of a li st of transa cu ions and a block header One sq ecial transa cu ion added by the miner, awarding herself 12 . 5 bitcoins

  25. Mining – sol v ing a block Block header has Hash of previous block header (chaining) Hash of all transa cu ions in this block A nonce A di ffi culty target Solving – Find a nonce such that the hash of the block header is less than the di ffi culty target

  26. Vulnerabilities ? Majority is not enough — sel fj sh mining Routing attacks Anything else???

  27. References Bitcoin for the Befuddled Ma st ering Bitcoin Le cu ure on Blockchain EconTalk episode EconTalk episode 2 More EconTalk: Venezuela and Bitcoin Ethereum white paper

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend