Git Product home page Git Product logo

zkllvm-blueprint's Introduction

Circuit Definition Library for =nil; Foundation's Cryptography Suite

Run tests

Dependencies

Building and installation

cmake -B build -DCMAKE_INSTALL_PREFIX=/path/to/install
make -C build install

Note: if you got an error on find_package during cmake configuration, make sure that you provided paths to the installed dependencies (for example, via CMAKE_PREFIX_PATH environment variable)

Nix support

This repository provides Nix flake, so once you have installed Nix with flake support, you can use single command to fetch all the dependencies and build:

nix build ?submodules=1#

To activate Nix development environment:

nix develop

To run all tests:

nix flake check -L ?submodules=1#

To build/develop/test with local crypto3 version, add an argument --override-input nil_crypto3 /path/to/local/crypto3 to any of the above commands.

zkllvm-blueprint's People

Contributors

akokoshn avatar aleasims avatar andreymlashkin avatar ayashunsky avatar cblpok-git avatar etatuzova avatar iluvmagick avatar luannet avatar makxenov avatar martun avatar nemothenoone avatar nkaskov avatar noamdev avatar rinat229 avatar shatooon avatar sk0m0r0h avatar skywinder avatar tshchelovek avatar ukorvl avatar valeh2012 avatar vo-nil avatar vuittont60 avatar x-mass avatar zerg1996 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zkllvm-blueprint's Issues

Update R1CS blueprint

R1CS blueprint is outdated and requires update according to new repository structure and PLONK-blueprint-alike concepts.

Fp6_2over3 implementation review

Fp6_2over3_cyclotomic_sqr_component assumes existence of fp2 extension of fp6_2over3 field. It would be great to remove this requirement.

Substitute component-oriented selectors with gate-oriented

Component-oriented selector choice is incorrect and may lead to potential efficiency issues, since we can not distinguish two instances of one component with different input params (parametrized with different input variables) - such instances will have same selectors. And if we directly use variables from params instead of using copy constraints (it may take place in small components, for example), it will lead to undefined behaviour - constraints are different, but selectors are the same.

Most obvious way to fix this is to switch to gate-oriented selectors. But it doesn't sound like an easy task, since it will require building gate ID based on it's content. Most likely we will do it after implementing stable math expression type: NilFoundation/crypto3-math#5 .

Until we closed this issue - we always must use copy constraints for params variables!

Feature Request: Not Equals Zero Component

It'd be cool to have a not equals component that would be more efficient that compare component or packing component + disjunction component.
The constraint I suggest is: inv * x =1 for some inv.
This can only be true if x is non zero.
on witness generation inv would be assigned the inverse of x.
It'd better to write it in a way that supports linear combinations and not just variables, this way it could be used to check that any two numbers/variables are different just by subtracting one from the other and using the not_zero component on the linear combination.

Github actions change patch version.

Add file with library version. If necessary, the developer will change the major and minor versions of the library in it.

Make automatic change of library patch version in case of merge to master. (In case of successful closing of PR)

Introduce R1CS GG PPzkSNARK tests with all components

It looks like basic components require usage of set_input_sizes functions to be compatible with zk's r1cs_gg_ppzksnark. This hypothesis has to be checked and after that it's important to write corresponding tests.

Update verify_heterogenous scalar and base assignments

Implement both circuit and assignments separation into small parts

For some tasks, including parallelization, we need to add many components to circuit and generate assignments for them independently or even at the same time. Since it's not possible with only one circuit and assignments state structs instance (because of memory management), we need to make it possible to construct many small circuits and then assemble these parts together.

Move high-level wrappers to separate repository

Many circuits we added for Mina are in-fact high-level wrappers on our components. They will be substituted by the code written upon the zkLLVM compiler. Since we need to use it while zkLLVM is WIP, we decided to move them to separate relevant repository. There they do not have to follow components constraints, since they are not components.

Meging element_powers implementations.

Currently, there are two different implementations of element_powers class. One of them is incomplete, another one has tests located in the wrong directory.

We should delete the incomplete one, and move the complete one to the correct directory. I also used this issue to slightly modify the implementation.

Update PLONK components to be compatible with zkllvm assigner interface

zkLLVM assigner requires components to have updated flexible interface, allowing advanced optimizations. Such updates need to be applied to all needed PLONK components.

This is the list of components to start with:

  • non-native:
    • bit-decomposition +
    • bool_scalar_multiplication +/-
    • complete_addition_edwards25519
    • doubling_edwards25519
    • ec_point_edwards25519
    • fixed_base_multiplication_edwards25519
    • reduction +
    • scalar_non_native_range +
    • variable_base_multiplication_edwards25519
    • variable_base_multiplication_per_bit_edwards25519
  • signatures_verification
  • ed25519
  • sha512

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.