Blockchains Lecture 2.

Slides:



Advertisements
Similar presentations
Distributed Systems Major Design Issues Presented by: Christopher Hector CS8320 – Advanced Operating Systems Spring 2007 – Section 2.6 Presentation Dr.
Advertisements

DISTRIBUTED SYSTEMS II FAULT-TOLERANT BROADCAST Prof Philippas Tsigas Distributed Computing and Systems Research Group.
RPC Robert Grimm New York University Remote Procedure Calls.
Jaringan Informasi Pengantar Sistem Terdistribusi oleh Ir. Risanuri Hidayat, M.Sc.
Remote Procedure Call (RPC)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Distributed components
Distributed Systems Fall 2010 Replication Fall 20105DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Slide 1 Client / Server Paradigm. Slide 2 Outline: Client / Server Paradigm Client / Server Model of Interaction Server Design Issues C/ S Points of Interaction.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 3 – Distributed Systems.
Group Communications Group communication: one source process sending a message to a group of processes: Destination is a group rather than a single process.
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
.NET Mobile Application Development Introduction to Mobile and Distributed Applications.
Process-to-Process Delivery:
Fundamentals of Computer Networks ECE 478/578 Lecture #19: Transport Layer Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University.
1. I NTRODUCTION TO N ETWORKS Network programming is surprisingly easy in Java ◦ Most of the classes relevant to network programming are in the java.net.
Advanced Computer Networks Topic 2: Characterization of Distributed Systems.
Practical Byzantine Fault Tolerance
Byzantine fault-tolerance COMP 413 Fall Overview Models –Synchronous vs. asynchronous systems –Byzantine failure model Secure storage with self-certifying.
The InetAddress Class A class for storing and managing internet addresses (both as IP numbers and as names). The are no constructors but “class factory”
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
Lecture 5: RPC (exercises/questions). 26-Jun-16COMP28112 Lecture 52 First Six Steps of RPC TvS: Figure 4-7.
Object Interaction: RMI and RPC 1. Overview 2 Distributed applications programming - distributed objects model - RMI, invocation semantics - RPC Products.
BChain: High-Throughput BFT Protocols
Last Class: Introduction
Development of a Simulator for the HANARO Research Reactor (Communication Protocol) H.S. Jung.
03 – Remote invoaction Request-reply RPC RMI Coulouris 5
Distributed Systems – Paxos
Distributed web based systems
CHAPTER 3 Architectures for Distributed Systems
Principles of Computer Security
#01 Client/Server Computing
Principles of Computer Security
IS 651: Distributed Systems Midterm
Process-to-Process Delivery:
Principles of Computer Security
Hwajung Lee ITEC452 Distributed Computing Lecture 2 Interprocess Communication (IPC): An Overview.
IS 651: Distributed Systems Distributed Communication
ACM Transactions on Information and System Security, November 2001
Distributed Ledger Technology (DLT) and Blockchain
Distributed Systems CS
Architectures of distributed systems Fundamental Models
PERSPECTIVES ON THE CAP THEOREM
EEC 688/788 Secure and Dependable Computing
Architectures of distributed systems Fundamental Models
EEC 688/788 Secure and Dependable Computing
EECE.4810/EECE.5730 Operating Systems
Remote Procedure Call Hank Levy 1.
Lecture 6: RPC (exercises/questions)
Architectures of distributed systems
An Introduction to Internetworking
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
Remote Procedure Call Hank Levy 1.
Architectures of distributed systems Fundamental Models
EEC 688/788 Secure and Dependable Computing
Lecture 6: RPC (exercises/questions)
Lecture 7: RPC (exercises/questions)
Process-to-Process Delivery: UDP, TCP
Distributed Systems CS
Cryptography Lecture 24.
Distributed Systems (15-440)
Last Class: Communication in Distributed Systems
CSE 451: Operating Systems Messaging and Remote Procedure Call (RPC)
#01 Client/Server Computing
Blockchains Lecture 1.
Blockchains Lecture 6.
Presentation transcript:

Blockchains Lecture 2

Review of Lecture 1

Client-Server Architecture One server is a single point of failure or compromise Request Response Client Server

Blockchains (State Machine Replication) Blockchains tolerate Byzantine (arbitrary) failures Integrity/safety: the code to be executed correctly Availability/liveness: the service is always available (Typically, not confidentiality) Replicas Client

Blockchain Consensus (What is it? Why hard?) Correct servers maintain the same consistent state, even 1) under highly concurrent client requests 2) when a fraction of servers are compromised 3) under network asynchrony

Roughly, Consensus: All About Achieving “Total Order” [Lamport, ACM TOPLAS 1984] Blockchains (modeled as state machine replication) $100 $100 $100

The “Total Order” Requirement Client 1: “Deposit $100” $100 $200 Client 1: “Deposit $100” $100 $200 $100

The “Total Order” Requirement Client 1: “Deposit $100” Chase: “Charge 10%” $100 $200 $180 Client 1: “Deposit $100” Chase: “Charge 10%” $100 $200 $180 $100

The “Total Order” Requirement Client 1: “Deposit $100” Chase: “Charge 10%” $100 $200 $180 Client 1: “Deposit $100” Chase: “Charge 10%” $100 $200 $180 $100

The “Total Order” Requirement Chase: “Charge 10%” Client 1: “Deposit $100” $100 $90 $190 Chase: “Charge 10%” Client 1: “Deposit $100” $100 $90 $190 $100

The “Total Order” Requirement Chase: “Charge 10%” Client 1: “Deposit $100” $100 $90 $190 Client 1: “Deposit $100” Chase: “Charge 10%” $100 $200 $180 $100

Review of Lecture 1 The above are blockchains goals! Not how we implemented or realized blockchains. However, use them in a black-box manner.

