<p>Yes. The simplest way to understand this is to understand the zero-knowledge proof that you know a 3-coloring of a graph. 3-coloring is NP-complete, so an arbitrary hash function <span class="math-container">$h$</span> and target value <span class="math-container">$w$</span> can be represented as a graph where knowing a 3-coloring for that graph is equivalent to knowing a <span class="math-container">$v$</span> such that <span class="math-container">$h(v) = w$</span>.</p>

<p>That isn't the most efficient way to do it; for that you'd want zk-snarks or one of the zillion similar encodings. That approach is similar but you're modeling your hash function as a modular matrix multiplication instead of a graph coloring. But the answer is yes, there is a zero-knowledge protocol for proving you know the preimage of a value for a hash function.</p>

CC BY-SA 4.0
2020-07-21T19:08:13.530Z
Can u be more precise that how zk-snarks is useful here? I do not mean internal working. but how the input to the zk-snarks and output to the zk-snarks look like
Vinay
CC BY-SA 4.0
2020-04-22T19:15:26.457Z
2020-04-22T19:15:26.457Z
lacker
<p>Is there Zero Knowledge Proof of Knowledge protocol for Hash function? (If h(v)=w) without revealing v to the anyone can we prove that we know 'v')</p>

CC BY-SA 4.0
2020-04-21T11:55:59.157Z
Every function in NP has zkp I think.
VS.
<hash-function><zero-knowledge>
Zero Knowledge proofs of knowledge
Vinay
# Zero Knowledge proofs of knowledge

(Asked by: username_0 on 2020-04-16)

Is there Zero Knowledge Proof of Knowledge protocol for Hash function? (If h(v)=w) without revealing v to the anyone can we prove that we know 'v')

**Tags:** hash-function, zero-knowledge

> **Comments:**
> **username_1**: Every function in NP has zkp I think.  

---

## 1 answers

### Answer by username_2 on 2020-04-22. Score: 2 | Accepted answer

Yes. The simplest way to understand this is to understand the zero-knowledge proof that you know a 3-coloring of a graph. 3-coloring is NP-complete, so an arbitrary hash function $h$ and target value $w$ can be represented as a graph where knowing a 3-coloring for that graph is equivalent to knowing a $v$ such that $h(v) = w$.

That isn't the most efficient way to do it; for that you'd want zk-snarks or one of the zillion similar encodings. That approach is similar but you're modeling your hash function as a modular matrix multiplication instead of a graph coloring. But the answer is yes, there is a zero-knowledge protocol for proving you know the preimage of a value for a hash function.

> **Comments:**
> **username_0**: Can u be more precise that how zk-snarks is useful here? I do not mean internal working. but how the input to the zk-snarks and output to the zk-snarks look like  

---

