Skip to content
Proof of concept integration of Zerocash on Ethereum: https://arxiv.org/abs/1904.00905
C++ Python JavaScript CMake Other
Branch: master
Clone or download
AntoineRondelet Merge pull request #27 from clearmatics/update-cmake
Used last version of cmake in Dockerfile for base image
Latest commit 61a224a Apr 30, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
api Fixed spacing in proto files Apr 30, 2019
coinstore Rephrased the note in the coinstore README Feb 28, 2019
debug Explained the purpose of the debug folder Feb 28, 2019
depends update submodule last commits Apr 30, 2019
jsClient Added deprecated mention in jsclient Apr 30, 2019
keystore
pyClient Added command to fecth solc manually if python module fails to do it Apr 30, 2019
src Fixed spacing and formatting Apr 30, 2019
trusted_setup Updated README in the trusted setup folder Feb 28, 2019
zeth-contracts Renamed constructor arguments consistently Apr 30, 2019
.dockerignore Added pyenv to gitignore and added dockerignore file Feb 27, 2019
.editorconfig Added editorconfig file Apr 15, 2019
.gitattributes Added gitattributes to get highligting for the tcc files Jan 3, 2019
.gitignore fix problems in pyClient and other small stuffs Apr 30, 2019
.gitmodules update libsnark repo Mar 28, 2019
CMakeLists.txt some changes to the cmakelists variables and readmes Apr 30, 2019
CODE_OF_CONDUCT.md Updated README and added code of conduct contributing file Feb 28, 2019
CONTRIBUTING.md Updated README and added code of conduct contributing file Feb 28, 2019
Dockerfile-base Used last version of cmake in Dockerfile for base image Apr 30, 2019
Dockerfile-zeth Updated docker section to work with both the base and dev images Apr 30, 2019
LICENSE Added LICENSE file Feb 28, 2019
README.md Updated docker section to work with both the base and dev images Apr 30, 2019
setup_env.sh Modified README instructin as the zeth exec are added to the PATH Feb 28, 2019
zethConfig.h.in Added config file for versionning Jan 3, 2019

README.md

Zeth - Zerocash on Ethereum

🚨 WARNING This project is a Proof of Concept. It is highly inefficient and has not been thoroughly reviewed. Please do not use in production!

Disclaimer: This work is inspired from babyzoe, Miximus. It follows and extends the design presented in zerocash-ethereum by adapting some code initially written by Zcash.

👉 Check our paper for more information about Zeth.

Building and running the project:

Environment

In order to follow the README below, you will need:

  • Docker
  • Npm (at least version 6.4.1)
  • Node (at least version v9.5.0)
  • Python3 (at least version 3.6.3)

We use 3 terminals to run the project. One terminal will be used to run the proving service/server, another one will be used to run a local Ethereum testnet, and the final terminal will be used to run a python stub that triggers a few proof generations on the proving server in order to do confidential transactions on the Ethereum testnet.

The titles of the sections below are prefixed with the terminal ID the commands should be ran into.

Terminal 1: Configure the project and run the cpp tests (Docker)

# Clone this repository:
git clone git@github.com:clearmatics/zeth.git
cd zeth

# Pull the zeth-base image (built from `Dockerfile-base`)
docker pull clearmatics/zeth-base:latest
# Build the zeth-dev image
docker build -f Dockerfile-zeth -t zeth-dev .
# Start the zeth development container
docker run -ti -p 50051:50051 --name zeth zeth-dev:latest

## All the commands below are ran in the docker container
# Configure your environment
. ./setup_env.sh

# Compile the proving server
mkdir build
cd build
cmake ..
## (optional) Run the tests
make check # Builds and run the tests (once the tests are built, calling "make test" suffices to execute them)
## Compile
make

# Start the proving server
prover_server
Build Options

By default, zeth makes use of GROTH16. To chose a different zksnark run the following:

cmake -DZKSNARK=$ZKSNARK ..

where $ZKSNARK is PGHR13(see https://eprint.iacr.org/2013/279, http://eprint.iacr.org/2013/879) or GROTH16(see https://eprint.iacr.org/2016/260).

Terminal 2: Start an Ethereum testnet to test the smart contracts

# Start the ethereum test net by running the following commands
cd zeth-contracts

# Install dependencies
npm install

# Start a local Ethereum testnet
npm run testrpc

Terminal 3: Start the testing Python stub

# Configure your environment
. ./setup_env.sh

cd pyClient
# Follow the few steps described in the README of the python stub

Use the pyClient or the jsClient

This Proof of Concept comes with some minimal building blocks to integrate Zeth with your applications. You can use the python and/or the javascript clients to interact with the proving service and request proofs on a given (instance, witness) pair.

If you do not know where to start, you can just follow the instructions of the README in pyClient to run one of the testEtherMixing.py or testERCTokenMixing.py script. These scripts implement a scenario where Alice, Bob and Charlie do confidential transfers using Ether and an ERC20 token, respectively.

Note: These clients are very minimal and only used for testing purpose!

References and useful links

License notices:

Zcash

Copyright (c) 2016-2018 The Zcash developers
Copyright (c) 2009-2018 The Bitcoin Core developers
Copyright (c) 2009-2018 Bitcoin Developers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


The MIT software license (http://www.opensource.org/licenses/mit-license.php)
above applies to the code directly included in this source distribution.
Dependencies downloaded as part of the build process may be covered by other
open-source licenses. For further details see 'contrib/debian/copyright'.


This product includes software developed by the OpenSSL Project for use in the
OpenSSL Toolkit (https://www.openssl.org/). This product includes cryptographic
software written by Eric Young (eay@cryptsoft.com).


Although almost all of the Zcash code is licensed under "permissive" open source
licenses, users and distributors should note that when built using the default
build options, Zcash depends on Oracle Berkeley DB 6.2.x, which is licensed
under the GNU Affero General Public License.

Libsnark

The libsnark library is developed by SCIPR Lab (http://scipr-lab.org)
and contributors.

Copyright (c) 2012-2014 SCIPR Lab and contributors (see AUTHORS file).

All files, with the exceptions below, are released under the MIT License:

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Miximus

barryWhiteHat/miximus GNU General Public License v3.0

You can’t perform that action at this time.