SLIDE 1 Attacks on Mining Protocol
1
Yujin Kwon KAIST 2018.03.22
SLIDE 2
Cryptocurrencies
SLIDE 3
Cryptocurrencies
Increa rease! se!
SLIDE 4
Cryptocurrencies
1 BTC≈ $8.5K 1 ETH≈ $180
Increa rease! se!
SLIDE 5 Proof-of-Work Mining
They use blockcha kchain to run without a trusted third party. Miners generate blocks by spending their comp mputatio utationa nal power er. If a miner generates a valid block, he earns re rewar ard d for t r the block. This process is competi etiti tive ve.
12.5 5 BTC
Block
chain ain New Block
(N (N-1) 1)-th th Block
N-th th Bloc
k
(N+1)-th th Block
Miner ner
SLIDE 6 Proof-of-Work Mining
Problem
– Miners must solve cryptographic problems to generate a valid block. – What is the valid nonce such that 𝐼(𝑑𝑝𝑜𝑢𝑓𝑜𝑢𝑡| 𝑜𝑝𝑜𝑑𝑓 < TARGET𝐺 ? – 𝐼(∙) is a hash function based on SHA-256 in Bitcoin.
Nonce
SLIDE 7
Step (Miner)
New transactions are broadcast to all nodes. Each node collects new transactions into a block. Each node works on finding a difficult proof-of-work for its block. When a node finds a proof-of-work, it broadcasts the block to all nodes. Nodes express their acceptance of the block by working on creating the next chain, using the hash of the accepted block as the previous hash.
SLIDE 8
Forks
SLIDE 9
Forks
SLIDE 10
Forks
SLIDE 11
Forks
SLIDE 12
Forks
SLIDE 13
Forks
Only one head is accepted as a valid one among heads. An attacker can generate forks intentionally by holding his found block for a while.
SLIDE 14
Forks
Only one head is accepted as a valid one among heads. An attacker can generate forks intentionally by holding his found block for a while.
SLIDE 15 Mining Difficulty
Ti Time Di Diffic iculty ulty
Inc ncrease! rease!
From “https://blockchain.info”
SLIDE 16 Mining Pool
AntPool
23% 23% F2Pool 11% 11% BitFury 11% 11% BTCC 11% 11% Slush 7% 7%
BW.COM COM
7% 7%
BTC.COM C.COM
7% 7% Others rs 23% 23%
Miners organize pools and prefer to mine together to reduce the variance of reward. Currently, major players are pools.
Bitcoin Ethereum Litecoin
Ethpool
27% 27% F2Pool 23% 23% nano 11% 11% MPH 10% 10% Ethfans ans 8% 8% Others rs 21% 21% AntPool
30% 30% F2Pool 30% 30% LTC.top 10% 10% ViaBTC 10% 10%
BW.COM COM
6% 6% Litecoi
6% 6% Others rs 8% 8%
SLIDE 17 Mining Pool
Workers
Pool manager
PPoW: 𝐼(𝑑𝑝𝑜𝑢𝑓𝑜𝑢𝑡| 𝑜𝑝𝑜𝑑𝑓 < target𝑄 ? FPoW: 𝐼(𝑑𝑝𝑜𝑢𝑓𝑜𝑢𝑡| 𝑜𝑝𝑜𝑑𝑓 < TARGET𝐺 ? (target𝑄 ≫ TARGET𝐺)
SLIDE 18 Mining Pool
Workers Pool manager
463 125 352 432
PPoW FPoW
SLIDE 19 Mining Pool
Workers Pool manager
SLIDE 20 Several Mining Attacks
The 51 % Attack
- “The Economics of Bitcoin Mining, or Bitcoin in the Presence of Adversaries”, WEIS 2013
Selfish mining
– Generate forks intentionally
- “Majority Is Not Enough: Bitcoin Mining Is Vulnerable”, FC 2014
Block withholding (BWH) attack
– Exploit the pools’ protocol
- “The Miner’s Dilemma”, IEEE S&P 2015
- “On Power Splitting Games in Distributed Computation: The Case of Bitcoin Pooled
Mining”, CSF 2016
Fork after withholding (FAW) attack
– Generate forks intentionally through pools
- “Be Selfish and Avoid Dilemmas: Fork After Withholding (FAW) Attacks on Bitcoin”,
ACM CCS 2017
SLIDE 21 Selfish Mining
21
SLIDE 22 Selfish Mining
Forks
– Due to the nonzero block propagation delay, nodes can have different views. – When a fork occurs, only one block becomes valid.
(N (N-1) 1)-th th Block (N+1)-th th Bl Block
N-th th Bloc
k
(N+1)-th th Block
Fork
Which of two blocks should I choose as a main chain?
SLIDE 23 Selfish Mining
Generate intentional forks adaptively.
– An attacker finds a valid block and propagates the block when en anot
her bloc
k is found d by an honest est node.
Force the honest miners into wasting victims’ computations on the stale public branch.
SLIDE 24 Selfish Mining
𝛿: An attacker’s network capability When an attacker possesses more than 33% computational power, the attacker can always earn extra rewards.
SLIDE 25
Selfish Mining
SLIDE 26
Selfish Mining
Im Impra practical! ctical!
SLIDE 27 Impractical
The value of γ cannot be 1 because when the intentional fork occurs, the honest miner who generated a block will select his block, not that of the selfish miner. Honest miners can easily detect that their pool manager is a selfish mining attacker.
– If the manager does not propagate blocks immediately when honest miners generate FPoWs, the honest miners will know that their pool manager is an attacker. – The blockchain has an abnormal shape when a selfish miner exists.
SLIDE 28 Block Withholding Attack
28
SLIDE 29 Block Withholding (BWH) Attack
An Attacker Pool manager Submit only PPoWs.
463 125 352 432
Withhold
SLIDE 30 Block Withholding (BWH) Attack
An attacker joins the victim pool. She should split her computational power into solo mining and malicious pool mining (BWH attack). She receives unearned wages while only pretending to contribute work to the pool.
Solo Pool Pool
BWH Attack Mining Attacker
SLIDE 31
Block Withholding (BWH) Attack
SLIDE 32 Result
Infiltration mining power Attacker relative reward Victim relative reward
The BWH attack is always profitable.
SLIDE 33 The Miners’ dilemma (S&P 2015)
Pools can launch the BWH attack each other through infiltration.
Po Pool
Po Pool
Infiltration from Pool 1 into Pool 2 Infiltration from Pool 2 into Pool 1
SLIDE 34
Result
When they execute the BWH attack each other, both of them make a loss.
SLIDE 35 The Miners’ dilemma (S&P 2015)
The equilibrium reward of the pool is inferi nferior
- r compared to the no-attack scenario.
The fact that the BWH attack is not
commo mmon n may be explained.
From “The Miner’s Dilemma”
SLIDE 36 Fork After Withholding Attack
36
SLIDE 37 FAW Attack Against One Pool
Tar arge get t poo
Pool Pool Solo
Mining Submit an FPoW to the pool only if others generate another block. Otherwise, throw away her FPoW. Attacker Others rs
SLIDE 38 FAW Attack Against One Pool
Tar arge get t poo
Pool Pool Solo
Mining Attacker Others rs
An attacker generates forks intentionally through a pool!
Submit an FPoW to the pool only if others generate another block. Otherwise, throw away her FPoW.
SLIDE 39 FAW vs BWH
Case 1) When an attacker finds an FPoW through solo mining…
Blockch
ain New Block
(N (N-1) 1)-th th Block
N-th th Bloc
k
(N+1)-th th Block
FAW/ W/ BWH Attack acker er Victim ctim Othe hers rs
SLIDE 40 FAW vs BWH
Case 1) When an attacker finds an FPoW through solo mining…
Blockch
ain New Block
(N (N-1) 1)-th th Block
N-th th Bloc
k
(N+1)-th th Block
FAW/ W/ BWH Attack acker er
The attacker earns the block reward.
Victim ctim Othe hers rs
SLIDE 41 FAW vs BWH
Case 2) When an honest miner in the victim pool finds an FPoW…
Blockch
ain New Block
(N (N-1) 1)-th th Block
N-th th Bloc
k
(N+1)-th th Block
FAW/ W/ BWH Attack acker er Victim ctim Othe hers rs
SLIDE 42 FAW vs BWH
Case 2) When an honest miner in the victim pool finds an FPoW…
Blockch
ain New Block
(N (N-1) 1)-th th Block
N-th th Bloc
k
(N+1)-th th Block
The victim earns the block reward and shares the reward with the attacker.
FAW/ W/ BWH Attack acker er Victim ctim Othe hers rs
SLIDE 43 FAW vs BWH
Case 3) When only others find an FPoW…
Blockch
ain New Block
(N (N-1) 1)-th th Block
N-th th Bloc
k
(N+1)-th th Block
FAW/ W/ BWH Attack acker er Victim ctim Othe hers rs
SLIDE 44 FAW vs BWH
Case 3) When only others find an FPoW…
Blockch
ain New Block
(N (N-1) 1)-th th Block
N-th th Bloc
k
(N+1)-th th Block
Others earn the block reward.
FAW/ W/ BWH Attack acker er Victim ctim Othe hers rs
SLIDE 45 FAW vs BWH
Case 4) When the attacker finds an FPoW in the victim pool, and others also find another FPoW…
Blockch
ain New Block
(N (N-1) 1)-th th Block
N-th th Bloc
k
(N+1)-th th Block
BWH Attack acker er Victim ctim Othe hers rs
SLIDE 46 BWH Attack acker er
FAW vs BWH
Case 4) When the attacker finds an FPoW in the victim pool, and others also find another FPoW…
Blockch
ain New Block
(N (N-1) 1)-th th Block
N-th th Bloc
k
(N+1)-th th Block
Others earn the block reward.
Victim ctim Othe hers rs
SLIDE 47 FAW vs BWH
Case 4) When the attacker finds an FPoW in the victim pool, and others also find another FPoW…
Blockch
ain Attacker’s Ne New Block
(N (N-1) 1)-th th Block
N-th th Bloc
k
Others’ Ne New Block
(N+1)-th th Block
FAW Attack acker er Victim ctim Othe hers rs
SLIDE 48 FAW vs BWH
Case 4) When the attacker find an FPoW in the victim pool, and others also find another FPoW…
Blockch
ain Attacker’s Ne New Block
(N (N-1) 1)-th th Block
N-th th Bloc
k
If others’ block is selected as the main chain,
- thers earn the block reward.
Others’ Ne New Block
(N+1)-th th Block
FAW Attack acker er Victim ctim Othe hers rs
SLIDE 49 FAW vs BWH
Case 4) When the attacker find an FPoW in the victim pool, and others also find another FPoW…
Blockch
ain Attacker’s Ne New Block
(N (N-1) 1)-th th Block
N-th th Bloc
k
If the attacker’s block is selected as the main chain, the victim earns the block reward and shares the reward with the attacker.
Others’ Ne New Block
(N+1)-th th Block
FAW Attack acker er Victim ctim Othe hers rs
SLIDE 50 FAW vs BWH
Case 4) When the attacker find an FPoW in the victim pool, and others also find another FPoW…
Blockch
ain Attacker’s Ne New Block
(N (N-1) 1)-th th Block
N-th th Bloc
k
To increase the probability to win this race, the attacker can plant many Sybil nodes in the Bitcoin network.
Others’ Ne New Block
(N+1)-th th Block
FAW Attack acker er Victim ctim Othe hers rs
SLIDE 51
FAW vs BWH
The FAW Attack The BWH Attack
SLIDE 52
FAW vs BWH
The FAW Attack The BWH Attack
SLIDE 53
FAW vs BWH
At Attac acker ker Victi tim Others ers FAW AW BWH
SLIDE 54 Numerical Analysis
An attacker possesses 20% power (0.2). A variable 𝑑 represents a probability that an attacker’s FPoW will be selected as the main chain.
Attacker Victim Always positive Always negative
SLIDE 55 Numerical Analysis
The case is equivalent to the case of the BWH attack. Increasing An attacker’s power We can see that the FAW attack is more profitable than the BWH attack numerically.
𝒅 𝜷 0.1 0.2 0.3 0.4 0.53 (%) 1.14 (%) 1.85 (%) 2.7 (%) 0.25 25 0.65 (%) 1.38 (%) 2.2 (%) 3.1 (%) 0.5 0.85 (%) 1.74 (%) 2.7 (%) 3.75 (%) 0.75 75 1.21 (%) 2.37 (%) 3.52 (%) 4.69 (%) 1 2.12 (%) 3.75 (%) 5.13 (%) 6.37 (%)
Increasing
SLIDE 56 FAW Attack Against Multiple Pools
56
Pool 1 Pool 3 Pool 2 Solo
Tar arge get t poo
l 1 Others rs Submit FPoWs to pools only if
Otherwise, throw her FPoWs. Mining Tar arge get t poo
l 2 Tar arge get t poo
l 3 Attacker
SLIDE 57 FAW Attack Against Two Pools
When the attacker finds an FPoW in each of pools, a fork with three branches
In general, when 𝑜 pools are targeted, a fork with 𝑜 + 1 branches can occur. When considering the power distribution, the attacker can earn the extra reward 56% more than the BWH attacker.
SLIDE 58 FAW Attack Game
Pools can launch the FAW attack each other through infiltration.
Po Pool
Po Pool
Infiltration from Pool 1 to Pool 2 Infiltration from Pool 2 to Pool 1
SLIDE 59
Dilemma? Not Always
Pool 1 possesses 0.2 computational power. The bigger pool can earn the extra reward unlike the miner’s dilemma. Pool 1 Pool 2 Pool 1 can earn the extra reward in the Nash equilibrium. Pool 2 can earn the extra reward in the Nash equilibrium.
SLIDE 60 Break Dilemma
Poo
can earn the extra a reward rd in Nash h equilibri rium. um. FAW attacks between two pools lead to a pool size game: the larger pool can always earn the extra reward.
SLIDE 61 Detection of FAW Attack
The FAW attack causes high fork rate. The FAW attacker leaves a trace of the only victim pools’ identities but not the attacker’s identity unlike selfish mining. The manager can identify the miner who submits the FPoW causing the fork. The FAW attacker can use many Sybil il nod
es in the victim pool. The e FAW AW attacker acker can n make ake the e detec ecti tion
less.
SLIDE 62 No Silver Bullet
New reward systems for mining pools
– High variance of rewards
Change Bitcoin protocol
– Two-phase proof-of-work – Not backward compatibility
There ere is no
ilver ver bull llet. et.
SLIDE 63
Conclusion
Currently, the most main coins have the proof-of-work mechanism. The proof-of-work mechanism is vulnerable to several attacks. There are still open problems.
SLIDE 64 Yu Yujin jin Kwon
dbwls872 wls8724@kaist 4@kaist.ac .ac.kr .kr