Characterizing Blockchains Permissionless: explicitly/implicitly rely on cryptocurrency Permissioned: traditional Byzantine fault-tolerant distributed system (consortium blockchains, private blockchains) Membership Consensus Approach Examples Permissionless Dynamic PoX (Proof of “X”) Bitcoin, Ethereum Permissioned Fixed; know IDs of each other BFT (Byzantine fault tolerance) Fabric, Iroha, Chios, BEAT

Characterizing Blockchains Permissionless: explicitly/implicitly rely on cryptocurrency Permissioned: traditional Byzantine fault-tolerant distributed system (consortium blockchains, private blockchains) Hybrid: use BFT to improve permissionless blockchains Membership Consensus Approach Examples Permissionless Dynamic PoX (Proof of “X”) + Some mechanism Bitcoin, Ethereum Permissioned Fixed; know IDs of each other BFT (Byzantine fault tolerance) Fabric, Iroha, Chios, BEAT Hybrid (permissonless) Sybil resistant PoX+ BFT Elastico, OmniLedger, Ethereum Casper

Systems and Distributed Systems Basics Reading material: Cachin book, chapter 2 (Basic abstractions) https://library.umbc.edu/ Search “Introduction to Reliable and Secure Distributed Programming” Select “online access”

Safety and liveness (Generalized Notations) Safety: a safety property is a property of a distributed algorithm that can be violated at some time t and never be satisfied again after that time. You algorithm should not do anything wrong. Liveness: for any time t, there is some hope that the property can be satisfied at some time t’>t. Something good eventually happens. They can be rather specific when the setting is fixed.

One Example Ordered data stream (e.g., TV show, NBA live) Messages are 1 ) neither lost 2) nor duplicated, and 3) are received in the order where they were sent.

What about Blockchains? Blockchains tolerate Byzantine (arbitrary) failures Integrity/safety: the code to be executed correctly Availability/liveness: the service is always available Replicas Client

In order to Describe a Distributed System Participants: Processes Links connecting processes

Processes via Failures Types A process never fails? Crash failures Arbitrary failures (Byzantine failures) Processing a request incorrectly Corrupting local state Sending incorrect or inconsistent messages Not function as designated (this is the definition) https://lwn.net/Articles/540368/

Failures Failure happens all the time When you design, you design for failure

Links How can two correct processes communicate with each other? If you trust each other, good! easy If you think the link is not trustworthy, still easy! use crypto

Cryptography Message authentication codes (MACs) Digital signatures Both of them allow you to establish authenticated channels

Links Crash failure model Byzantine failure model Fair-loss links Stubborn delivery Perfect links (e.g., TCP) Byzantine failure model Authenticated perfect links

Fair-Loss Links Fair-loss: if a correct process p infinitely sends a message m to q, then q delivers m an infinite number of times Finite duplication: ….finite times, …finite … No creation: If q delivers m with send p, the m was sent to q by p.

Stubborn Links Stubborn delivery: if a correct process p sends a message m to q once, then q delivers m an infinite number of times No creation Built from fair-loss links?

Perfect Links Reliable delivery: if a correct p sends a message to a correct q, q eventually delivers m. No dup: q only receives m once No creation

Authenticated Perfect Links Reliable delivery: if a correct p sends a message to a correct q, q eventually deliver m. No dup No creation  authenticity

Timing Assumptions Synchronous environments Asynchronous environments Partially asynchronous environments

Synchronous environment Failure detection MSG ACK Server 1 Server 2

Asynchronous environment Replicas Client

System model Failure types Links Environments What is the hardest model? What is the most appropriate model?

Common Communication Pattern The remaining lecture will focus on communcation

Communication Mechanisms Many protocols are available Sockets Remote Procedure Call (RPC) Distributed shared memory (later in the class) MPI …

Socket Communication TCP (Transmission Control Protocol; realizing perfect links) Protocol built upon the IP networking protocol, which supports sequenced, reliable, two-way transmission over a connection (or session, stream) between two sockets More reliable More expensive UDP (User Datagram Protocol) Also protocol built on top of IP. Supports best-effort, transmission of single datagrams It’s ok to lose, re-order, or duplicate messages Low latency

Other communication models Can be based on perfect links Broadcast Multicast

RPC Remote Procedure Call A type of client/server communication Programming (just a bit easier) Hide complexity Standardize some low-level data packaging protocols

RPC The application calls the remote procedure locally at the stub The stub intercepts calls that are for remote servers Marshalling: pack the parameters into a message Make a system call to send the message Stubs are generated automatically by RPC frameworks (libraries), which also provide the RPC Runtime Programmers only write definitions for their data structures and protocols in an IDL

RPC The RPC Runtime handles message sending The interface definition language (IDL) handles message translation RPC hides heterogeneity among the computers and handles the communication across network

RPC technologies XML/RPC SOAP CORBA Protocol buffers Thrift Over HTTP, huge XML parsing overheads SOAP Designed for web services via HTTP, huge XML overhead CORBA Relatively comprehensive, but quite complex and heavy Protocol buffers Lightweight, developed by Google Thrift Lightweight, supports services, developed by Facebook

Projects If you code, I recommend you maintain the code in github or bitbucket. It is easier for you and me to track the progress and understand the code complexity.

Sample Projects improving some open source projects (Hyperledger Fabric, Tendermint); threshold cryptography library; an interesting DApp; MPC with a real-world use case; devise a new blockchain system and prove it is better; cryptographic engineering projects; multi-cloud deployment of blockchains; implementation and comparison of existing blockchains (with some interesting findings); attacks on existing blockchains (with ethics and procedures discussed in class). Out-of-box ideas are highly encouraged!

Exercises