Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.9%) to scientific vocabulary
Last synced: 9 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: Hash-CP-NIZKs
  • License: apache-2.0
  • Language: Go
  • Default Branch: zkpaper
  • Size: 9.39 MB
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation Security

README.md

gnark zk-SNARK library

Twitter URL License Go Report Card PkgGoDev Documentation Status DOI

gnark is a fast zk-SNARK library that offers a high-level API to design circuits. The library is open source and developed under the Apache 2.0 license

Useful Links

gnark Users

To get started with gnark and write your first circuit, follow these instructions.

Checkout the online playground to compile circuits and visualize constraint systems.

Warning

gnark has been partially audited and is provided as-is, we make no guarantees or warranties to its safety and reliability. In particular, gnark makes no security guarantees such as constant time implementation or side-channel attack resistance.

gnark and gnark-crypto packages are optimized for 64bits architectures (x86 amd64) and tested on Unix (Linux / macOS).

Issues

gnark issues are tracked in the GitHub issues tab.

To report a security bug, please refer to gnark Security Policy.

If you have any questions, queries or comments, GitHub discussions is the place to find us.

You can also get in touch directly: gnark@consensys.net

Release Notes

Release Notes

Proving schemes and curves

Refer to Proving schemes and curves for more details.

gnark support the following zk-SNARKs:

which can be instantiated with the following curves

  • [x] BN254
  • [x] BLS12-381
  • [x] BLS12-377
  • [x] BW6-761
  • [x] BLS24-315
  • [x] BW6-633
  • [x] BLS24-317

Example

Refer to the gnark User Documentation

Here is what x**3 + x + 5 = y looks like

```golang package main

import ( "github.com/consensys/gnark-crypto/ecc" "github.com/consensys/gnark/backend/groth16" "github.com/consensys/gnark/frontend" "github.com/consensys/gnark/frontend/cs/r1cs" )

// CubicCircuit defines a simple circuit // x**3 + x + 5 == y type CubicCircuit struct { // struct tags on a variable is optional // default uses variable name and secret visibility. X frontend.Variable gnark:"x" Y frontend.Variable gnark:",public" }

// Define declares the circuit constraints // x**3 + x + 5 == y func (circuit *CubicCircuit) Define(api frontend.API) error { x3 := api.Mul(circuit.X, circuit.X, circuit.X) api.AssertIsEqual(circuit.Y, api.Add(x3, circuit.X, 5)) return nil }

func main() { // compiles our circuit into a R1CS var circuit CubicCircuit ccs, _ := frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit)

// groth16 zkSNARK: Setup
pk, vk, _ := groth16.Setup(ccs)

// witness definition
assignment := CubicCircuit{X: 3, Y: 35}
witness, _ := frontend.NewWitness(&assignment, ecc.BN254.ScalarField())
publicWitness, _ := witness.Public()

// groth16: Prove & Verify
proof, _ := groth16.Prove(ccs, pk, witness)
groth16.Verify(proof, vk, publicWitness)

}

```

Citing

If you use gnark in your research a citation would be appreciated. Please use the following BibTeX to cite the most recent release.

