Ethsnarks / ethsnarks-il

Intermediate Language for zkSNARK circuits
GNU Lesser General Public License v3.0
7 stars 3 forks source link

Support low-level circuit formats for circuit compilers and optimisers #2

Open HarryR opened 5 years ago

HarryR commented 5 years ago

In order to benefit from a wider range of tools and broaden horizons I think it's a good idea to support netlist formats - or formats that are easily parsable and usable as a zkSNARK circuit.

The ISCAS89 format is widely supported and similar to the Pinocchio output format.

Example files:

Example tools:

However, CBMC-GC-2 is the most interesting, as it's specifically designed for MPC - converting a subset of C into ISCAS style gates.

CBMC-GC example format: https://gitlab.com/securityengineering/CBMC-GC-2/blob/master/examples/tutorial_addition/output.gate.txt

SFDL / SHDL example: https://github.com/tastyproject/tasty/blob/master/tasty/circuit/circuits/BNP08_FairplayMP2.1/Millionaires.sfdl.shdl

Other examples:

Potential high level languages:

Potential low-level languages:

HarryR commented 5 years ago

I am giving up on Pinocchio, it's interesting as a quaint proof of concept, but has little further value.

However, further work should be done to support the Pinocchio style circuit format used by jsnark and xjsnark as they'e far more promising.

Furthermore, I'm working on a translated from SHDL (compiled from SFDL via the FairPlay compiler)

And working on integrating CBMC-GC-2

HarryR commented 5 years ago

https://practice-project.eu/downloads/publications/D22.1-State-of-the-art-analysis-PU-V1.1.pdf provides a good overview of different high-level languages and compilers for secure function evaluation.

HarryR commented 5 years ago

Other interesting projects:

HarryR commented 5 years ago

https://github.com/ZcashFoundation/GrantProposals-2018Q2/issues/33 is also related and contains many relevant resources