QEDIT

ZkInterface:
ZoKrates ➞ Bulletproofs

ZkInterface is a standard for interoperability of zero-knowledge frameworks.

In this demonstration, we connect the ZoKrates compiler to the Dalek Bulletproofs proving system.

All tools run on this page as WebAssembly modules, and communicate through ZkInterface. Check out the code of this demo to get started with your own zero-knowledge application.

WebAssembly Modules

The modules compile and run independently.
The application moves ZkInterface messages between modules.

ZoKrates.wasm

The frontend module generates the constraints, prover's witnesses, and verifier's inputs, and store them in ZkInterface messages.


      let constraints = zkif_zokrates.make_constraint_system(code);
      
      let {prover_msg, verifier_msg} = zkif_zokrates.make_witness(code, x, y);
    

Bulletproofs.wasm

The proving system reads the ZkInterface messages to generate proofs.
 


      let proof = zkif_bulletproofs.prove(constraints, prover_msg);
      
      let valid = zkif_bulletproofs.verify(constraints, verifier_msg, proof);
    

ZkInterface messages

There are three types of messages:

See the interface definition and the paper for details.

Zero-knowledge Program

A computation in the ZoKrates language.


      _
    

Constraint System

The program is compiled into a common R1CS form.


          _
        

Prover's View

A private witness is used to generate a proof.


          _
        

Verifier's View

The proof is checked based on public inputs.


      _