In this article I will will detail the implementation of the Dynamo programmable proof of work system and its novel consensus based update mechanism.
Progpow is not new and many projects have somewhat successfully used it to deter, but not eliminate, ASIC mining. One notable exception is Monero, however this project went so far that they also eliminated GPU mining. I personally believe that GPU mining strikes a good balance between security and decentralization for reasons I have detailed elsewhere. My goal was to create a GPU friendly, but ASIC-proof POW algorithm. This algorithm is now incorporated into the Dynamo core full node and reference miner both of which are available on the Dynamo Foundation github repo.
The progPOW implementation is composed of:
- A hash script language which provides for sequential execution of basic cryptographic and mathematical operations.
- A periodic auto generator which creates new algorithms to be voted on.
- Distribution of the approved algorithm on the blockchain.
This is a sample hash script, which is used to generate the genesis block in Dynamo.
The first line indicates the timestamp to start using the hash. The remaining lines are the hash script which provides for SHA2, integer ADD/XOR, etc. The script also allows for generation of arbitrary sized memory blocks and selection of random numbers from those blocks. The fullnode and the miner software execute the script for each block in order to create the block hash as part of the proof of work consensus. All of the operations are based on 32 bit data sizes in order to allow for optimization on GPUs. For example, the ADD and XOR functions operate on 8 int32_t structures rather than an entire 256bit structure and allow for 32 bit overflow as opposed to 256bit overflow.
New hash creation and distribution
The system is designed to periodically create a set of new random hash scripts and submit them for voting on chain. This will initially occur every 120 days. After the voting period is over, the script winner is distributed on chain via a special OP_RETURN command code. All full nodes will load the new script and start using it as of the effective timestamp. The entire history of hash scripts is preserved on chain and can be reconstructed by any full node.
Using this mechanism, the script autonomously changes and updates periodically, rendering any ASIC design pointless because:
- The script cannot be parallelized in hardware so there is no energy efficiency to be gained.
- The memory generation routine allows for arbitrarily large pools to be created, so if an ASIC is developed with some amount of RAM it can be bricked simply by generating a slightly larger pool if even for a short amount of time.
This design eliminates the need for hard forks and removes core developers, or anyone else, from the process of updating the progpow hash, thereby decentralizing the entire process.
The scripted hash function feature of Dynamo is a novel progpow hash which is GPU friendly, ASIC proof and completely decentralized and autonomous. The code can be viewed on the github repo here: