Package: ethsnarks
EthSnarksZero-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, usingGroth16.Prove zkSNARKs in-browser, with WebAssembly and EmscriptenLinux, Mac and Windows buildsSolidity, Python and C++ support in one placeA growing library of gadgets and algorithmsEthSnarks 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 existExamplesMiximus - a self-service coin mixer and anonymous transfer method for EthereumHopper: an Open-Source Mixer for Mobile-friendly private transfers on EthereumExample implementations of ethsnarksAn example of a zero-knowledge-proof of a SHA256 pre-image for EthereumBuildingUnix Flavours (Linux, OSX, Ubuntu, CentOS etc.)The following dependencies are required to build Ethsnarks:cmakeg++ or clang++gmpnpm / nvmCheck-out the source-code using:gitclonegit@github.com:HarryR/ethsnarks.git&&cdethsnarksAfter checking-out the repository you need to install the necessary dependencies, theMakefileincludes pre-determined rules for different platforms, you need to run this asrootor 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, requiresHomebrew)Then install the Python dependencies, via Pip, into the local user directory:make python-dependenciesThen build and test the project:git submodule update --init --recursivemakeWindows (64-bit)Install MSYS2 fromhttps://www.msys2.org/then open the MSYS2 Shell and run:pacman--noconfirm-Smakegmpgmp-develgccgitcmake
gitclonegit@github.com:HarryR/ethsnarks.gitcdethsnarks
gitsubmoduleupdate--init--recursive
cmake-Emake_directorybuild
cmake-Echdirbuildcmake-DCMAKE_BUILD_TYPE=Debug..
cmake--buildbuildBuilding 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 / BrowserWebAssembly, WASM and JavaScript builds are partially supported viaethsnarks-emscriptenandethsnarks-cheerp. The build process is similar, but using the Emscripten and Cheerp toolchains.Requests and ContributionsThis 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, pleaseOpen an issue, or submit a pull request.GadgetsWe 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 anew issueThe following gadgets are available1-of-N2-bit lookup table3-bit lookup tableMiMChash and cipherPoseidonhash functionMiyaguchi-Preneel one-way functionMerkle treeSHA256 (Ethereum compatible, full round)Shamir's Secret Sharing Scheme'Baby JubJub' twisted Edwards curveEdDSAPedersen hashMaintainers@HarryR