## 3 Proposed PBFT Architecture and Model
### Consensus Process of Proposed PBFT
#### 3.3.2 Consensus Stage
Upon receiving the message, a GPN (Group Primary Node) passes it down to another GPN in its lower layer if one exists. If no additional lower-layer GPNs are available, the GPN transitions to the Pre-Prepare phase. The estimated time required for the Request phase is calculated using the formula provided in Equation (2). \[T_{\textit{Request}}=(\frac{N_{\textit{child}}\times S_{\textit{block}}}{BW}+L_ {\textit{intra}})\times N_{\textit{hierarchy}} \tag{2}\]  
Figure 4: An example of consensus process of proposed PBFT. As shown in Equation (2), the equation calculates the time it takes for a message to be sent from a CPN or GPN node to all its child GPN nodes and then multiplies it by the number of layers in the hierarchy that this process needs to happen. This gives an overall estimate of the time required for the Request phase of the consensus process. (3) Pre-Prepare Phase: This phase marks the initiation of PBFT within each group. The GPN first assesses the integrity of the consensus message it receives from the Cluster Primary Node (CPN). This is a crucial step to ensure that the message has not been tampered with and is legitimate. If the consensus message is intact and free from anomalies, the GPN adds its signature to it. This signature acts as a stamp of approval from the GPN, indicating that the message has passed its checks. After signing the consensus message, the GPN broadcasts the consensus message that needs to be agreed upon to all Normal Nodes (NNs) within its group. This broadcasting is a form of communication where the message is sent out to all nodes in each group without explicitly targeting any single node. The equation for estimating the time required for the Pre-Prepare phase is given by Equation (3)  
\[T_{Pre-Prepare}=\frac{(N_{g\_node}-1)\times S_{block}}{BW}+L_{intra} \tag{3}\]  
(4) Prepare Phase: This phase serves as the initial verification step in the main consensus process. Upon receiving the consensus message from the GPN, each Normal Node (NN) validates its contents. This involves checking for any issues with the message itself as well as verifying the signatures of the CPN and GPN. If the message and signatures are valid, the NN adds its own signature and broadcasts Prepare messages to other nodes within its group. However, if the consensus message is incorrectly delivered to nodes that are not receiving the group information properly, in that case, the NN returns the current group information, indicating that a change has occurred. In the Prepare phase, a Normal Node (NN) transitions to the Prepared state when it receives more than \(2f+1\) Prepare messages. This count must be concerning the total number of nodes in the group, denoted by \(N_{g\_node}\), where \(f\) represents the number of malicious nodes in the group. Upon reaching this threshold, the NN proceeds to the subsequent Commit phase. The estimated time required for the Prepare phase is calculated using Equation (4). \[T_{Prepare}=(\frac{(N_{g\_node}-1)\times S_{block}}{BW}+L_{intra})+T_{verify} \tag{4}\]  
(5) Commit Phase: This phase is the second verification step. Nodes within the group that have transitioned to the Prepared state broadcast Commit messages to the members of their respective groups. If the GPN and NNs receive more than \(2f+1\) Commit messages for their group, and the total number of group nodes is \(N_{g\_node}\), they change their state to Committed. They then temporarily reflect the block in their blockchain or ledger. Suppose the unique identification number of the next consensus block differs from the temporarily stored block. In that case, it is considered that the previous block has been successfully integrated into the entire blockchain network. Once the integration of the previous block is confirmed, each node officially incorporates the temporarily stored block into its own blockchain or ledger. The estimated time required for the fifth Commit phase is calculated by Equation (5).