Class 15: Scripting Transactions Cryptocurrency Cabal cs4501 Fall 2015 David Evans and Samee Zahur University of Virginia.

Slides:



Advertisements
Similar presentations
Buffer Overflows Nick Feamster CS 6262 Spring 2009 (credit to Vitaly S. from UT for slides)
Advertisements

CISC Data Structures Ben Perry University of Delaware Summer 2011.
Chapter 3A Review boolean fun = true; if(fun) System.out.print(“yeah!”);
Secure Multiparty Computations on Bitcoin
Cs2220: Engineering Software Class 10: Generic Datatypes Fall 2010 University of Virginia David Evans.
David Evans CS201j: Engineering Software? University of Virginia Computer Science Lecture 2: Java Semantics, Validation.
Discussion1 Quiz. Q1 Which of the following are invalid Java identifiers (variable names)? a) if b) n4m3 c) Java d) e) DEFAULT_VALUE f) bad-choice.
Cs1120 Fall 2009 David Evans Lecture 16: Power Analysis.
Cryptocurrency Café UVa cs4501 Spring 2015 David Evans Class 16: Alternate Cryptocurrencies flickr cc: epSos.de.
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
CS-1010 Dr. Mark L. Hornick 1 Selection Statements and conditional expressions.
Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.
BITCOIN – 2014 John BlackSpring Digital Currency  Chaum’s ideas in the 1980’s  All ideas required a central bank or single point of trust  Chaum.
Stack buffer overflow
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #11.
Program Commenting CS-212 Dick Steflik. Commentary Commentary are pieces of information included in a program’s source files to provide additional information.
Cryptocurrency Café UVa cs4501 Spring 2015 David Evans Class 23: Blooming Sidechains!
Administrative MUST GO TO CORRECT LAB SECTION! Homework due 11:59pm on Tuesday. 25 points off if late (up to 24 hours) Cannot submit after 11:59pm on Wednesday.
Cs205: engineering software university of virginia fall 2006 Semantics and Specifying Procedures David Evans
Cryptocurrency Café UVa cs4501 Spring 2015 David Evans Class 11: Mining Pools and Attacks.
Image from (but I think they stole it from Monsters and Aliens)
The Java Collections Framework (Part 2) By the end of this lecture you should be able to: Use the HashMap class to store objects in a map; Create objects.
Bitcoin Transaction Scripting Andy Ofiesh Senior Software Engineer Armory Technologies, Inc. MIT Bitcoin Expo, May 3rd, 2014 © Armory Technologies, Inc.
Bitcoins and the Digital Economy Presented By: Matt Blackman.
1 Bitcoin A Digital Currency. Functions of Money.
CS 241 (03/07/12). MP #5 Exam Reminders  We still have a few students that still need to take the conflict.  Thanks for not discussing it on Piazza.
More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia.
Lab 1 – Data Types "Using C code, determine the size of signed and unsigned char, int, and long integral data types. Demonstrate the problems of overflow.
Computing with C# and the.NET Framework Chapter 3 Software Engineering with Control Structures.
CS 240 – Computer Programming I Lab Kalpa Gunaratna –
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
Class 20: Hidden Services, Zero Knowledge Cryptocurrency Cabal cs4501 Fall 2015 David Evans and Samee Zahur University of Virginia.
Method Parameters and Overloading Version 1.0. Topics The run-time stack Pass-by-value Pass-by-reference Method overloading Stub and driver methods.
1 CS 1430: Programming in C++. 2 Find Max, Min, Average of m Sections Max, Min and Average of each section Max, Min and Average of all sections together.
Tail Recursion l The case in which a function contains only a single recursive call and it is the last statement to be executed in the function. l Tail.
1 CS 1430: Programming in C++. 2 Input: Input ends with -1 Sentinel-Controlled Loop Input: Input begins with.
CS-1010 Dr. Mark L. Hornick 1 Selection and Iteration and conditional expressions.
Jordan Jozwiak CS50. Announcements Pset3 will be returned by 7pm on Tuesday REMINDER: Access section materials from this year and last year at
Welcome to CISC220 Data Structures in C++ sakai.udel.edu Office Hours: Tues 3PM - 4PM / Thurs 1PM - 2PM TA: David.
Section #9: Bitcoins. Digital currency Unique string of bits Use cryptography for security and privacy Not tied to names: hard to trace Finite set of.
Java Basics. Tokens: 1.Keywords int test12 = 10, i; int TEst12 = 20; Int keyword is used to declare integer variables All Key words are lower case java.
Cryptocurrency Café UVa cs4501 Spring 2015 David Evans Class 18.
Methods. The Structure of a Method Essentially, a method is a block of code with a name. You can execute the code by using the method’s name. You can.
Midterm 2 Review Notes on the CS 5 midterm Take-home exam due by 5:00 pm Sunday evening (11/14) Hand in your solutions under the door of my office, Olin.
Bitcoin’s new Era OP_CSV, Segregated Witness And how it relates to Bitcoin at Visa’s scale.
Function Parameters and Overloading Version 1.0. Topics Call-by-value Call-by-reference Call-by-address Constant parameters Function overloading Default.
Alexander Bernauer What is Bitcoin?
Micro-transaction channels
Blockchain & Bitcoin Notions fondamentales Lionel Brunie, Omar Hasan Institut National des Sciences Appliquées de Lyon
Class 8: Procedure Practice
CS216: Program and Data Representation
Mechanics of Bitcoin Part I
C# and the .NET Framework
protocollo e casi studio
Introduction to Python
CS898AT – Bitcoins and Cryptocurrencies
Technical Overview of Bitcoin
Methods and Parameters
Introduction to Python
CISC101 Reminders Assn 3 due tomorrow, 7pm.
Programming Embedded Systems in C++
Bitcoin: Data flow.
When a function is called...
The Zoo of Software Security Techniques
Assertions References: internet notes; Bertrand Meyer, Object-Oriented Software Construction; 4/25/2019.
Some Assembly (Part 2) set.html.
Blockchain & Bitcoin Notions fondamentales Lionel Brunie, Omar Hasan Institut National des Sciences Appliquées de Lyon
Introduction to Python
Week 2 - Friday CS222.
Bitcoin and Blockchain
Presentation transcript:

