0% found this document useful (0 votes)
23 views65 pages

L1 Intro

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views65 pages

L1 Intro

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 65

CS 394B Introduction

Marco Canini

CS 394B – S18 1
This Class
• Course is a combination: classes in a flipped classroom style and paper
presentations/discussions

• Learn technical aspects of blockchain technologies and distributed consensus


• Have the conceptual foundations to engineer secure software that interacts with the blockchain
• Be able to integrate ideas from the blockchain in their own projects

• Comprehend and critique relevant research papers in the area of blockchain systems
• Present research ideas both orally in a concise way and within the allotted time as well as in
writing
• Defend the research approach, design decisions, and the evaluation methods in a discussion
• Moderate a discussion after a research presentation

CS 394B – S18 2
About the Instructor
• Marco Canini
• Assistant Professor at KAUST since Aug ’16
• https://mcanini.github.io
• Research interests span
• Distributed and Networked systems in the context of cloud computing, large-
scale data analytics, and machine learning
• Head of SANDS Lab
• Software-defined Advanced Networked and Distributed Systems Laboratory

CS 394B – S18 3
My research
Formal
Distributed Security
Methods
Systems
Machine Optimization
Learning Theory
Networking
Software Programming
Engineering Languages

I design, build, measure and analyze large-scale


networked systems that span multiple autonomous,
potentially untrusted entities
Goal: Discover and apply fundamental principles and
valuable knowledge on how to build scalable, dependable
and future-proof systems,
CS 394B –worthy
S18 of society’s trust 4
Challenges
#1 Challenge: Complexity

Hard to reason about behavior as systems scale to large numbers of


components and users

• Poorly understood connections


• Need predictability to ensure scalable performance, reliable operation, etc.

CS 394B – S18 5
Systems Approach
• Formulate problem
• Get idea
• Build prototype
• Measure & analyze
• Adjust prototype … repeat previous step

Principles of system construction


• modularity, hierarchy, layering, abstraction, end to end

CS 394B – S18 6
New approaches are needed
Systems based on design decisions made in the last decade can hardly
cope with today’s scale, volume or velocity, let alone the future

We need new techniques, designs and solutions:


• Improve performance by at least 10x, in some cases 100x
• Ensure predictability of performance and high reliability
• Lower complexity of managing large-scale systems and processing big data

CS 394B – S18 7
SANDS Lab Vision
Make it easy to produce and manage key networked systems that are
worthy of society’s trust and achieve specific objectives:
• High performance and scalability
• High dependability and future-proof
• Low power
•…

We build prototypes that directly improve the lives of real users


We learn general principles and lessons of what works in practice
CS 394B – S18 8
Example: Dynam-IX
• Dynamic Interconnection eXchange

• https://dynam-ix.github.io/

CS 394B – S18 9
What About You?
• Please introduce yourself!
• Why are you in this class?
• How can we make it a very useful one?

CS 394B – S18 10
About this class

CS 394B – S18 11
Course Schedule
• Webpage: http://web.kaust.edu.sa/Faculty/MarcoCanini/classes/CS394B/S18/
• Piazza: https://piazza.com/kaust.edu.sa/spring2018/cs394b
• Meetings
• 4PM – 5:30 PM (Sun for lectures and discussions)
• Pay attention to the online announcements and schedule
• On average, one meeting per week
• Makeups will be added on a need-to-add basis, typically Wed

CS 394B – S18 12
Prerequisites
• CS 240 (Computing Systems and Concurrency)
• Basics of OS organization, threads, memory management, file systems,
scheduling, networking, etc.
• Equivalent course of CS 240 is acceptable as well
• Good programming skills
• Distributed systems – helpful
• Cryptography – helpful
• Probability – helpful

CS 394B – S18 13
Flipped classroom
• Course lectures are online
• We follow the course Bitcoin and Cryptocurrency Technologies by Arvind
Narayanan, Joseph Bonneau, Edward Felten and Andrew Miller
http://bitcoinbook.cs.princeton.edu/
• You must watch the video material before the meeting
• We go deep into each topic during meetings
• Send me questions in advance regarding the material

CS 394B – S18 14
Textbook
• Textbook not required but can be very helpful
• Arvind Narayanan, Joseph Bonneau, Edward Felten, Andrew Miller
and Steven Goldfeder, Bitcoin and Cryptocurrency Technologies
• A pre-publication draft of the book is available for download on the
website: http://bitcoinbook.cs.princeton.edu/

CS 394B – S18 15
Course Requirements

Paper Reviews 15%


