# zkStrata: a declarative langauge for zero-knowledge proof specification

**URL:** <https://community.zkproof.org/t/zkstrata-a-declarative-langauge-for-zero-knowledge-proof-specification/370>\
**Category:** Research\
**Created:** [January 23, 2020, 10:03am UTC](https://community.zkproof.org/t/zkstrata-a-declarative-langauge-for-zero-knowledge-proof-specification/370 "2020-01-23T10:03:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.zkproof.org/marc/32/170_2.png) [@Marc](https://community.zkproof.org/u/Marc)\
**Post date:** [January 23, 2020, 10:03am UTC](https://community.zkproof.org/t/zkstrata-a-declarative-langauge-for-zero-knowledge-proof-specification/370/1 "2020-01-23T10:03:50Z")

</div>

I have created a declarative language for expressing zero-knowledge proofs, that can be compiled into an executeable representation of R1CS gadgets. The goal is to showcase benefits of restrictions in expressiveness (compared to existing general-purpose high-level languages) and a requirement for witness data to comply to a public schema (e.g. a passport or drivers license) such as readability and additional tools for error prevention through type safety.

The code, documentation and examples are [available on GitHub](https://github.com/MarcKloter/zkStrata).

Statements written in the language can be compiled into an intermediate representation of R1CS gadgets (called [bulletproofs\_gadgets](https://github.com/MarcKloter/bulletproofs_gadgets)) executable using the experimental R1CS API of [dalek-cryptograhy’s Bulletproofs implementation](https://github.com/dalek-cryptography/bulletproofs).

A proof of age claiming a person being born at least 18 years ago using a goverment-issued passport as witness could be expressed as:

```nohighlight
PROOF FOR
    WITNESS myPassport COMPLIANT TO us_passport
THAT
    myPassport.dateOfBirth <= 20020123

```

Where `us_passport` would for example be a JSON schema published by the U.S. government defining the fields and data types of a valid passport along with an additional statement to express logic used to prove the authenticity of a document. In this case this could be the structure of a merkle tree for the government to sign and publish the root hash for:

```nohighlight
PROOF FOR 
    THIS 
THAT 
    public.rootHash IS MERKLE ROOT OF 
    (
        (
            (private.firstName, private.lastName), 
            (private.dateOfBirth, private.placeOfOrigin)
        ),
        (
            (private.dateOfIssue, private.dateOfExpiry), 
            (private.authority, private.identifier)
        )
    )

```

A full example of a proof of age together with instruction to its execution can be found as [example within the repository](https://github.com/MarcKloter/zkStrata/tree/master/examples/passport).

To try out the language, there is also the [zkStrata Playground](https://github.com/MarcKloter/zkStrata-playground), which can be pulled as a [docker image from GitHub Packages](https://github.com/MarcKloter/zkStrata-playground/packages/111216).

As this is the first iteration of the language, any feedback, inputs and ideas would be appreciated.
