3

I read this article: https://media.consensys.net/introduction-to-zksnarks-with-examples-3283b554fc3b

However, it's not clear to me a function such as zksnarkverify has been already implemented in Ethereum Solidity? Or we need to implement it by our self?

Is there an API or library to use zk-SNARK algorithms ? such as:

public keys generator G(program C, secret lambda) -> (prover public key, verifier public key),

or

prover algorithm P(prover public key, public x, secret w) -> proof

or

verifier algorithm V(verifier public key, public x, proof) -> true ?

where program C is C(public x, secret w).

Questioner
  • 2,670
  • 2
  • 33
  • 62
  • Related: https://ethereum.stackexchange.com/questions/49781/can-zksnarks-be-implemented-now-on-the-ethereum-ecosystem – eth Sep 24 '18 at 05:51

1 Answers1

3

The only thing that is in solidity are precompiled contracts for Ellyptic curve operations.

For implementations check out Is there a decentralized zk-SNARK (zero-knowledge Succinct Non-Interactive ARgument of Knowledge)?

Nico Vergauwen
  • 1,004
  • 7
  • 11
  • Thanks but we need to implement verifier algorithm on-chain by Solidity. How to do it by ZoKrates ? According to its Github link : "It helps you create offchain programs and link them to the Ethereum blockchain" – Questioner Aug 29 '18 at 12:22
  • Creating a ZK Snark generates a solidity contract to deploy on chain. – Nico Vergauwen Aug 29 '18 at 12:50