The December 2022 issue of IEEE Spectrum is here!

Close bar

Open-Source Tool Lets Anyone Experiment With Cryptocurrency Blockchains

SimBlock, a new blockchain simulator, lets users play around with the parameters of Bitcoin, Litecoin, and Dogecoin

3 min read
Abstract image of a tech network.
Illustration: iStock

Blockchain technology records information to a ledger shared between thousands of nodes. In the technology’s purest form, those nodes are not controlled by any central authority, and information cannot be changed once written to the ledger. Because of the security and autonomy this technology offers (in theory at least), blockchains now underpin many popular cryptocurrencies such as Bitcoin

But as Kazuyuki Shudo, an associate professor at the Tokyo Institute of Technology, points out, "It has been nearly impossible to test improvements on real-world blockchain networks, because that would mean having to update the software of all the thousands of nodes on a network."

In researching blockchains, Shudo and his colleagues searched for a simulator that would help them experiment with and improve the technology. But existing simulators were too hard to use and lacked the features the team wanted. Moreover, these simulators had apparently been created for specific research and were abandoned soon after that work was completed, because many of the tools the group found were no longer being updated. 

"The most recent simulator we looked at was developed in October 2016," says Shudo. "And it was no longer being maintained."

So, the group developed its own simulator. Dubbed SimBlock, it runs on any personal computer supporting Java and enables users to easily change the behavior of blockchain nodes. Consequently, investigating the effects of changed node-behavior has now become a straightforward matter, says Shudo.

"All the parameters of the nodes in SimBlock are written in Java," he explains. "These source files are separated from the main SimBlock Java source code, so the user simply edits [the nodes'] source code to change their behavior." 

Changes may be applied to all nodes at once, or to an individual node or group of nodes. 

SimBlock can simulate the parameters of Bitcoin, Litecoin, and Dogecoin. It mirrors a blockchain's network size, block-generation interval, and Internet communication speeds, taking into account bandwidth and latency between six regions: North America, South America, Europe, Australia, Asia Pacific, and Japan. It also lets users modify simulated communication speed parameters as well as the parameters of the blockchain nodes.  

To help users understand how a network behaves after different modifications, the group has created a visualization tool that shows communication between nodes, as well as the length of a blockchain. This is presented as an animated simulation of the network running on a world map.

Image of the simulation network on a map. SimBlock’s data visualization tool shows how nodes behave in a network as users make changes to the network’s parameters.Illustration: SimBlock

The visualizer reads out a simulation log of a given network generated by SimBlock, and its contents are overlaid across the world map. The visualizer then runs an animation depicting the behavior of the nodes, which are color-coded to show transactional changes. As a new block is generated, the block is assigned a new color. The colors of the nodes first seen in the animation are the same as those of the last block that the nodes received. When a different node receives the new block, that node is recolored to match the color of the new block.

To compare an original network directly with a network in which the parameters have been changed, the user can open two windows and run two simulations simultaneously. By comparing the changes, the user can see, for instance, which network is more efficient for block propagation, and how changes affect propagation in each region of the map.

The team behind SimBlock plans to add support for other cryptocurrencies such as Ethereum, update the tool’s simulated Internet communication speed, and add support for newer communication protocols like Compact Block Relay, which provides a more realistic simulation of Bitcoin. 

The researchers are also using SimBlock to test the security of distributed networks by conducting malicious attacks against them within the tool and gauging their success rates.

"Though we developed SimBlock for our own research," says Shudo, "we decided to make it publicly available as open source so that other researchers can use it and so help accelerate blockchain research.”

Download SimBlock here.

Download SimBlock visualizer here.

Documentation in English and Japanese is available here.

The Conversation (0)

Why Functional Programming Should Be the Future of Software Development

It’s hard to learn, but your code will produce fewer nasty surprises

11 min read
Vertical
A plate of spaghetti made from code
Shira Inbar
DarkBlue1

You’d expectthe longest and most costly phase in the lifecycle of a software product to be the initial development of the system, when all those great features are first imagined and then created. In fact, the hardest part comes later, during the maintenance phase. That’s when programmers pay the price for the shortcuts they took during development.

So why did they take shortcuts? Maybe they didn’t realize that they were cutting any corners. Only when their code was deployed and exercised by a lot of users did its hidden flaws come to light. And maybe the developers were rushed. Time-to-market pressures would almost guarantee that their software will contain more bugs than it would otherwise.

Keep Reading ↓Show less
{"imageShortcodeIds":["31996907"]}