Introduction

Blockchain technology, introduced by Satoshi Nakamoto in 2008, established a decentralized, transparent, and tamper-resistant framework for recording digital transactions1. Although initially developed for cryptocurrency applications, blockchain has since expanded into diverse domains—including supply chain management, healthcare, and financial services—due to its intrinsic features of trustlessness and distributed control2,3. Its decentralized architecture ensures that no single authority governs the network, thereby enhancing security and resilience against manipulation4. Despite these advantages, scalability remains a central challenge. In major cryptocurrencies such as Bitcoin and Ethereum, every node must validate every transaction, resulting in performance bottlenecks as transaction volume increases5. Several layer-2 solutions, including the Lightning Network and Plasma6,7, attempt to mitigate this load by enabling off-chain execution, but they introduce system complexity and potential security trade-offs. Furthermore, high latency—particularly in Proof-of-Work (PoW) systems—arises from computationally intensive consensus procedures, which also contribute to significant energy consumption and environmental concerns8,9,10,11.

To address these limitations, researchers have increasingly employed metaheuristic optimization methods. Metaheuristic algorithms provide robust global search capabilities, effectively navigating large and non-linear solution spaces while avoiding premature convergence12,13. Classical techniques such as Genetic Algorithms (GA)14, Particle Swarm Optimization (PSO)15, and Ant Colony Optimization (ACO)16 have demonstrated strong performance across various engineering, scheduling, and machine-learning tasks17,18,19,20,21,22,23. GA leverages evolutionary principles, including selection, crossover, and mutation, to iteratively refine candidate solutions iteratively14,23. At the same time, PSO draws inspiration from collective animal behavior, adjusting particle movement based on personal and social experience15,24. More recent advancements include pheromone-driven ACO variants, the parameter-less Jaya algorithm (JA), and the nature-inspired Snake Optimization Algorithm (SOA), each offering distinct advantages in exploration and exploitation balance16,25,26,27. Notably, SOA has shown measurable improvements in blockchain-related optimization tasks, including increased throughput and reduced latency28. The Global Best–Worst Particle Swarm Optimization (GBWPSO) algorithm extends PSO by incorporating both best- and worst-particle influences, enabling stronger convergence dynamics and improved performance in complex environments such as blockchain networks29.

Many studies attempt to enhance metaheuristic behavior by introducing adaptive parameter mechanisms. Shi and Eberhart’s inertia-weight formulation improved the exploration–exploitation trade-off in PSO, while subsequent work introduced dynamically tuned cognitive and social coefficients to guide particle learning30,31. Techniques such as velocity clamping were proposed to maintain swarm stability, preventing divergence and enabling more controlled convergence32. However, despite these advancements, existing optimization-based blockchain solutions suffer from several limitations. Most rely on fixed or linear parameter schedules, which fail to adapt to rapidly changing blockchain workloads. Many optimization approaches operate in static environments and do not account for real-time state changes, leading to suboptimal performance under fluctuating transaction loads. Furthermore, the integration of optimization strategies with dynamic sharding—a key mechanism for enhancing blockchain scalability—remains underexplored. Energy efficiency is typically treated as a secondary objective rather than a core design requirement. These gaps highlight the need for a dynamically self-adjusting optimization framework that can sustain optimal performance under varying network conditions.

Dynamic sharding has emerged as a promising scalability technique in modern blockchain architectures. It partitions the blockchain network into multiple shards, with each shard responsible for processing only a subset of transactions33. Unlike static sharding systems, dynamic sharding allows shards to merge, split, or resize adaptively based on real-time workload conditions34. This adaptiveness enables improved load balancing and reduces the likelihood of bottlenecks. However, dynamic sharding introduces optimization challenges: as the number of shards increases, inter-shard communication, synchronization overhead, cross-shard transaction coordination, and metadata maintenance also grow. Excessive sharding reduces batching efficiency and increases per-transaction consensus overhead, ultimately degrading throughput and latency. Determining the optimal shard configuration, therefore, requires a careful balance between parallelism and coordination overhead35—a task well suited to metaheuristic optimization.

To address these limitations, this study introduces a dynamic sharding framework based on Adaptive Global Best–Worst Particle Swarm Optimization (AGBWPSO). The proposed method enhances GBWPSO by integrating dynamic parameter tuning, allowing the algorithm to adjust its inertia weight, cognitive coefficient, and social coefficient during optimization. This adaptiveness improves particle diversity, accelerates convergence, and enhances robustness under varying blockchain workloads36. The proposed framework targets three key blockchain performance metrics—transaction throughput, latency, and energy consumption—using a simulated blockchain environment for evaluation. In addition, the algorithm is compared with widely used consensus models such as Proof-of-Stake (PoS)37 and Proof-of-Elapsed-Time (PoET)38 to demonstrate its advantage over traditional blockchain performance solutions.

The remainder of this paper is organized as follows. Section “Algorithm used for analysis” provides an overview of the optimization algorithms used in this study. Section “Proposed methodology” details the proposed methodology and the integration of AGBWPSO with dynamic sharding. Section “Experimental setup” presents the experimental setup, including datasets, hardware, and parameter configurations. Section “Results analysis” discusses the results obtained across multiple blockchain scenarios. Section “Discussions” highlights the key insights, implications, and limitations of the proposed approach. Finally, Sect. “Conclusion” concludes the study and outlines prospects for future research.

