fh campus wien · title: bitcoin: how it works. a lightweight intro to block chains author: ulrich...
TRANSCRIPT
Bitcoin: How it works.A lightweight intro to block chains
Ulrich Haböck
Kompetenzzentrum für IT-Security, FH Campus Wien
October 30, 2017
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Speaker
Ulrich Habö[email protected]: 48F796E247BEEDE8.
• PhD Mathematics (University Vienna)• Post-doc TU-Vienna• since 2013 at the Competence Centre for IT-Security, FH Campus Wien• Lecturer Bachelor Information Technology and Telecommunications
as well as Master IT-Security• Focus: mathematics and cryptography
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
The problem of digital cash
• normal cash: expensive to copy/reproduce.
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
The problem of digital cash
• digital cash: copy and paste, even when certified (just abunch of data!)
Serial-No:aabcf7...bValue:1.24 UOwner: Mr. Hans PansIssuer: Bank XYZDate:2017/29/02Sig:c60cb9fc0c04bb2e3bcb72c29dffb908e2edaffcbd5e62d8194f3d719632
Serial-No:aabcf7...bValue:1.24 UOwner: Mr. Hans PansIssuer: Bank XYZDate:2017/29/02Sig:c60cb9fc0c04bb2e3bcb72c29dffb908e2edaffcbd5e62d8194f3d719632
Serial-No:aabcf7...bValue:1.24 UOwner: Mr. Hans PansIssuer: Bank XYZDate:2017/29/02Sig:c60cb9fc0c04bb2e3bcb72c29dffb908e2edaffcbd5e62d8194f3d719632
Serial-No:aabcf7...bValue:1.24 UOwner: Mr. Hans PansIssuer: Bank XYZDate:2017/29/02Sig:c60cb9fc0c04bb2e3bcb72c29dffb908e2edaffcbd5e62d8194f3d719632
Serial-No:aabcf7...bValue:1.24 UOwner: Mr. Hans PansIssuer: Bank XYZDate:2017/29/02Sig:c60cb9fc0c04bb2e3bcb72c29dffb908e2edaffcbd5e62d8194f3d719632
Serial-No:aabcf7...bValue:1.24 UOwner: Mr. Hans PansIssuer: Bank XYZDate:2017/29/02Sig:c60cb9fc0c04bb2e3bcb72c29dffb908e2edaffcbd5e62d8194f3d719632
Serial-No:aabcf7...bValue:1.24 UOwner: Mr. Hans PansIssuer: Bank XYZDate:2017/29/02Sig:c60cb9fc0c04bb2e3bcb72c29dffb908e2edaffcbd5e62d8194f3d719632
Serial-No:aabcf7...bValue:1.24 UOwner: Mr. Hans PansIssuer: Bank XYZDate:2017/29/02Sig:c60cb9fc0c04bb2e3bcb72c29dffb908e2edaffcbd5e62d8194f3d719632
Serial-No:aabcf7...bValue:1.24 UOwner: Mr. Hans PansIssuer: Bank XYZDate:2017/29/02Sig:c60cb9fc0c04bb2e3bcb72c29dffb908e2edaffcbd5e62d8194f3d719632
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
The problem of digital cash
Double-spending: same certified unit spent twice
A B
C
500 500
500
same coin
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
The problem of digital cash
One way to prevent double-spending : online log of entiretransaction history
Serial-No:aabcf7...bValue:1.24 UOwner: Mr. Hans PansIssuer: Bank XYZDate:2017/29/02Sig:c60cb9fc0c04bb2e3bcb72c29dffb908e2edaffcbd5e62d8194f3d719632
TransactionSerial-No:aabcf7...bTo: Ms. DissFrom: Mr. Hans PansDate:2017/1/03Sig:8a1545cc09a8c027e93380add5f9818ba14382c4d78acff5198f6e46e2b4
TransactionSerial-No:aabcf7...bTo: BC-ComputersFrom: Ms. DissDate:2017/1/03Sig:59a6854d3b7427765a3ea84988779c60720793a8a3fed593ff378c819bf3
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
The problem of digital cash
Inherent issues:• centralised reglementation (e.g. Bank): set under pressure
easily by powerful players,• decentralised reglementation: robust, secure consensus
necessary
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Bitcoin
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Bitcoin
• is a digital currency• (partially) anonymous (pseudonymous)• decentralised, based on blockchain technology
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Bitcoin
• 1992: E.Hughes, T.May: cipherpunks• 1997,98: Proof of work to mitigate spam emails (hash
cash), W.Dai’s b-money, N.Szabo’s Bit Gold• 2008: S. Nakamoto’s white paper on Bitcoin• Jan 2009: initial release of bitcoin core (Windows), first
bitcoin network in practice
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Bitcoin
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Bitcoin
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Bitcoin
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Bitcoin wallets
Every participant (user) can create a wallet full of random keys(Bitcoin addresses)
e.g.
1D3hJ52SXjZamJDSWHN4w6qPwYYDS6zFxq, or3J6atJNyitmTCmoE4e26w5tTceVBtYQ7TY, or1AYDLj29QcTgYNc86umbwdyDV3CgCBvu1f.
addresses are not a-priori bound to any value!
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Transactions
tx
−→ signed with the key of incoming address
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Transactions
. . . are distributed over Bitcoins P2P-network
tx
tx
tx
txtx
tx
tx
tx
tx
tx
tx
tx
tx
verified & collected by full nodes in Mempool
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Blockchain & mining
new block
tx0 tx1
tx2 tx3
tx4 tx5
so-called miners take tx’s from Mempool in block
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Blockchain & mining
previous block
tx5tx4
tx3tx2
tx0 tx1
preprevious block
tx5tx4
tx3tx2
tx0 tx1
new block
tx0 tx1
tx2 tx3
tx4 tx5
previous block
tx5tx4
tx3tx2
tx0 tx1found!
Hash(.)= 000...0***...*n zero bits
f9bf1b65...146c03319...1ebc18dd7...9
and solve a block depending puzzle
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Blockchain & mining
• When nonce found −→ miner distributes Block + nonceover the network.
• Miner receivesreward (newly generated, mined coins)+ transaction fees
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Why the hash puzzle??
Proof of work is essential for stable and robust consensus
+
yields the basis of worth for the currency (like gold was fortraditional currencies)
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Difficulty
As of June 2017, hash puzzles have a difficulty of ≈ 75 leadingzero Bits, e.g.
h=0000000000000000002f47c8785c85cd6e7dc5e8249ebb7c9ba065408ec03209
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
The consensus mechanism
Rule: Truth is defined by the longest chain (minus last fiveblocks)
Not valid! -> mining effort worthless
Not valid!
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
The consensus mechanism
Hence miners always work on longest chain
• it is the most profit promising• otherwise mining effort eventually rewardless
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
The consensus mechanism
Stability: forks are not stable!
FIRST!
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
The consensus mechanism
Stability: forks are not stable!
Uh-Oh!Other chainis longer!
Let's movethere!
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
The consensus mechanism
Robustness: double spending attack not feasible
tx
tx'in secret
hash race: min. 6 blocks to go
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
The consensus mechanism
Not feasible 6= impossible
computing power success(% of entire network) probability
≥ 50% 1.40% 0.4930030% 0.1564520% 0.0233110% 0.000595% 0.00001
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Blockchain stats
Let’s have a look at https://blockchain.info/
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
How to start
Choose wallet software
Be careful, not all wallets offer same features / security −→see https://bitcoin.org
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Where can I buy bitcoins?
• online marketplaces, e.g.
• local exchange, e.g. paper wallets
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
Thank you!
Introduction Bitcoin Basics Wallets and Transactions Blockchain Consensus Blockchain stats How to start?
some links
• https://bitcoin.org/en/• https://blockchain.info/• https://bitcoin-austria.at/de• A.M. Antonopoulos, Mastering Bitcoin, O‘Reilly 2014.
• http://zerocash-project.org/• https://www.ethereum.org/