MultiBranch Forging Simulation Tool
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

This is the tool for multibranch forging simulation for PoS crypto-currencies networks. Please read our papers around that:

(All our articles & papers could be found in special GitHub repository)


  1. If you use Linux you can download & run ready executable program. Download archive with it & config file with forging model parameters there

  2. If you use other operating system or don't want to run downloaded binaries, compile program from sources & run.


To compile you need:

  1. GHC haskell compiler. sudo apt-get install ghc

  2. cabal-install for external haskell packages installation sudo apt-get install cabal-install

  3. ConfigFile package, which can be locally installed cabal install ConfigFile

  4. Then run shell-script for Linux to compile the sources

  5. The executable name is multibranch unless another name is manually specified


Configuration file 'multibranch.cfg' (the name is statically defined in constants.hs, after changing recompilation is needed) consists of the following parameters:

  • strTimesFileName: String. Name of the output file for times between generated blocks in one (longest) chain

  • bUseTFDepth: bool. Boolean parameter denotes whether to use nTFDepth parameter, or do the forging to as many blocks as possible (TOO SLOW)

  • nTFDepth: Integer. Parameter means the number of blocks to forge to, they are selected from the ordered list of open blocks. If it set to zero - single branch forging (with forks) is simulated

  • nFixAccounts: Integer. Number of accounts in the network besides God account. Cannot be more than 15. The systemBalance (defined in Constants.hs) is distributed uniformly between them


When running the program asks the number of steps (ticks) to simulate the system. Reasonable choice is 1000-2000. The calculation time depends on the number of accounts and depth of tree forging. Program prints results of each step to the standard output. It consists of:

  1. List of correspondences between account number (starting with 'H', like H1, H2 etc) and a number of block generated by it. This is printed for each account.

  2. The Blocktree structure for the 1st account (the notation of trees is given at ) For each block the generator ID is printed.

  3. The number of blocks in the main chain (makes sense only after rebalacing)

  4. baseTarget of the last block in the main chain (can be ignored)

Rebalancing of the Blocktree to get the longest chain is performed at the end of simulation with the similar output. The time intervals in the main chain is output to the file defined by the 'strTimesFileName' parameter ('' by default) and the distribution can be viewed by the script (Gnuplot package is needed to view the diagram). The Gnuplot can be installed with sudo apt-get install gnuplot gunplot-x11

CONTACTS & Discussion

Please contact andruiman, for any reasonable questions or suggestions about the program. Also please visit our subforum @ Nxt forum :