Algorithm used for analysis

Metaheuristic algorithms are problem-independent optimization techniques that efficiently explore large, complex search spaces. They can produce near-optimal solutions to combinatorial problems while avoiding premature convergence into suboptimal regions of the solution space39. Several well-established metaheuristic methods have been applied across diverse domains and are considered in this study for comparison with the proposed algorithm.

  • Genetic algorithm (GA) Proposed by John Holland in 197014, GA evolves a population of candidate solutions using principles inspired by natural selection, including selection, crossover, and mutation. Its robustness and adaptability make it suitable for solving complex optimization problems with large search spaces40.

  • Particle swarm optimization (PSO) Introduced by Kennedy and Eberhart in 199515, PSO is inspired by the social behavior of flocks of birds and schools of fish. Each particle represents a potential solution, adjusting its position based on personal experience and social interactions. Its simplicity and rapid convergence make PSO a practical choice for continuous optimization tasks41.

  • Ant colony optimization (ACO) Developed by Marco Dorigo in the early 1990s16, ACO models the pheromone-based foraging behavior of ants. Candidate solutions are constructed by probabilistic decisions influenced by virtual pheromone trails, enabling ACO to perform well in discrete and combinatorial optimization settings.

  • Jaya algorithm Proposed by Rao in 201626, the Jaya algorithm is a parameter-less optimization method that iteratively moves solutions toward the best candidate and away from the worst. Its simplicity and effectiveness make it attractive for nonlinear, large-scale optimization tasks.

  • Snake optimization algorithm (SOA) A more recent metaheuristic inspired by snake foraging behavior27, SOA introduces adaptive movement rules that enable it to navigate dynamic, highly nonlinear environments. Recent studies have demonstrated SOA’s ability to enhance blockchain performance by improving throughput and reducing latency28.

  • Global best–worst particle swarm optimization (GBWPSO) GBWPSO extends standard PSO by incorporating both the best and worst particles in the swarm into velocity updates29. This dual influence promotes a better balance between exploration and exploitation, contributing to faster convergence and higher-quality solutions in complex optimization tasks22.

  • Proof-of-stake (PoS) PoS is a consensus mechanism designed to improve blockchain scalability and energy efficiency. Instead of computational competition, validators are selected based on the amount of cryptocurrency they are willing to stake as collateral, significantly reducing energy consumption and improving throughput37.

  • Proof-of-elapsed time (PoET) Developed by Intel, PoET is designed for permissioned blockchains and relies on Trusted Execution Environments (TEEs) to ensure fair and energy-efficient leader election. By replacing computational puzzles with secure, randomized waiting times, PoET drastically lowers the energy footprint of consensus38.

Recent research increasingly focuses on adaptive optimization techniques designed to address blockchain scalability, security, and energy efficiency. Several studies published between 2023 and 2025 have explored adaptive PSO variants for dynamic scheduling, job-shop optimization, and decentralized decision-making, demonstrating improved convergence behavior and robustness under fluctuating workloads. Parallel advances have investigated energy-efficient consensus mechanisms—including PoS and PoET- to reduce computational overhead and improve long-term sustainability in blockchain deployments.

Metaheuristic techniques have also been widely integrated with blockchain systems due to their ability to navigate complex, non-linear search spaces. Bhagat and Maulik42 showed that a blockchain-secured hybrid GA enhances predictive accuracy while maintaining data integrity in medical analytics. Abidallah et al.43 reviewed synergistic interactions between blockchain architectures and genetic algorithms for decentralized optimization. Sana et al.44 introduced a blockchain-enhanced PSO for flexible job-shop scheduling, leveraging distributed transparency to improve search performance. Preethi et al.45 combined swarm optimization, Lyapunov control, and blockchain mechanisms to secure task offloading in smart homes, whereas Paranthaman et al.46 integrated ACO with hybrid blockchain frameworks to support large-scale distributed analytics. Complementary work includes Zhang’s47 application of ACO to smart contract management, Vishwakarma and Yadav’s48 MKD-Net—a blockchain-secured neuro-evolutionary model for medical image classification—and Shelke and Shinde’s49 multi-objective Jaya-based optimization for storage efficiency in blockchain-enabled IoMT systems. More recently, Shimal et al.50 introduced a snake optimization–based strategy to address blockchain scalability limitations, highlighting the potential of nature-inspired methods to reduce congestion and enhance throughput.

Despite these advancements, existing approaches still exhibit several shortcomings. Many methods rely on static or application-specific configurations that do not generalize well across diverse blockchain workloads, and adaptive mechanisms for real-time shard reconfiguration remain largely unexplored. Furthermore, while blockchain sustainability has become increasingly important, energy efficiency is often treated as a secondary performance criterion rather than a core optimization objective. These limitations underscore the need for a generalizable, dynamically adaptable optimization framework. The proposed AGBWPSO-based dynamic sharding approach addresses these challenges by integrating dual-extremum-driven adaptive parameter tuning with real-time shard allocation, enabling simultaneous improvements in scalability, latency, and energy efficiency under highly variable blockchain operating conditions.

Proposed methodology

This study focuses on optimizing transaction processing and resource management to reduce latency and energy consumption, thereby enhancing transaction throughput and improving the efficiency of blockchain networks. Integrating a metaheuristic algorithm involves several steps, as outlined in Algorithm 1.

Algorithm 1
figure a

Integration of metaheuristic algorithm inblockchain.

Standard PSO updates the particle velocity using only its personal best and the global best positions:

GBWPSO extends this by incorporating a repulsion term based on the global worst (gworst) position, but the coefficients remain static:

$${V}_{i}^{PSO}\left(t+1\right)= \omega {V}_{i}\left(t\right)+{c}_{1}{r}_{1}\left({pbest}_{i}- {X}_{i}(t)\right)+{c}_{2}{r}_{2}\left(gbest- {X}_{i}(t)\right)$$

However, GBWPSO uses fixed coefficients and the \(gworst\) term is only a simple repulsive constant, without adaptive weighting, iteration scheduling, or exploration–exploitation balancing.

$${V}_{i}^{GBWPSO}\left(t+1\right)= \omega {V}_{i}\left(t\right)+{c}_{1}{r}_{1}\left({pbest}_{i}- {X}_{i}\right)+{c}_{2}{r}_{2}\left(gbest- {X}_{i}\right)-{c}_{3}{r}_{3}\left(gbest- {X}_{i}\right)$$

The Jaya algorithm does not use velocity, nor does it use “best–worst attraction and repulsion.” Jaya lacks the dynamic exploration–exploitation balance. Its update rule is:

$${X}_{i}^{Jaya}\left(t+1\right)= {X}_{i}\left(t\right)+{r}_{1}\left(best-|{X}_{i}\left(t\right)|\right)-{r}_{2}\left(worst-|{X}_{i}\left(t\right)|\right)$$

Adaptive global best–worst particle swarm optimization (AGBWPSO)

The algorithm is enhanced with dynamic parameter adjustment, adaptive inertia weight, and adaptive cognitive and social coefficients as shown in Fig. 1. These improvements are specifically designed to promote exploration and exploitation, prevent excessive movement with velocity clamping, and ultimately reduce latency, increase transaction throughput, and improve energy efficiency in a blockchain network.

Fig. 1
figure 1

AGBWPSO optimization architecture.

The AGBWPSO framework optimizes blockchain dynamic sharding by adaptively updating shard configurations based on a dual-extremum influence mechanism.

Let each particle \(i\in \{\text{1,2},\dots .,N\}\) represent a potential shard configuration defined by the vector

$${X}_{i}=\left[{s}_{1},{s}_{2},\dots \dots ,{s}_{k}\right],$$

where \({s}_{j}\) denotes the transaction capacity or allocation ratio for the shard \(j\). The corresponding velocity vector is \({V}_{i}=[{v}_{1},{v}_{2},\dots ..{v}_{k}]\)

The optimization aims to minimize the overall network cost function \(f \left({X}_{i}\right),\) expressed as:

$$f \left({X}_{i}\right)= \alpha L\left({X}_{i}\right)+\beta E\left({X}_{i}\right)-\gamma T\left({X}_{i}\right),$$

where:

$$L\left({X}_{i}\right):\text{average\, transaction\, latency\, across\, shards},$$
$$E\left({X}_{i}\right):\text{energy consumption\, per\, transaction},$$

\(T\left({X}_{i}\right):\text{transaction\, throughput},\text{ and }\alpha , \beta ,\gamma\) are weighting coefficients satisfying α + β + γ = 1

Based on the domain considerations, the values of α, β, and γ are used to balance latency, energy, and throughput, respectively, subject to the constraint that α + β + γ = 1.

Let \({X}_{i}\left(t\right)\) and \({V}_{i}\left(t\right)\) denotes the position and velocity of particle \(i\) at iteration \(t.\) The velocity and position updates in AGBWPSO incorporate both attraction toward the global best and repulsion from the global worst solutions as:

$${V}_{i}\left(t+1\right)=\omega \left(t\right){V}_{i}\left(t\right)+{c}_{1}{r}_{1}\left[{P}_{I}\left(t\right)-{X}_{i}\left(t\right)\right]+{c}_{2}{r}_{2}\left[{G}_{best}\left(t\right)-{X}_{i}\left(t\right)\right]-{c}_{3}{r}_{3}\left[{W}_{worst}\left(t\right)-{X}_{i}\left(t\right)\right]$$
$${X}_{i}\left(t+1\right)={X}_{i}\left(t\right)+{V}_{i}\left(t+1\right)$$

where:

  • Adaptive inertia weight

    The inertia weight controls the influence of the previous velocity on the current velocity Eq. 1. A high value of inertia weight makes the algorithm explore. In contrast, a low value of inertia weight encourages exploitation.

$$\omega \left(t\right)={\omega }_{max}-\left(\frac{{\omega }_{max}-{\omega }_{min}}{\text{max}\_itr}\right)*t$$
(1)

where \(\omega \left(t\right)\) is the inertia weight at iteration, \({\omega }_{max}\) and \({\omega }_{min}\) are the maximum and minimum inertia weights, \(\text{max}\_itr\) is the maximum number of iterations.

  • Adaptive cognitive and social coefficients

    Adapt the cognitive (C1) and social (C2) coefficients to balance personal and global best influences dynamically Eq. 2 & Eq. 3.

