14
Bitcoin Tech Talk Zehady Abdullah Khan (Andy) Graduate Assistant, Computer Science Department, Purdue University.

Bitcoin tech talk @Purdue Bitcoin Club

Embed Size (px)

Citation preview

Page 1: Bitcoin tech talk @Purdue Bitcoin Club

Bitcoin Tech Talk

Zehady Abdullah Khan (Andy)

Graduate Assistant,

Computer Science Department,

Purdue University.

Page 2: Bitcoin tech talk @Purdue Bitcoin Club

Bitcoin

2

Bitcoin

Digital

Currency

Public KeyCryptograp

hy

InternetSecurity

Cryptography

Financial Transaction

E-Cash

Complex Network

Intro

Page 3: Bitcoin tech talk @Purdue Bitcoin Club

What is Bitcoin?• A digital currency

o Unit: BTC (1 BTC = 110 USD).

o Buy or sell goods.

o Exchange with Yen, USD etc.

• Differences

o Decentralized and Distributed.

o Very low fee.

o Very Fast Transaction.

o Non-reversible: Requires less trust .

o Pseudo-anonymous: Address <=> Address.

o Value increase (Only 21,000,000 Bitcoin)

• How do you get and use bitcoin?o Bitcoin exchanges to buy and sell bitcoin.

o Bitcoin wallets to use bitcoin to purchase or send bitcoin.

3

Page 4: Bitcoin tech talk @Purdue Bitcoin Club

Bitcoin Network protocols

• Steps to run the bitcoin network.

o New transactions are broadcast to all nodes.

o Each node collects new transactions into a block.

o Each node works to find a difficult proof-of-work for its

block. These nodes are called Bitcoin Miners.

o When a node finds a proof-of-work, it broadcasts the

block to all nodes.

o Other nodes accept the block only if all transactions in

it are valid and not already spent.

o Nodes express their acceptance of the block by

introducing the next block, using the hash of the

accepted block.

• Bitcoin uses SHA256 cryptographic hash function.

4

Page 5: Bitcoin tech talk @Purdue Bitcoin Club

How Bitcoin looks like?

• Not a physical object like gold or paper-money.

• A chain of digital signatures in a block-chain.

o Block header

o Transactions

• https://www.youtube.com/watch?v=3ujUIz9hQ7c

5

Page 6: Bitcoin tech talk @Purdue Bitcoin Club

Block: Human Readable format

6

http://blockexplorer.com/block/00000000000000001588d80f3cb1d593cb198f485aef33ca926b58a62bcceda8

https://blockchain.info/tree/15296863

Page 7: Bitcoin tech talk @Purdue Bitcoin Club

Validation of a Block• Condition for a hash to validate a block

o Hash of block header Target

• Block Reward(B)o 50(25) bitcoin per valid block

o Halves every 4 year

• Target(T) is a 32 byte(256 bit) number

o Current target(Tcur): “Bits” field of the block header in compact format.

o Maximum target(Tmax): 0x1d00ffff = 0x00000000FFFF0000000000000000000000000000000000000000000000000000

• Which hash will validate the block ?

• A given hash validating a block is a Random Event

o Independent of the validity of any other calculated hash

7

£

Nonce

Time Stamp

Change

A completelydifferent hash of the

block header

Page 8: Bitcoin tech talk @Purdue Bitcoin Club

Block Header

8

Change of Nonce Resulting Hash

3590836561 000000000000004b6cca89a20a6287dd423bbec48d901755dfe888bc9fa948d4

0972783904 00000000000000497fc8294f1f1ba9c24c5edf016e2e066772f7794e33b372cf

(3590836561)d=(100001011100010011100010110100101010)2

(0972783904)d=(000000111001111110111000000100100000)2

There are 2^32 different Nonces to try.

Page 9: Bitcoin tech talk @Purdue Bitcoin Club

Block Difficulty• Difficulty(D): A measure of how difficult it is to find a new block

compared to the easiest.

• Maximum Difficulty is set when = 1 , Tmax is defined as 0x1d00ffff

• Exp: If = 0x1b0404cb,then

o Desired rate of finding a block: 1 block / 10 minutes.

o Difficulty is adjusted after every 6*24 * 14 = 2016 blocks to maintain

the rate.

9

Tcur

D =0x1d00 ffff

0x1b0404cb= ? =16307.669773817162

D =Tmax

Tcurif Tcur = 0 , D = infinity

Tcur

Page 10: Bitcoin tech talk @Purdue Bitcoin Club

Network Hash Rate Calculation

• To find a block, the hash must be less than the target. The hash is

effectively a random number between 0 and 2^256 – 1.

• 0x00000000FFFF0000000000000000000000000000000000000000000000000000

The offset for difficulty 1 is (2^16-1) * 2^208

and for difficulty D is ((2^16-1)* 2^208) / D

• The expected number of hashes we need to calculate to find a

block with difficulty D is

D * 2^256 / ((2^16-1) * 2^208)=D * 2^48 / (2^16 – 1) = D*2^32

• Difficulty is set such that previous 2016 blocks would have been

found at the rate of 1 every 10 minutes. So, the network hash rate,

H = D * 2^48/(2^16-1)/(60* 10) = D*2^32/600

10

208 bits16bits

Tmax

Page 11: Bitcoin tech talk @Purdue Bitcoin Club

Difficulty Graph

Page 12: Bitcoin tech talk @Purdue Bitcoin Club

Network Hash Rate Graph

Page 13: Bitcoin tech talk @Purdue Bitcoin Club

Bitcoin Mining War

• https://en.bitcoin.it/wiki/Mining_hardware_comparison

• https://bitcoinwisdom.com/bitcoin/calculator

Page 14: Bitcoin tech talk @Purdue Bitcoin Club

Bitcoin's Development Visualized

• https://www.youtube.com/watch?v=cVGEbtIBxIE