Zcash Algorithm Explained

Zcash Algorithm Explained

Last Updated: 1st November 2018

Founded by Zooko Wilcox, Zcash is a peer-to-peer digital currency that is designed to allow for private transactions to be made. Zcash is intended to fulfill a similar role to Bitcoin, which is to serve as a medium of exchange in the purchasing of goods and services. However, Zcash aims to bring robust user privacy whilst serving as a medium of exchange. The privacy feature that has been developed to achieve this is Zcash’s zero-knowledge cryptography, also known as zk-SNARKs. Underpinning the entire protocol is the Zcash algorithm for proof of work mining, Equihash.

Proof of work mining concerns the process of producing a hash value that, when an input is inserted into a hashing algorithm, an output of a fixed length is formed (with the output representing the hash value). In proof of work systems, miners will take certain data elements from a block header as an input, and repeatedly run it through a hashing algorithm, which in this case for Zcash is Equihash. Miners hash slight variations of the input data by including a nonce, which is an arbitrary number, each time the input data is inserted into the algorithm.

Zcash's Equihash Algorithm

The Zcash algorithm is known as Equihash, and it was developed by Alex Biryukov and Dmitry Khovratovich at the University of Luxembourg. The Equihash algorithm is an asymmetric memory-orientated proof of work system that is premised on the generalized birthday problem. The Zcash algorithm, Equihash, is also memory-orientated in that it is ‘memory-hard’. As a result, the amount of proof of work mining that can be done using the Equihash algorithm is primarily determined by how much memory i.e. RAM that an individual possesses. Put differently, memory-hard refers to the instance in which the length of time taken to finish a computational problem is, to a large extent, decided by the amount of memory that is required to hold data.

The current landscape of proof of work mining for systems such as Bitcoin can be said to be one that has now become largely centralized. The cause of this can primarily be attributed to the development of mining specific hardware such as the ASIC (application-specific integrated circuit). ASIC hardware is a custom integrated circuit that has been specially designed for cryptocurrency mining. As a result, they are exceptionally powerful and efficient in generating a large number of hashes for the proof of work process, giving ASIC miners a considerable advantage over other miners e.g. GPU miners. Because of this, the activity of cryptocurrency mining has grown increasingly centralized in favour of entities that can afford ASIC hardware in large batches. This has resulted in large scale mining farms largely dominating the cryptocurrency mining landscape.

The Equihash algorithm was designed to prevent ASIC mining centralization, leading to the Equihash algorithm often being referred to as ‘ASIC-resistant’. The Zcash algorithm curbs ASIC centralization by requiring that the generation of hash is memory intensive. This is because memory as a resource in computing, is expensive. Thus, attempting to optimize an ASIC chip for memory will come at a considerable expense to the user. This then makes cryptocurrency mining using the Equihash algorithm a much less efficient and powerful process when compared to mining on algorithms that are memory-less.

The Equihash algorithm is also asymmetric. This is important in proof of work systems because hashes that are computed must be difficult to prove but easy to verify. This is not the case for the majority of memory-hard schemes, meaning that they are memory symmetrical. This means that a verifier must expend the same amount of memory as the prover to validate a correct hash.

Mining Centralization in Zcash

Zcash adopted Biryukov and Khovratovich’s Equihash algorithm in 2016, citing its ASIC resistance as the reason for implementing it. However, soon after phasing in the algorithm, Bitmain, the largest manufacturer of ASIC hardware, announced the release of their custom design hardware, the Antminer Z9 mini, that had been specially designed to mine on the Equihash algorithm. This course of events demonstrates the difficulty in developing a mining algorithm that is intended to achieve mining democratization, but also possess ASIC-resistant characteristics over the long run.

Further information about Biryukov and Khovratovich’s Equihash algorithm can be found in their research paper: ‘Equihash: Asymmetric Proof-of-Work Based on the Generalized Birthday Problem’.