cs 394b introduction - kaustweb.kaust.edu.sa/faculty/marcocanini/classes/cs394b/s18/... ·...
TRANSCRIPT
CS394BIntroductionMarcoCanini
CS394B– S18 1
ThisClass• Courseisacombination:classesinaflippedclassroomstyleandpaperpresentations/discussions
• Learntechnicalaspectsofblockchain technologiesanddistributedconsensus• Havetheconceptualfoundationstoengineersecuresoftwarethatinteractswiththeblockchain• Beabletointegrateideasfromtheblockchain intheirownprojects
• Comprehendandcritiquerelevantresearchpapersintheareaofblockchain systems• Presentresearchideasbothorallyinaconcisewayandwithintheallottedtimeaswellasinwriting
• Defendtheresearchapproach,designdecisions,andtheevaluationmethodsinadiscussion• Moderateadiscussionafteraresearchpresentation
CS394B– S18 2
AbouttheInstructor
• MarcoCanini• AssistantProfessoratKAUSTsinceAug’16• https://mcanini.github.io
• Researchinterestsspan• DistributedandNetworkedsystemsinthecontextofcloudcomputing,large-scaledataanalytics,andmachinelearning
• HeadofSANDSLab• Software-definedAdvancedNetworkedandDistributedSystemsLaboratory
CS394B– S18 3
Myresearch
4
SoftwareEngineering
Networking
FormalMethods
ProgrammingLanguages
OptimizationTheory
Idesign,build,measureandanalyzelarge-scalenetworkedsystemsthatspanmultipleautonomous,
potentiallyuntrustedentities
Security
MachineLearning
Goal: Discoverandapplyfundamentalprinciplesandvaluableknowledgeonhowtobuildscalable,dependable
andfuture-proofsystems,worthyofsociety’strust
DistributedSystems
CS394B– S18
Challenges
#1Challenge:Complexity
Hardtoreasonaboutbehaviorassystemsscaletolargenumbersofcomponentsandusers
• Poorlyunderstoodconnections• Needpredictabilitytoensurescalableperformance,reliableoperation,etc.
5CS394B– S18
SystemsApproach
• Formulateproblem• Getidea• Buildprototype• Measure&analyze• Adjustprototype…repeatpreviousstep
Principlesofsystemconstruction• modularity,hierarchy,layering,abstraction,endtoend
6CS394B– S18
Newapproachesareneeded
Systemsbasedondesigndecisionsmadeinthelastdecadecanhardlycopewithtoday’sscale,volumeorvelocity,letalonethefuture
Weneednewtechniques,designsandsolutions:• Improveperformancebyatleast10x,insomecases100x
• Ensurepredictabilityofperformanceandhighreliability
• Lowercomplexity ofmanaginglarge-scalesystems andprocessingbigdata
7CS394B– S18
SANDSLabVision
Makeiteasytoproduceandmanagekeynetworkedsystemsthatareworthyofsociety’strustandachievespecificobjectives:• Highperformanceandscalability• Highdependabilityandfuture-proof• Lowpower• …
WebuildprototypesthatdirectlyimprovethelivesofrealusersWelearngeneralprinciplesandlessonsofwhatworksinpractice
8CS394B– S18
Example:Dynam-IX
• DynamicInterconnectioneXchange
• https://dynam-ix.github.io/
CS394B– S18 9
WhatAboutYou?
• Pleaseintroduceyourself!• Whyareyouinthisclass?• Howcanwemakeitaveryusefulone?
CS394B– S18 10
Aboutthisclass
CS394B– S18 11
CourseSchedule
• Webpage:http://web.kaust.edu.sa/Faculty/MarcoCanini/classes/CS394B/S18/• Piazza:https://piazza.com/kaust.edu.sa/spring2018/cs394b
• Meetings• 4PM– 5:30PM(Sun forlecturesanddiscussions)
• Payattentiontotheonlineannouncementsandschedule• Onaverage,onemeetingperweek• Makeupswillbeaddedonaneed-to-addbasis,typicallyWed
CS394B– S18 12
Prerequisites
• CS240(ComputingSystemsandConcurrency)• BasicsofOSorganization,threads,memorymanagement,filesystems,scheduling,networking,etc.• EquivalentcourseofCS240isacceptableaswell
• Goodprogrammingskills• Distributedsystems– helpful• Cryptography– helpful• Probability– helpful
CS394B– S18 13
Flippedclassroom
• Courselecturesareonline• WefollowthecourseBitcoinandCryptocurrencyTechnologiesbyArvindNarayanan,JosephBonneau,EdwardFelten andAndrewMillerhttp://bitcoinbook.cs.princeton.edu/
• Youmustwatchthevideomaterialbeforethemeeting• Wegodeepintoeachtopicduringmeetings• Sendmequestionsinadvanceregardingthematerial
CS394B– S18 14
Textbook
• Textbooknotrequiredbutcanbeveryhelpful• ArvindNarayanan,JosephBonneau,EdwardFelten,AndrewMillerandStevenGoldfeder,BitcoinandCryptocurrencyTechnologies• Apre-publicationdraftofthebookisavailablefordownloadonthewebsite:http://bitcoinbook.cs.princeton.edu/
CS394B– S18 15
CourseRequirements
PaperReviews 15%Paper Presentation 15%ActiveParticipation 5%Assignments 25%Project 40%
Checkpoint#1:initialproposal 5%Checkpoint#2:midtermprogressreport 10%Presentation 10%Finalreport 15%
CS394B– S18 16
PaperReviews
• Paperreviewsaccountfor20% ofthetotalgrade• 6-8summariestowrite• Whatgoesinagoodsummary?• Highlightstrengths• Highlightweaknesses• Describetheentirepaperin3-5sentences
CS394B– S18 17
Papers
• Readcritically!• Istheproblemreal?• Whatisthesolution’smainidea(nugget)?• Whyissolutiondifferentfrompreviouswork?• Areassumptionsdifferent?• Isworkloaddifferent?• Isproblemnew?
• Doesthepaper(ordoyou)identifyanyfundamental/hardtrade-offs?• Doyouthinktheworkwillbeinfluentialin10years?• Whyorwhynot?
CS394B– S18 18
PaperReviews
• Reviewsmustbesubmittedelectronically24hoursbeforetheclass• SendthereviewviaPiazzaasprivatenotetoInstructors
• Youcanmissatmosttwowithoutanypenalty• Eachmissingonebeyondthatwillresultin25%decreaseingradeforthissegment• Meaning,missingsixormorewillresultin0%forthe“PaperReviews”segmentofyourgrade
• Reviewsarepeer-reviewed• Anotherstudentwillreadandgiveconstructivefeedbackonyourreview• Thegoalistomakebetterreviews• Goodfeedbackwillbeconsideredpositivelyduringgrading
• Read(ifyouhaven’talready!)• HowtoReadaPaper byS.Keshav• Howtoreadaresearchpaper byMichaelMitzenmacher• WritingReviewsforSystemsConferences byTimothyRoscoe
CS394B– S18 19
HowtoReview
• Youwillseeasectionfordescribingapapersummary,itsstrengths,itsweaknesses,anddetailedcomments• Inthesummarysection,pleasedirectlyaddress:
1. Whatproblemthepaperisaddressing(1-2sentencesorbullets)2. Thecorenovelideasortechnicalcontributionsofthework(1-2sentencesorbullets).Put
anotherway,what'sthe30secondelevatorpitch,or,fiveyearsfromnow,whatshouldonerememberaboutthispaper?
3. Alongerdescription(3-5sentences)thatsummarizesthepaper'sapproach,mechanisms,andfindings.
• Fortheothersections,pleaseinclude2-4bulletpointsforthestrengthsandweaknesses,whileamuchlongerexpositioninthedetailedcomments.• Remembertobeconstructive:don'tonlyfocusonthepaper'sshortcomings,butalsoonwhatitcouldhavedonedifferentlyorasthenextsteps.Imaginethatyouarehavingaconversationwiththeauthors:Whatwouldyoutellthem?
CS394B– S18 20
PaperPresentation
• Eachstudentmustpresentatleasttwopapers;possiblythree• Paperpresentationaccountfor15% ofthetotalgrade
• Twopapersperclassand20-minutespresentationforeach• Sharp20minutes;westartclapping!• Followedbydiscussionanchoredbythepresenters
• Whatshouldgoinausefulpresentation?• Motivate• Highlightthekeyideasandinsights;skip thedetails
• Leadthediscussion• Gothroughthestrengthsandweaknessesfromthepaperreview
CS394B– S18 21
PresentationGuidelines
Youroraldescriptionofthepapershouldfollowamuchsimilarformat:1. Title,authorsandinstitutions,conference/journal2. Problem3. Coreideas4. Descriptivesummaryandmainresults5. Strengths6. Weaknesses/limitations7. Furtherdiscussion,includingproposalsforfollow-upwork
CS394B– S18 22
PaperPresentation
• Emailyourslidestotheinstructor24hoursbeforetheclass• Prepareearly• Practicealot• Also,read• HowtoGiveaBadTalk byDavidA.Patterson• PointersforLeadingPaperDiscussions byRandyH.Katz
CS394B– S18 23
Participation
• Attendallmeetings• Canmissatmosttwowithlegitimatereasons
• Readallthepapersandparticipate• Askquestions!
• Sendquestionsonvideolectures(inadvance)
CS394B– S18 24
Assignments
• 3programmingassignments• Tobedoneindividually;due11:59pmonduedate
• 20/2Assignment1due• 6/3Assignment2due• 21/3Assignment3due
• Noextensionsgiven
CS394B– S18 25
Project
• Thebiggestcomponentofthiscourse• Pickaninterestingopenproblem.Whyisitimportant?• Whathasalreadybeendone?Whyaretheynotenough?• Developahypothesisabouthowyou’dimproveit
• Intuitively,whywillyourapproachwork?• Buildasubstantialprototype
• Experiment,measure,andcompareagainstthestate-of-the-art
• Aimatproducingaconference/workshop-qualityresearchpaper• Canberelatedtoyourresearchtopicbutitisexpectedtobedistinct!
CS394B– S18 26
Projects
• Thefinalprojectaccountsfor40% oftotalgrades• Doneingroupsof2students.Findyourpeers!
• Whatcanandcannotbeaproject?• Justsurveysarenotallowed.Infact,eachprojectmustincludeasurveyofrelatedworkandbackground• Anidealprojectshouldanswerthequestionsyouaskedduringpaperreviewsandpointsyoucaredaboutforpresentations• Measurementsofnewenvironmentsorofexistingsolutionsonnewenvironmentsareacceptableupondiscussion
• Willcoverprojectsinmoredepthinthenextmeeting!
CS394B– S18 27
HowtoApproachit?
1. Findaproblemandmotivatewhythisisworthsolving2. Surveybackgroundandrelatedworktogetasenseofyour
(friendly!)competition• Mightrequireyoutogobacktothefirststep
3. Form/updateyourhypothesis4. Testyourhypothesis• Gobackto3untilyouarehappy
5. Presentyourfindingsinapresentationandinwriting• Discussknownlimitations
CS394B– S18 28
MilestonesDate Milestone DetailsASAP Form Group Find like-minded students
14/2/18 Draft Proposal Send your proposal by email
7/3/18Finalize ProposalCheckpoint #1 (5%)
After a back-and-forth discussions with the instructor
21/3/18Midterm Progress ReportCheckpoint #2 (10%)
Should read like parts of a research paper
25/3/18 Midterm PresentationsDefine and motivate a problem, survey related work, and form initial hypothesis and idea
13/5/18 Presentations (10%) Present your findings in a presentation
16/5/18 Research paper (15%) Submit a final report similar to the papers you readCS394B– S18 29
DraftProposal
• Twopagesincludingreferencesthatideally includes• Whatistheproblem?• Whyisitimportanttosolve?• Anyinitialthoughtsonwhatyouwanttodo?• Howwouldyouevaluateyoursolution?
• Includeteammembers• Meaning,formagroupASAP
• Scheduleviaemaila15-minutemeetingtodiscuss
CS394B– S18 30
Read:TheHeilmeier’s Catechism
FinalizedProposal
• Twopagesincludingreferencesthatmust include• Whatistheproblem?• Whyisitimportanttosolve?• Anyinitialthoughtsonwhatyouwanttodo?• Howwouldyouevaluateyoursolution?
• Approvedbytheinstructorandagreeduponbyyou• Formsthebasisofexpectation
CS394B– S18 31
MidtermPresentation
• In-classshortpresentationoveroneday• Thisistomakesureyouaremakingprogress
• Mustinclude• Whatistheproblem?• Whyisitimportant?• Whatarethemostrelatedwork?• What’syourhypothesissofar?• Howare/willyouevaluateit?
CS394B– S18 32
FinalPresentationandPaper
• Presentation• Itwillfollowaformatsimilartootherpresentationsgivenintheclass
• Researchpaper• Thekeypart• Shouldbewrittensimilartothepapersyou’veread• Yourgoalistodopublishablequalitysystemsresearch• Uptofive“bestprojects”willbeearmarkedforexpeditedsubmissiontoarenownedconference,withthehelpoftheinstructor• HowtoWriteaGreat ResearchPaper bySimonPeytonJones
CS394B– S18 33
RoughOutline
• Abstract• Introduction(Highlighttheimportanceandgiveintuitionofsolution)• Motivation (Usedataandsimpleexamples)• Overview(Summarizeyouroverallsolutionsothatreaderscanfollowlater)• CoreIdea (Maincontributionw/challengesandhowyouaddressthem)• Implementation(Discussnon-obviouspartsofyourimplementation)• Evaluation (Convincereadersthatitworksandwhenitfails)• RelatedWork (Letreadersknowthatyouknowyourcompetition!)• Discussion(Knowyourlimitationsandpossibleworkarounds)• Conclusion(Summarizeandpointoutfuturework)
CS394B– S18 34
CourseTopics
• Introductorymaterial(~10videolectures)• basicsofcryptography;Merkle tree• blockchain;distributedconsensus• mining;incentives• proofofwork;proofofstake• governance;economics• security• smartcontracts;applications
• Advancedmaterial• activeresearchproblemsinthearea,includingattacks,networkscalability,alternativestoproofofwork/stake
CS394B– S18 35
BeforeWeMoveOn…
• Noextensions• Everyonemustwatchlecturesandreadpapersinadvance• Classmeetingformat• Quicksummarybytheinstructor• Topicdiscussionandaddressingquestions• Presentationofonepaper• Presentersleaddiscussionsonthepaperswe’vereadandrelatedtopics
CS394B– S18 36
DevelopingaCryptocurrency
SlidecourtesyofIttay EyalCS394B– S18 37
Bitcoin
2008:TheBitcoinwhitepaper2009:Referenceimplementation
Probablynotthisguy
SlidecourtesyofIttay Eyal CS394B– S18 38
KeyChallenges
A
B
C
1. Nostealing:OnlyAlicecanmovehermoney2. Minting:Fairmoneycreation3. Nodouble-spending:Alicecannotduplicatehermoney
SlidecourtesyofIttay Eyal CS394B– S18 39
60SecondsonPublicKeySignatures
Alicegenerateskeypair1. privatekey𝑘",keptsecret2. publickey𝐾",publishedwithpublickeyinfrastructure
• Alicesignsamessage𝑚withprivatekey𝑘",generatingasignature𝑠.
• Anyonecanverifythat𝑠 isasignatureof𝑚 withkey𝑘"given𝑚 and𝐾".
SlidecourtesyofIttay Eyal CS394B– S18 40
AddressesandTransactions
1.sgn(𝑘")
2.sgn(𝑘')2.𝐾(,amount𝑦
1.𝐾*,amount0.5𝑥
3.𝐾/,amount0.5𝑥
2.𝐾",amount𝑥
…
…
1.𝐾',amount𝑦
SlidecourtesyofIttay Eyal CS394B– S18 41
1. Nostealing:OnlyAlicecanmovehermoney2. Nodouble-spending:Alicecannotduplicatehermoney3. Minting:Fairmoneycreation
KeyChallenges
A
B
C
SlidecourtesyofIttay Eyal CS394B– S18 42
GlobalLedger
Mà A
Aà B
Bà C
SlidecourtesyofIttay Eyal CS394B– S18 43
GlobalLedger
Mà A
Aà B
Aà C
SlidecourtesyofIttay Eyal CS394B– S18 44
GlobalLedger
Mà A
Aà B
Bà C
SlidecourtesyofIttay Eyal CS394B– S18 45
KeyChallenges
A
B
C
1. Nostealing:OnlyAlicecanmovehermoney2. Nodouble-spending:Alicecannotduplicatehermoney3. Minting:Fairmoneycreation
SlidecourtesyofIttay Eyal CS394B– S18 46
60SecondsonCryptographicHashing
HashFunction
𝐻
Lorem ipsum dolorsitamet,consecteturadipiscing elit,sed doeiusmod temporincididunt ut labore etdolore magnaaliqua.Utenim adminimveniam,quis nostrudexercitationullamco laboris nisiut aliquip exeacommodo consequat.Duis aute irure dolorinreprehenderit involuptate velit esse cillumdolore eu fugiat nulla pariatur.Excepteur sintoccaecat cupidatat nonproident,sunt inculpaquiofficia deserunt mollit anim idest laborum.
56293a80e0394d252e995f2debccea8223e4b5b2b150bee212729b3b39ac4d46
Stringinput 256bitnumber(forexample)
Givena256bitnumberℎ,onecannotfindaninputstringthatresultsinℎ fasterthanrepeatedlyguessinginputs𝑥 andcalculating𝐻(𝑥).
SlidecourtesyofIttay Eyal CS394B– S18 47
Mining– MintingforProofofWork
Computationallydifficultpuzzle:
Find𝑥 suchthat𝐻 𝑥|𝑦 < 𝑡
Solverguessesvaluesfor𝑥 untilfindingavalidone
• Differentstrings𝑦 fordifferentpuzzles• Thetarget𝑡 determinesthedifficulty,averagetimetosolve
SlidecourtesyofIttay Eyal CS394B– S18 48
Mining– MintingforProofofWork
A
puzzle
solution(PoW)
SlidecourtesyofIttay Eyal CS394B– S18 49
KeyChallenges
1. Nostealing:OnlyAlicecanmovehermoneyCryptographicsignatures
2. Nodouble-spending:AlicecannotduplicatehermoneyGloballedger
3. Minting:FairmoneycreationMintforproofofwork
SlidecourtesyofIttay Eyal CS394B– S18 50
KeyChallenges
Whogivesmoneyforpuzzles?
Whorunsthepublickeyinfrastructure?
Whomaintainsthepublicledger?
Canthisbedecentralized?
1. Nostealing:OnlyAlicecanmovehermoneyCryptographicsignatures
2. Nodouble-spending:AlicecannotduplicatehermoneyGloballedger
3. Minting:FairmoneycreationMintforproofofwork
SlidecourtesyofIttay Eyal CS394B– S18 51
ReplicatedStateMachine
• Insteadofonemachine,useareplicatedstatemachine• Multiplemachinesoperateasingleledger,PKI,andmintfairly• Asubsetcanbehavearbitrarily– akaByzantine
Butwhochoosestheparticipatingmachines?
SlidecourtesyofIttay Eyal CS394B– S18 52
AReplicatedStateMachine
𝐴8 → 𝐵8
Log
A B
𝐴8 → 𝐴; 𝐵8 → 𝐶8
SlidecourtesyofIttay Eyal CS394B– S18 53
Nakamoto’s Blockchain
Log Blockchain
block
header
SlidecourtesyofIttay Eyal CS394B– S18 54
Nakamoto’s Blockchain
Log Blockchain
block
header
SlidecourtesyofIttay Eyal CS394B– S18 55
Nakamoto’s Blockchain
Log Blockchain
hash( )< target*
*target:adeterministicfunctionofpreviousblocks
SlidecourtesyofIttay Eyal CS394B– S18 56
Nakamoto’s Blockchain
SlidecourtesyofIttay Eyal CS394B– S18 57
Nakamoto’s Blockchain
SlidecourtesyofIttay Eyal CS394B– S18 58
Nakamoto’s Blockchain
Exponentialrandominterval
SlidecourtesyofIttay Eyal CS394B– S18 59
IncentiveforMining
• InternalPrize:• Minting• Fees
Wins proportionaltocomputationpower
SlidecourtesyofIttay Eyal CS394B– S18 60
Forks
• Naturalinadistributedsystem
SlidecourtesyofIttay Eyal CS394B– S18 61
ForkResolution
• Longest chainwins• Transactionsarereverted• Double-spendingathreat
SlidecourtesyofIttay Eyal CS394B– S18 62
ForkResolution
Atransactionisconfirmed whenitisburied deepenough
SlidecourtesyofIttay Eyal CS394B– S18 63
KeyChallenges
Decentralized
1. Nostealing:OnlyAlicecanmovehermoneyCryptographicsignatures
2. Nodouble-spending:AlicecannotduplicatehermoneyGloballedger
3. Minting:FairmoneycreationMintforproofofwork
SlidecourtesyofIttay Eyal CS394B– S18 64
Next…
• Followlecture1• ReadBitcoin:APeer-to-PeerElectronicCashSystem
• WemeetonWednesday
CS394B– S18 65