Skip to content

Playground for ZoKrates ZK Snark toolbox for Ethereum

Notifications You must be signed in to change notification settings

MoonfishApp/ZKPlayground

Repository files navigation

alt text

ZK Playground

ZK Playground is an easy-to-use visual IDE for exploring the Zokrates language and ZK-Snarks.

ZK Playground uses ZoKrates toolbox.

Features

alt text

  • Zokrates syntax highlighting
  • Auto-completion
  • Auto-linting
  • Auto-parsing of main arguments
  • One-click compile and proof generation

alt text

What is Zokrates?

Zokrates is an experimental language and toolbox for zk-SNARK-based smart contracts, funded by the Ethereum Foundation.

When a Zokrates smart contract is executed, Zokrates produces the new result (the new state) plus a proof that the computation was run correctly. This enables smart contracts to be run only once on a single computer (as opposed to every single mining node in the network), which greatly improves blockchain scaling.

Zokrates also supports privacy. Inputs (arguments) can be set to private. Private inputs will not be known to the verifiers, yet the verifiers can easily verify that correctness of the output, even without knowing the inputs.

Zokrates is experimental and not suitable for production. Alternatives to Zokrates include ZEXE and Snarky.

Why ZK Playground?

Zero knowledge proofs will likely revolutionize blockchain. ZK Playground was created to make zk-SNARKs accessible to as many developers as possible. Understanding the concepts behind zk-SNARKs (even without the mathematics) could be extremely valuable as more blockchains use zero knowledge proofs.

What are zk-SNARKs?

zk-SNARKs are a new and fascinating form of cryptography. Zk-SNARKS are a way to prove honest computation: an application (the verifier) can verify that another computer (the prover) ran a computation correctly, without having to rerun the computation itself, or even having to know the inputs used to run the computation.

The prover produces the output (e.g., a new blockchain state) plus a small proof (less that half a kilobyte) that proves that the prover ran the computation correctly. A blockchain node can then cheaply verify the correctness, even if the node does not know the inputs. Verification is cheap. In a way, proof verification is similar to how a node now instantly verifies a Proof of Work block hash is correct.

Zk-SNARKs could potentially solve three big challenges blockchains face today:

  • Privacy: Inputs can be set to private and don't have to be known by the verifier. This property is used by coins like Zcash.
  • Scaling: Instead of having every blockchain node running the same scripts, only one (off-chain) node needs to run the smart contract.
  • Centralization: By generating proof of verification of the blockchain, a tiny, fixed sized blockchain becomes possible. Unlike traditional blockchains (which can be gigabytes in size), any small computer or even phone is able to verify the blockchain state. Coda uses zk-SNARKs to compress the blockchain to 20 kilobytes.

ZK-Snarks are currently used by Zcash, Coda, ZEXE and 0x.

Alternatives to zk-SNARKs include zk-STARKs (with a T) and Bulletproofs (useful for range proofs).

Download

Download latest version in releases section.

Requirements

  • MacOS 10.13 or higher

Zokrates Resources

zk-SNARK Resources

Notes

ZK Playground was created in two weeks as part of the first Insight Distributed Consensus program in March-April 2019.