Abstract:Blockchain is the basic technology of bitcoin,which is a decentralized peer-to-peer transaction system.Blockchain consists of distributed storage,peer-to-peer transfer,consensus mechanism and encryption algorithm.The security of blockchain is always the focus of people's attention.Many researches use mathematic methods to analyze the impact of each attack in blockchain,however the types of attacks in blockchain have not been fully identified.Evaluating the security of blockchain by analyzing the impact of each attack separately is incomplete.In this paper,a method is proposed to detect and evaluate the security of each state in blockchain by simulating blockchain's process.This simulation method uses two strategies,attacking algorithm and honest algorithm,to get all states of blockchain including attacking states.When a block contains illusory transactions connecting with more than six blocks,the state of blockchain is regarded as attacking state and others are called honest state.According to simulating process,the probability that honest state becomes attacking state is analyzed.When the probability exceeds a high value,people will get a warning,they can wait a longer time to accept the transactions in order to defend being attacked and improve the security of blockchain.Some experiments are also carried out to measure this method and various forms are used to analyze the results that show the method is correct and feasible.