Score:0

Practical feasibility of proving a plaintext hash relationship with a zk-SNARK

gl flag

I am interested in the practicality of using generic SNARK techniques to prove the following relation.

Let E and E' be two ElGamal ciphertexts. They have the form E = (E1, E2) = (g^r, M*PK^r) and E' = (E1', E2') = (g^r', M'*PK^r').

There is also a hash function H.

All of these are public: E, E', PK, H.

I want to prove that M' = H(M). I do not hold the secret key associated with the public key PK, but I do know the randoms r and r' that were used for the encryptions.

In particular, my witness is (r,r') and the SNARK verification circuit will:

  1. Use PK, r, and E2 to decrypt M.
  2. Use PK, r', and E2' to decrypt M'.
  3. Output accept iff M' = H(M).

My questions are:

  • Can someone provide a rough intuition for how practical proving this statement will be? I am more sensitive to verification time and proof size than I am to prover time.
  • Are there any hash functions that are particularly well-suited for this kind of task? (I have heard of the existence of Poseidon, but there seem to be a few SNARK friendly hash functions and I haven't yet gotten to the bottom of how they compare.)

Many thanks

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.