Skip to content
Crypto.world

Research

iblock: Accurate and Scalable Bitcoin Simulations with OMNeT++

Researchers who want to study how Bitcoin behaves under different transaction loads, network delays or mining strategies cannot experiment on the live network, so they build simulators.

iblock: Accurate and Scalable Bitcoin Simulations with OMNeT++
arXiv
2512.20402
Published
2025-12-23
Authors
Niccolò Scatena, Pericle Perazzo, Giovanni Nardini

AI summary

Overview

Research area: Blockchain simulation and performance modelling — specifically discrete-event simulation of the Bitcoin protocol (consensus, incentives, transaction data, and peer-to-peer propagation).

Technical level: Intermediate. Readers need a working understanding of Bitcoin's proof-of-work consensus, mempools and UTXOs, plus familiarity with discrete-event simulation concepts, but the paper is a systems/tooling contribution rather than a heavy mathematical one.

Scope (one sentence): The paper presents iblock, a C++23 library and simulation model for OMNeT++ that reproduces Bitcoin's data, consensus, incentive and network layers, and demonstrates that it is both faithful to theory and far faster and lighter than the Python-based BlockSim simulator.

What This Paper Is About

Researchers who want to study how Bitcoin behaves under different transaction loads, network delays or mining strategies cannot experiment on the live network, so they build simulators. Existing simulators are written in high-level languages (Python, Java, Scala) and skip important details such as variable transaction fees, variable transaction and block sizes, UTXOs, and automatic difficulty adjustment, which makes detailed large-scale studies slow or impossible. The paper's goal is to provide a Bitcoin simulator written in C++ on top of the general-purpose OMNeT++ framework that keeps much more of Bitcoin's real behaviour while remaining efficient enough to scale, and then to prove both its accuracy and its speed.

Key Contributions

  1. A new simulator, iblock, released as a C++23 library and simulation model for OMNeT++ (compatible with OMNeT++ version 6.x), with source code publicly available on GitHub at https://github.com/SpeedJack/iblock.
  2. A modular node architecture built from simple modules ("applications") that inherit from an AppBase class. Every node must contain BlockchainManager and MempoolManager (making it a full node), while Wallet, Miner and TransactionGenerator are optional; three global modules — the Global Blockchain Manager (GBM), WalletManager and NodeManager — handle the genesis block and memory pruning, address lookup, and node lookup respectively. This lets users assemble nodes with different capabilities without changing the simulator's code.
  3. A feature set that covers ground earlier simulators miss. Table 1 compares iblock against the Bitcoin privacy simulator, Bitcoin-Simulator, both BlockSim variants, VIBES and SimBlock across variable transaction fee, variable transaction size, UTXOs, variable block size, variable block interval, difficulty adjustment and scalability; only iblock is marked as supporting all seven.
  4. A quantitative performance comparison against BlockSim (Alharby et al.), plus validation of iblock against analytical theory for both normal Bitcoin operation and the selfish mine attack.

Main Findings

  • Mining rewards match theory in normal operation. In a 62-node network (50 non-miner nodes generating a transaction every 20 seconds on average, 10 miners with hash rates of 0.1%, 0.4%, 0.5%, 1%, 3%, 5%, 10%, 15%, 25% and 40%, one non-miner generating one transaction every 5 minutes and one every second), producing slightly over 4 transactions per second, all 95% confidence intervals over 30 runs included the analytically expected number of blocks per miner.
  • Total block count is close to the protocol target. Over 3 simulated days the simulation produced 425.57 blocks on average, against an expected 432 based on the protocol's average of six blocks per hour.
  • Selfish mining success grows over-linearly with hash rate. Mean numbers of successful attacks over 20 repetitions of 2 simulated days were 3.35 at a 10% relative hash rate (8.888 TH/s), 9.80 at 20% (20 TH/s), 14.55 at 30% (34.286 TH/s) and 15.30 at 40% (53.333 TH/s).
  • The selfish-mining profitability threshold appears at about 33%. Below a 33% hash rate the selfish miner's reward line stays below both the honest-miner line and the theoretical identity line; above it, selfish earnings exceed honest ones. The authors state this agrees with Eyal and Sirer's results for a propagation factor γ = 0.
  • Honest mining is simulated correctly. The confidence intervals for the honest miner's reward always overlap the theoretical identity line, which the authors treat as further validation of the implementation.
  • Execution time can fall as node count rises (at fixed global transaction rate). Going from 10 to 50 nodes with a constant 3 transactions per second and miners at 20% of nodes, execution time decreased because the same UTXO set is spread over more nodes, so each node scans fewer transactions when searching for funds; memory usage increased, since every node keeps its own mempool.
  • Higher transaction rates cost both time and memory. With 30 nodes and 6 miners, execution time and memory both rose with transaction rate, because of the larger number of transactions processed and the larger mempool and UTXO set per node.
  • Scaling nodes and transaction rate together increases both metrics, as shown with a per-node generation rate of one transaction every 12 seconds.
  • iblock is dramatically faster and lighter than BlockSim. In a 30-node scenario with 10 miners and 3 transactions per second globally, iblock simulated 1 hour in 1 s, 2 h in 2 s, 3 h in 4 s, 4 h in 5 s, 5 h in 7 s and 6 h in 10 s, while BlockSim took 7m 16s, 28m 8s, 1h 55m 13s, 3h 13m 56s, 6h 30m 46s and 7h 16m 59s respectively. BlockSim's execution time even exceeded the simulated time in the 5-hour and 6-hour cases.
  • BlockSim could not be pushed further. A BlockSim process simulating a 12-hour scenario was terminated by the operating system after exceeding 30 GB of virtual memory, which is why the comparison was capped at six hours of simulated time.

