Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Blockchain Game

The Blockchain Game

A hands-on exercise to teach the fundamentals of Blockchain to non-technical audiences. For full details visit: https://christiansonjs.com/blockchain-game/

Interested in content like this? Then check out The Free-Range Technologist from Prof C. https://profc.substack.com/

J. Scott Christianson

August 11, 2024
Tweet

More Decks by J. Scott Christianson

Other Decks in Education

Transcript

  1. The Blockchain Game J Scott Christianson This work is licensed

    under a Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License.
  2. Blockchain Basics • A Distributed Ledger • No central server

    or authority. • Everyone (aka node) on the network has a copy of the ledger. • A huge variety of information can be stored on a blockchain ledger. The Blockchain Game
  3. Blockchain Basics • A Distributed Ledger Can Store: • Financial

    Transactions • Property Records • Shipments and Inventory • Grades???? The Blockchain Game
  4. Blockchain Basics • A Distributed Ledger For Grades • All

    teachers calculate student grades and then enter the grades into a central repository (the registrar or central office ). • Why not eliminate the registrar (save some $$) and just have the teachers maintain the ledger of grades? The Blockchain Game
  5. The Grade Blockchain • Let’s try it! • Everyone in

    the class will act as “special” nodes called “Miners.” • I will pick on seven people to be “students” The Blockchain Game
  6. The Grade Blockchain • Student identities are concealed. • Each

    student has a public ID that matches with a private ID that only the student knows. The Blockchain Game
  7. Below is your key pair for the grade blockchain. Your

    teacher will assign a grade to your public key. You can then use any of the grade scanning tools to review the blockchain and retrieve your grades. 1 Student Public Key Private Key ad59da c8fc47b6fe
  8. Our First Block The Blockchain Game Grade BlockChain Block Course

    Student Grade Nonce (1-3) a b c Value of Last 2 digits of Prev Hash Hash 212 1 Parks 320 ad59da F 12 2 3 4 5 6
  9. Finishing the block: Hashing The Blockchain Game • Miners will

    solve a puzzle to create a unique number for the block (aka a hash) using the information contained in our block and use that to make our ledger secure! • First to generate a correct hash wins • Other miners and nodes will verify if that hash is correct
  10. Miners Mine!! N 78 O 79 P 80 Q 81

    R 82 S 83 T 84 U 85 V 86 W 87 X 88 Y 89 Z 90 A 65 B 66 C 67 D 68 E 69 F 70 G 71 H 72 I 73 J 74 K 75 L 76 M 77 Look up Table a = Value of the first letter of the course in the look up table (a=65, b=66, etc.) b = Value of the first letter of the student Public Key in the look up table (a=65, b=66, etc.) c = Value of the Grade in the look up table (a=65, b=66, etc.) value between 1 and 3 that you will adjust to calculate a hash that can be equally divisible by 3 Nonce = Hash = Nonce + a + b + c - Value of Last 2 digits of prev Hash
  11. Our First Block The Blockchain Game Grade BlockChain Block Course

    Student Grade Nonce (1-3) a b c Value of Last 2 digits of Prev Hash Hash 212 1 Parks 320 ad59da F 80 65 70 12 2 3 4 5 6 Hash = Nonce + a + b + c - Value of Last 2 digits of prev Hash
  12. Finishing the block: Hashing The Blockchain Game 1 Grade BlockChain

    Block Course Student Grade Nonce (1-3) a b c Value of Last 2 digits of Prev Hash Hash 212 1 Parks 320 ad59da F 1 80 65 70 12 204 2 3 4 5 6 Hash = Nonce + a + b + c - Value of Last 2 digits of prev Hash
  13. Block 2 Course: Student: Grade: The Blockchain Game Engineering 300

    bd9ebc B Miners Mine —> Verify and Vote —> N 78 O 79 P 80 Q 81 R 82 S 83 T 84 U 85 V 86 W 87 X 88 Y 89 Z 90 A 65 B 66 C 67 D 68 E 69 F 70 G 71 H 72 I 73 J 74 K 75 L 76 M 77 Look up Table Hash = Nonce + a + b + c - Value of Last 2 digits of prev Hash
  14. Finishing the block: Hashing The Blockchain Game 1 2 Grade

    BlockChain Block Course Student Grade Nonce (1-3) a b c Value of Last 2 digits of Prev Hash Hash 212 1 Parks 320 ad59da F 1 80 65 70 12 204 2 Engineering 300 bd9ebc B 1 69 66 66 4 198 3 4 5 6 Hash = Nonce + a + b + c - Value of Last 2 digits of prev Hash
  15. Block 3 Course: Student: Grade: The Blockchain Game Business 200

    c67445 C Miners Mine —> Verify and Vote —> N 78 O 79 P 80 Q 81 R 82 S 83 T 84 U 85 V 86 W 87 X 88 Y 89 Z 90 A 65 B 66 C 67 D 68 E 69 F 70 G 71 H 72 I 73 J 74 K 75 L 76 M 77 Look up Table Hash = Nonce + a + b + c - Value of Last 2 digits of prev Hash
  16. Finishing the block: Hashing The Blockchain Game 1 2 3

    Grade BlockChain Block Course Student Grade Nonce (1-3) a b c Value of Last 2 digits of Prev Hash Hash 212 1 Parks 320 ad59da F 1 80 65 70 12 204 2 Engineering 300 bd9ebc B 1 69 66 66 4 198 3 Business 200 c67445 C 3 66 67 67 98 105 4 5 6 Hash = Nonce + a + b + c - Value of Last 2 digits of prev Hash
  17. Block 4 Course: Student: Grade: The Blockchain Game Parks 320

    e2dd8a B Miners Mine —> Verify and Vote —> N 78 O 79 P 80 Q 81 R 82 S 83 T 84 U 85 V 86 W 87 X 88 Y 89 Z 90 A 65 B 66 C 67 D 68 E 69 F 70 G 71 H 72 I 73 J 74 K 75 L 76 M 77 Look up Table Hash = Nonce + a + b + c - Value of Last 2 digits of prev Hash
  18. Finishing the block: Hashing The Blockchain Game 1 2 3

    4 Grade BlockChain Block Course Student Grade Nonce (1-3) a b c Value of Last 2 digits of Prev Hash Hash 212 1 Parks 320 ad59da F 1 80 65 70 12 204 2 Engineering 300 bd9ebc B 1 69 66 66 4 198 3 Business 200 c67445 C 3 66 67 67 98 105 4 Parks 320 e2dd8a B 3 80 69 66 5 213 5 6
  19. Block 5 Course: Student: Grade: The Blockchain Game Engineering 300

    e2dd8a D Miners Mine —> Verify and Vote —> N 78 O 79 P 80 Q 81 R 82 S 83 T 84 U 85 V 86 W 87 X 88 Y 89 Z 90 A 65 B 66 C 67 D 68 E 69 F 70 G 71 H 72 I 73 J 74 K 75 L 76 M 77 Look up Table Hash = Nonce + a + b + c - Value of Last 2 digits of prev Hash
  20. Finishing the block: Hashing The Blockchain Game 1 2 3

    4 5 Grade BlockChain Block Course Student Grade Nonce (1-3) a b c Value of Last 2 digits of Prev Hash Hash 212 1 Parks 320 ad59da F 1 80 65 70 12 204 2 Engineering 300 bd9ebc B 1 69 66 66 4 198 3 Business 200 c67445 C 3 66 67 67 98 105 4 Parks 320 e2dd8a B 3 80 69 66 5 213 5 Engineering 300 e2dd8a D 2 69 69 68 13 195 6
  21. Block 6 Course: Student: Grade: The Blockchain Game Engineering 300

    bde7af B Miners Mine —> Verify and Vote —> N 78 O 79 P 80 Q 81 R 82 S 83 T 84 U 85 V 86 W 87 X 88 Y 89 Z 90 A 65 B 66 C 67 D 68 E 69 F 70 G 71 H 72 I 73 J 74 K 75 L 76 M 77 Look up Table Hash = Nonce + a + b + c - Value of Last 2 digits of prev Hash
  22. Finishing the block: Hashing The Blockchain Game 1 2 3

    4 5 6 Grade BlockChain Block Course Student Grade Nonce (1-3) a b c Value of Last 2 digits of Prev Hash Hash 212 1 Parks 320 ad59da F 1 80 65 70 12 204 2 Engineering 300 bd9ebc B 1 69 66 66 4 198 3 Business 200 c67445 C 3 66 67 67 98 105 4 Parks 320 e2dd8a B 3 80 69 66 5 213 5 Engineering 300 e2dd8a D 2 69 69 68 13 195 6 Engineering 300 bde7af B 2 69 66 66 95 108
  23. Questions? The Blockchain Game • Anyone, what courses did c67445

    take and what grade did they earn? • Student 2 what grades have you received?
  24. What if…. The Blockchain Game • A grade is announced

    by someone other than a faculty member? • Student pays off a node (any node) to record an A in for their grade? • Student 5’s Private Key is lost.
  25. Finishing the block: Hashing The Blockchain Game 1 2 3

    4 5 6 Grade BlockChain Block Course Student Grade Nonce (1-6) a b c Value of Last 2 digits of Prev Hash Hash 212 1 Parks 320 ad59da F 1 80 65 70 12 204 2 Engineering 300 bd9ebc B 1 69 66 66 4 198 3 Business 200 c67445 C 3 66 67 67 98 105 4 Parks 320 e2dd8a B 3 80 69 66 5 213 5 Engineering 300 e2dd8a D 2 69 69 68 13 195 6 Engineering 300 bde7af B 2 69 66 66 95 108
  26. What if…. The Blockchain Game • A miner changes a

    transaction and announces the hash to the network before anyone else calculates it? • The difficulty of calculating a hash increases as the blockchain grows?
  27. What did we observe in this “Game” • Distributed Ledger

    • No central authority to hold ledger or be attacked. • All people (aka nodes) have complete ledger. • Transparent but anonymous Ledger • Ledger can be public while concealing identity.
 • Append only Ledger • Each entry (aka block) is linked to the previous entry via some math (aka hash). • Some nodes (aka miners) are paid for performing calculations (aka proof of work). • Immutable Ledger • Attacks to ledger are impractical due to need for majority of nodes (aka 51% attack) to agree to a change and the computational power required.
  28. Grade Blockchain • While a grade blockchain provides a good

    exercise to explain blockchain in a class, storing grades is probably not a great application for blockchain. • What are good applications for blockchain? I recommend the DHS flowchart to get you started. The Blockchain Game
  29. Review • Distributed Ledger • No central authority to hold

    ledger or be attacked. • All people (aka nodes) have complete ledger. • Transparent but anonymous Ledger • Ledger can be public while concealing identity.
 • Append only Ledger • Each entry (aka block) is linked to the previous entry via some math (aka hash) • Some node (aka miners) are paid for performing calculations (aka proof of work) • Immutable Ledger • Attacks to ledger are impractical due to need for majority of nodes to agree to a change and the computational power required.