Paper Presentation 15%
Active Participation 5%
Assignments 25%
Project 40%
Checkpoint #1: initial proposal 5%
Checkpoint #2: midterm progress report 10%
Presentation 10%
Final report 15%

CS 394B – S18 16
Paper Reviews
• Paper reviews account for 20% of the total grade
• 6-8 summaries to write
• What goes in a good summary?
• Highlight strengths
• Highlight weaknesses
• Describe the entire paper in 3-5 sentences

CS 394B – S18 17
Papers
• Read critically!
• Is the problem real?
• What is the solution’s main idea (nugget)?
• Why is solution different from previous work?
• Are assumptions different?
• Is workload different?
• Is problem new?
• Does the paper (or do you) identify any fundamental/hard trade-offs?
• Do you think the work will be influential in 10 years?
• Why or why not?
CS 394B – S18 18
Paper Reviews
• Reviews must be submitted electronically 24 hours before the class
• Send the review via Piazza as private note to Instructors
• You can miss at most two without any penalty
• Each missing one beyond that will result in 25% decrease in grade for this segment
• Meaning, missing six or more will result in 0% for the “Paper Reviews” segment of your grade
• Reviews are peer-reviewed
• Another student will read and give constructive feedback on your review
• The goal is to make better reviews
• Good feedback will be considered positively during grading
• Read (if you haven’t already!)
• How to Read a Paper by S. Keshav
• How to read a research paper by Michael Mitzenmacher
• Writing Reviews for Systems Conferences by Timothy Roscoe
CS 394B – S18 19
How to Review
• You will see a section for describing a paper summary, its strengths, its weaknesses, and
detailed comments
• In the summary section, please directly address:
1. What problem the paper is addressing (1-2 sentences or bullets)
2. The core novel ideas or technical contributions of the work (1-2 sentences or bullets). Put
another way, what's the 30 second elevator pitch, or, five years from now, what should one
remember about this paper?
3. A longer description (3-5 sentences) that summarizes the paper's approach, mechanisms, and
findings.
• For the other sections, please include 2-4 bullet points for the strengths and
weaknesses, while a much longer exposition in the detailed comments.
• Remember to be constructive: don't only focus on the paper's shortcomings, but also on
what it could have done differently or as the next steps. Imagine that you are having a
conversation with the authors: What would you tell them?
CS 394B – S18 20
Paper Presentation
• Each student must present at least two papers; possibly three
• Paper presentation account for 15% of the total grade
• Two papers per class and 20-minutes presentation for each
• Sharp 20 minutes; we start clapping!
• Followed by discussion anchored by the presenters
• What should go in a useful presentation?
• Motivate
• Highlight the key ideas and insights; skip the details
• Lead the discussion
• Go through the strengths and weaknesses from the paper review
CS 394B – S18 21
Presentation Guidelines
Your oral description of the paper should follow a much similar format:
1. Title, authors and institutions, conference/journal
2. Problem
3. Core ideas
4. Descriptive summary and main results
5. Strengths
6. Weaknesses/limitations
7. Further discussion, including proposals for follow-up work

CS 394B – S18 22
Paper Presentation
• Email your slides to the instructor 24 hours before the class
• Prepare early
• Practice a lot
• Also, read
• How to Give a Bad Talk by David A. Patterson
• Pointers for Leading Paper Discussions by Randy H. Katz

CS 394B – S18 23
Participation
• Attend all meetings
• Can miss at most two with legitimate reasons
• Read all the papers and participate
• Ask questions!
• Send questions on video lectures (in advance)

CS 394B – S18 24
Assignments
• 3 programming assignments
• To be done individually; due 11:59pm on due date

• 11/2 Assignment 1 due


• 28/2 Assignment 2 due
• 21/3 Assignment 3 due

• No extensions given

CS 394B – S18 25
Project
• The biggest component of this course
• Pick an interesting open problem. Why is it important?
• What has already been done? Why are they not enough?
• Develop a hypothesis about how you’d improve it
• Intuitively, why will your approach work?
• Build a substantial prototype
• Experiment, measure, and compare against the state-of-the-art
• Aim at producing a conference/workshop-quality research paper
• Can be related to your research topic but it is expected to be distinct!

CS 394B – S18 26
Projects
• The final project accounts for 40% of total grades
• Done in groups of 2 students. Find your peers!
• What can and cannot be a project?
• Just surveys are not allowed. In fact, each project must include a survey of
related work and background
• An ideal project should answer the questions you asked during paper reviews
and points you cared about for presentations
• Measurements of new environments or of existing solutions on new
environments are acceptable upon discussion
• Will cover projects in more depth in the next meeting!

CS 394B – S18 27
How to Approach it?
1. Find a problem and motivate why this is worth solving
2. Survey background and related work to get a sense of your
(friendly!) competition
• Might require you to go back to the first step
3. Form/update your hypothesis
4. Test your hypothesis
• Go back to 3 until you are happy
5. Present your findings in a presentation and in writing
• Discuss known limitations

CS 394B – S18 28
Milestones
Date Milestone Details
ASAP Form Group Find like-minded students
14/2/18 Draft Proposal Send your proposal by email
Finalize Proposal After a back-and-forth discussions with the
7/3/18
Checkpoint #1 (5%) instructor
Midterm Progress
Report
21/3/18 Should read like parts of a research paper
Checkpoint #2
(10%)
Define and motivate a problem, survey
Midterm
25/3/18 related work, and form initial hypothesis
Presentations
and idea
Presentations
13/5/18 Present your findings in a presentation 29
(10%) CS 394B – S18
Draft Proposal
• Two pages including references that ideally includes
• What is the problem?
• Why is it important to solve?
• Any initial thoughts on what you want to do?
• How would you evaluate your solution?
• Include team members
• Meaning, form a group ASAP
• Schedule via email a 15-minute meeting to discuss
Read: The Heilmeier’s Catechism

CS 394B – S18 30
Finalized Proposal
• Two pages including references that must include
• What is the problem?
• Why is it important to solve?
• Any initial thoughts on what you want to do?
• How would you evaluate your solution?
• Approved by the instructor and agreed upon by you
• Forms the basis of expectation

CS 394B – S18 31
Midterm Presentation
• In-class short presentation over one day
• This is to make sure you are making progress
• Must include
• What is the problem?
• Why is it important?
• What are the most related work?
• What’s your hypothesis so far?
• How are/will you evaluate it?

CS 394B – S18 32
Final Presentation and Paper
• Presentation
• It will follow a format similar to other presentations given in the class
• Research paper
• The key part
• Should be written similar to the papers you’ve read
• Your goal is to do publishable quality systems research
• Up to five “best projects” will be earmarked for expedited submission to a
renowned conference, with the help of the instructor
• How to Write a Great Research Paper by Simon Peyton Jones

CS 394B – S18 33
Rough Outline
• Abstract
• Introduction (Highlight the importance and give intuition of solution)
• Motivation (Use data and simple examples)
• Overview (Summarize your overall solution so that readers can follow later)
• Core Idea (Main contribution w/ challenges and how you address them)
• Implementation (Discuss non-obvious parts of your implementation)
• Evaluation (Convince readers that it works and when it fails)
• Related Work (Let readers know that you know your competition!)
• Discussion (Know your limitations and possible workarounds)
• Conclusion (Summarize and point out future work)
CS 394B – S18 34
Course Topics
• Introductory material (~10 video lectures)
• basics of cryptography; Merkle tree
• blockchain; distributed consensus
• mining; incentives
• proof of work; proof of stake
• governance; economics
• security
• smart contracts; applications
• Advanced material
• active research problems in the area, including attacks, network scalability,
alternatives to proof of work/stake
CS 394B – S18 35
Before We Move On…
• No extensions
• Everyone must watch lectures and read papers in advance
• Class meeting format
• Quick summary by the instructor
• Topic discussion and addressing questions
• Presentation of one paper
• Presenters lead discussions on the papers we’ve read and related topics

CS 394B – S18 36
Developing a
Cryptocurrency

CS 394B – S18 37
Slide courtesy of Ittay Eyal
Bitcoin

2008: The Bitcoin white paper


2009: Reference implementation

Probably not this guy

Slide courtesy of Ittay Eyal CS 394B – S18 38


Key Challenges

A
C

1. No stealing: Only Alice can move her money


2. Minting: Fair money creation
3. No double-spending: Alice cannot duplicate her money
Slide courtesy of Ittay Eyal CS 394B – S18 39
60 Seconds on Public Key Signatures
Alice generates key pair
1. private key , kept secret
2. public key , published with public key infrastructure

• Alice signs a message with private key , generating a


signature .
• Anyone can verify that is a signature of with key given
and .

Slide courtesy of Ittay Eyal CS 394B – S18 40


Addresses and Transactions

1. , amount
2. , amount 1. sgn()
2. , amount
1. , amount 2. sgn()
3. , amount

Slide courtesy of Ittay Eyal CS 394B – S18 41


Key Challenges

A
C

1. No stealing: Only Alice can move her money


2. No double-spending: Alice cannot duplicate her money
3. Minting: Fair money creation
Slide courtesy of Ittay Eyal CS 394B – S18 42
Global Ledger

MA

AB

BC

Slide courtesy of Ittay Eyal CS 394B – S18 43


Global Ledger

MA

AB

AC

Slide courtesy of Ittay Eyal CS 394B – S18 44


Global Ledger

MA

AB

BC

Slide courtesy of Ittay Eyal CS 394B – S18 45


Key Challenges

A
C

1. No stealing: Only Alice can move her money


2. No double-spending: Alice cannot duplicate her money
3. Minting: Fair money creation
Slide courtesy of Ittay Eyal CS 394B – S18 46
60 Seconds on Cryptographic Hashing
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud Hash 56293a80e0394d25
exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in Function 2e995f2debccea82
23e4b5b2b150bee2
reprehenderit in voluptate velit esse cillum
12729b3b39ac4d46
dolore eu fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in culpa
qui officia deserunt mollit anim id est laborum.

256 bit number


String input
(for example)

Given a 256bit number , one cannot find an input string that results
in faster than repeatedly guessing inputs and calculating .
Slide courtesy of Ittay Eyal CS 394B – S18 47
Mining – Minting for Proof of Work

Computationally difficult puzzle:

Find such that

Solver guesses values for until finding a valid one

• Different strings for different puzzles


• The target determines the difficulty, average time to solve

Slide courtesy of Ittay Eyal CS 394B – S18 48


Mining – Minting for Proof of Work

puzzle

solution (PoW)
A

Slide courtesy of Ittay Eyal CS 394B – S18 49


Key Challenges
1. No stealing: Only Alice can move her
money
Cryptographic signatures
2. No double-spending: Alice cannot
duplicate her money
Global ledger
3. Minting: Fair money creation
Mint for proof of work

Slide courtesy of Ittay Eyal CS 394B – S18 50


Key Challenges
1. No stealing: Only Alice can move her Who runs the public
money key infrastructure?
Cryptographic signatures
2. No double-spending: Alice cannot Who maintains
duplicate her money the public ledger?
Global ledger
3. Minting: Fair money creation Who gives money
for puzzles?
Mint for proof of work

Can this be decentralized?


Slide courtesy of Ittay Eyal CS 394B – S18 51
Replicated State Machine

• Instead of one machine, use a replicated state machine


• Multiple machines operate a single ledger, PKI, and mint fairly
• A subset can behave arbitrarily – aka Byzantine

But who chooses the participating machines?

Slide courtesy of Ittay Eyal CS 394B – S18 52


A Replicated State Machine
Log

𝐴 1 → 𝐵1
𝐴1 → 𝐴2 𝐵 →𝐶
1 1

A B CS 394B – S18 53
Slide courtesy of Ittay Eyal
Nakamoto’s Blockchain

Log Blockchain

header

block

Slide courtesy of Ittay Eyal CS 394B – S18 54


Nakamoto’s Blockchain

Log Blockchain

header

block

Slide courtesy of Ittay Eyal CS 394B – S18 55


Nakamoto’s Blockchain

Log Blockchain

hash( ) target*

* target: a deterministic function of previous blocks


Slide courtesy of Ittay Eyal CS 394B – S18 56
Nakamoto’s Blockchain

Slide courtesy of Ittay Eyal CS 394B – S18 57


Nakamoto’s Blockchain

Slide courtesy of Ittay Eyal CS 394B – S18 58


Nakamoto’s Blockchain

Exponential random interval

Slide courtesy of Ittay Eyal CS 394B – S18 59


Incentive for Mining
• Internal Prize:
• Minting
• Fees

Wins proportional to computation power


Slide courtesy of Ittay Eyal CS 394B – S18 60
Forks

• Natural in a distributed system

Slide courtesy of Ittay Eyal CS 394B – S18 61


Fork Resolution

• Longest chain wins


• Transactions are reverted
• Double-spending a threat

Slide courtesy of Ittay Eyal CS 394B – S18 62


Fork Resolution

A transaction is confirmed when


it is buried deep enough

Slide courtesy of Ittay Eyal CS 394B – S18 63


Key Challenges
1. No stealing: Only Alice can move her
money
Cryptographic signatures
2. No double-spending: Alice cannot
duplicate her money
Global ledger
3. Minting: Fair money creation
Mint for proof of work

Decentralized
Slide courtesy of Ittay Eyal CS 394B – S18 64
Next…
• Follow lecture 1
• Read Bitcoin: A Peer-to-Peer Electronic Cash System

• We meet on Wednesday

CS 394B – S18 65

You might also like