CSCE 190 Computing in the Modern World Blockchain: the Basics

Slides:



Advertisements
Similar presentations
PIS: Unit III Digital Signature & Authentication Sanjay Rawat PIS Unit 3 Digital Sign Auth Sanjay Rawat1 Based on the slides of Lawrie.
Advertisements

6/1/20151 Digital Signature and Public Key Infrastructure Course:COSC Instructor:Professor Anvari Student ID: Name:Xin Wen Date:11/25/00.
Department of Information Engineering1 Major Concerns in Electronic Commerce Authentication –there must be proof of identity of the parties in an electronic.
CSE331: Introduction to Networks and Security Lecture 21 Fall 2002.
CSE 597E Fall 2001 PennState University1 Digital Signature Schemes Presented By: Munaiza Matin.
E- Business Digital Signature Varna Free University Prof. Teodora Bakardjieva.
Pay As You Go – Associating Costs with Jini Leases By: Peer Hasselmeyer and Markus Schumacher Presented By: Nathan Balon.
CRYPTOGRAPHIC DATA INTEGRITY ALGORITHMS
Alexander Potapov.  Authentication definition  Protocol architectures  Cryptographic properties  Freshness  Types of attack on protocols  Two-way.
INTRODUCTION Why Signatures? A uthenticates who created a document Adds formality and finality In many cases, required by law or rule Digital Signatures.
Diameter End-to-End Security: Keyed Message Digests, Digital Signatures, and Encryption draft-korhonen-dime-e2e-security-00 Jouni Korhonen, Hannes Tschofenig.
Digital Signature Technologies & Applications Ed Jensen Fall 2013.
Csci5233 Computer Security1 Bishop: Chapter 10 Key Management: Digital Signature.
Cryptography, Authentication and Digital Signatures
Key Management. Session and Interchange Keys  Key management – distribution of cryptographic keys, mechanisms used to bind an identity to a key, and.
Slide 1 © 2004 Reactivity The Gap Between Reliability and Security Eric Gravengaard Reactivity.
1 Bitcoin A Digital Currency. Functions of Money.
Middleware for Secure Environments Presented by Kemal Altıntaş Hümeyra Topcu-Altıntaş Osman Şen.
Digital Signatures, Message Digest and Authentication Week-9.
1 Session 4 Module 6: Digital signatures. Digital Signatures / Session4 / 2 of 18 Module 4, 5 - Review (1)  Java 2 security model provides a consistent.
April 20023CSG11 Electronic Commerce Authentication John Wordsworth Department of Computer Science The University of Reading Room.
@Yuan Xue Case Study (Mid-term question) Bob sells BatLab Software License Alice buys BatLab Credit card information Number of.
 Introduction  History  What is Digital Signature  Why Digital Signature  Basic Requirements  How the Technology Works  Approaches.
Block Chain 101 May 2017.
Computer Communication & Networks
Cryptographic Hash Function
CSCE 715: Network Systems Security
B. R. Chandavarkar CSE Dept., NITK Surathkal
Bitcoin - a distributed virtual currency system
Cryptographic Hash Pointers
Distributed Systems for Information Systems Management
Blockchains and Cryptocurrencies: What Financial Planners Need to Know
Blockchain beyond cryptocurrencies
So what is Blockchain anyway?
Blockchain Adrian Zaragoza.

Rechtsanwältin – Germany Attorney at Law – New York
Data Structures and Analysis (COMP 410)
Blockchain and Cryptocurrencies
Focus Group 3: Blockchain and digitalisation
BLOCKCHAIN BASICS & LEGAL ISSUES
Cryptographic Hash Functions
Setting the Stage for a Community Blockchain Incubator
Digital Certificates and X.509
Distributed Ledger Technology (DLT) and Blockchain
Blockchain Alexander Prenta 9/27/2018.
Modernization of. Currency. Evolution Of Currency: Bartering System: Grains and cattle are popular in Barters. Firstly recorded in Egypt. Coinage: Metals.
Blockchain Principles
Bishop: Chapter 10 Key Management: Digital Signature
IPFS: Interplanetary File Systems
OurSQL = MySQL + Blockchain
Data Structures and Analysis (COMP 410)
Consensus Algorithms.
Chapter -7 CRYPTOGRAPHIC HASH FUNCTIONS
Chapter -8 Digital Signatures
Modified from Bob Vachon
Hashing Hash are the auxiliary values that are used in cryptography.
Wokshop SAIS 2018 Dr. Meg Murray Kennesaw state university
Faculty Seminar Series Blockchain Technology
Blockchain Technology: A New Approach to Provenance
….for authentication and confidentiality PGP
Blockchain Tech Big Picture
Block Chain Technology in Agriculture
Blockchain Tech Big Picture
One-Way Hash Functions
ACE – Auditing Control Environment
Explore Txs, block, blockchain in Bitcoin
BUILDING A BLOCKCHAIN USING PYTHON
Presentation transcript:

CSCE 190 Computing in the Modern World Blockchain: the Basics Fall 2018 Marco Valtorta mgv@cse.sc.edu www.cse.sc.edu/~mgv/csce190f18

The Original Paper This presentation is based on: Massimo Di Pierro. “What is the Blockchain?” IEEE Computing Edge, 4, 4 (April 2018), pp.22-25. This paper is not peer reviewed.

