## 2 Preliminaries
### Consensus Problem Statement  
In a distributed system, reaching agreement is a fundamental problem because all nodes decide on a common outcome. The system requires that the nodes exchange information to negotiate with one another and eventually reach a common agreement before taking application-specific actions [30]. A blockchain is a distributed database system, wherein the nodes collectively decide whether to commit or abort a block in which they participate. For reaching consensus, many famous algorithms have been proposed and applied to all kinds of domains, such as the two-phase commit protocol [31], three-phase commit protocol [32], and paxos protocol [33]. Scholars are exploring the application of these algorithms to blockchain systems. The communication of a distributed system will be affected by many factors, for example:  
**Asynchronous communication**: In asynchronous communication mode, the system has no clock, no time synchronization, cannot use the timeout mechanism, cannot detect failures, and messages can be arbitrarily delayed or out of order. **Network connectivity**: The system has full logical connectivity in which each node can communicate with any other node by direct message passing. However, in practical applications, links may stop carrying or drop messages. **Byzantine faults**: The system has malicious behavior such as malicious tampering or attacks. Links in the system may exhibit arbitrary behaviors, which can create and alter messages. It is impossible to reach a consensus in a distributed environment. [PERSON] (FLP) [34] proposed the FLP theorem in 1985. There is no deterministic protocol that solves the consensus problem in a message-passing asynchronous system in which at most one process may fail. In an asynchronous system, a node cannot determine whether a non-faulty node has crashed or is slow. Based on these considerations, we should consider the fault-tolerance performance of the system in practical applications so that it will not affect the normal output of the system and will allow it to properly function. We will consider a distributed database with \(n\) nodes in a system. Each node \(i\) has an input \(x_{i}\). The consensus problem must guarantee the following:  
**Definition 1**. : _Termination. Every non-faulty node eventually decides a value._  
**Definition 2**. : _Agreement. All non-faulty nodes decide on the same value in a distributed system._  
**Definition 3**. : _Validity. The consensus value must be the input of at least one node and the non-faulty nodes must decide on the same value._  
If these three conditions are satisfied [35], the system can work effectively and be applied in practice. Then, we define consensus in a blockchain system. **Definition 4**. : _Consensus mechanism. In an agreement process, the nodes in a blockchain system must agree on an output to decide whether to append the block to the blockchain. Each node starts with an input message, which comes from the client. At the end of the execution of the algorithm, all nodes output the same result. It is a collaborative computing process in which a majority of the network nodes come to agreement on the state of a ledger._  
**Definition 5**. : _Primary-backup. Let \(p\) denote the primary node, which is the initiator of the request. The primary node is responsible for tallying the results of voting by other nodes. R = (r\({}_{1}\), r\({}_{2}\),..., r\({}_{n}\)) is the set of backup nodes, which record the same information from the primary node. Primary and backup nodes run the consensus algorithm together and record the data of the blockchain._  
**Definition 6**. : _Quorum.