Methodology in Plain English

The authors built Bitcoin's moving parts as software modules inside OMNeT++, a general-purpose discrete-event simulator that already supplies event queues, schedulers and random number generators, so they could concentrate on Bitcoin logic. Each simulated node is assembled from interchangeable applications: one keeps the node's own view of the blockchain (handling forks, reorganisations, orphan blocks and the 2016-block difficulty recalculation), one keeps its mempool ordered by fee rate, and optional ones hold the node's UTXOs, mine blocks, or generate transactions. Instead of modelling every gossip message hop by hop, a new block or transaction is sent as a single message that arrives at each destination with a different random delay, which reproduces gossip-like propagation at much lower computational cost. Memory is shared: the Global Blockchain Manager holds one copy of each distinct block and nodes keep only pointers to branch heads. To check correctness, the authors ran scenarios whose answers are known analytically — ordinary operation with ten miners of specified hash rates, and a selfish-mining attack where one node secretly withholds blocks — and compared simulated rewards against predicted ones. To check performance, they varied node count and transaction rate one at a time and then together, and finally ran the same scenario in BlockSim's full mode on identical hardware.

Why This Matters

Impact on research. Bitcoin research often rests on simulation results whose credibility depends on how much of the protocol the simulator actually models. iblock removes the trade-off the authors identify in prior tools — either high realism at high cost (Shadow-Bitcoin, which runs the reference implementation) or speed at the price of missing fees, UTXOs and difficulty adjustment. Because it sits inside OMNeT++, it can also be composed with existing libraries such as INET (TCP/IP), Simu5G (4G/5G) and Artery (vehicular networks), enabling studies that mix Bitcoin behaviour with realistic networking.

Real-world applications:

  • Stress-testing protocol parameters (block size, block interval, difficulty adjustment) before proposing changes to the network.
  • Evaluating the profitability and detection of mining attacks such as selfish mining at different hash-rate shares.
  • Studying mempool and fee dynamics under realistic transaction volumes and propagation delays.
  • Assessing Bitcoin or blockchain designs layered on cellular, vehicular or general IP infrastructure by composing iblock with other OMNeT++ models.

Industry relevance. Mining pools, exchanges and node operators care about confirmation latency and orphan rates; protocol developers and auditors care about incentive compatibility. A simulator that runs six simulated hours in ten seconds makes large parameter sweeps and multi-seed studies practical on ordinary hardware, where BlockSim needed over seven hours of wall-clock time for the same six hours of simulated time.

Future Directions

  • Integrating BSELA's event-management ideas. The authors note that BSELA by Cui and Hu uses a mix of queues and min-heaps to hold intra- and inter-block events, and suggest that such an optimisation is orthogonal to theirs and could be integrated into OMNeT++ as future work.
  • Exploiting OMNeT++ library composition. The paper repeatedly points to integration with INET, Simu5G and Artery as a route to highly detailed scenarios; concrete studies combining Bitcoin with realistic network stacks are left open.
  • Extending the model via the modular architecture. New node behaviours are added by writing new applications, as the selfish-mining study did by substituting SelfishBCManager for BlockchainManager; the range of attacks and protocol variants worth implementing is not enumerated.
  • Scaling the evaluation further. The scalability study covers 10 to 50 nodes and the BlockSim comparison is capped at 6 simulated hours because of BlockSim's memory use; the paper does not report how iblock behaves at substantially larger network sizes or over longer runs.

Target Audience

Blockchain and distributed-systems researchers who need a credible, fast Bitcoin testbed; PhD students and engineers building simulation models in OMNeT++ who want a ready-made Bitcoin layer; and protocol analysts studying mining incentives, mempool dynamics or block propagation, who will find the selfish-mining validation and the BlockSim benchmark most directly useful. Readers without prior exposure to proof-of-work terminology will need the background section first.

Authors’ abstract

This paper proposes iblock, a comprehensive C++ library for Bitcoin simulation, designed for OMNeT++. iblock offers superior efficiency and scalability with respect to state-of-the-art simulators, which are typically written in high-level languages. Moreover, the possible integration with other OMNeT++ libraries allows highly detailed simulations. We measure iblock's performance against a state-of-the-art blockchain simulator, proving that it is more efficient at the same…

The full abstract on arXiv
Read the original paper