$${C}_{1}\left(t\right)={C}_{{1}_{max}}-\left(\frac{{C}_{{1}_{max}}-{C}_{{1}_{min}}}{\text{max}\_itr}\right)*t$$
(2)
$${C}_{2}\left(t\right)={C}_{{2}_{max}}-\left(\frac{{C}_{{2}_{max}}-{C}_{{2}_{min}}}{\text{max}\_itr}\right)*t$$
(3)

where \({C}_{{1}_{max}}\) and \({C}_{{1}_{min}}\) are the maximum and minimum cognitive coefficients, and \({C}_{{2}_{max}}\) and \({C}_{{2}_{min}}\) are the maximum and minimum social coefficients.

The third term introduces a repulsive force proportional to the particle’s distance from the worst position. The magnitude of the repulsion increases during early iterations (to promote global exploration) and gradually decreases as the swarm converges, according to:

$${c}_{3}\left(t\right)={c}_{3,max}\left(1-\frac{t}{T}\right)$$

This dual extremum strategy balances exploration and exploitation by dynamically adjusting the attraction toward gbest and the repulsion from gworst. It enables the swarm to search more diverse regions during early iterations and gradually shift toward fine-grained convergence as iterations progress. This mechanism is crucial for handling dynamic blockchain workloads, where optimal shard allocation can shift rapidly as transaction loads fluctuate.

  • Velocity clamping

    Velocity clamping prevents particles from moving too fast and bypassing reasonable solutions Eq. 4.

$${vel}_{i,j}\left(t\right)=clamp ({vel}_{i,j}\left(t\right), {vel}_{min}, {vel}_{max})$$
(4)

where \({vel}_{i,j}\left(t\right)\) is the velocity of the \({i}^{th}\) particle in the \({j}^{th}\) dimension at \(t\) iteration \({vel}_{max}\) and \({vel}_{min}\) are the maximum and minimum allowed velocities.

The proposed AGBWPSO algorithm is specifically applied to optimize the transaction management and block formation process in blockchain networks. More concretely, it targets three key modules:

  1. (i)

    Transaction-to-Shard Allocation, where incoming transactions are assigned to shards based on sender information and transaction type.

  2. (ii)

    Shard Resizing and Load Balancing, where the number of active shards is dynamically adjusted based on network workload.

  3. (iii)

    Block Formation Scheduling, where validated transactions are grouped into blocks and ordered for parallel execution.

By optimizing these modules, AGBWPSO enhances shard utilization efficiency, reduces bottlenecks during high transaction loads, and improves the overall throughput, latency, and energy efficiency of the blockchain system (Fig. 1).

Figure 2 illustrates how the proposed AGBWPSO algorithm’s system-level workflow integrates optimization with blockchain dynamic sharding to improve transaction management. Incoming transactions first undergo Shard Allocation, where they are distributed to available shards based on sender information, transaction type, or workload distribution. Within the Dynamic Sharding module, shard utilization is continuously monitored to detect imbalances or overload conditions. The Monitoring component tracks transaction throughput, latency, and resource consumption across shards. Based on this data, the Decision unit, guided by the AGBWPSO optimization engine, determines whether shards should be expanded, merged, or resized. For example, if a shard reaches its capacity, AGBWPSO may recommend splitting it into two smaller shards; conversely, under low load, shards may be merged to reduce overhead. Once optimal shard configurations are established and validated, transactions are grouped during Block Formation and appended to the blockchain. Through this process, AGBWPSO ensures efficient shard utilization, balanced transaction distribution, and improved performance metrics, including higher throughput, lower latency, and better energy efficiency.

Fig. 2
figure 2

Overview of the proposed AGBWPSO-based dynamic sharding architecture. Illustrates the high-level workflow of the dynamic sharding module integrated with AGBWPSO.

The proposed design specifies integrating the AGBWPSO algorithm with the blockchain’s dynamic sharding process. The goal is to optimize transaction-to-shard allocation, shard resizing, and block formation scheduling in real time. Figure 3 shows the detailed process-flow diagram showing how AGBWPSO updates the shard configuration of the proposed methodology, which is described as follows:

  1. 1.

    Transaction initiation Incoming transactions are signed and submitted to the blockchain network.

  2. 2.

    Validation Each transaction is validated for signatures, integrity, and format.

  3. 3.

    Shard allocation Validated transactions are provisionally grouped into shards based on sender ID or transaction type.

  4. 4.

    Monitoring and feedback The system continuously monitors shard load, transaction arrival rates, and processing delays.

  5. 5.

    Optimization with AGBWPSO

  6. Particles represent potential shard configurations (number of shards, capacity per shard, and allocation mapping).

  7. The fitness function evaluates throughput, latency, and energy efficiency.

  8. AGBWPSO updates shard configurations by applying dual extremum influence and adaptive parameter tuning.

  9. 6.

    Shard adjustment Based on optimization results, shards are dynamically resized, merged, or split to achieve load balance.

  10. 7.

    Block formation Optimally grouped transactions are executed in parallel, block hashes are calculated, and finalized blocks are appended to the blockchain.

Fig. 3
figure 3

