Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to make ZoKrates usage non interactive #1218

Open
shishirhome opened this issue Aug 28, 2022 · 0 comments
Open

Not able to make ZoKrates usage non interactive #1218

shishirhome opened this issue Aug 28, 2022 · 0 comments

Comments

@shishirhome
Copy link

I am a new user of the ZoKrates library. I am not clear about the sequence of the events taking place. (Let's Ignore the trusted setup step for now)

The first step is to load Verification Id into the blockchain (Smart Contract)
Then a prover comes up with proof and claims the output
However, in both these steps, it's easy to capture (listen to mempool) and establish the relationship between Sender of Verification Id and Sender of Proof. And hence one can easily establish a relationship. Even this can easily be front run by any MEV bot.

My requirement is just to break the relationship (non-interactive way) between the sender and receiver of the transaction. Output can be seen on the chain.

Another option in ZoKrates is to prove the knowledge of the preimage of SHA256 or EdDSA Signature. But here again, anyone can listen to mempool and establish the relationship between Sender of Verification Id and Sender of Proof.

Am I missing some basic steps, please help. I am using the below code (it's all working fine) just that I am not able to make all these non-interactive.

For EdDSA signature inside ZoKrates ****************************

from "ecc/babyjubjubParams" import BabyJubJubParams;
import "signatures/verifyEddsa.zok" as verifyEddsa;
import "ecc/babyjubjubParams.zok" as context;

def main(private field[2] R, private field S, field[2] A, u32[8] M0, u32[8] M1) -> bool {
    BabyJubJubParams context = context();
    bool isVerified = verifyEddsa(R, S, A, M0, M1, context);
    return isVerified;
}

For Proof Of preimage Knowledge****************************

import "hashes/sha256/512bitPacked" as sha256packed;

// def main(field value1, field value2 , private field a, private field b, private field c, private field d) -> bool {
def main(field[2] value , private field[4] preimage) -> bool {
    // field[2] mut value = [203772347275113904407135746007417663121,66616246088195480745399082012482605937];
    // field[4] mut preImage = [387708,155717,887569,56533];
    return sha256packed(preimage)  == value;
}

https://ethereum.stackexchange.com/questions/134491/not-able-to-make-zokrates-usage-non-interactive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant