Okay, pretty much what I thought: those magic knights don't exist, and the level of understanding about the second most important aspect of DigiByte is, in general, close to zero.
Considering just how important it is to have a good understanding of this, would it be too much to ask for an explanation in layman's terms?
As a guide, not that you need it as you clearly answered both with your posting of the respective codes, but in order to help with the framing of that explanation for the average person, I'll remind of the framing of the last questions:
We know that before the most recent hardfork, global network hashrate (that is the combined total of the 5 algos) was key, and that all the algos diffs adjusted in response to changes in aggregate hashrate. The question is how much did that change? To what precise degree are the algos currently independent, and to what degree are they still inter-dependent?
Looks to me like the overall relationship is still very similar, in that all 5 algos have their difficulties to mine calculated from the same base input, but, not being an expert, I don't want to misrepresent the facts and prefer to hear your, expert, explanation for the masses.
More than anything because I could be wrong. As I said, I'm not an expert, and in this matter I consider myself to be a member of the masses.
Very much appreciated!
A great place to begin answering this question is with MentalCollatz's original post on the GitHub repo. And also many, many thanks to MentalCollatz for contributing this code and insight to DigiByte.
https://github.com/digibyte/digibyte/pull/36First off, this will fix the safe mode warnings once and for all. But it does so much more than that. Currently, an attacker can 51% attack the network with roughly 60% of SHA256D and nothing else. After this change, an attacker with 90% of the SHA256D hashrate and 33% of each of the other 4 algorithms would have insufficient hashpower to mount a 51% attack.
The new formula was chosen as a function of the difficulties and based on these criteria:
1. It should be a symmetric funtion
2. It should be order 1 homogenous
3. It should be homogenous with respect to each variable
Or in plain English:
1. There should be nothing algorithm-specific (such as per-algorithm weights) nor should it depend on which algorithm actually solved the block.
2. If all difficulties double, the block work should double
3. If one difficulty doubles, the block work should change by some constant factor
There is only one function (save multiplication by a constant factor) satisfying all 3 conditions: the geometric mean. As an added bonus, because of how the difficulty algorithm works the geometric mean can change by at most 3% from block to block (which addresses the safe-mode warning issue).
In order to 51% attack the network, the product of the attacker's hashrates must exceed the product of the network's hashrates. In particular, the attacker must have some hashrate in all 5 algorithms.
So to summarise, there is no longer an individual algorithm weighting (workfactor) but a geometric mean (nthRoot) of all algos. This allows for five birds to be killed with one stone; preventing time warp attacks, eliminating safe mode error, improving difficulty adjustments, making sure each algo is only getting 20% of all the blocks and dramatically increasing the difficulty of a 51% attack. If you look back at the previous several thousand blocks and calculate the average % of each algo you will get the 20% average. Things are working as expected in that regard.
Now as to electrical efficiency of each mining setup. ASIC's are by their very nature designed to be highly efficient:
https://en.wikipedia.org/wiki/Application-specific_integrated_circuitThe original idea was to allow for people with both used, obsolete ASIC's and GPU's as well as some CPU's to be able to mine. As time has gone on the mining scene has undoubtedly changed and we now have two algos (Sha256 and Scrypt) dominated by ASIC's. As time goes on these two algos miners will get more electrically efficient but still only account 40% of new DGB coming into circulation. The other 60% is up for grabs from GPU's.
As ASIC's get cheaper and more efficient it will be easier to distribute ASIC miners to people such as gamers. Remember the only thing a Sha256 or Scrypt ASIC can be used for is to mine a digital currency.
Does this answer everyones questions? This is a very complex topic so we understand the confusion. We are always open to new ideas and suggestions as technology is rapidly changing.