EthSnarks
Zero-Knowledge proofs are coming to Ethereum and Dapps in 2019!
EthSnarks is a collection of zkSNARK circuits and supporting libraries to use them with Ethereum smart contracts, it aims to help solve one of the biggest problems facing zkSNARKS on Ethereum - cross-platform on desktop, mobile and in-browser, cheap enough to run on-chain, and with algorithms that significantly reduces the time it takes to run the prover.
The notable advantages of using EthSnarks are:
- Reduced cost, 500k gas with 1 input, using Groth16.
- Prove zkSNARKs in-browser, with WebAssembly and Emscripten
- Linux, Mac and Windows builds
- Solidity, Python and C++ support in one place
- A growing library of gadgets and algorithms
EthSnarks is participating in the Ethereum Foundation's grants program, development will continue full-time and we will be working with companies and developers to help overcome the common challenges and hurdles that we all face. Get in-touch for more information.
WARNING: EthSnarks is beta quality software, improvements and fixes are made frequently, and documentation doesn't yet exist
Examples
- Miximus - a self-service coin mixer and anonymous transfer method for Ethereum
- Hopper: an Open-Source Mixer for Mobile-friendly private transfers on Ethereum
- Example implementations of ethsnarks
- An example of a zero-knowledge-proof of a SHA256 pre-image for Ethereum
Building
Unix Flavours (Linux, OSX, Ubuntu, CentOS etc.)
The following dependencies are required to build Ethsnarks:
- cmake
- g++ or clang++
- gmp
- npm / nvm
Check-out the source-code using:
git clone git@github.com:HarryR/ethsnarks.git && cd ethsnarks
After checking-out the repository you need to install the necessary dependencies, the Makefile includes pre-determined rules for different platforms, you need to run this as root or an administrator user (i.e. for Brew on OSX):
make fedora-dependencies(CentOS, Fedora, RHEL etc. requiresdnf)make ubuntu-dependencies(Ubuntu, Debian etc. requiresapt-get)make mac-dependencies(OSX, requires Homebrew)
Then install the Python dependencies, via Pip, into the local user directory:
make python-dependencies
Then build and test the project:
git submodule update --init --recursivemake
Windows (64-bit)
Install MSYS2 from https://www.msys2.org/ then open the MSYS2 Shell and run:
pacman --noconfirm -S make gmp gmp-devel gcc git cmake
git clone git@github.com:HarryR/ethsnarks.git
cd ethsnarks
git submodule update --init --recursive
cmake -E make_directory build
cmake -E chdir build cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build build
Building under 32-bit MinGW32, MSYS (not MSYS2) and Microsoft Visual Studio may be supported in future depending upon demand, but currently it's probably broken...
WASM / Browser
WebAssembly, WASM and JavaScript builds are partially supported via ethsnarks-emscripten and ethsnarks-cheerp. The build process is similar, but using the Emscripten and Cheerp toolchains.
Requests and Contributions
This project aims to help create an ecosystem where a small number of well tested but simple zkSNARK circuits can be easily integrated into your project without having to do all of the work up-front.
If you have any ideas for new components, please Open an issue, or submit a pull request.
Gadgets
We are surely increasing the range of gadgets, supporting libraries, available documentation and examples; at the moment the best way to find out how to use something is to dig into the code or ask questions via a new issue
The following gadgets are available
- 1-of-N
- 2-bit lookup table
- 3-bit lookup table
- MiMC hash and cipher
- Poseidon hash function
- Miyaguchi-Preneel one-way function
- Merkle tree
- SHA256 (Ethereum compatible, full round)
- Shamir's Secret Sharing Scheme
- 'Baby JubJub' twisted Edwards curve
- EdDSA
- Pedersen hash
Maintainers
Metadata
Release files for ethsnarks 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ethsnarks-0.0.1.tar.gz | 52.1 kB | Without provenance | Details for ethsnarks-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ethsnarks-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for ethsnarks-0.0.1-py3-none-any.whl |
Total release size: 99.3 kB
Release files / ethsnarks-0.0.1.tar.gz
| Download URL | ethsnarks-0.0.1.tar.gz |
|---|---|
| Size | 52.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb0f5bed19c86fcdb645aa08aba9f3c50572ae2f2f06a3654b297a867f33d96d
|
|
BLAKE2b-256 checksum How to use checksums |
8aa3d1592a955a7fdaaadb45667b8815b5ce099647bedd273f0b2030b204e2fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.3
|
Release files / ethsnarks-0.0.1-py3-none-any.whl
| Download URL | ethsnarks-0.0.1-py3-none-any.whl |
|---|---|
| Size | 47.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b844db22e2de8754d9c636442a23f1cf783b25d09719efebea1818a55af61f9f
|
|
BLAKE2b-256 checksum How to use checksums |
1d49ac1ddebcfa25322ad54442f284c7617dc0abe102690f64f448771cb7cd38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.3
|
Security for ethsnarks 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.