CryptoNight is a hashing algorithm used in cryptocurrency mining for certain Proof of Work blockchains. First introduced to digital currencies with the launch of Bytecoin (BCN) in July 2012, CryptoNight has since been adopted by a number of different blockchain projects. Among the top 10 CryptoNight-based blockchains by market capitalization, the CryptoNight mining algorithm secures over $130 million in digital currencies as of the time of this writing.
In this article, we explore why CryptoNight was invented and how the algorithm has been modified by prominent blockchain projects. We will then assess its current effectiveness compared to other Proof of Work hashing algorithms.
Why Is CryptoNight Important?
The development and implementation of the CryptoNight hashing algorithm centers around two main use cases: untraceable transactions and ASIC resistance. Understanding how CryptoNight became a popular solution requires an analysis of the issues that existed prior to its emergence in 2012.
Bitcoin was once incorrectly portrayed in the media as an “untraceable currency.” This has always been a myth. In fact, digital currency payments settled on open, distributed ledgers are actually more transparent than traditional fiat systems. If you have another person’s public address, it is simple to view their wallet balance, transactional history, and other data.
Because of these data privacy concerns, the CryptoNight hashing algorithm was designed as an efficient solution for sending and receiving private blockchain transactions. To accomplish this, developers introduced two important privacy technologies: ring signatures and stealth addresses.
While these two new features did accomplish the goal of improving privacy, it also eventually led to the delisting of various privacy coins on popular cryptocurrency exchanges due to regulatory concerns.
It is crucial to note that CryptoNight-based coins were not the only digital currencies delisted due to privacy features that raised regulatory concerns. Zcash, which uses the Equihash algorithm, was also delisted on some exchanges. The difference is that privacy (z-addresses) and transparency (t-addresses) are both possible options for transactions on Zcash’s blockchain. In contrast, privacy was intended as a mandate for the CryptoNight hashing algorithm.
The secondary reason behind the development of CryptoNight was to mitigate the rise and dominance of ASIC mining rigs and subsequent centralization of cryptocurrency mining.
The first commercial ASIC mining rigs did not hit the market until 2013, well after CryptoNight was initially proposed. Still, as ASICs emerged, CryptoNight developers envisioned an egalitarian system where GPUs and CPUs could remain competitive.
CryptoNight was built to require more computational memory compared to Bitcoin’s SHA-256 hashing algorithm. CryptoNight was also intended to offer an improvement over the Scrypt hashing algorithm, which required additional memory but did not achieve the level of ASIC resistance that CryptoNight developers desired.
Origins of CryptoNight
Despite being a popular hashing algorithm, little information is known about the origins of CryptoNight. Here is what we do know.
CryptoNight Vs. CryptoNote: What Is The Difference?
The similarity between these two names tends to create some confusion. The simplest explanation is that CryptoNote is the consensus mechanism, and CryptoNight is the hash function within it. All CryptoNight coins are CryptoNote coins, and vice versa. Thus, they are often used interchangeably when referring to their implementations in various blockchain networks.
The Mystery of Nicolas van Saberhagen
The exact origins of CryptoNote and CryptoNight remain a mystery. Some have guessed that the protocol and hash algorithm are results of work from Stanford Bitcoin Group, Nick Szabo, or even Satoshi Nakamoto. However, none of these rumors have ever been confirmed.
Nicolas van Saberhagen is credited as the creator of CryptoNight in the CryptoNote v2.0 whitepaper from October 2013. He is also listed as one of the authors of CryptoNote Standard 001, which was published in December 2011 as the first document related to CryptoNote and CryptoNight. Although he once agreed to an in-person speech at a conference workshop, van Saberhagen did not show up and instead called in via Skype using a voice anonymizer.
The First Implementation of CryptoNight
CryptoNoteCoin is a coin that implements CryptoNote/CryptoNight technology. However, developers have continued to relaunch the network’s genesis block every two months in order to prevent CryptoNoteCoin from gaining monetary value. To this day, CryptoNoteCoin does not appear as a search result on various market cap ranking websites, such as Coin Gecko or CoinMarketCap.
The title for the first CryptoNight digital currency goes to Bytecoin (BCN). In 2011, Bytecoin developers began to outline and implement the code. Instead of performing a hard fork, developers built Bytecoin from scratch and launched the network’s genesis block in July 2012.
Prominent Projects That Use CryptoNight
This section provides an overview of five well-known digital currencies that use the CryptoNight hashing algorithm and looks at their stances on ASIC resistance.
Note that a variety of modified CryptoNight algorithms exist that are not mentioned below (i.e.CryptoNight Lite, CryptoNight Heavy, etc.). A complete historical timeline of all CryptoNight project launches can be found here.
As mentioned above, Bytecoin was the first CryptoNight-based digital currency. The project team originally launched the network to be ASIC-resistant.
However, Bytecoin has since reversed its position on this subject. According to an official statement from 2018, Bytecoin decided to support ASIC mining by continuing to use the original CryptoNight algorithm.
The Bytecoin team’s main concerns about switching hashing algorithms are the potential threats to security and anonymity. The statement states: “The basic value of a coin is based on the PoW and its consensus’ ability to protect the ecosystem. In this case, ASIC miners are acting like protective agents in their ability to defend it.”
While the project has said it will look at solutions to support GPUs, it also suggests that miners consider using ASIC mining rigs. The project acknowledges that an ASIC ban is possibly futile considering that future generations of ASICs will include FPGA devices that can easily be reconfigured to keep up with minor algorithm adjustments.
Monero (XMR) [No Longer Uses CryptoNight]
Of all the CryptoNight-based coins, Monero has undoubtedly put the most effort and resources towards ASIC resistance.
In April 2018, developers forked Monero from the original CryptoNight algorithm to CryptoNight v7 as a strategy for blocking ASIC manufacturers like Bitmain and Innosilicon from manufacturing XMR-based ASIC miners. Monero hard forks intended to increase the network’s ASIC resistance led to the creation of four new currencies: XMO, XMV, XMC, and ZMR.
The ineffectiveness of these hard forks to achieve ASIC resistance is best shown in the implementation of CryptoNight variant 2 (CryptoNight v8) in October 2018. Monero developers were able to discover that ASICs returned to the network on December 31st, 2018 near block 1,738,000.
In February 2019, a researcher published a nonce forensics analysis that calculated 5,400 ASIC rigs comprised 85.2 percent of the network hashrate. The report concludes that ASIC miners figured out how to obfuscate nonce patterns via random nonce picking, making them more difficult to distinguish between other mining hardware.
In March 2019, another fork implemented CryptoNight R but ASICs returned once again. This series of events prompted Monero developers to begin work on RandomX, a completely new method for blockchain consensus.
Electroneum has wavered on its stance towards ASIC resistance. In May 2018, developers followed Monero’s example by switching from the original CryptoNight algorithm to the more ASIC-resistant CryptoNight v7 algorithm.
According to CEO Richard Ells, “The GPU community actually convinced us to go anti-ASIC. But when we did this, they [GPU miners] left in droves, which made the network less profitable for them and less secure for us and our users.”
The introduction of ASIC-resist code led to critical security vulnerabilities. Network hashrate declined from 2,000 MH/s to 30 MH/s. Ells said that bad actors could have used a cloud mining site like NiceHash to perform a 51% attack for as little as $3,000.
In July 2018, Electroneum decided to re-introduce the original CryptoNight algorithm. This led to further debates among the community on the project’s subreddit.
HYCON currently uses the CryptoNight v7 algorithm. HYCON (HYC) initially planned to implement a Blake2b hash function as part of its HYCON system.
However, an updated whitepaper published in May 2019 revealed that the project would instead choose CryptoNight due to comparatively higher ASIC resistance. The project’s updated whitepaper also stated that developers would utilize periodic adjustments to the hashing algorithm as a deterrent. The project GitHub page includes code repositories linking users to HYCON-specific mining rigs for CPUs, Nvidia GPUs, and AMD GPUs.
Dero (DERO) uses the original CryptoNight algorithm and appears to be mostly in favor of ASIC miners. The project website even links users to the Bitmain Antminer X3 product page. Nonetheless, the project has addressed the possibility of changing its hashing algorithm.
In October 2019, Dero published a blog post analyzing Monero’s RandomX algorithm. This post mentions the potential security issues found when testing RandomX’s CFROUND instruction. Dero also recognizes that RandomX depends on chip manufacturers like Intel, AMD, and others to maintain support for their implementations. Unexpected changes from these companies could lead to negative effects for the network, such as invalid proofs on the chain. With these drawbacks in mind, Dero has decided to keep using CryptoNight for the time being.
How Effective Has CryptoNight Been At ASIC Resistance?
CryptoNight has not been an effective solution for ASIC resistance, as it was originally intended to be. While it did perform better than other hashing algorithms (i.e. SHA-256) for a few years, ASICs began to take over in early 2018.
Struggles To Combat ASICs
As the former market cap leader among CryptoNight coins, Monero’s inability to stop ASICs provides a case study for other projects. Monero contributors recognized that continuously implementing hard forks can help to decentralize mining but also means a greater reliance on developers to keep supporting the forks.
This tends to bring unwanted results, like the creation of new hard fork coins and diluted support for the core project. ASIC manufacturers were able to adjust quickly to algorithm changes— only needing one month to design and produce new chips. This makes it possible for them to reach ROI within six months.
The conclusion is clear. CryptoNight-based projects have had to choose two of three properties: private transactions, network security, or ASIC resistance. The majority of projects have decided to prioritize the first two options. To achieve all three, the most practical option is to switch hashing algorithms altogether.
Monero Switches To RandomX Algorithm: Will Other Projects Follow?
On December 1, 2019, Monero confirmed via Twitter that the mainnet hard fork implementing RandomX was successful.
Monero’s decision to change hashing algorithms has brought both anticipation and skepticism from CryptoNight-based projects. Besides some of the criticisms mentioned above, another potential issue could be an increase of botnets and mining malware running on CPUs.
The counter-argument presented by Monero is that these threats will decrease as the memory consumption will be noticeable by administrators. An overall decrease in network hashrate will increase the proportion of the block reward going to legitimate miners whether they are mining with CPUs or GPUs. Early test results demonstrate that CPUs have a sizeable hashrate advantage over GPUs. However, work to improve the competitiveness of GPU hashrate is underway.
Although RandomX is not yet battle-tested on mainnet, the focus now turns to how adoption shapes up outside of the Monero community. Arweave, a blockchain protocol enabling data storage for the serverless internet, is also running RandomX. Arweave sponsored the first of four independent audits prior to the hashing algorithm’s public testnet release, with the Monero community funding the other three.
Improving Proof of Work Consensus Algorithms
There are two major perspectives within the blockchain industry regarding ASIC mining rigs: supporting them and the increased security they bring, or opposing them because these specialized miners lead to the centralization of a blockchain's peer-to-peer network.
Several CryptoNight-based projects listed above that have supported ASICs by accepting mining centralization as a tradeoff for network security and continued feature compatibility. Other projects have made ASIC resistance a top priority above everything else (i.e. Monero’s hard forks and eventual switch to RandomX). When it comes to ASIC resistance, all PoW blockchains are in the same boat. The rise of ASICs impacts hashing algorithms like Equihash, SHA-256, and others.
Komodo developers are working to make networks more fair and accessible through the customization of blockchain consensus protocols. With Komodo's multi-chain architecture, developers can launch a Komodo Smart Chain with customizable consensus rules.
Options include Proof of Work, Proof of Stake, or any combination of the two. If you choose PoW, you can choose between either Equihash or VerusHash hashing algorithms. The Proof of Stake implementation Komodo offers can be used in combination with Proof of Work consensus rules. In addition, the Komodo Dev Team plans to make more algorithms available in the future, with CryptoNight being a strong candidate.
If you're a business looking to integrate blockchain technology, fill out the form on our business page to contact our business team.
If you'd like to learn more about blockchain technology and keep up with Komodo's progress, subscribe to our newsletter. Begin your blockchain journey with Komodo today.