02 Bitcoin Protocol and Consensus - A High Level Overview.pdf ...

13 downloads 262 Views 3MB Size Report
Whoops! There was a problem loading more pages. Retrying... 02 Bitcoin Protocol and Consensus - A High Level Overview.pd
1

2

LECTURE OUTLINE 1

Intro and Terminology

2

Bitcoin and Consensus

3

Bitcoin Concepts

4

Mining Sketch

5

Bonus Content: Merkle Trees and Consensus Updates

3

1

INTRODUCTION

4

TERMINOLOGY





● ● ●

5

2

BITCOIN AND CONSENSUS

6

SATOSHI NAKAMOTO'S INNOVATION

● ○ ● ○ ○ Dorian Satoshi Nakamoto (not actually Satoshi Nakamoto)

Slide by Viget

v1 Alice writes and signs a message describing her transaction

A

“I, Alice, am giving Bob one bitcoin.”

G

A

Slide by Viget

C

v1

E

Alice sends her message to the world

F A J

B H

G

A

Slide by Viget

C

v1

E

Alice sends five identical messages

F A J

B

? H

G

A

Slide by Viget

C

v2

E

Introducing uniquely identifiable serial numbers

F A J

8732

B H

Slide by Viget

v2 Where do serial numbers come from?

8732

?

Slide by Viget

v2 A central bank manages transactions and balances

E D

G

B

A

H

C

I

Slide by Viget

v2 Centralization

E D B

A

G H

01

01

01

C

01

I

Slide by Viget

v3 Making everyone the bank. Everyone has a complete record of transactions

E D B

A

G C

I

Slide by Viget

v3 Alice sends her transaction to Bob

E D B

A

G C

I

Slide by Viget

v3 Bob announces the transaction to the world

E D B

A

G C

I

Slide by Viget

v3 Alice double spends on Bob and Charlie

E D B

A

G C

I

Slide by Viget

v4 Everyone verifies transactions

E D B

A

G C

I

Slide by Viget

v4 Alice is prevented from double spending

E D B

A

G C

I

Slide by Viget

v4 Alice sets up multiple identities

A A B

A

A C

A

Slide by Viget

v4 Alice double spends with her multiple identities Sybil Attack: Creating many fake identities to subvert a system

A A B

A

A C

A

G

A

Slide by Viget

v5

CProof-of-work F A J

E

B H

Slide by Viget

v5 Other users add to list of pending transactions

1.

I, Tom, am giving Sue one bitcoin, with serial number 3920.

2.

I, Sydney, am giving Cynthia one bitcoin, with serial number 1325.

3.

I, Alice, am giving Bob one bitcoin, with serial number 1234.

Slide by Viget

v5 Verifying transactions

1 Check blockchain

2 Solve puzzle

3 Announce block

Slide by Viget

v5 Why the math?

Slide by Viget

v4 Alice double spends with her multiple identities

A A B

A

A C

A

Slide by Viget

v5 Proof-of-work as a competition

Slide by Viget

Summary Version

Major feature

Value added

1

Signed messages announced to the network

Basis of entire system

2

Serial numbers

Uniquely identifiable transactions

3

The block chain

Shared record of transactions

4

Everyone verifies transactions

Increased security

5

Proof-of-work

Prevents double spending

29

BASIC CONCEPTS - IDENTITY IN BITCOIN ● ○ ● ○ ■ ○ ● ○ ○ ○ ○ ○

30

TRANSACTION - A BASIC VERSION

● ○ ○ ● ○ ●

Coinbase interface

31

BASIC CONCEPTS - TRANSACTIONS ● ● ●

Source: Bitcoin Developer Guide

32

BLOCKS AND BLOCKCHAIN

● ○ ●

● Source: Bitcoin Developer Guide

33

BLOCKS AND BLOCKCHAIN

Source: blockchain.info

Basic Concepts - UTXO analogy UTXOs stands for "Unspent Transaction Outputs" ● ●

Global set of unspent bitcoins "I'm spending THIS bitcoin," not "I'm spending A bitcoin."

Analogous to Rai Stones of the Yap Islands ● ●

Rai Stones never moved Instead: Agreed on change of ownership

Source: Wikipedia

35

MINING SKETCH

● ● ● ●

● ● ●

36

MINING SKETCH - FINDING BLOCKS ● ○ ■ ○ ○ ● ○ ■ ○ ■ ● ○ ○ ○ ○

37

MINING SKETCH - FINDING BLOCKS ● ○ ● ● ○ ● ● ○ ○ ■

38

A TRANSACTION FLOW ● ○ ○ ● ○ ○ ● ○ ●

39

51% ATTACKS

41

BONUS: FORKING + CONSENSUS UPDATES Source: Bitcoin.org Developer Guide

42

BONUS: MERKLE TREE

● ●

Makes transaction history immutable PoW to add chains Source: Nakamoto 2009

43

NEXT TIME: CRYPTOGRAPHY AND WALLETS

● ○ ● ○ ● ○ ● ○