
Understanding mining algorithms
Mining algorithms are the backbone of blockchain-based networks like Bitcoin and other protocols.
In blockchain technology, mining algorithms are necessary for transaction verification and network security. A mining algorithm instructs miners’ computers to follow a set of rules to generate a valid block.
Proof-of-work (PoW) is the well-known consensus algorithm used by Bitcoin and other cryptocurrencies. In PoW, miners compete using computational power to find a specific hash value that will give them the new block. Application-specific integrated circuits (ASICs) are the specialized hardware necessary for miners to be competitive in such an energy-intensive process, but before ASICs, lower-scale CPU and GPU mining equipment was utilized by users at home.
ASIC mining primarily uses the SHA-256 hash function, which was designed by the United States National Security Agency (NSA) and published in 2001 as a data integrity standard. Bitcoin uses SHA-256 to ensure maximum security and integrity, as the slightest change to the algorithm would alter the mining hash function output.
To keep up with industrial-scale mining operations, many miners join mining pools to combine their computational power, thereby increasing the chances of successfully mining a block. Block rewards are shared proportionally based on each member’s contribution.
Choosing the mining algorithm is a crucial decision for a cryptocurrency project, as it determines the rules and requirements necessary to create and secure the blockchain network, other than how the participants are rewarded with newly minted coins. Examples of other popular mining algorithms include Ethash, used by the Ethereum blockchain, and CryptoNight, used by the Monero Network.
What is the CryptoNight algorithm?
CryptoNight is one of the fastest mining algorithms and part of the CryptoNote consensus protocol.
CryptoNight is a PoW mining algorithm for CPU and GPU mining, designed to be ASIC-resistant to prevent the centralization of mining power. It hopes to help users mine more efficiently using a combination of hashing functions, including the CryptoNight and the Keccak hash functions.
Its cryptographic hash function works around the Advanced Encryption Standard (AES), a military-level algorithm for extreme security, making CryptoNight a mining algorithm highly focused on security. Since Monero started using it as the hash algorithm for its blockchain consensus, CryptoNight’s reputation as a security algorithm has strengthened across the crypto world.
The CryptoNight algorithm’s creation is fascinating and recalls the origin of Bitcoin. Its creator — who goes by the fictitious name of Nicolas van Saberhagen — disappeared, just like the famous Satoshi Nakamoto.
Given the similarity, many believe that the two developers are the same person, with the mystery further enhanced by the spooky release date of CryptoNote, Dec. 12, 2012 (12/12/2012). CryptoNote was a security protocol and a privacy tool that promoted confidential transactions, non-linkable transactions and ring signatures.
How does the CryptoNight mining algorithm work?
CryptoNight uses the CryptoNote consensus protocol to strengthen privacy so that nobody can tell which participant in the transaction is paying and who is receiving the money.
CryptoNight is GPU-mining friendly, but its characteristics make it ideal for CPU mining. With its set of 64-bit fast multipliers for maximum speed, the CPU architecture is very efficient; moreover, the heavy use of CPU caches guarantees the best performance.
Its working process involves three main steps:
Creating a “scratchpad”
A large memory with intermediate values is stored during a hashing function. The first input data is hashed with the Keccak-1600 hashing function, resulting in 200 bytes of randomly generated data.
Encryption transformation
It then takes the first 31 bytes of this Keccak-1600 hash and transforms them into the encryption key for an AES-256 algorithm, the highest value within the AES family.
Final hashing
CryptoNight takes the entire data set created by the AES-256 and Keccak functions in the previous step and passes it through the rest of the hash functions. Ultimately, a final hash results from the CryptoNight proof-of-work. This hash has a 256-bit extension or a total of 64 characters.
Why is CryptoNight important?
CryptoNight was designed to give CPUs and GPUs an equal opportunity to mine blocks and discourage ASIC miners’ use.
CryptoNight is important for three crucial reasons: It provides stronger privacy with untraceable transactions, its ASIC resistance feature, and scalability. Most…
cointelegraph.com
