Crypto251.0 Cryptocurrency and the Smileycoin
Total Page:16
File Type:pdf, Size:1020Kb
crypto251.0 Cryptocurrency and the Smileycoin Gunnar Stefansson (editor) 29. nóvember 2020 Copyright This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/1.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. 1 Efnisyfirlit 1 Introduction to cryptocurrencies 8 1.1 Introductiontothecourse. .. 8 1.1.1 Handout................................ 8 1.2 Enrollment,creditsandSmileycoinrewards . ....... 9 1.3 Readingmaterial ............................... 9 1.3.1 Handout................................ 9 1.4 Cryptocurrencies ............................... 10 1.5 Behindthescenes(inIcelandic) . ... 10 1.6 Ausefulallegory ............................... 11 1.7 Theuserside ................................. 11 1.8 Overview ................................... 11 1.8.1 Handout................................ 11 2 Bitcoin and Smileycoin basics 12 2.1 Operatingawallet............................... 12 2.2 Theblockandblockexplorers . 12 2.3 Thetransaction ................................ 12 2.4 Wherewecomefrom(a):thetutor-web . .. 13 2.4.1 Handout................................ 13 2.5 Wherewecomefrom(b): EducationinaSuitcase . ..... 13 2.5.1 Handout................................ 13 2.6 Wherewecomefrom(c):SMLY. 14 2.6.1 Handout................................ 14 2.7 Overview ................................... 14 2.7.1 Handout................................ 14 2.7.2 References .............................. 14 3 Picking up and using a wallet 17 3.1 Single-coinvsmulti-coinwallets . ..... 17 3.1.1 Handout................................ 17 3.2 Smileycoinwallets .............................. 17 3.2.1 Handout................................ 17 3.3 Theconfigurationfile ............................. 18 3.3.1 Handout................................ 18 3.4 Overview ................................... 18 3.4.1 Handout................................ 19 4 Compiling the wallet 20 4.1 TheLinuxsteps................................ 20 4.2 GetacomputerrunningLinux . 20 4.3 Linux: UsegittodownloadtheSMLYwalletsource . ..... 20 4.4 Linux:Runthetoolstocompilethecode. .... 20 4.5 Linux:Installthewalletwhereyouwantit . ...... 20 4.5.1 Handout................................ 20 4.6 Windows:Compilingthewallet . 21 4.7 MacOSX:Compilingthewallet . 21 4.8 Overview ................................... 21 4.8.1 Handout................................ 21 2 5 Introduction to the SMLY command line 22 5.1 TheSMLYcommandline.. .. .. .. .. .. .. .. 22 5.1.1 Handout................................ 22 5.1.2 Examples............................... 22 6 Basic cryptocurrency economics 23 6.1 Background.................................. 23 6.2 Theissues................................... 23 6.3 Thecoinbase,difficultyandminingstrategy . ....... 23 6.3.1 Handout................................ 23 6.4 Mining:Thetragedyofthecommons . 24 6.5 Miningdevelopment ............................. 24 6.6 Basiceconomics ............................... 24 6.6.1 Handout................................ 24 6.7 Investmentandspeculation . .. 25 6.7.1 Handout................................ 25 6.8 Theairdropfallacy .............................. 27 6.9 Settingupusecases.............................. 27 6.10Donations ................................... 27 6.10.1 Handout................................ 28 6.11 Dividentpayments .............................. 28 6.12 TheSmileyCoineconomy . 29 6.12.1 Handout................................ 29 6.13 Cryptocurrencies as a Universal Basic Income . ........ 29 6.14 Solving UBI implementation issues: delivery and demand.......... 30 6.14.1 Examples ............................... 30 6.15 Keepingoravoidingdeveloperanonymity . ...... 32 7 The transaction 34 7.1 Background.................................. 34 7.2 Atypicaltransaction ............................. 34 7.3 Insidethetransaction:Theoutput . .... 34 7.4 Insidethetransaction:Theinput . .... 35 7.5 TheUTXO .................................. 35 7.5.1 Handout................................ 35 7.6 Keys...................................... 36 7.6.1 Handout................................ 36 7.7 SpendingtheUTXO ............................. 37 7.7.1 Handout................................ 37 7.8 Thetransactiononthecommandline. ... 37 7.8.1 Handout................................ 37 7.9 TheUTXOset................................. 38 7.9.1 Handout................................ 38 7.10 Thetransactionfee .............................. 38 7.10.1 Examples ............................... 38 7.11 Manualtransactionexample-maintainingafund . ........ 38 7.11.1 Examples ............................... 39 3 8 The block, the blockchain and the network 40 8.1 Theblockandthechain............................ 40 8.2 Thehashandthenonce............................ 40 8.2.1 Handout................................ 40 8.2.2 Examples............................... 40 8.3 Thenetwork.................................. 41 8.3.1 Handout................................ 41 9 Cryptocurrency mining 42 9.1 Mining,hashesandthecryptographypuzzle . ...... 42 9.2 Miningfromawallet ............................. 42 9.2.1 Handout................................ 42 9.3 GPUmining.................................. 43 9.3.1 Handout................................ 43 9.4 Miningusingspecialisedhardware(ASICmining) . ....... 43 9.4.1 Handout................................ 43 9.5 MiningusingasmallASIC. .. .. .. .. .. .. .. 44 9.5.1 Handout................................ 44 9.6 Whichhashesandhow ............................ 44 9.6.1 Handout................................ 44 9.7 Theminingalgorithm............................. 45 9.7.1 Handout................................ 45 9.8 Mining,energyandotheruses . 45 10 Cryptography and cryptocurrencies 46 10.1 Cryptographyusebycryptocurrencies . ...... 46 11 Hash function introduction 47 12 Elliptic curves 48 13 The trilogy: tutor-web, Smileycoin and Education in a Suitcase 49 13.1 Thisisjustaplaceholder!! . ... 49 13.2 Wherewecomefrom............................. 50 13.3 Thetutor-websystem. 51 13.4sl03030 .................................... 53 13.5sl03040 .................................... 55 13.6sl03050 .................................... 56 13.7sl03055 .................................... 56 13.8sl03060 .................................... 56 13.9sl03070 .................................... 57 14 The SmileyCoin Fund 58 14.1 Preminingacryptocurrency. ... 58 14.1.1 Handout................................ 58 14.2 TheSmileyCoinpremine . 58 14.2.1 Handout................................ 58 14.3 Setting up a cryptocurrency fund: The SmileyCoin Fund . ......... 58 14.3.1 Handout................................ 58 4 15 Splitting the coinbase: No longer just a miner’s fee 60 15.1 Alternativestopreminesandfunds . ..... 60 15.1.1 Handout................................ 60 15.2 Splittingthecoinbase:Why? . ... 60 15.2.1 Handout................................ 60 15.3 TheSmileyCoincoinbasesplit . ... 61 15.3.1 Handout................................ 61 15.4 Effectsofthecoinbasesplit. .... 61 15.4.1 Handout................................ 61 16 Staking and proof-of-stake 62 16.1Staking .................................... 62 16.2Proofofstake ................................. 62 17 The tutor-web as a faucet 63 17.1 Cryptocurrencyfaucets . .. 63 18 The command line from a Linux script 64 18.1 TheLinuxshell ................................ 64 18.2Startupfiles .................................. 64 18.3Betzy ..................................... 64 18.3.1 Handout................................ 64 18.4 Thecommandscript ............................. 65 19 Building slightly more complex transactions on the commandline 66 19.1 Asimpletransaction . .. .. .. .. .. .. .. .. 66 19.1.1 Handout................................ 66 19.2 Maintainingasingleaddress . ... 66 19.2.1 Example ............................... 67 19.3 MakinganonstandardtransactionusingP2SH . ...... 67 19.3.1 Handout................................ 67 20 Cryptocurrency exchanges 69 20.1 Smileycoinexchanges. 69 20.2 Thehoneypotproblem ............................ 69 20.3 Trackingstolengoods. 69 20.4Aninsidejob ................................. 69 21 API access to exchanges 70 21.1 Automatingaccess to cryptocurrency exchanges . ......... 70 22 Automation on the blockchain (stores, ATM, gambling etc) 71 22.1 Doingstuffontheblockchain. ... 71 22.2 Sohowdoyoudostuff? ........................... 71 22.3 Gamblingontheblockchain . 71 22.4 Messagesontheblockchain . 71 22.5 AverysimpleATMontheblockchain . .. 72 22.6 AmoreelaborateATMontheblockchain . ... 72 22.7 Traditionaldata ................................ 72 22.7.1 Examples ............................... 72 22.8 APIaccesstotheblockchain . .. 72 22.8.1 Handout................................ 73 5 23 The Bitcoin programming language 74 23.1 Frominputtooutput ............................. 74 23.2 Theassembler................................. 74 23.2.1 Handout................................ 74 23.3 Simpleexample................................ 75 23.3.1 Example ............................... 75 23.4spending.................................... 76 23.4.1 Handout................................ 76 23.5 A more detailed look inside the spending transaction . .......... 76 23.5.1 Example ............................... 76 23.6 AmoredetailedlookatP2SH . 79 23.6.1 Handout................................ 79 23.6.2 Example ............................... 79 24FunandgameswithBitcoinandSmileyCoin