via Medium

One of the lesser-discussed topics in the blockchain community is the difficulty algorithm used by Bitcoin and other Proof of Work (PoW) coins. What exactly is the difficulty algorithm? I like the simplicity with which it is defined at blockchain.info. “A relative measure of how difficult it is to find a new block. The difficulty is adjusted periodically as a function of how much hashing power has been deployed by the network of miners.” It is one of the most critical components of the entire Bitcoin system, yet it comes with some inherent weaknesses.

The primary one of these weaknesses is hashrate instability. As noted by Mengerian when he discussed Bitcoin Cash’s new algorithm, this instability is caused when miners “quickly switch between mining coins with compatible Proof of Work algorithms”. This can lead to “unpredictable confirmation times, and long periods with very slow blocks”. While this is currently not a major problem for Bitcoin, it did come to the fore when concerns that China might ban mining surfaced in late 2017. With Chinese mining pools controlling over 70% of the hashing power for Bitcoin, we could have experienced a huge drop in the hashing rate and some very slow confirmation times while other pools tried to ramp up capacity and while the algorithm adjusted for the new hashing rate.

While this was happening, block size, segregated witness, lightning network, transactions fees, Proof of Stake protocols, etc. dominated the public discourse. Relatively speaking, the difficulty algorithm has gotten little attention. Despite that, we see it as a significant constraint to the long-term viability and scalability of both Bitcoin and other public PoW coins. It’s the primary driver of the energy consumption that concerns so many about Bitcoin. It has also been the key factor for many of the altcoins that have been effectively rendered defunct due to hashrate instability. At Chartercoin we’ve been thinking for years about how to design a protocol that is fast, stable, efficient and addresses the problems with the difficulty algorithm. So, we ditched it and came up with something better. We call it Proof of Complexity.

Tim, the inventor of Chartercoin, believed the following:

- Mining needed to be faster and more efficient;
- The system needs to eliminate the effects of hashrate instability completely;
- Anyone on any device should have the ability to mine and be rewarded for it.

First, he created an 8192 bit digital signature — a mathematical model with increasing levels of “uniqueness” that requires computational power to solve for. The signature uses 1024 ASCII characters and computes complexity as a measure of the spread between elements. Miners race each minute to find the most complex (i.e. unique) digital signature. This is a better approach to mining then the difficulty algorithm as it is faster and more efficient for the mining, transaction & verification of currency.

He then developed a system to equitably distribute the work to miners. Rather than have all miners work on finding the answer to the same “puzzle”, supernodes distribute to each miner their own complexity score that they must beat. Miners report back when they “beat” the score and continue to solve for more complex scores over the course of 60 seconds. The miner with the highest reported complexity score is the winner and receives the reward. If no one wins then a supernode receives the reward. With 1,208,925,819,614,629,999,999,999 puzzles available per race, it’s virtually impossible for any 2 miners to receive the same puzzle to work on. This approach not only prevents miners from artificially increasing or decreasing the complexity, it also removes the hashrate as a controlling component on the speed and stability of Chartercoin.

Chartercoin has developed other key features of its consensus mechanism that add additional security and support the long-term stability of Chartercoin. For example, Chartercoin cannot be forked due to an interdependency between links in the chain and a supernode aging list. Miners cannot outrun Chartercoin, so no orphan links are every created. Chartercoin is Atomic (time-based) so miners do not control the order of transactions in the chain. It’s Byzantine Fault Tolerant and asynchronous Byzantine Fault Tolerant. These features and more will enable Chartercoin to truly function as electronic cash as Satoshi originally envisioned. It’s time to ditch the difficulty algorithm.