## 1 Introduction
Group-based PBFT divides nodes into multiple groups, conducting PBFT within each group or forming a consensus group where a subset of the total nodes act as representatives to perform PBFT [14]. Trust score-based PBFT calculates the trust scores of each node and utilizes a method where nodes with high trust scores participate in the consensus as representatives, or consensus groups are formed based on trust scores when organizing groups [15; 16]. Multi-layered PBFT divides the nodes participating in the blockchain into groups and forms a hierarchical structure for each group when conducting a consensus based on PBFT [13; 17]. This approach facilitates faster consensus. Additionally, a method where nodes from a specific layer act as representatives to conduct the consensus can also be applied [17]. In previous research, when using the PBFT consensus algorithm, the approach often involved limiting the number of participating nodes to enhance consensus performance. However, this method can reduce the reliability of the consensus results, as it decreases the number of nodes verifying the block or the consensus message. Additionally, there should be more consideration for communication delays, such as the propagation delay time between participating nodes. The communication delay between nodes is a critical factor in PBFT-based consensus, particularly as the number of communication messages increases dramatically with the increasing number of participating nodes [18; 16]. This can lead to performance degradation, especially in scenarios where grouped nodes are significantly distant from each other compared to those that are closer. Therefore, in PBFT-based blockchain consensus processes, research is needed on methods that ensure the participation of all nodes while minimizing communication delays when forming groups based on a hierarchical structure. Additionally, as the optimal hierarchical structure can vary depending on a blockchain network environment, such as the number of nodes participating in the blockchain, it is necessary to adjust the hierarchical structure dynamically. This paper proposes an enhanced PBFT method via dynamic hierarchy management and location-based clustering to improve group-based PBFTs. In the proposed PBFT method, each node participating in the blockchain network is clustered based on their location, and groups are created for each cluster. Additionally, each cluster's group is structured in a hierarchy, and consensus is carried out based on PBFT. Therefore, as nodes in close proximity are organized into clusters and groups, the communication delay time for sending and receiving consensus messages between each node can be minimized [19]. For this purpose, we propose algorithms for clustering all nodes and dynamic hierarchy management. Our method dynamically constructs a hierarchy structure by calculating an expected consensus time for each cluster to provide optimal performance in terms of consensus time. The proposed method addresses latency issues by implementing a strategy of clustering nodes based on their location information, resulting in enhanced performance in consensus time. This improvement is attributed to adapting an optimal hierarchy structure tailored according to the number of nodes participating within each cluster. To validate the efficacy of the proposed scheme, a simulation study was conducted comparing the proposed PBFT scheme with the conventional PBFT and Dynamic Layer Management PBFT (DLM-PBFT) [20]. This study's findings revealed a significant performance enhancement; specifically, there was a minimum improvement of approximately 107% with a network of 160 nodes and a maximum improvement of about 128% when the network comprised 300 nodes in terms of the consensus processing time. When compared to DLM-PBFT, the proposed scheme exhibited its minimal performance improvement with 120 nodes, showing an improvement rate of approximately 90% in terms of the consensus processing time.