shadow / shadow-plugin-bitcoin

A Shadow plug-in that runs the Bitcoin Satoshi reference software

Home Page:https://shadow.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simulate block creation?

haasn opened this issue · comments

Looking at the example, it seems to be that it simulates a sort of static network, which, as far as I can tell, does nothing except connecting and then sending a few pings every now and then.

How exactly am I supposed to use shadow to simulate a dynamic network involving miners, transactions and block generation? What is shadow-plugin-bitcoin actually supposed to be measuring?

Hi Niklas,
We've used shadow to simulate transaction propagation times, and to confirm the presence of some DoS attacks (since patched). It would also be good for simulating the effects of a modified protocol on propagation time. It could easily be used to support transaction generation, block generation, and dynamic topology, but there aren't any prepared examples yet of how to do that.
I'd turn it around and phrase it differently... What do you want to measure? Then I can answer how you could use this simulator framework to make a meaningful measurement

Well for example, one of the things I would find interesting if it was possible is numerically establishing the bounds of a specific attack: Say I want to run a selfish mining attack, and verify that my network is safe as long as the selfish miner's CPU power is within a certain upper bound.

Anyway, as for the over-arching reason why I'm asking this: I don't really have a specific use case in mind, but I'm evaluating the capabilities and limitations of various available bitcoin network simulation programs as part of a research project. So part of my goal is to figure out what e.g. differentiates shadow-plugin-bitcoin from alternatives such as the Bitcoin-Simulator ns3 plugin.

Would it be fair to say that shadow-plugin-bitcoin is mostly interested in gathering network throughput and performance statistics, with a focus on e.g. propagation time, processing overhead and DoS protection - rather than actually simulating the properties of the blockchain (such as resistance to selfish mining) itself?

I see. I think what you wrote is a fair comparison.

The most important thing to keep in mind, is that the main difference is the Shadow plugin actually runs the real Bitcoin source code, whereas the ns3 plugin runs a simplified model (which might behave differently). This means that Shadow is better for exhibiting behavior caused by specific details of the Bitcoin application code.