Operational workflow of the shard-optimization pipeline using AGBWPSO. Illustrates the sequential processes involved in the proposed optimization cycle, beginning with transaction initiation, validation, and shard allocation.

This expanded design ensures that shard reconfiguration is guided by a continuous optimization loop, allowing the blockchain system to adapt to fluctuating workloads. The integration of AGBWPSO reduces the risk of bottlenecks and underutilized resources while achieving statistically significant improvements in throughput, latency, and energy efficiency.

Each shard processes a subset of transactions, which allows the network to handle more transactions in parallel. Figure 4 illustrates the workflow of AGBWPSO, which utilizes dynamic sharding to enhance the scalability, efficiency, and performance of blockchain networks. The process involves setting up the network topology—nodes, peers, and orderers—to initialize the blockchain network with the necessary configuration settings, ensuring nodes are correctly connected and synchronized. Deploy the smart contracts onto the blockchain network. Initialize the smart contracts with the required parameters to ensure they are operational. Below is an implementation procedure for the proposed algorithm in a simulated environment, and it follows the subsequent steps:

figure b
Fig. 4
figure 4

Detailed flowchart of transaction processing and dynamic shard adjustment using AGBWPSO. The flowchart depicts the complete transaction lifecycle within the proposed system.

Figure 4 detailed flowchart of transaction processing and dynamic shard adjustment using AGBWPSO. The flowchart depicts the complete transaction lifecycle within the proposed system.

The adaptive strategies are particularly crucial in blockchain contexts because transaction arrival rates and shard utilization vary unpredictably. Static parameter settings often fail under such non-stationary loads. AGBWPSO’s dynamic tuning allows the system to continuously adapt exploration–exploitation balance and resource allocation, ensuring efficient performance across fluctuating blockchain environments. The various steps involved in dynamic shard optimization for the AGBWPSO are described in Algorithm 2.

Algorithm 2
figure c

AGBWPSO-based Dynamic ShardOptimization.

The computational complexity of AGBWPSO is O(N*k*max_itr), where N is the swarm size, k is the dimensionality of the shard‑configuration vector, and max_itr is the maximum number of iterations. Since shard reconfiguration is triggered only when shard utilization crosses predefined thresholds, the overhead relative to baseline transaction processing remains low, as discussed in Sect. “Discussions” .


Comparative analysis with existing optimizing algorithms

  • Dual extremum influence mechanism

    Unlike GBWPSO, which uses only the global best and worst particles with fixed influence, AGBWPSO dynamically combines both best and worst positions with adaptive scaling factors, thereby enhancing the exploration–exploitation balance and avoiding premature convergence.

  • Adaptive non-linear parameter adjustment

    Standard PSO and GBWPSO use fixed or linearly varying inertia weights and coefficients. In contrast, AGBWPSO employs a nonlinear adaptive strategy to update the inertia weight, cognitive, and social coefficients based on the progress of iterations and trends in swarm performance, leading to faster and more stable convergence.

  • Integration with dynamic sharding

    Existing PSO variants optimize generic functions, whereas AGBWPSO integrates dynamic sharding for blockchain networks. This allows real-time optimization of shard configuration, enhancing transaction throughput, reducing latency, and improving energy efficiency under varying network loads.

While the dual extremum mechanism may resemble Jaya’s concept of moving towards the best and away from the worst, AGBWPSO is fundamentally different. Jaya applies fixed directional updates, whereas AGBWPSO adaptively scales the influence of both extremums and incorporates nonlinear tuning of inertia, cognitive, and social parameters. Furthermore, its tight integration with dynamic sharding enables real-time shard optimization, a capability absent in Jaya and GBWPSO.

Experimental setup

The experiment’s setting regarding determining the optimality of the blockchain network’s parameters using the AGBWPSO algorithm is explained by deploying the blockchain network, deploying smart contracts, configuring the metaheuristic algorithms, and evaluating different datasets. In all experiments, AGBWPSO was applied at the transaction management layer of the blockchain system, influencing transaction-to-shard allocation, shard resizing decisions, and block formation scheduling. The system simulated cross-shard communication and transaction distribution under controlled workload, while the AGBWPSO optimizer dynamically adjusted shard sizes to balance load. The consensus protocols (PoS and PoET) and blockchain data storage remained unchanged, ensuring that improvements were attributable solely to the optimization of the transaction processing and sharding modules.


Datasets

The proposed AGBWPSO algorithm was experimented on several datasets, as documented in Table 1, to ensure comprehensive evaluation across diverse real-world blockchain scenarios.

Table 1 Datasets.
  • Ethereum public dataset Contains transaction hashes, gas prices, block numbers, and timestamps for over 200 million records (500 GB). This dataset represents public cryptocurrency transactions in a widely used blockchain platform, reflecting high transaction volumes and complex fee structures.

  • Bitcoin transaction dataset Includes transaction IDs, input/output addresses, transaction values, and timestamps (150 million records, 300 GB). It captures the most extensive cryptocurrency network, providing insights into performance under typical Bitcoin transaction loads.

  • Hyperledger fabric benchmark dataset Consists of endorsement policies, block numbers, transaction payloads, and timestamps (100 million records, 200 GB). This dataset represents permissioned enterprise blockchain networks, relevant for supply chain, healthcare, and financial applications.

  • Financial transaction dataset Simulated data containing transaction amounts, sender/receiver addresses, and timestamps (50 million records, 100 GB). Selected to evaluate blockchain use in financial services, ensuring the algorithm’s applicability to secure financial transaction processing.

  • IoT transaction dataset Contains sensor readings, device IDs, timestamps, and transaction statuses (25 million records, 50 GB). This dataset represents blockchain integration with IoT applications, where large numbers of small transactions require scalable processing with low energy consumption.

