zkInterface — An Emerging Standard for Zero-Knowledge Frameworks

Gokul B Alex
5 min readJun 10, 2020

Interoperability is a big thing in the intelligent world of information. It has become a creative challenge for the realms of ciphers and codes ! Yes, we are talking about interoperability in Zero Knowledge Proofs (ZKP). We have come a long way in the world of ZKP from the initial conceptualisation from PCP theorem and random oracles. It has become a much needed movement as we are witnessing a Cambrian explosion of zero knowledge proofs in the recent years ever since the flamboyant facade around Zero Cash and ZCash.

Image by Gerd Altmann from Pixabay

What are these Zero Knowledge Proofs (ZKP) ? ZKPs are cryptographic primitives that allow some entity (the prover) to prove to another party (the verifier) the validity of some statement or relation. It is essentially an approach to delegate and delineate much of the cryptographic assumptions to the communication circuitry beyond the source and destination of ciphers. In the classical crytography, ciphers were born in the collective hardness of keys and associated ciphers. It demanded a lot of complex circuitry for encrypting and decrypting ciphers with sophisticated key generation devices. Zero knowledge proofs decouple the construction of ciphers into components of proof generation and verification systems. Prover and verifier could be modelled as probabilistic Turing machines. Turing machine is a creative construct that transforms mathematical measurements into mechanical devices doing magical processes known as computations. This radically changes the contours of cryptography forever. We no-longer need any strong information theory centered hardness assumptions. Instead it is all about computational complexity focused hardness assumptions. Hence cryptographic assumptions become centred around rigourous relationships than static symbolisms.

https://zkproof.org

ZKProof is an open industry — academic initiative to bring zero knowledge proof cryptogrpahy into mainstream through a community driven standardization process that focuses on security and interoperability. zkInterface is an interesting tool for Zero Knowledge Interoperability with this perspective. Please find the GitHub repository of zkInterface for further details. You can explore an interactive live demo of the WebAssembly modules built on zkInterface with this website.

There are a set of application specific statements of zero knowledge proofs with low-constraint systems being created by various protocols. These are consumed by cryptographic backends which generate and verify proofs.

ZkInterface Integration Architecture

zkInterface aims to decouple the frontends and backends allowing application writers to choose the frontend most convenient for their functional and development needs and combine it with the backend that best matches their performance and security needs. Zokrates, libsnark, Mir r1cs, PySNARK are some of the most mature frontends. Bellman and Dalek are two powerful backends. Bellman is based on Groth16 elliptical curves whereas Dalek is a bullet proof based system.

Following are some of the goals highlighted in ZkInterface:

Communicating various constraint systems used for proof construction

Communicating various models of variable assignments

Construction of constraint systems out of smaller circuit and gadgets

We briefly touched upon the frontends of ZKPs. In the application specific statements the instance and witness are expressed as variable assignments, and relations are expressed via low-level languages. Some of these languages include arithmetic circuits, Boolean circuits, Quadratic Arithmetic Programs, Quadratic Span Programs etc. Following are some of the interesting procedures in these frontends outlined by ZkInterface paper.

The specification of a high-level language for expressing statements.

A compiler that converts relations expressed in the high-level language into the low-level relations suitable for some backend.

Instance reduction: conversion of the instance in a high-level statement to a low-level instance.

Witness reduction: conversion of the witness to a high-level statement to a low-level witness

Instance reduction is the process of constructing a constraint system. Witness reduction is the process of assigning values to all variables in the system before generating a proof about concrete input values. When using a proving system with pre-processing, instance reduction is performed once ahead of time and used in the key generation. In proving systems without preprocessing, instance reduction is used in proof verification. The standard supports both execution flows.

What are the current bottlenecks to the standardisation efforts in ZKP ? The zkInterface paper highlights the following :

There is no portability between different backends and frontends

It is not possible to generate a constraint system using different frontends

Thus zkInterface aims to create explicit formatting layer between the frontends and backends. Interestingly, we can see a collection of WebAssembly modules in zkInterface to build live demos. In the live demo, zkInterface connects to ZoKrates compiler to the Dalek Bulletproofs proving system.

zkInterface is a procedural, purely functional interface for zero-knowledge systems that enables cross-language interoperability. It has introduced a new messaging system to streamline the interaction between caller and gadgets. Messages are purely read-only data, which grants a great flexibility to implementations of gadgets and applications.

Different parts of an application may be written in different programming languages, and interoperate through messages. These parts may be linked and executed in a single process, calling functions, and exchanging messages through buffers of shared memory. This approach helps in the design of interoperability a lot. Messages in the zkInterface are defined through FlatBuffers interface definion language. All messages and fields are defined in this schema.The FlatBuffers system includes an interface definition language which implies a precise data layout at the byte level.

zkInterface aspires to create a standard format for the proof statement instance and witness to enable users to have their choice of frameworks (frontends and backends) and streaming for storage and communication, and facilitate creation of benchmark test cases that could be executed by any backend accepting these formats.

This is my first article introducing the exciting world of interoperability in the realms of Zero Knowledge Proofs. A lot more to explore and explain. I will share further condensations and conversations in this regard soon !

--

--