All Projects → spring-epfl → zksk

spring-epfl / zksk

Licence: MIT license
Zero-Knowledge Swiss Knife

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to zksk

haal
Hääl - Anonymous Electronic Voting System on Public Blockchains
Stars: ✭ 96 (+71.43%)
Mutual labels:  zero-knowledge-proofs
bulletproofs
Bulletproofs and Bulletproofs+ Rust implementation for Aggregated Range Proofs over multiple elliptic curves
Stars: ✭ 62 (+10.71%)
Mutual labels:  zero-knowledge-proofs
bulletproofs-r1cs-gadgets
Arithmatic circuits convertible to R1CS based on Bulletproofs
Stars: ✭ 65 (+16.07%)
Mutual labels:  zero-knowledge-proofs
awesome-zkp-starter-pack
A curated collection of links for zero-knowledge proof cryptography used in blockchains
Stars: ✭ 63 (+12.5%)
Mutual labels:  zero-knowledge-proofs
bellman
Bellman zkSNARK library for community with Ethereum's BN256 support
Stars: ✭ 121 (+116.07%)
Mutual labels:  zero-knowledge-proofs
baseline
The Baseline Protocol is an open source initiative that combines advances in cryptography, messaging, and distributed ledger technology to enable confidential and complex coordination between enterprises while keeping data in systems of record. This repo serves as the main repo for the Baseline Protocol, containing core packages, examples, and r…
Stars: ✭ 565 (+908.93%)
Mutual labels:  zero-knowledge-proofs
Grin
Minimal implementation of the Mimblewimble protocol.
Stars: ✭ 4,897 (+8644.64%)
Mutual labels:  zero-knowledge-proofs
zkay
A programming language and compiler which enable automatic compilation of intuitive data privacy specifications to NIZK-enabled private smart contracts.
Stars: ✭ 28 (-50%)
Mutual labels:  zero-knowledge-proofs
zerocash-ethereum
Smart contract - Zerocash-like approach for privacy on Ethereum
Stars: ✭ 18 (-67.86%)
Mutual labels:  zero-knowledge-proofs
threshold-signatures
Threshold Signature Scheme for ECDSA
Stars: ✭ 79 (+41.07%)
Mutual labels:  zero-knowledge-proofs
WatermarkNN
Watermarking Deep Neural Networks (USENIX 2018)
Stars: ✭ 63 (+12.5%)
Mutual labels:  zero-knowledge-proofs
PS-Signature-and-EL-PASSO
A C++ Implementation of Short Randomizable Signatures (PS Signatures) and EL PASSO (Privacy-preserving, Asynchronous Single Sign-On)
Stars: ✭ 21 (-62.5%)
Mutual labels:  zero-knowledge-proofs
bellman-substrate
A library for supporting zk-SNARKs to Substrate
Stars: ✭ 26 (-53.57%)
Mutual labels:  zero-knowledge-proofs

zksk

Build status Documentation status Test coverage MIT License Paper on arXiv

Zero-Knowledge Swiss Knife: Python library for prototyping composable zero-knowledge proofs in the discrete-log setting.


Let's say Peggy commits to a secret bit and wants to prove to Victor in zero knowledge that she knows this bit—that is, without revealing it. In Camenisch-Stadler notation, we can write:

PK{ (r): (C = rH) ∨ (C - G = rH) }

To implement this zero-knowledge proof, Peggy will run:

from zksk import Secret, DLRep
from zksk import utils

# Setup: Peggy and Victor agree on two group generators.
G, H = utils.make_generators(num=2, seed=42)
# Setup: generate a secret randomizer.
r = Secret(utils.get_random_num(bits=128))

# This is Peggy's secret bit.
top_secret_bit = 1

# A Pedersen commitment to the secret bit.
C = top_secret_bit * G + r.value * H

# Peggy's definition of the proof statement, and proof generation.
# (The first or-clause corresponds to the secret value 0, and the second to the value 1. Because
# the real value of the bit is 1, the clause that corresponds to zero is marked as simulated.)
stmt = DLRep(C, r * H, simulated=True) | DLRep(C - G, r * H)
zk_proof = stmt.prove()

Victor will receive the commitment C and zk_proof from Peggy, and run this to verify the proof:

from zksk import Secret, DLRep

# Setup: get the agreed group generators.
G, H = utils.make_generators(num=2, seed=42)
# Setup: define a randomizer with an unknown value.
r = Secret()

stmt = DLRep(C, r * H) | DLRep(C - G, r * H)
assert stmt.verify(zk_proof)

Victor is now convinced that Peggy knows the committed bit.


Documentation and materials

Docs https://zksk.readthedocs.io
Academic paper https://arxiv.org/abs/1911.02459 — theoretical details

> Warning. Please don't use this software for anything mission-critical. It is designed for quick protyping of privacy-enhancing technologies, not production use.


Getting started

You need to have Python 3.6 or higher to use zksk. The library is tested and supported on Debian-based systems. Mac support is not guaranteed.

You can install zksk using pip:

pip install git+https://github.com/spring-epfl/zksk

To make sure everything is in order, you can run unit tests. For that, install the dev version of the package:

pip install "git+https://github.com/spring-epfl/zksk#egg=zksk[dev]"

Then, run the tests with pytest:

pytest

Contributing

See the contributing document.

Citing

If you use zksk in your research, please cite like this:

@inproceedings{LueksKFBT19,
  author    = {Wouter Lueks and
               Bogdan Kulynych and
               Jules Fasquelle and
               Simon Le Bail{-}Collet and
               Carmela Troncoso},
  title     = {zksk: {A} Library for Composable Zero-Knowledge Proofs},
  booktitle = {Proceedings of the 18th {ACM} Workshop on Privacy in the Electronic
               Society ({WPES@CCS})},
  pages     = {50--54},
  year      = {2019},
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].