First, install the Zcash build dependencies. These can be found on the
official Zcash docs.
Only install the dependencies listed in the apt-get
block, and skip
the rest of the instructions.
Once you have installed the build dependencies:
# build all dependencies
$ make -C ./depends/
$ ./autogen.sh
$ HOST=$(./depends/config.guess)
# Use the previously compiled dependencies instead of system libraries
$ export CONFIG_SITE="$PWD/depends/$HOST/share/config.site"
# Configure the build
$ ./configure --disable-tests --disable-bench --disable-hardening --enable-online-rust
# Build the Rust C++ bindings + bridge
$ make -C src cargo-build-lib
# Find the location of the newly compiled Rust C++ bridge library
$ BRIDGE_LOCATION=$(dirname $(./contrib/devtools/find-libcxxbridge.sh))
# Instruct the linker to include the Rust C++ bridge library
$ export LDFLAGS="-L$BRIDGE_LOCATION -lcxxbridge1"
# Reconfigure the build, taking our freshly compiled Rust C++ bridge into account.
$ ./configure --disable-tests --disable-bench --disable-hardening --enable-online-rust
# Run the actual build
$ make -j # omit the -j if running into memory issues
The observant reader will note that this requires a bit of back and forth, which
might seem odd. Two calls to ./configure
, what's this??
The issue boils down to the following:
- We're building a C++ library based on generated C++ code from Rust sources (in the
make -C src cargo-build-lib
step) - This needs to have the same C++ toolchain configuration as the rest of the build
- The output of this (
libcxxbridge1.a
) must be included in the linker flags (LDFLAGS
) for the build to succeed - However, the Rust libraries have to be in place before we invoke
./configure
... This leads to an awkward chicken-or-egg situation. - The solution (it might be a strange one, perhaps there's better options) is to run
./configure
twice, and doing the Rust build step in-between.
Building on macOS is not as well supported as on Linux. The upstream Zcash repo doesn't fully support macOS, and our support is monkey-patched in by a guy who doesn't fully know what he's doing.
Building upstream Zcash is not supported at all on ARM chips. However, macOS has very good support for running x86_64 binaries, through Rosetta. We therefore build for x86_64 chips, and use these binaries to run on both newer and older machine.
Install build dependencies:
$ brew install git pkgconfig automake autoconf libtool coreutils
The rest of the instructions are the same as for building for Linux, except that two environment variables need to be set:
export BUILD=x86_64-apple-darwin23.0.0
export HOST=$BUILD
These variables have been attempted to be set through the build system instead, without success. If someone more skilled at the build system than the previous author strolls along, please take a look.
To install all dependencies and build zcash-sidechain on ubuntu (22.04) run:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git curl
# install nix package manager
sh <(curl -L https://nixos.org/nix/install) --daemon
# now follow the instructions and then close and open the terminal (to get nix initialized)
git clone git@github.com:nchashch/zcash-sidechain.git
cd zcash-sidechain
nix-shell # this will install all build tools and dependencies
./autogen.sh
./configure $configureFlags
make -j8 # or number of cores you want to use
A script for: activating this sidechain (on drivechain), mining blocks, depositing and withdrawing coins, generating t/z addresses and using them, is available here.
Zcash is an implementation of the "Zerocash" protocol. Based on Bitcoin's code, Zcash intends to offer a far higher standard of privacy through a sophisticated zero-knowledge proving scheme that preserves confidentiality of transaction metadata. More technical details are available in our Protocol Specification.
This software is the Zcash client. It downloads and stores the entire history of Zcash transactions; depending on the speed of your computer and network connection, the synchronization process could take a day or more once the blockchain has reached a significant size.
See important security warnings on the Security Information page.
Zcash is experimental and a work in progress. Use it at your own risk.
This release is considered deprecated 16 weeks after the release day. There is an automatic deprecation shutdown feature which will halt the node some time after this 16-week period. The automatic feature is based on block height.
- 📘 See the documentation at the ReadTheDocs for help and more information.
- 📨 Ask for help on the Zcash forum.
- 💬 Join our community on Discord
Participation in the Zcash project is subject to a Code of Conduct.
For license information see the file COPYING.