Blockchain vs. Bitcoin Blockchain is a technique at the foundation of Bitcoin and all other cryptocurrencies Blockchain has other uses, such as smart contracts Source: https://blogdesantiagonadal.wordpress.com/2018/02/05/e-commerce-y-smart-contracts-1-3/

Trust Nakamoto’s system creates a distributed storage of timestamped documents where no party can tamper with the content of the data or the timestamps without detection This is different from the problems of authentication (who created a document?), integrity (was the document surreptitiously modified after being created?), and nonrepudiation (can the true author of a document deny its creation?), which are solved by digital signatures A digital signature guarantees a link between a document and its creator, but says nothing about when the document was signed

Example: House Sales Transactions need to be recorded in a secure ledger, to establish ownership A single trusted centralized ledger is the usual solution (cf: registry of deeds) Centralized ledgers do not scale and are prone to tampering The blockchain provides a distributed mechanism with multiple copies, and “every party can verify that the order and timestamp of the transactions have not been tampered with.”

iClicker Answer the following multiple-choice question. A blockchain solves the problem of A. Authentication B. Establishing trust in a distributed system of transactions C. The same problem solved by digital signature D. Nonrepudiation E. All of the above

Cryptographic Hash Functions Wikipedia, accessed 2018-10-16. The ideal cryptographic hash function has five main properties: it is deterministic so the same message always results in the same hash it is quick to compute the hash value for any given message it is infeasible to generate a message from its hash value except by trying all possible messages a small change to a message should change the hash value so extensively that the new hash value appears uncorrelated with the old hash value it is infeasible to find two different messages with the same hash value

Cryptographic Hash Functions The ideal cryptographic hash function has five main properties: it is deterministic so the same message always results in the same hash it is quick to compute the hash value for any given message it is infeasible to generate a message from its hash value except by trying all possible messages a small change to a message should change the hash value so extensively that the new hash value appears uncorrelated with the old hash value it is infeasible to find two different messages with the same hash value Wikipedia, accessed 2018-10-16

Transaction Representation A transaction is a triple of three strings: timestamp (the time of the transaction) details (the description of the transaction) hash of the concatenation of the timestamp and details of the current transaction and the hash of the previous transaction It is convenient to think of a blockchain as a table, with each transaction in a row and three columns (timestamp, detail, and hash)

Transaction Examples A transaction is a triple of three strings: timestamp (the time of the transaction) details (the description of the transaction) hash of the concatenation of the timestamp and details of the current transaction and the hash of the previous transaction Example (four consecutive transactions; the first one is special): (1539718609.131, 'A found $1', '') (1539718698.678, 'A gives $1 to B‘ 'a0bffae472cc26e89318185afe1b04e3f0c79fcf') (1539718717.25, 'B gives $1 to C', 'ca911be27eaeaf54549ae9f29c32e6417549bdcc') (1539718734.571, 'C gives $1 to D', 'ab7ebcf29c9fe59ef53993791e2f5a8fe586d3f5') Triples are in parenthesis: (a,b,c). Hash is computed using the sha1 algorithm

Python Implementation import hashlib, json, time print hashlib.sha1('hello,world').hexdigest() def bhash (timestamp, details, prev_hash): token = json.dumps([timestamp, details, prev_hash]) return hashlib.sha1(details).hexdigest() This is a basic implementation by Di Pierro (see ref. on slide 2)

Python Implementation class Blockchain(object): def __init__(self, details='new-chain'): self.blocks = [(time.time(), details, '')] def record(self, details, timestamp = None): timestamp = timestamp or time.time() prev_hash = self.blocks[-1][2] new_hash = bhash(timestamp, details, prev_hash) self.blocks.append((timestamp, details, new_hash)) This is a basic implementation by Di Pierro (see ref. on slide 2) Init is a constructor; the initial transaction has no hash of the previous one Method record stores a new transaction; by default, the current time is used as timestamp Self.blocks[-1] is the previous transaction; self.blocks[-1][2] is the third (we count from zero) field in the previous transaction

iClicker Answer the following multiple-choice question. The blockchain code is written in A. C B. Java C. Python D. Prolog E. Haskell

Running the Code: Creating a Chain >>> bc = Blockchain('A found $1') >>> bc.record('A gives $1 to B') >>> bc.record('B gives $1 to C') >>> bc.record('C gives $1 to D') This is a basic implementation by Di Pierro (see ref. on slide 2) The fist line uses the constructor to build an instance of the Blockchain The next three lines add transactions

Running the Code: Printing a Chain >>> print bc.blocks [(1495941516.704196, 'A found $1', ”), (1495941516.704201, 'A gives $1 to B', 'a75a9227f...'), (1495941516.704277, 'B gives $1 to C', 'ca911be27...'), (1495941516.704290, 'C gives $1 to D', 'cb462885e...')] This is a basic implementation by Di Pierro (see ref. on slide 2) The fist line uses the constructor to build an instance of the Blockchain The next three lines add transactions

Verifying a Chain’s Integrity def verify(blockchain): prev = blockchain.blocks[0] for block in blockchain.blocks[1:]: new_hash = bhash(block[0], block[1], prev[2]) if block[2] != new_hash: return False prev = block return True Loop over the transactions (blocks) starting with the second one, checking that the hash computed from the timestamp, details, and hash of the previous block matches the hash in the current bloc. Call by: # Example ##>>> print verify(bc) ##True