forked from: https://github.com/Zerocash/libzerocash
refer to: https://github.com/Electric-Coin-Company/libzerocash
The libzerocash library implements the Zerocash protocol, which provides a privacy-preserving version of Bitcoin (or a similar currency).
Zerocash fixes an inherent weakness of Bitcoin: every user's payment history is recorded in public view on the block chain, and is thus readily available to anyone. While there are techniques to obfuscate this information, they are problematic and ineffective. Instead, in Zerocash, users may pay one another directly, via payment transactions that reveal neither the origin, destination, or amount of the payment. This is a marked improvement compared to Bitcoin (and similar decentralized digital currencies), where every payment's information is made public for the whole world to see.
The basic Zerocash protocol is described in this paper:
- Eli Ben-Sasson, Alessandro Chiesa, Christina Garman, Matthew Green, Ian Miers, Eran Tromer, Madars Virza, Zerocash: Decentralized Anonymous Payments from Bitcoin, proceedings of the IEEE Symposium on Security & Privacy (Oakland) 2014, 459-474, IEEE, 2014
It improves on an earlier protocol, Zerocoin, developed by some of the same authors, both in functionality (Zerocoin only hides a payment's origin, but not its destination or amount) and in efficiency (Zerocash transactions are less than 1KB and take less than 6ms to verify).
Zerocash relies on Succinct Noninteractive Arguments of Knowledge (SNARK) proofs, as implemented in the open-source libsnark library by SCIPR Lab.
-
./get-libsnark
,r un get-libsnark to git pull libsnark from github.com,
-
- checkout the version when lightning_circuit was generated.
cd depsrc/libsnark/ && git checkout 746ade7ce0f30a6f6e612e50450294c8e7ade9a4
- checkout the version when lightning_circuit was generated.
-
- Comment
git pull
in get-libsnark
- Comment
-
- run get-libsnark again,
./get-libsnark
- run get-libsnark again,
-
make
There are two bugs:
-
fatal error: curses.h: No such file or directory
solution:sudo apt-get install libncurses5-dev libncursesw5-dev
-
fatal error: cryptopp/osrng.h: No such file or directory
solution:sudo apt-get install libcrypto++-dev libcrypto++-doc libcrypto++-utils
-
error: base class ‘class CryptoPP::AbstractRingCryptoPP::Integer’ should be explicitly initialized in the copy constructor [-Werror=extra]
solution: removed the -Werror and -Wfatal-errors flags from the Makefile. zcash issue
For more information see the Zerocash web site.
This is an academic proof-of-concept prototype. This implementation is not ready for production use. It does not yet contain all the features, careful code review, tests and integration that are needed for a deployment. Future changes to the cryptographic protocol and data formats are likely.
- Eli Ben-Sasson (Technion)
- Alessandro Chiesa (UC Berkeley)
- Christina Garman (Johns Hopkins University)
- Matthew Green (Johns Hopkins University)
- Ian Miers (Johns Hopkins University)
- Eran Tromer (Tel Aviv University)
- Madars Virza (MIT)