bib @software{gnark-v0.9.0, author = {Gautam Botrel and Thomas Piellard and Youssef El Housni and Ivo Kubjas and Arya Tabaie}, title = {ConsenSys/gnark: v0.9.0}, month = feb, year = 2023, publisher = {Zenodo}, version = {v0.9.0}, doi = {10.5281/zenodo.5819104}, url = {https://doi.org/10.5281/zenodo.5819104} }

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the Apache 2 License - see the LICENSE file for details

Owner

  • Name: Hash-CP-NIZKs
  • Login: Hash-CP-NIZKs
  • Kind: organization

Citation (CITATION.bib)

@software{gnark-v0.7,
  author       = {Gautam Botrel and
                  Thomas Piellard and
                  Youssef El Housni and
                  Ivo Kubjas and
                  Arya Tabaie},
  title        = {ConsenSys/gnark: v0.7.0},
  month        = march,
  year         = 2022,
  publisher    = {Zenodo},
  version      = {v0.7.0},
  doi          = {10.5281/zenodo.5819104},
  url          = {https://doi.org/10.5281/zenodo.5819104}
}

GitHub Events

Total
  • Public event: 1
Last Year
  • Public event: 1

Dependencies

.github/workflows/pr.yml actions
  • actions/checkout v4 composite
  • actions/setup-go v4 composite
  • golangci/golangci-lint-action v3 composite
  • gotesttools/gotestfmt-action v2 composite
  • slackapi/slack-github-action v1.24.0 composite
  • thollander/actions-comment-pull-request v2 composite
.github/workflows/push.yml actions
  • actions/checkout v4 composite
  • actions/setup-go v4 composite
  • golangci/golangci-lint-action v3 composite
  • gotesttools/gotestfmt-action v2 composite
  • slackapi/slack-github-action v1.24.0 composite
go.mod go
  • github.com/bits-and-blooms/bitset v1.8.0
  • github.com/blang/semver/v4 v4.0.0
  • github.com/consensys/bavard v0.1.13
  • github.com/consensys/gnark-crypto v0.11.2
  • github.com/davecgh/go-spew v1.1.1
  • github.com/fxamacker/cbor/v2 v2.5.0
  • github.com/google/go-cmp v0.5.9
  • github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b
  • github.com/kr/text v0.2.0
  • github.com/leanovate/gopter v0.2.9
  • github.com/mattn/go-colorable v0.1.13
  • github.com/mattn/go-isatty v0.0.19
  • github.com/mmcloughlin/addchain v0.4.0
  • github.com/pmezard/go-difflib v1.0.0
  • github.com/rogpeppe/go-internal v1.11.0
  • github.com/rs/zerolog v1.30.0
  • github.com/stretchr/testify v1.8.4
  • github.com/x448/float16 v0.8.4
  • golang.org/x/crypto v0.12.0
  • golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
  • golang.org/x/sys v0.11.0
  • gopkg.in/yaml.v3 v3.0.1
  • rsc.io/tmplfunc v0.0.3
go.sum go
  • github.com/bits-and-blooms/bitset v1.8.0
  • github.com/blang/semver/v4 v4.0.0
  • github.com/consensys/bavard v0.1.13
  • github.com/consensys/gnark-crypto v0.11.2
  • github.com/coreos/go-systemd/v22 v22.5.0
  • github.com/creack/pty v1.1.9
  • github.com/davecgh/go-spew v1.1.1
  • github.com/fxamacker/cbor/v2 v2.5.0
  • github.com/godbus/dbus/v5 v5.0.4
  • github.com/google/go-cmp v0.5.9
  • github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b
  • github.com/google/subcommands v1.2.0
  • github.com/kr/pretty v0.3.1
  • github.com/kr/text v0.2.0
  • github.com/leanovate/gopter v0.2.9
  • github.com/mattn/go-colorable v0.1.12
  • github.com/mattn/go-colorable v0.1.13
  • github.com/mattn/go-isatty v0.0.14
  • github.com/mattn/go-isatty v0.0.16
  • github.com/mattn/go-isatty v0.0.19
  • github.com/mmcloughlin/addchain v0.4.0
  • github.com/mmcloughlin/profile v0.1.1
  • github.com/pkg/errors v0.9.1
  • github.com/pmezard/go-difflib v1.0.0
  • github.com/rogpeppe/go-internal v1.11.0
  • github.com/rs/xid v1.5.0
  • github.com/rs/zerolog v1.30.0
  • github.com/stretchr/testify v1.8.4
  • github.com/x448/float16 v0.8.4
  • golang.org/x/crypto v0.12.0
  • golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
  • golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
  • golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6
  • golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab
  • golang.org/x/sys v0.6.0
  • golang.org/x/sys v0.11.0
  • gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
  • gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
  • gopkg.in/yaml.v2 v2.4.0
  • gopkg.in/yaml.v3 v3.0.1
  • rsc.io/tmplfunc v0.0.3