Author

Topic: simbit - p2p network simulator (Read 5312 times)

full member
Activity: 238
Merit: 100
Stand on the shoulders of giants
May 22, 2014, 11:17:49 PM
#8
cool .. thanks for sharing ...
kjj
legendary
Activity: 1302
Merit: 1026
May 22, 2014, 11:03:39 AM
#7
This fulfills the bounty conditions IMO.

Agreed.
legendary
Activity: 1596
Merit: 1100
May 20, 2014, 09:49:56 AM
#6
This fulfills the bounty conditions IMO.
vip
Activity: 198
Merit: 101
May 13, 2014, 01:22:56 PM
#5
It's not too hard to collect stale block/share rates and propagation time of messages, I'll build that into the inventory system soon.

Right now the MinCen simulation isn't a good model of mincen yet for the following reasons:

  • No MTUs
  • No merkle blocks
  • Nodes don't adjust peering relationships based on which nodes have best connectivity to miners
  • Nodes don't enforce transaction verification before relaying shares
  • Transactions aren't being created

When those things are added I can get all of the stats you were simulating before.

Supporting DECOR/GHOST is also on my todo list.
hero member
Activity: 555
Merit: 654
May 11, 2014, 10:56:35 PM
#4
It looks awesome!
I'm using a simple console based simulator with no fancy graphs...

I will check it out.

Does it collect data regarding stale blocks and block propagation time?

I would like to try to use it to simulate the DECOR+ protocol. Have you tried?

http://bitslog.wordpress.com/2014/05/02/decor/
http://bitslog.wordpress.com/2014/05/07/decor-2/

Best regards!
vip
Activity: 198
Merit: 101
May 10, 2014, 05:55:09 AM
#3
Selfish Mining Attack

Demo: http://ebfull.github.io/index-selfish.html
Code: https://github.com/ebfull/simbit/blob/master/sim-selfish.js

simbit was originally created to simulate this attack, and I got some pretty graphs out of it:



vip
Activity: 198
Merit: 101
May 10, 2014, 05:54:58 AM
#2
MinCen Simulation

Demo: http://ebfull.github.io/
Code: https://github.com/ebfull/simbit/blob/master/sim.js

Sergio's MinCen is an interesting incentive structure for aggregating mining and discouraging forks in the chain, which comes in handy when block intervals are decreased below network propagation rates. It is a quasi-decentralized system in which miners voluntarily delegate to a master (or manager) party whose primary purpose is to select the winning branch and prevent a wasteful race. In theory, if the master attempts to abuse their position, it is in complete view of the network and the master will be abandoned. Some malicious actions can be prevented with fraud proofs.

I've created a bare-bones simulation of this protocol with 1 minute block times, with M=16 share slots. This is just a demonstration; a thorough analysis of MinCen would require much more to be implemented.

vip
Activity: 198
Merit: 101
May 10, 2014, 05:54:47 AM
#1
simbit is a javascript p2p network simulator which focuses on consensus networks like Bitcoin. It can be executed with Node (in clustered simulations) or in the web browser with visualization. It is a general framework for simulating any number of latency-sensitive networks, strategies and protocols.


Project page: http://github.com/ebfull/simbit

The standard bitcoin simulation includes a working blockchain (with difficulty adjustment, reorgs), maporphans, mempool, UTXO, orphan transactions, inventory system, peer manager and mining simulator.

This is still in alpha. In fact the TCP-like network interface for nodes does not yet account for the size of messages between nodes, and nodes do not yet (but can) simulate computational delay. Also, the network topography is really arbitrary and probably does not represent the real bitcoin network. It also does not come close to perfectly representing the reference client.

I would love feedback, and if you have anything you'd like added or simulated using this framework feel free to bring it up to me. The goal of this framework isn't exactly to be the most efficient possible, but fun and easy to develop with.
Jump to: