Last month we were pleased to announce the OlaVM Whitepaper, an EVM-compatible ZKVM solution, released the 25th of July, 2022. ZKEVM has been a hot topic itself over the past couple of weeks, and upon the release of OlaVM, the paper managed to receive some honorable attention from prominent people in the industry, amongst them, one being Daira Hopwood (who also is the main author of the Zcash protocol), we would like to thank Daira for her feedback. Daira brought up a few important questions in regards to the design decisions, one of them relating to the choice of hash function in ECDSA and Schnorr signature algorithms. The exact comment can be seen in the tweet attached below.
What Daira is referencing can in simple terms be described with the following: The security level of Sinsemilla hash is collision resistant, so it cannot be regarded as a Random Oracle. For the ECDSA and Schnorr signature algorithms, in order to satisfy sufficient security, the choice of hash function needs to be regarded as Random Oracle. In order to understand this better, we need to understand some cryptographic concepts first.
According to the definition in the paper Cryptographic Hash-Function Basics, the security properties corresponding to a CHF are divided into the following three categories:
An important aspect to be noted is that, if you satisfy the conditions for Collision Resistance, you also satisfy the conditions for Second Preimage Resistance, however this does not guarantee that you are satisfying the conditions for Preimage Resistance.
A Random Oracle is described in the following model:
To briefly summarize the behavior of Random Oracles, assuming the input is x:
If x has been used as input data before, it will directly return the corresponding H(x).
If x has never been used as input data, the Random Oracle will generate a string consisting of 0.1 in the range of values completely randomly.
It might be noted that:
Complete randomness here means that even the Random Oracle itself does not know what the final value will be, it has no rules to follow. This is the main difference from hash functions. Any hash function has its own calculation rules.
But in the real world, it is quite difficult to achieve an actual Random Oracle, therefore, we need to find a potential candidate for Random Oracles, and we need to make the output as random as possible. Hash functions are a good choice. A secure hash function needs to satisfy the following conditions: Preimage Resistance, Second Preimage Resistance, and Collision Resistance. A hash function that can be used as Random Oracle must satisfy these three properties, but a hash function that satisfies these three properties may not necessarily be used as Random Oracle, there is a necessary and insufficient relationship between them. More details can be found in What is the “Random Oracle Model” and why is it controversial?
As mentioned in the papers On the security of ECDSA with additive key derivation and presignatures and On the Exact Security of Schnorr-Type Signatures in the Random Oracle Model, the hash functions in both ECDSA and Schnorr signature algorithms need to be considered Random Oracles before they are safe. According to the previous description, this hash needs to satisfy all the security properties of CHF: preimage-resistance, 2nd-preimage resistance, and collision resistance.
The Sinsemilla hash function was designed by Daira Hopwood and Sean Bowe, and the bottom layer relies on ECDLP(Elliptic Curve Discrete Logarithm Problem). Under a fixed-length input, the Sinsemilla hash function satisfies the Collision Resistance property, but not the Preimage Resistance property. Please refer to Daira’s answer for further clarification.
According to the Zcash protocol specification, the original intention of designing the Sinsemilla hash function is to make full use of the advantages of being Lookup-friendly during the execution of the zero-knowledge proof algorithm Halo2, in order to improve the execution efficiency of Halo2. Therefore, the Sinsemilla hash function is a Lookup-friendly hash function, which is more suitable for computation of promises and computation of Merkle Tree roots.
We would like to thank Daira Hopwood for pinpointing this and her guidance, we will continue gathering feedback to continuously optimize and improve the OlaVM design, making it more efficient and secure. The Sinsemilla hash function will still be used in suitable modules in the OlaVM design. Regarding the usage of hash functions for signatures, we will opt for an appropriate and secure hash function, such as e.g the Poseidon- or Reinforced Concrete hash functions.