Top Banner
Bitcoin
26

Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Dec 17, 2015

Download

Documents

Michael Francis
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Bitcoin

Page 2: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

What is Bitcoin?

• A P2P network for electronic payments• Benefits:– Low fees– No middlemen– No central authority– Can be anonymous– Each payment goes through, no censorship

Page 3: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

How Does it Work?

• Does not rely on real currency but one can buy bitcoins for money– Valuable because they are useful and limited in supply

• New coins are ”mined” by performing cryptographic operations that take lots of CPU

• A user can package the new coin together with a block containing new transactions of others– “Verifying a block” brings the user 25 BTC reward– Reward is halved every 4 years

Page 4: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

How Does it Work?

• Each transaction is signed by the sender’s private key– So no one can spend others’ money

• Transaction = bitcoins, public key of recipient• Each transaction is broadcast in the P2P network• Recipients collect and verify transactions in a block– On the average 6 blocks per hour are generated

Page 5: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

How Does it Work?

• Blocks are chained together so that latter blocks depend on previous ones

• If multiple chains appear only the longest and fastest-growing chain is accepted as true– This prevents double-spending

• Anonymity can be achieved by using a new public/private key pair for each receiving transaction

Page 6: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Transaction FormatField DescriptionVersion 1In-counter Int>0List of inputs TxinOut-counter Int>0List of outputs TxoutLock_time When is the transaction final, only

valid if sequence_no < 0xFFFFFFFF

Page 7: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Txin FormatField DescriptionPrevious Transaction hashPrevious Txout-index Which output of prev Tx is usedTxin-script length Int >= 0Txin-script/scriptSigSequence_no normally 0xFFFFFFFF

Page 8: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Txout FormatField DescriptionValue number of BTC*108 to be transferred

Txout-script length Int >= 0Txout-xcript/scriptPubKey

Page 9: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Sample Transaction

• Input 50 bitcoins from transaction with hash f5d… then send them to a Bitcoin address 4043 ..

• If the input was greater than the amount you want to spend create another output to yourself with the rest

• Any part of input not redeemed is the transaction fee and belongs to whoever generates a block

Page 10: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Transaction Verification

• Use a scripting system – describes how the transaction amount can be redeemed

• Input’s scriptSig is evaluated first – this leaves some state on the stack

• Output’s scriptPubKey is evaluated second• Through scripting system one can create

different sorts of payments with different conditions

Page 11: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Types of Transactions

• Transfer to IP address

• Transfer to Bitcoin address

• Generation

Page 12: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Blocks• A block is a record of some or all transactions that

have not been recorded so far• Each block contains:– A reference to the block immediately before it – chaining

(roughly one block is added each 10 min)– A solution to a cryptographic puzzle– A generation transaction so fee can be claimed for

generating the block

• Transactions are broadcast and peers compete in trying to generate new blocks

• More about block rules https://en.bitcoin.it/wiki/Protocol_rules#Blocks

Page 13: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Puzzles

• A puzzle is finding an input to a hash algorithm that, when combined with the block’s hash results in output with many zeros

• The difficulty of the puzzle is automatically adjusted so that roughly 6 puzzles per hour can be solved

• Every two weeks all clients compare how much off target they were and adjust puzzle difficulty

• Clients accept the chain with the highest combined difficulty of puzzles as valid

Page 14: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Double-Spending

• Could one spend the same coin twice?– Bitcoin peers verify all transactions they add to the

block to ensure that the same coin wasn’t spent elsewhere

– There are some race conditions that may lead to double-spending before transactions are verified

– As the confirmations increase no double-spending is possible

Page 15: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Some Statistics

Page 16: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Some Statistics

Page 17: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Some Statistics

Page 18: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Some Statistics

Page 19: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Some Statistics

Page 20: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Some Statistics

Page 21: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Some Statistics

Page 22: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Drive-By Downloads

Page 23: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

What are Drive-By Downloads

Page 24: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Are These Just Exploits?

• If my computer is well-protected should I worry?• Drive-by downloads occur in two ways:– There’s a pop-up that a user clicks on or sometimes even

closes. This is interpreted as permission to download and install malware onto your machine

– There’s a script on the page a user visited that initiates file download. Some browsers may run such files automatically, infecting the machine

• Some browsers will force downloads and warn on downloads of executable software

Page 25: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

What If I Visit Well-Known Sites?

• Even such sites can have vulnerable servers that get infected by attackers

• Or they may serve ads that distribute malware• Exploit kits for Web servers proliferate on

black markets– They are also very versatile and customizable

Page 26: Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.

Are There Any Defenses?

• Lots of research in the area from top security experts• BLADEhttp

://www.youtube.com/watch?v=9emHejh8hW“all executable files delivered through browser downloads must result from explicit user consent”