Class 15: Scripting Transactions Cryptocurrency Cabal cs4501 Fall 2015 David Evans and Samee Zahur University of Virginia

Plan for Today Scripting Transactions Review/PS2 1 Reminders Extra office hours (see notes) Midterm Wednesday (in class) Problem Set 3

2

3

4

5

Interpreting Script 6

7 Version 0.1 Project idea: look at how bitcoin core code has evolved over time Latest

8

9 Vout: ([]btcjson.Vout) (len=2 cap=4) { (btcjson.Vout) { Value: (float64) 229, N: (uint32) 0, ScriptPubKey: (btcjson.ScriptPubKeyResult) { Asm: (string) (len=85) "OP_DUP OP_HASH160 d f0e93e9742b6389e09117b6b630a3 OP_EQUALVERIFY OP_CHECKSIG", Hex: (string) (len=50) "76a914d f0e93e9742b6389e09117b6b630a388ac", ReqSigs: (int32) 1, Type: (string) (len=10) "pubkeyhash", Addresses: ([]string) (len=1 cap=4) { (string) (len=34) "PsVSrUSQf72X6GWFQXJPxR7WSAPVRb1gWx" } },

10 OP_DUP OP_HASH160 d f0e93e9742b6389e09117b6b630a3 OP_EQUALVERIFY OP_CHECKSIG OP_DUP [x] Duplicates the top stack item OP_HASH160 [x]Replaces top of stack with RIPEMD160(SHA256([top])) OP_EQUALVERIFY [x1] [x2]If top two items are equal, outputs True; otherwise, marks transaction as Invalid. OP_CHECKSIG [pubkey] [sig]Checks that E_pubkey(sig)([entire transaction]) Locking Script

11

12 OP_DUP OP_HASH160 d f0e93e9742b6389e09117b6b630a3 OP_EQUALVERIFY OP_CHECKSIG Locking Script Unlocking Script

13

Unlocking Script 14

“Pay-to-Script-Hash” 15 OP_HASH160 [20-byte hash] OP_EQUAL Locking Script

Unlocking/Locking (pre-2010) 16 OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG Locking Script Unlocking Script

OP_RETURN 17 Original meaning: terminate script execution, leaving stack unchanged.

Steal any output! 18 OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG Locking Script Unlocking Script

Steal any output! 19 OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG Locking Script Unlocking Script This is the by far biggest bug in bitcoin (discovered so far!).

OP_RETURN (fixed July 2010)

Actual Scripts in Bitcoin 21

22 (first 290,000 blocks, through )

23 OP_RETURN OP_DATA_40

More Powerful Scripts 24 OP_CHECKMULTISIG [x] [sig] k [pub key] k valid := 0 for each signature [1, k]: if checksig(sig k, pub k ): valid += 1 if valid >= x: 1 else: 0

Has this Changed? 25

26 Saba Eskandarian’s project last semester

27

Charge Wednesday: Midterm Upcoming office hours: Today: 5-6:30 (Ori, Rice 442) Tomorrow: 2-3:30pm (Dave, Rice 507) Tomorrow: 3:30-4:30pm (Samee, Rice 442) 28