These datasets were chosen to cover public and private blockchain environments with varying transaction sizes, frequencies, and data types, thereby ensuring that the proposed AGBWPSO algorithm is evaluated under realistic and diverse operational conditions.


Tools and technologies

Figure 5 depicts the test environment for the AGBWPSO experimental setup. The diagram illustrates the test environment for the proposed AGBWPOS optimizing algorithm, integrating an IoT dataset with a blockchain network. The IoT dataset provides information about real-world devices. Data generation incorporates security measures, such as encryption and digital signatures, during preprocessing in Python. Based on the sender information, the smart contract also determines an appropriate shard value during pre-processing. If the shard capacity is insufficient, the AGBWPOS algorithm iteratively checks for the optimal value. The smart contracts handle the shard adjustment in parallel. Finally, the processed transactions are updated in the ledger. Hyperledger Caliper facilitates seamless interaction with the Hyperledger blockchain, while the intermediary layer provides a standardized environment to deploy the application.

Fig. 5
figure 5

Test environment of AGBWPSO.

The hardware configuration for simulating the AGBWPSO algorithm is presented in Table 2.

Table 2 Details of hardware configuration.

The software configuration for simulating the AGBWPSO algorithm is presented in Table 3.

Table 3 Details of software configuration.

Configuration of blockchain network

The Hyperledger Fabric framework is applied to implement enterprise blockchain solutions, as documented in Table 4.

Table 4 Details of network configuration.

Smart contract deployment

Table 5 provides detailed insight into the deployment of smart contracts, which generally form the efficient backbone of a blockchain network. Effective transaction processing and resource management are the core of these contracts.

Table 5 Details of smart contract deployment.

Metaheuristic algorithms’ configurations

The detailed configurations of the metaheuristic algorithms used in the experiment setup to optimize the parameters of the blockchain network are presented in Table 6.

Table 6 Parameter settings for algorithms.

All algorithms used a population size of 50 and a maximum of 100 iterations. PSO, SOA, and GBWPSO employed fixed inertia weights, cognitive, and social coefficients with velocity clamping in the range [-4, 4]. GA, ACO, and Jaya operated with their standard configurations without these specific parameters. The proposed AGBWPSO algorithm utilized adaptive settings for inertia weight (0.9–0.4) and cognitive/social coefficients (0.5–2.5), along with velocity clamping [-4, 4], to enhance optimization performance.

Results analysis

The performance of the proposed AGBWPSO algorithm is evaluated using various blockchain datasets, as tabulated in Table 1, using three main metrics: Throughput, Latency, and Energy Efficiency. These metrics are chosen to provide a comprehensive assessment of the scalability, speed, and energy efficiency of blockchain networks when optimized using the proposed approach. The evaluation of the proposed algorithm is conducted in two phases: one based on transactions and the other based on varying shard values. To evaluate the impact of dynamic sharding, additional experiments were performed by changing the number of shards in the blockchain network. Specifically, shard counts of 4, 8, 16, and 32 were considered to simulate small-, medium-, and large-scale transaction environments. For each configuration, incoming transactions were allocated across shards using the proposed AGBWPSO algorithm and competing baselines. The experiments measured how throughput, latency, and energy efficiency change with varying shard sizes, thereby validating the effectiveness of dynamic shard optimization. The error bars represent ± standard error computed from 50 independent runs.


Transaction throughput

TPS measures the number of transactions processed by the blockchain network per second (units: transactions per second, TPS). A higher TPS indicates better scalability and the network’s ability to handle large transaction volumes efficiently. The proposed algorithm demonstrated higher transaction throughput than many blockchain platforms, as shown in Table 7. On the Ethereum network, the proposed algorithm achieved 2700 TPS, surpassing the 2550 TPS of the GBWPSO and the 2520 TPS of the SOA. The proposed AGBWPSO algorithm achieved 2500 TPS on the Bitcoin network, outperforming GBWPSO (2400 TPS) and SOA (2380 TPS). In the Hyperledger Fabric network, the enhanced algorithm achieved the highest throughput of 2750 TPS, surpassing GBWPSO at 2600 TPS and SOA at 2570 TPS. These values show improvements of 5% to 10% over GBWPSO and are significantly higher than those of traditional algorithms.

Table 7 Transaction throughput.

As demonstrated in Fig. 6, algorithms increase transaction throughput from 4.17% to 5.88%, claiming better scalability and transaction processing power. On the other hand, the transaction throughput gains achieved by the proposed AGBWPSO algorithm are substantial on all tested blockchain networks. The proposed work outperformed the GBWPSO and other metaheuristic algorithms by up to 7%. This increase in TPS can be attributed to the dynamic parameter adjustments’ ability to balance exploration and exploitation, resulting in increased transaction processing efficiency and enhanced network throughput. Transactions per second, enabled by improvements in the proposed AGBWPSO, ensure the network can handle increased loads while remaining robust enough to support large-scale applications.

