| Blockchain technology has been extensive concerned and participated by many governments,organizations and individuals from all over the world in just ten years since its appearance in 2008.Because of its excellent decentralization and tamper-proof properties,Digital assets,traceability,authentication,credit reporting and other fields have broad application prospects.As the core algorithm of blockchain technology,the study of consensus algorithms is of great significance for the application of blockchain technology.This paper explores and improves the public blockchain consensus algorithm as the research background.Firstly,it introduces the mainstream consensus algorithm and the corresponding scope of application.Then compares the advantages and disadvantages of various algorithms,and considers PoW from the perspective of security and openness.The algorithm is still the best choice for the consensus algorithm of the public blockchain system.Secondly,as the most recognized public chain consensus algorithm,the PoW algorithm has a long transaction confirmation time,and the transaction has the risk of being falsified when less confirmation numbers are obtained.Aiming at this problem,this paper proposes a method to optimize and improve the original PoW algorithm,and innovatively advances the bifurcation re-consensus process to the first block where the bifurcation occurs,and increases the node to actively judge when the bifurcation is at the same length.The mechanism of the forking difficulty to accelerate the re-consensus of the network forking,thereby increasing the convergence speed of the tampering probability.The improved PoW algorithm will theoretically improve the blockchain network in the following aspects: 1.Reduce the probability of forking,improve user transaction confidence,and make transactions more secure;2.Suppress forking length and reduce the number of confirmations required to ensure transaction security.Improve ease of use.Finally,based on the Bitcoin source code,the optimized algorithm is designed to be coded,and the control experiment is set to test the probability of each forking length of the algorithm before and after the improvement.The experimental results show that the improved algorithm reduces the average probability of each length bifurcation by about 50%,at the same time reduce the cumulative accumulation required to ensure the security of the transaction,reduce the use of the transaction confirmation,and the theoretical analysis results. |