## 3 Improved RE-BPFT Blockchain Consensus Algorithm  
### Node Credit Calculation  
The node credit evaluation metrics designed in this paper are divided into three categories: direct credit value, indirect credit value, and historical credit value. The direct credit value is related to the node's voting behavior and consensus completion status; the indirect credit value is related to the node's status in various groups and its credit ranking; while the historical credit value is related to the node's accumulated credit value. **Definition 1**. : _Consensus credit \(C_{\text{conf}}\). Used to evaluate the degree of consensus completion by a node. The consensus credit \(i\) of node \(C_{\text{conf}_{i}}\) is calculated by the following formula:_  
\[C_{\text{conf}_{i}}=\frac{Num_{c_{i}}}{TNum_{c_{i}}+\epsilon} \tag{3}\]  
_Here, \(Num_{c_{i}}\) denotes how many times node \(i\) has successfully reached consensus, while \(TNum_{c_{i}}\) represents the total consensus rounds in which node \(i\) participated. The parameter \(\epsilon\) Varepsilon \(\epsilon\) is introduced as an infinitesimally small positive value to avoid division by zero. The capability of nodes to successfully achieve consensus serves as the primary criterion for evaluating node reliability. Consequently, successful consensus participation significantly affects the node's credibility assessment, being assigned the greatest importance among evaluation metrics. Simply put, nodes gain higher credibility scores as they achieve consensus successfully more frequently. This mechanism allows nodes within the master node group to sustain their positions over extended periods while simultaneously motivating nodes in the consensus group to enhance their performance and seek advancement to the master node group, thus enabling their participation in subsequent master node elections._  
**Definition 2**. : _Voting credit \(C_{\text{conf}}\). This metric evaluates how effectively a node completes voting tasks. The voting credit \(C_{\text{conf}_{i}}\) for node \(i\) is computed using the formula below:_  
\[C_{\text{vot}_{i}}=\frac{Num_{c_{i}}}{TNum_{c_{i}}+\epsilon} \tag{4}\]  
_Here, \(Num_{c_{i}}\) indicates the count of successful voting completions by node \(i\), while \(TNum_{c_{i}}\) represents the total voting rounds node \(i\) participated in. Notably, a higher number of successful voting completions results in a greater voting credit score. Such a credit mechanism effectively motivates nodes in the consensus group to proactively engage in voting, thereby boosting their credibility and creating opportunities to advance into the master node group. Similarly, observer nodes can also leverage active participation in voting processes to join the consensus group, gaining enhanced privileges within the network._  
**Definition 3**. : _Direct credit value \(C_{\text{dir}}\). This metric assesses the behavioral performance of a node during the consensus activities. Specifically, the primary actions influencing this evaluation are the node's participation in achieving consensus and engaging in voting procedures. Thus, the direct credit value of a node is obtained by calculating a weighted combination of its consensus credit and voting credit scores. The direct credit value \(C_{\text{dir}_{i}}\) for node \(i\) is formulated as follows:_  
\[C_{\text{dir}_{i}}=\lambda\times C_{\text{conf}_{i}}+\mu\times C_{\text{vot}_{i}} \tag{5}\]_where \(\lambda\) is the weight of consensus credit, \(\mu\) is the weight of voting credit, which should be flexibly set according to system policies. These two weights satisfy \(\lambda+\mu=1\)._  
**Definition 4**. : _Activity credit \(C_{\text{act}}\). Used to calculate the activity level of node \(i\) during the consensus process, assigning higher weights to recently participated behaviors. It combines the node's performance across different rounds with a time decay factor through weighted averaging to compute the node's activity credit.