A Stochastic Model for Analysis of Attacks on Blockchain (preliminary version, please do not quote) Ming-hua Hsieh, National Chengchi University, [email protected]ABSTRACT In a blockchain, the longest chain, which has the greatest proof-of-work effort spent in it, represents the majority decision. To change the transaction data of a block, an attacker has to control more computing power than other honest nodes. This situation can happen if the attacker can hack into the systems of honest nodes. To analyze the probability of such event, we propose a probability model for analysis of attacks on blockchain. The model is based on the structure of a peer-to-peer network. We assume the state of each honest node follows a two-state (hacked or normal) Markov chains. A hacked node is assumed to be controlled by the attacker and its computing power belongs to the attacker. On the other hand, the computing power of a normal node belongs to the honest longest chain. We apply the model to study the probability of the majority decision is controlled by the attacker and the duration of such event. In addition, we analyze the magnitude of the loss for such event. Keywords: Blockchain, the longest chain, blockchain attack, Markov chain, stochastic process INTRODUCTION Blockchain or distributed ledger technology (DLT) is one of most disruptive innovation in FinTech. The success of bitcoin has highlighted the impact of the blockchain technology to the financial services industry. In addition to the innovative payment methods like Bitcoin, there are many other applications in the blockchain: Airbnb and other companies are recruiting blockchain
20
Embed
A Stochastic Model for Analysis of Attacks on Blockchain for analy… · 24/10/2016 · model for analysis of attacks on blockchain. The model is based on the structure of a peer-to-peer
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
A Stochastic Model for Analysis of Attacks on Blockchain
∃! 𝑗𝑗 ∈ {1, … ,𝑛𝑛𝑖𝑖} 𝑠𝑠. 𝑡𝑡. ℎ𝑖𝑖𝑘𝑘 = 𝑡𝑡𝑖𝑖𝑖𝑖 ,𝑤𝑤𝑖𝑖𝑘𝑘 = 𝑣𝑣𝑖𝑖𝑖𝑖 Set the state of transaction hnk as ank. When ank = 1, the transaction is under attack; when ank
= 0 the transaction is normal. Then we have
𝐿𝐿𝑛𝑛 = �𝑤𝑤𝑛𝑛 ∗ 𝐼𝐼(𝑎𝑎𝑛𝑛𝑘𝑘 = 1)𝑚𝑚𝑛𝑛
𝑘𝑘=1
To fit the distribution of the number of transactions per block, we use the data from block height 501984 to the block height 518112 in bitcoin ledger. We fit with gamma, log normal, beta, and generalized pareto. Table 1 shows the AICs for the four distributions, and the p value for the kolmogorov-smirnov test (in parentheses). The hypothesis is as follows: H0: The number of transactions in each block is from the specified distribution H1: Otherwise Among them, the sum of AICs of fitted beta distribution was the lowest, and the p value of kolmogorov-smirnov test was greater than 0.05 in all data sets. Therefore, we choose beta as the distribution of the number of transactions in each block. Figure 1 shows the results of four models for the number of transactions from block 514080 to block 516096 and block 516096 to block 518112. The histogram of the block transaction number is in blue, and the distribution probability distribution is in orange. The fitted beta distribution is very close to the histogram. The parameters are estimated using block 516096 to block 518112. Table 2 shows the AICs and p values of kolmogorov-smirnov test, and the distribution mean and standard deviation. Figure 2 shows the fitted beta distributions.
Fig 1. Fitted ditributions and data histograms
Fig. 2 The fitted beta distrution of the number of transactions in each block
gamma lognormal beta generalized pareto
from block 501984 to block 504000 31120.55 (0.1492) 38894.71 (0.0000) 31097.60 (0.6154) 38539.61 (0.0000)
from block 504000 to block 506016 29944.15 (0.0029) 37865.47 (0.0000) 29888.55 (0.2131) 37920.22 (0.0000)
from block 506016 to block 508032 29118.00 (0.0071) 36598.34 (0.0000) 29073.55 (0.0750) 35598.00 (0.0000)
from block 508032 to block 510048 28324.20 (0.0008) 35332.39 (0.0000) 28253.11 (0.4515) 34134.75 (0.0000)
from block 510048 to block 512064 28049.95 (0.0113) 34977.46 (0.0000) 27968.36 (0.8073) 38006.47 (0.0000)
from block 512064 to block 514080 28186.56 (0.0009) 33839.63 (0.0000) 28136.74 (0.1243) 34023.22 (0.0000)
from block 514080 to block 516096 28185.70 (0.0000) 34966.38 (0.0000) 28003.45 (0.0694) 33731.74 (0.0000)
from block 516096 to block 518112 27848.52 (0.0001) 33028.76 (0.0000) 27689.58 (0.3193) 33279.37 (0.0000)
aic sum 230777.63 285503.1198 230110.9364 285233.3739
Table 1 Summary of the fitted distribution for the number of transactions per block
Table 2 The fitted beta distribution: AIC, kolmogorov-smirnov test p value, mean and standard deviation.
To fit the distribution of the log transaction amount per transaction, we use the data from block height 508012 to the block height 518112 in bitcoin ledger. We fit with gamma, log normal, beta, and generalized pareto. Table 3 shows the AICs for the four distributions, and the p value for the kolmogorov-smirnov test (in parentheses). The hypothesis is as follows: H0: log transaction amount per transaction is from the specified distribution H1: Otherwise Among them, the sum of AICs of fitted beta distribution was the lowest, and the p value of
kolmogorov-smirnov test was greater than 0.05 in all data sets. Therefore, we choose beta as the distribution of the log transaction amount per transaction.
Figure 3 shows the results of four fitted distributions. Table 4 shows the AICs and p values of kolmogorov-smirnov test, and the distribution mean and standard deviation. Figure 4 shows the fitted beta distributions.
aic sum 157661.0646 159857.6764 156431.014 289127.0952
Table 3 Summary of the fitted distribution for the log transaction amount per transaction.
aic p value mean std
txValues (beta) 2582261.95 0 19.2 1.68
Table 4 The fitted beta distribution: AIC, kolmogorov-smirnov test p value, mean and standard deviation.
Numerical results of Monte Carlo simulation Below are the basic setting:
Fig. 4 The fitted beta distrution of the log transaction amount per transaction
Fig 3. Fitted ditributions and data histograms
1. The number of replications: 200 2. N = 100 3. Initial computing power w = 25%。 4. 𝛼𝛼 = 0.95, 𝛽𝛽 = 0.95。 5. H = 2.5 ∗ 108𝑠𝑠𝑎𝑎𝑡𝑡𝑠𝑠𝑠𝑠ℎ𝑖𝑖 = 2.5 𝐵𝐵𝐵𝐵𝐵𝐵。
.
Table 5 Summary of the simulated loss distribution Mean 4293.82
Std 1960.28
Min 1501.84
25 Percentile 2849.93
Median 3888.35
75 Percentile 5107.47
Max 11878.86
VaR95 8479.26
ES 9947.16
We choose 95% VaR as the key risk measure for analyzing the sensitivity of each model parameters. Other summary statistics and risk measures are also listed in tables. The parameters includes N, w, α, β and H.
Fig. 5 The simulated loss distribution
N 100 300 500 1000 1500 2000
w 0.25 0.25 0.25 0.25 0.25 0.25
Alpha 0.95 0.95 0.95 0.95 0.95 0.95
Beta 0.95 0.95 0.95 0.95 0.95 0.95
H 2.5 2.5 2.5 2.5 2.5 2.5
- - - - - - -
Mean 4190.34 13932.76 23050.95 46373.37 69400.36 92988.88
ES 9807.69 9793.60 11072.44 21499.58 25566.12 60301.91 65884.14
Table 10: Sensitivity analysis of 𝐻𝐻
Fig. 10: Sensitivity analysis of VaR 95 in 𝐻𝐻
Conclusion and future works
We extend attackers’ model in (Nakamoto 2008) to address the importance attacker’s issue in
the standard blockchain protocol. We use bitcoin transactional data to fit the distributions of the
number of transactions in each block and transaction amount of each transaction. We then use Monte
Carlo simulation to analyze the risk of an attack numerically.
To estimate such quantities via Monte Carlo simulation, computational efficiency is usually an
important and practical issue (Asmussen and Glynn 2007; Glasserman 2004). Fast simulation
algorithm for similar network problem can be found in (Asmussen and Glynn 2007) and
(Heidelberger 1995) and fast simulation in financial applications are very common for a variety of
situations (Boyle, Broadie, and Glasserman 1997; Boyle 1977; Broadie and Glasserman 1996; Chiang,
Yueh, and Hsieh 2007; Glasserman 2004; Hsieh, Liao, and Chen 2014; Joshi and Kainth 2004; Wang
and Sloan 2011). We have designed some efficient algorithms for derivative pricing (Chiang, Yueh,
and Hsieh 2007). We have extended our algorithms to incorporate additional variance reduction
techniques. We think the algorithms will be more efficient. Therefore we wish to design such
algorithms in the future works.
The result can provide a useful insight for blockchain technology and the issues related to its
security. These issues will be very important for financial service and fintech industries. It might then
be useful for financial institutions and fintech companies facing new regulation and changing
environment.
References
Antonopoulos, Andreas M. 2014. Mastering Bitcoin: unlocking digital cryptocurrencies: " O'Reilly
Media, Inc.". Asmussen, Søren, and Peter W Glynn. 2007. Stochastic simulation: Algorithms and analysis:
Springer. BHASKAR, Nirupama Devi, Pak Nian LAM, and David KC LEE. 2015. Bitcoin, IPO, ETF and
Crowdfunding. Boyle, Phelim, Mark Broadie, and Paul Glasserman. 1997. Monte Carlo methods for security
pricing. Journal of Economic Dynamics and Control. Boyle, Phelim P. 1977. Options A Monte Carlo Approach. Journal of Financial Economics. Broadie, Mark, and Paul Glasserman. 1996. Estimating Security Price Derivatives Using
Simulation. MANAGEMENT SCIENCE 42 (2). Buterin, Vitalik. 2014. A next-generation smart contract and decentralized application platform.
white paper. Chiang, Mi-Hsiu, Meng-Lan Yueh, and Ming-Hua Hsieh. 2007. An efficient algorithm for basket
default swap valuation. The Journal of Derivatives 15 (2):8-19. De Filippi, Primavera. 2015. Blockchain-based Crowdfunding: what impact on artistic production
and art consumption? Observatório Itaú Cultural (19). Dennis Richard, and Owen Gareth. 2015. Rep on the block: A next generation reputation system
based on the blockchain. In 2015 10th International Conference for Internet Technology and Secured Transactions (ICITST): IEEE.
Eyal, Ittay, and Emin Gün Sirer. 2014. Majority is not enough: Bitcoin mining is vulnerable. Paper read at International Conference on Financial Cryptography and Data Security.
Friedlmaier, Maximilian, Andranik Tumasjan, and Isabell M Welpe. 2016. Disrupting Industries With Blockchain: The Industry, Venture Capital Funding, and Regional Distribution of Blockchain Ventures.
Georgios Zervas, Davide Proserpio, and John W. Byers. 2015. A first look at online reputation on Airbnb, where every stay is above average, Where Every Stay is Above Average.
Gervais, Arthur, Ghassan Karame, Srdjan Capkun, and Vedran Capkun. 2014. Is Bitcoin a decentralized currency? IEEE security & privacy 12 (3):54-60.
Glasserman, Paul. 2004. Monte Carlo methods in financial engineering. Vol. 53: Springer. Heidelberger, Philip. 1995. Fast simulation of rare events in queueing and reliability models. ACM
Transactions on Modeling and Computer Simulation (TOMACS) 5 (1):43-85. Hsieh, Ming-Hua, Wei-Cheng Liao, and Chuen-Lung Chen. 2014. A Fast Monte Carlo Algorithm
for Estimating Value at Risk and Expected Shortfall. The Journal of Derivatives 22 (2):50-66.
Huckle, Steve, Rituparna Bhattacharya, Martin White, and Natalia Beloff. 2016. Internet of Things, blockchain and shared economy applications. Procedia Computer Science 98:461-466.
Jacynycz, Viktor, Adrian Calvo, Samer Hassan, and Antonio A Sánchez-Ruiz. 2016. Betfunding: A Distributed Bounty-Based Crowdfunding Platform over Ethereum. Paper read at Distributed Computing and Artificial Intelligence, 13th International Conference.
Joshi, Mark S., and Dherminder Kainth. 2004. Rapid and accurate development of prices and Greeks fornth to default credit swaps in the Li model. Quantitative Finance 4 (3):266-275.
Kosten, Dmitri. 2015. Bitcoin Mission Statement. Or What Does It Mean Sharing Economy and Distributed Trust?
Lamarque, Mélodie. 2016. The blockchain revolution: new opportunities in equity markets, Massachusetts Institute of Technology.
Lee, Larissa. 2015. New Kids on the Blockchain: How Bitcoin's Technology Could Reinvent the Stock Market. Available at SSRN 2656501.
Mainelli, M, and Mike Smith. 2015. Sharing ledgers for sharing economies: an exploration of mutual distributed ledgers (aka blockchain technology). The Journal of Financial Perspectives 3 (3):38-69.
Nakamoto, Satoshi. 2008. Bitcoin: A peer-to-peer electronic cash system. Peters, Gareth William, and Guy Vishnia. 2016. Overview of Emerging Blockchain Architectures
and Platforms for Electronic Trading Exchanges. Shrier, David, J Larossi, Deven Sharma, and Alex Pentland. 2016. Blockchain & Transactions,
Markets and Marketplaces. Sundararajan, Arun. 2016. The Sharing Economy: The End of Employment and the Rise of Crowd-
Based Capitalism: MIT Press. Swan, Melanie. 2015. Blockchain: Blueprint for a new economy: " O'Reilly Media, Inc.". Victoria, Karlsson Lundström. 2016. Impact from the blockchain technology on the Nordic capital
market. Wang, X. Q., and I. H. Sloan. 2011. Quasi-Monte Carlo Methods in Financial Engineering: An
Equivalence Principle and Dimension Reduction. Operations Research 59 (1):80-95. Wyman, Oliver. 2016. Blockchain in Capital Markets: The Prize and the Journey. euroclear,
February. Zervas, Georgios, Davide Proserpio, and John Byers. 2016. The rise of the sharing economy:
Estimating the impact of Airbnb on the hotel industry. In Boston U. School of Management Research Paper.
Zhu, Huasheng, and Zach Zhizhong Zhou. 2016. Analysis and outlook of applications of blockchain technology to equity crowdfunding in China. Financial Innovation 2 (1):29.