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),


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


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

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


1 Answer 1


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)?

  • 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
    Commented Aug 29, 2018 at 12:22
  • Creating a ZK Snark generates a solidity contract to deploy on chain. Commented Aug 29, 2018 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.