AIResearch AIResearch
Back to articles
Network

AI Predicts Blockchain Traffic to Boost Speed and Security

A new AI method forecasts blockchain congestion before it happens, allowing shards to rebalance dynamically—improving transaction speed by up to 2x while keeping data secure from attacks.

AI Research
March 26, 2026
4 min read
AI Predicts Blockchain Traffic to Boost Speed and Security

Blockchain networks like Bitcoin and Ethereum face a critical bottleneck: they process only a handful of transactions per second, far below centralized systems like Visa. This limitation stems from every node validating every transaction, ensuring security but sacrificing speed. Sharding, which splits the blockchain into parallel partitions called shards, offers a solution by distributing transactions across multiple shards for simultaneous processing. However, traditional sharding s often fail in practice because they rely on static or random assignments, leading to uneven workloads where some shards become congested while others sit idle. This imbalance, combined with costly cross-shard communication, can reduce throughput by over 30%, undermining the scalability benefits sharding promises. To address this, researchers have developed the Predictive Shard Allocation Protocol (PSAP), an AI-driven framework that proactively manages shard loads to maintain balance and efficiency.

The core of PSAP is its ability to predict future transaction loads and dynamically reallocate accounts before congestion occurs. Unlike reactive approaches that adjust only after shards become overloaded, PSAP uses a Temporal Workload Forecasting (TWF) model to forecast shard workloads up to 32 blocks ahead, equivalent to 30–60 seconds for typical block intervals. This forecasting is integrated with a safety-constrained reinforcement learning controller called Safe-PPO, which decides which accounts to migrate between shards based on these predictions. The protocol enforces strict safety constraints, such as limiting Byzantine stake to below one-third per shard and capping migration gas at 2% of block capacity, ensuring security and preventing attacks. Experimental show that PSAP achieves up to a 2× improvement in throughput, a 35% reduction in latency, and a 20% decrease in cross-shard overhead compared to existing dynamic sharding s, demonstrating that predictive, intelligent allocation can significantly enhance blockchain scalability.

To implement this predictive capability, the researchers built PSAP with a multi-layered architecture that combines machine learning with blockchain consensus mechanisms. The system operates in a per-block control loop where each validator logs metrics like transaction counts and gas usage, then gossips compact summaries across the network. A lightweight LSTM-based forecaster processes a sliding window of these metrics to generate multi-step load predictions, adding about 28 milliseconds of inference overhead. The Safe-PPO reinforcement learning agent takes these forecasts, along with current load and stake data, to propose migration actions—moving accounts between shards to optimize balance. Before execution, a safety gate checks each proposal against constraints like stake concentration and gas limits, pruning any unsafe moves. Migrations are then committed atomically through a dual-inclusion scheme, where batches are verified and applied across shards without extra consensus rounds, ensuring consistency and liveness even under network delays or failures.

From evaluating PSAP on heterogeneous datasets, including Ethereum, NEAR, and Hyperledger Fabric traces, highlight its effectiveness. In throughput tests, PSAP sustained higher transaction rates than static or dynamic baselines, peaking at 9,870 transactions per second—62% above static hashing and 28% above the best dynamic scheme—while keeping 95th-percentile latency below 0.9 seconds until 0.85 utilization. Load balance improved significantly, with 96% of blocks maintaining shard utilization below 0.75 and mean imbalance reduced by 58–71% compared to alternatives. Cross-shard gas overhead dropped to 6.2%, a 42% reduction, due to proactive clustering of interactive accounts. Under adversarial stress tests, such as a 35% hot-spot attack where transactions are diverted to a single shard, PSAP restored balance within 400 blocks, 62% faster than reactive baselines, and consistently enforced safety limits like the one-third Byzantine stake cap, preventing takeover attempts.

Of PSAP extend beyond technical performance to broader real-world applications. By enabling blockchains to handle higher transaction volumes with lower latency, PSAP could support scalable decentralized applications in finance, supply chain, and IoT, where speed and security are paramount. Its predictive approach reduces the need for costly reactive rebalancing, making blockchain operations more efficient and cost-effective. The integration of AI with deterministic execution through the Deterministic Machine Learning Execution Layer (DMEL) ensures that inferences are reproducible across validators, bridging a gap between intelligent control and decentralized trust. This paves the way for autonomous, self-adaptive blockchain infrastructures that can dynamically respond to changing demands while maintaining robust security against adversarial attacks, potentially accelerating adoption in enterprise and public platforms.

Despite its advancements, PSAP has limitations that warrant further research. The forecasting model, while accurate with a mean absolute percentage error below 7%, relies on historical data and may struggle with entirely novel attack patterns or extreme workload shifts not seen in training. The safety constraints, though effective, introduce some overhead, with migration batches consuming up to 1.9% of block gas and adding about 50 milliseconds per block in computational latency. Scaling to very high shard counts, such as 64 shards, showed a slight efficiency drop of 7.5% due to cross-shard message congestion, indicating that near-linear scalability has practical bounds. Additionally, the protocol assumes a partially synchronous network with bounded delays, and its resilience under fully asynchronous conditions or more sophisticated adaptive adversaries remains to be fully explored. Future work could focus on integrating multi-agent reinforcement learning, federated inference, and quantum-secure randomness to enhance robustness and adaptability in diverse environments.

Original Source

Read the complete research paper

View on arXiv

About the Author

Guilherme A.

Guilherme A.

Former dentist (MD) from Brazil, 41 years old, husband, and AI enthusiast. In 2020, he transitioned from a decade-long career in dentistry to pursue his passion for technology, entrepreneurship, and helping others grow.

Connect on LinkedIn