8000 GitHub - seanvaleo/blockchain-difficulty at v0.1
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Simulating the effectiveness of various blockchain difficulty adjustment algorithms

License

Notifications You must be signed in to change notification settings

seanvaleo/blockchain-difficulty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Difficulty Simulator

Build Status Go Report Card

Simulate the effectiveness of various blockchain difficulty algorithms in terms of volatility and accuracy.

Background

In a decentralized blockchain, where no individual controls the timing of block additions, there must be a mechanism set in place in order to regulate the desired block frequency.

A so-called 'difficulty algorithm' can be used to adjust the difficulty of mining a new block, based on an estimate of the network's total problem solving power. With all things being equal, the block time should approach and maintain its target block time.

The goal of this project is to provide a simulator to report on the effectiveness of various difficulty algorithms by observing the standard deviation, and mean values of all block intervals after adding X blocks.

Performance

Blockchain 1         SMA-10             SD: 18.598669175489476  Mean: 60.17482517482517  
Blockchain 2         SMA-20             SD: 13.174972509226185  Mean: 59.324675324675326  
Blockchain 3         SMA-50             SD: 13.718402628006942  Mean: 57.624375624375624  
Blockchain 4         SMA-100            SD: 18.510401708827676  Mean: 55.07992007992008  
Blockchain 5         EMA-10             SD: 18.598669175489476  Mean: 60.17482517482517  
Blockchain 6         EMA-20             SD: 13.174972509226185  Mean: 59.324675324675326 
Blockchain 7         EMA-50             SD: 13.718402628006942  Mean: 57.624375624375624  
Blockchain 8         EMA-100            SD: 18.510401708827676  Mean: 55.07992007992008  

Installation

Install Go: https://golang.org/doc/install

Download sources and install: go get github.com/seanvaleo/dsim

Usage

dsim

Configuration

Configure environment variables in the .env file.

Default values:

TARGET_BLOCK_TIME=60
BLOCKS=1000
MINER_COUNT=100
MINER_HASH_TH=100

About

Simulating the effectiveness of various blockchain difficulty adjustment algorithms

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0