# Hybrid Consensus Algorithm Based on Modified Proof-of-Probability and DPoS
## 1 Introduction  
As a distributed shared ledger and database [1], blockchain has the characteristics of openness, transparency, decentralization, and anti-tampering. With the above characteristics, blockchain is widely used in the field of finance and the Internet of Things. Among them, a rising number of blockchain-based technical implementations for smart city (e.g., references [2; 3; 4]) have been proposed. The above application scheme makes full use of the decentralization of blockchain. Decentralization is realized by consensus algorithms [5], the most representative of which [6] are PoW [7], PoS [8], and DPoS [9]. PoW ensures the safety and fairness of the system through computing power competition among nodes, but it also causes a lot of unnecessary computing power and electric power waste. In addition,with the expansion of large mines and mining pools, it is difficult for individual users to obtain benefits, which obviously violates the original intention of blockchain. In contrast, PoS does not completely rely on computing power to compete for the right to keep accounts. The difficulty of node mining and the probability of success are determined by the coin age, which effectively avoids the waste of resources and increases the cost of attacking the whole system, because the node needs to have more than 51% of tokens to carry out effective attacks. However, it also makes the system less reliable and fair. On the one hand, nodes with more tokens tend to obtain more revenue and bring more revenue in the future, which leads to a monopoly situation in PoS similar to that in PoW. On the other hand, because PoS does not completely rely on computing power to compete for bookkeeping rights, it does not consume any additional resources for the node to try to fork the blockchain, while other nodes will try to mine on all forks without any loss in pursuit of profit maximization. As a result, PoS is prone to fork. DPoS, on the other hand, continuously selects a few nodes to replace most nodes to produce blocks, which improves the production efficiency of blocks, reduces the maintenance cost of the network, and enables common nodes to have a greater opportunity to gain benefits. However, it also sacrifices some decentralization. The PoP [10] consensus algorithm weakens the advantage of nodes with high computing power in probability by introducing false hash and waiting time mechanism, but its definition of true hash is not rigorous enough, which leads to the fact that the final selection result of true hash may not be unique, resulting in the risk of the system being forked. As can be seen from the above, a single mainstream consensus algorithm is often difficult to fully satisfy the needs of real-world scenarios (e.g., security, decentralization, and efficiency). Therefore, we hope to design a consensus algorithm to make it have the advantages of the mainstream consensus algorithms and make up for their shortcomings as much as possible. This paper proposes a hybrid consensus algorithm based on the modified PoP consensus algorithm and DPoS consensus algorithm to make up for the shortcomings of single consensus algorithms. In this algorithm, the work of block generation and verification is given to the nodes adopting the modified PoP consensus algorithm and DPoS consensus algorithm, respectively. As a result, malicious nodes must have more than 51% computing power and more than 51% tokens in the system to control the whole system and carry out effective attacks. This significantly increases the cost of malicious attacks. Among them, the modified PoP algorithm allocates the true hash and many false hashes together to the blockchain network when a transaction occurs. Each node has a different hash sorting algorithm, so the decryption order is different. Every time a node decrypts a hash, the modulo operation is done to its nonce value and is compared with the expected value given in advance by the supernode in the DPoS nodes to preliminarily verify the validity of the block.