Blockchain technology has played a more and more important role since its birth in 2008.Its decentralized and tamper proof characteristics make it widely used in various fields such as digital finance.As the core component of the blockchain,the consensus mechanism plays an important role in enabling distributed nodes to reach agreement on data without a central mechanism.Its quality directly determines the overall performance of the blockchain.Therefore,the design and optimization of distributed consensus algorithm in blockchain has gradually become a research hotspot.This paper optimizes the consensus mechanism based on the traditional chain block structure and the emerging directed acyclic graph block structure.Different from the existing consensus mechanism,the improved algorithm proposed in this paper can not only achieve node consistency with high efficiency,but also further resist malicious attacks and improve the security,stability and scalability of transaction data.At the same time,a poverty alleviation microfinance system based on blockchain is designed to prove the practicability of distributed consensus mechanism.This article mainly completed the following work:1.Aiming at the problems of network bifurcation and double payment that are easy to occur in the chain consensus mechanism,a hybrid consensus algorithm hqdpos based on the principal right proof mechanism dpos and the practical Byzantine fault-tolerant mechanism pbft is proposed,which makes up for the security loopholes of the chain structure,so that all honest nodes in the network can resist the DDo S attacks initiated by attackers and maintain good operation efficiency.The experiment designs a variety of scenarios,compares the block generation of four consensus algorithms under DDo S attack,and verifies the effectiveness of the proposed hybrid consensus mechanism.2.Aiming at the common scalability bottleneck of chain structure,a distributed consensus mechanism hqiota based on directed acyclic graph(DAG)structure is proposed,which not only improves the throughput and scalability limited by chain structure,but also improves the lack of global state in asynchronous communication of directed acyclic graph.In the experiment,four probability distributions are used to simulate the network state,and the uncertainty of node network communication in the real situation is fully considered.The simulation compares the security,throughput and system confirmation time of various consensus mechanisms to verify the effectiveness and robustness of the algorithm.3.The poverty alleviation microfinance system based on the above distributed consensus algorithm is further studied.Poverty alleviation microfinance,as an important measure of targeted poverty alleviation in China,used to adopt centralized management.This paper combines the blockchain with the poverty alleviation microfinance system,which has the characteristics of decentralization,openness,transparency and traceability.Through the detailed design of the system level and functional modules,this paper verifies the good practicability of the distributed consensus algorithm in the practical application field. |