huan ke bitcoin /blockchain for expertspeople.cs.uchicago.edu/~huanke/blockchain.pptx.pdf ·...

50
Huan Ke Bitcoin /BlockChain for Experts *

Upload: others

Post on 30-May-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Huan Ke

Bitcoin /BlockChain for Experts

ceres.cs.uchicago.edu

*

Page 2: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Bitcoin & BlockChain2

❏ Bitcoin is digital coin, it’s money, which is digital.❏ Blockchain is a technology that enables moving digital coin from

one individual to another individual.❏ Bitcoin is not equal to Blockchain.

Bitcoin

Blockchain

Ethereum

Hyperledger

Page 3: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Money Transfer Example3

Page 4: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Money Transfer Example4

Page 5: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Money Transfer Example5

Page 6: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Money Transfer Example6

Page 7: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Underlying BlockChain in Bitcoin

7

❏ What is Blockchain?❏ How does Blockchain work?❏ Why should we pay attention to Blockchain?❏ Discussion

Page 8: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

What is BlockChain?8

The blockchain is a decentralized ledger of all transactions across a peer-to-peer network.

Page 9: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

What is BlockChain?9

❏ Bob wants to send Sally 2 bitcoins, he broadcasts the transaction to the network

❏ When the miners receive the transaction, they add it to their current block

❏ The miners will do some mathematical computation (PoW), one of them will firstly complete it (mined a block).

❏ Then the new mined block is broadcasted to the network and added to everyone’s blockchain.

Page 10: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

How does BlockChain work?10

❑ Transaction❑ Block❑ Blockchain❑ Synchronisation❑ Miner/ Mining❑ Proof of Work

Page 11: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Transaction11

Page 12: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Transaction12

New transactions are created, they will be put in a pool called “Pending Transactions” and propagated.

Unconfirmed tx

Page 13: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Transaction Propagation13

Page 14: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Transaction Propagation14

Page 15: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Should I Relay a Transaction?15

❏ Transaction valid ❏ Haven’t seen before❏ Doesn’t conflict with others I’ve relayed.

Page 16: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Block16

The available transactions in the pool will be added into one block, and they are organized in a merkle tree.

Page 17: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Block17

The construction of the Merkle tree is such that any single transaction is changed, all hashes along the branch would be changed and ultimately the merkle root as well.This the key property ensuring security of the blockchain.

Page 18: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Block Propagation18

Relay a new block when you hear it if:❏ block meets the hash target❏ block has all valid transactions❏ block builds on current longest chain

Page 19: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

BlockChain19

The blockchain consists of multiple blocks, and each block hold a set of transactions and a reference to the previous block.

Page 20: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Detect Tampering20

If you want to change the Block 52, the hash of the entire block will not be matched up with Block 53.

Also we can tamper Block 53 as well, then they can match up, but Block 54 will not be matched up with 54 . . .

Page 21: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Double Spend21

Page 22: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Double Spend22

C

When miners pull the transactions simultaneously from the pool, both are considered valid and record them in the blockchain with a fork. Later, new tx will be followed, at least one chain is longer than the other, then the short one will be removed.

Page 23: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

51% attack23

C

You may tamper the blockchain of one node, but other nodes keep the ledger as well.

You have to tamper 51% nodes’ blockchain, then it works.

Page 24: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Synchronisation24

❏ When a new node join the network, it will automatically synchronize with the network

❏ Block sync: periodically send current blockchain to peer nodes.

❏ Transaction sync: when pending transactions in the pool arrives a given size, send all to peer nodes.

Page 25: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Miner/ Mining25

Miner is to “mine” new blocks. To be simple, the miner solves a mathematical puzzle, then it will generate a new block.

1. validate the transaction2. calculate the mathematical puzzle3. the first miner will get the reward

Page 26: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Proof of Work26

Miner is to “mine” new blocks. To be simple, the miner solves a mathematical puzzle, then it will generate a new block.

Page 27: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Proof of Work27

Page 28: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Proof of Work28

The node is required to find “nonce”, which will be hashed with merkle root, hash of previous block. . . to produce a hash for this block.

Once it satisfies the PoW, the new

block is mined (created) and will be

added to the blockchain and broad

casted to the network.

Page 29: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

BlockChain Network29

Page 30: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Join BlockChain Network30

Page 31: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Join BlockChain Network31

Page 32: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Join BlockChain Network32

Page 33: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Join BlockChain Network33

Page 34: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Recap34

Page 35: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Recap35

Page 36: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Recap36

Page 37: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Recap37

Page 38: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Recap38

Page 39: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Recap39

Page 40: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Recap40

Page 41: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Recap41

Page 42: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Blockchain Split/Fork42

Two miners arrive at two valid solutions for the same block at the same time. The p2p network resolves this problem by blockchain fork within a short period of time.

Page 43: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Blockchain Split/Fork43

Eventually the longest chain will survive.

Page 44: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Why should we pay attention to Blockchain?

44

Blockchain is not only a revolutionary for financial business but also the most important IT invention of our age. ❏ Proof of document existence❏ Decentralized storage❏ Decentralized IoT

Page 45: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Proof of document existence45

Traditional document validation replies on central authorities for storing and validating the documents, which present some security challenges.Now, a user can simply store the signature and timestamp associated with a legal document in the blockchain and validate it anytime.

Page 46: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Decentralized Storage46

Cloud file storage solutions such as Dropbox, Google drive typically face challenges in security, privacy and data control. Users have to trust a third party with one’s confidential files. Now, blockchain technology eliminates most traditional data failures and outages.

Page 47: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Decentralized IoT47

IoT platforms are based on a centralized model in which a hub controls the interaction between devices. It becomes impractical for many scenarios.Now, the blockchain keeps a trusted record of all messages exchanged smart devices in a decentralized IoT topology.

Page 48: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Summary48

❏ A peer-to-peer electronic cash system based on cryptographic proof instead of trust. ❏ transact directly without a trusted third party❏ transactions are computationally impractical to reverse.

Page 49: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Discussion49

❏ as far as I know, in the Bitcoin system, there are too many states. Some of them are forgotten to lock protected.

❏ Blockchain technology involves game theory, computing networking, data transmission, cryptography and so on, it’s easy bring different types of bugs

❏ A lot of tx, block propagation, the throughput is a limit.❏ only one signature algorithm, SHA-256, crypto primitives might

break by 2040.

Page 50: Huan Ke Bitcoin /BlockChain for Expertspeople.cs.uchicago.edu/~huanke/Blockchain.pptx.pdf · Bitcoin & BlockChain 2 Bitcoin is digital coin, it’s money, which is digital. Blockchain

Thank You!

50