Fig. 6
figure 6

Comparison of transaction throughput.


Latency

Latency is the time it takes for a transaction to be confirmed and added to the blockchain (units: milliseconds, ms). Lower latency signifies faster transaction processing and improved responsiveness of the blockchain system. Latency measurements confirmed that the proposed AGBWPSO algorithm reduced the time required for transaction confirmation, as shown in Table 8. The time taken by AGBWPOS on the Ethereum network was 120 ms, GBWPSO 140 ms, and the SOA 125 ms. On the Bitcoin network, the proposed algorithm achieved a latency of 130 ms, compared to 150 ms for GBWPSO and 135 ms for SOA. In the Hyperledger Fabric network, the proposed algorithm presented a latency of 115 ms, while the GBWPSO had a latency of 130 ms. In contrast, the SOA had a latency of 120 ms. These values exhibit approximately 15–20% lower latency than GBWPSO and other algorithms, resulting in faster transaction processing times.

Table 8 Latency.

Additionally, as shown in Fig. 7, the proposed algorithm reduces latency by 11.54–14.29%, thereby increasing transaction confirmation speed. This latency reduction proved the algorithm’s efficiency in faster transaction processing, which is essential for real-time applications. Compared to the original GBWPSO, the proposed algorithm achieved a 15% reduction in transaction latency. This reduction is necessary because it demonstrates that an algorithm can quickly converge to optimal solutions, thereby reducing transaction confirmation time.

Fig. 7
figure 7

Comparison of latency.


Energy efficiency

This metric calculates the average energy required to process a single transaction (units: kilowatt-hours per transaction, kWh/tx). It reflects the energy efficiency and sustainability of the blockchain network under different optimization strategies. The proposed algorithm was also able to indicate better energy efficiency as evidenced by a lower consumed energy per transaction, as listed in Table 9; the proposed algorithm was able to consume an estimated 0.15 kWh/tx in the Ethereum network, while the GBWPSO and the SOA consumed an average of 0.18 kWh/tx and 0.17 kWh/tx, respectively. The developed algorithm achieved 0.18 kWh/tx for the Bitcoin network, compared with GBWPSO and SOA at 0.20 kWh/tx and 0.19 kWh/tx, respectively. The improved algorithm achieved 0.12 kWh/tx on the Hyperledger Fabric network, while the GBWPSO and SOA achieved 0.15 kWh/tx and 0.13 kWh/tx, respectively. These values are 10–15% more energy-efficient than those of the GBWPSO and other algorithms, making the blockchain network more sustainable.

Table 9 Energy efficiency.

As shown in Fig. 8, the energy consumed per transaction in the proposed algorithm is 10%-20% lower than that of the GBWPSO. This extent of improvement in energy efficiency shows conclusively that augmentation in the performance of the improved algorithm supports greener blockchain operations in a two-fold manner: optimization of used resources endows more sustainable operations, while the reduction in energy use indirectly impacts costs and ultimately affects the overall greenness of blockchain operations in a friendly upward spiral. The decrease in per-transaction energy consumption in blockchain will not only keep costs low but also help address environmental concerns associated with the massive energy use in these operations. This improvement would be more relevant and vital in today’s context for a better, more sustainable world.

Fig. 8
figure 8

Comparison of energy consumption.


Scalability

To evaluate the system’s ability to handle escalating traffic volumes, experiments were conducted under transaction loads ranging from 5,000 to 45,000 TPS. Figure 9 shows that all algorithms exhibit non-linear, monotonic increases in throughput. AGBWPSO sustains the highest throughput across all loads, achieving up to 31,000 kbps at 45 k load, compared to 28,500 kbps (GBWPSO) and significantly lower values for PoS and PoET. These results validate AGBWPSO’s ability to maintain high performance under increasing network pressure, due to its dynamic parameter scheduling and balanced exploration–exploitation search behavior, which prevent premature convergence under high-load conditions.

Fig. 9
figure 9

Comparison of scalability for varying transaction load.


Dynamic sharding experiments

Figure 10 shows throughput (TPS) as the number of shards increases. The AGBWPSO approach achieves the highest overall throughput, peaking at 16 shards. Figure 11 illustrates latency improvements: AGBWPSO substantially reduces average transaction latency as the number of shards increases (optimal at 16 shards) and maintains low variability, as indicated by the minor standard errors. Figure 12 reports energy consumption per transaction (kWh/tx); AGBWPSO attains the lowest energy use at 16 shards. The AGBWPSO approach achieves the highest overall throughput, peaking at 16 shards; beyond this point, throughput plateaus or slightly degrades due to inter-shard coordination overhead. These results confirm that dynamic shard optimization via AGBWPSO can exploit parallelism up to the point of diminishing returns, and that the proposed method yields statistically significant improvements over baselines.

Fig. 10
figure 10

Comparison of throughput for varying shard values.

Fig. 11
figure 11

Comparison of latency for varying shard values.

Fig. 12
figure 12

Comparison of energy consumption for varying shard values.

Discussions

