CryptoNight & CryptoNote Explained
Last Updated: 30th October 2018
CryptoNight is a proof-of-work hashing algorithm originally designed by the Bytecoin and CryptoNote developer teams. It was originally designed to accommodate CPU and GPU mining whilst at the same time being resistant to Application-Specific Integrated Circuits, or better known as, ASICs. CryptoNight as an algorithm can be thought of as something similar to SHA-256, the mining algorithm used for Bitcoin, or Scrypt, the algorithm used within the Litecoin protocol.
How CryptoNight Works
CryptoNight was envisaged as an egalitarian hashing algorithm because it can be computed by CPUs and GPUs, but is impractical for use by ASICs. The CryptoNight algorithm does this by:
- Requiring access to memory
- Latency dependence
Requiring access to memory – Traditional ASICs are suited to hashing algorithms such as SHA-256 because it does not require the device to access memory in order to submit a result. Instead, the ASIC is limited simply by the number of calculations that it can perform per second. This is to the disadvantage of CPUs and GPUs which do have memory functions built in, therefore, inherently limiting the number of computations that they can perform. Furthermore, each time memory is accessed, the CryptoNight requires 2 MB of memory. This is problematic for some ASICs as they do not have memory functions built into them, therefore, CryptoNight is said to be memory-hard.
Latency dependence – Latency refers to the length of time it takes for a calculation to be issued and for the result to be returned. For example, if a calculation of 2+2 were to be issued, and it takes 3 seconds for the result of 4 to be returned, then the latency is 3 seconds. Furthermore, dependence refers to the notion that a second calculation cannot be performed until the result of the first has be returned, i.e. there is a dependence on the first calculation in order for the second calculation to be performed. In the context of the CryptoNight algorithm, every new solution that is proposed by a device, is dependent on all previously proposed solutions.
CryptoNote was originally implemented in the CryptoNoteCoin protocol, a cryptocurrency designed for the sole function of showcasing the CryptoNote technology. CryptoNoteCoin itself has no commercial value; the genesis block was relaunched every so often in order to prevent value from accruing.
Cryptocurrencies such as Bytecoin (the very first fork of the CryptoNote) and Monero chose to fork from CryptoNote due to the anonymity technology that the protocol has to offer. Examples of these technologies include:
- Ring signatures
- Stealth Addresses
- Adaptive Limits
Ring signatures – Ring signatures are a type of digital signature for which a group of possible signers are merged together to produce a distinctive signature that can authorize a transaction. A ring signature is composed of the actual signer, who is then combined with non-signers to form a ring. The actual signer and non-signers in this ring are all considered to be equal and valid. ring signature technology helps the sender mask the origin of a transaction by ensuring that all inputs are indistinguishable from each other.
Stealth Addresses – Stealth addresses grant additional security to the recipient of a digital currency by requiring the sender to create a random one-time address for a given transaction. When multiple transactions sending funds to a stealth address are conducted, instead of the transactions appearing on the blockchain as multiple payments to the same address, what will be recorded will in fact be multiple outgoing payments to different addresses.
Adaptive Limits – This refers to the continuous recalculation of different aspects of the CryptoNote protocol, such as its mining difficulty and block size. The difficulty is determined by summing the total work performed by nodes over the last 720 blocks and dividing it by the time taken to reach 720 blocks. In addition, the block size is calculated by taking the average block size of, for example the past 100 blocks, and multiplying it by 2. Therefore, if the average block size of the past 100 blocks had been 1 MB, the new block size would be calculated as being 2 MB.
To conclude, CryptoNight is a proof-of-work algorithm that was originally implemented in the CryptoNote protocol which has since been forked by projects such as Monero and Bytecoin. The CryptoNight algorithm functions by requiring access to memory, as well as placing an emphasis on latency dependence.
The CryptoNote protocol offers cryptographic technologies such as ring signatures, stealth addresses and adaptive limits.
More information on CryptoNote and CryptoNight can be found on the CryptoNote website and the CryptoNote whitepaper.