The use of dynamic parameter tuning and intelligent shard allocation represents a significant advancement in the use of metaheuristics for blockchain optimization. The heterogeneous evaluation ensures that the proposed AGBWPSO framework is robust across diverse blockchain use cases. The performance improvements are vital for future blockchain deployments that require high throughput, low latency, and energy-efficient operation.

The comprehensive experimental evaluation employed datasets from Ethereum, Bitcoin, Hyperledger Fabric, and synthetic financial and IoT transaction datasets. Simulations were executed on high-performance computing clusters and virtualized testbeds to validate the real-time applicability of the proposed Adaptive Global Best–Worst Particle Swarm Optimization (AGBWPSO) algorithm under varying workloads and network conditions. Comparative analyses across all datasets demonstrate that AGBWPSO consistently outperforms established optimization methods, including PSO, GA, ACO, Jaya, SOA, and GBWPSO.

The performance gains are primarily due to dynamic tuning of algorithmic parameters, which improves the balance between exploration and exploitation. By continuously adapting the inertia weight, cognitive coefficient, and social coefficient, AGBWPSO achieves faster convergence toward optimal solutions while maintaining diversity within the search space. This adaptive mechanism ensures stability across heterogeneous blockchain environments, resulting in measurable improvements across all key performance metrics.

The integration of both real-world datasets (Ethereum and Bitcoin) and synthetic datasets (financial and IoT applications) provides a broad validation framework that captures the diversity of blockchain transaction characteristics. The results collectively indicate that the proposed algorithm significantly enhances the scalability, efficiency, and sustainability of blockchain systems. By improving throughput, reducing latency, and lowering energy consumption, AGBWPSO addresses core limitations of current blockchain technologies and contributes to the development of greener, high-performance distributed systems.


Key findings

  1. 1.

    Transaction throughput AGBWPSO achieved up to a 5.88% increase in transaction throughput (TPS) compared to GBWPSO and up to a 10% improvement over baseline PSO and GA algorithms, confirming its superior scalability and parallel-processing efficiency.

  2. 2.

    Latency The algorithm consistently reduced transaction confirmation time by 11.54–14.29% relative to GBWPSO, demonstrating its effectiveness for real-time blockchain and IoT applications where prompt transaction validation is critical.

  3. 3.

    Energy efficiency AGBWPSO achieved a 15–20% reduction in energy consumption per transaction, validating its ability to enable energy-efficient, sustainable blockchain operations, particularly for resource-constrained IoT networks.

  4. 4.

    Consensus and resource utilization The system maintained optimized block sizes that ensured efficient consensus, minimized cross-shard transaction overhead, and balanced resource utilization, achieving an effective trade-off among throughput, latency, and energy consumption.

  5. 5.

    Scalability and shard optimization Throughput increased progressively as the number of shards scaled from 4 to 16, reflecting the benefits of parallel transaction execution. However, a marginal decline was observed at 32 shards, primarily due to increased inter-shard communication, cross-shard transaction frequency, and resource fragmentation, which elevated coordination and consensus overhead. This behavior aligns with established scalability trade-offs in distributed systems, indicating that 16 shards represent an optimal configuration for balanced performance.

Overall, the combination of dynamic parameter adaptation and intelligent shard allocation represents a substantial advancement in applying metaheuristics to blockchain optimization. The heterogeneous experimental setup confirms that AGBWPSO is robust, adaptable, and generalizable across diverse blockchain use cases. The observed improvements in throughput, latency, and energy efficiency highlight the algorithm’s potential for next-generation blockchain deployments requiring high performance, low latency, and sustainable operation.

Conclusion

Blockchain networks offer promising solutions for decentralized, transparent, and secure digital transactions but face persistent challenges related to scalability, latency, and energy efficiency, especially in high-throughput, real-time environments such as finance, IoT, and enterprise systems. This research proposed a novel Adaptive Global Best–Worst Particle Swarm Optimization (AGBWPSO) algorithm integrated with dynamic sharding to address these limitations. Unlike conventional optimization techniques, the AGBWPSO algorithm introduces a dual extremum-influencing mechanism and a nonlinear adaptive parameter-tuning approach for the inertia weight, cognitive, and social coefficients. These enhancements ensure a robust balance between exploration and exploitation, improve convergence stability, and dynamically adapt to real-time transaction loads. The integration with dynamic sharding further enables parallel transaction execution and intelligent resource allocation across shards.

These results validate the applicability of AGBWPSO as a scalable, energy-efficient, and real-time optimization framework for blockchain networks. The proposed method not only enhances the performance of blockchain systems but also contributes to the development of sustainable, responsive distributed ledger technologies. Importantly, the real-world implications of this research are substantial. For instance, the lower latency and higher throughput achieved by AGBWPSO lead to faster, more secure, and more reliable transactions in the financial services sector, thereby enhancing operational efficiency and improving the customer experience. Additionally, the improved energy efficiency and optimized transaction processing for IoT applications make it a sustainable solution, potentially reducing the environmental footprint of blockchain operations.

Future work may extend the proposed algorithm to support heterogeneous blockchain environments, integrate advanced consensus mechanisms, and evaluate performance under adversarial or fault-prone conditions to enhance security and resilience. Mitigation strategies—such as locality-aware transaction routing, larger per-shard batching, hierarchical sharding, or adaptive resource allocation—can push the optimal shard point further but were not explored in the present study and remain future work.