How to Mine ZCash on Linux

Mine Zcash on Linux

As it becomes clearer that cryptocurrency is here to stay, it also becomes time to investigate the diverse and volatile crypto world and consider new alternatives. There are many more coins out there than the big players like Bitcoin and Ethereum, and many of them either innovate in their design or fill a unique role. Zcash is a great example of a cryptocurrency that does both of these things.

Zcash is more anonymous by design, aiming to be a digital from of cash. It features shielded transactions, and everything about Zcash is designed to maintain privacy and security.

This, like many up-and-coming currencies, is still fairly easy and profitable to mine, and it has an accessible exchange rate to buy into.

Install Zcash

The Zcash developers packaged it for Debian and Ubuntu-based distributions, but there’s also a generic binary package available in a tarball. If you’re not on Debian or Ubuntu, drop by the Zcash download page, and grab the latest tarball. Unpack it and you can start using it from there. Otherwise, keep reading for the specific installation instructions.

First, make sure Apt supports installs over HTTPS.

sudo apt install apt-transport-https

Next, download and import the Zcash signing keys.

wget -qO - https://apt.z.cash/zcash.asc | sudo apt-key add -

You’ll need to add the Zcash repository to your sources. Use your text editor of choice to create a file at “/etc/apt/sources.list.d/zcash.list.” Put the following line in the file and save:

deb [arch=amd64] https://apt.z.cash/ jessie main

Now, update Apt and install the Zcash package.

sudo apt update
sudo apt install zcash

Configure Zcash

Fetch the Zcash Parameters

Before you can start mining Zcash, you’re going to need to do a bit of configuration. The first thing you’re going to need is the Zcash parameters. They’re used to generate shielded transactions. This is a fairly long download, so start it up when you have some time to wait.

zcash-fetch-params

You’ll need to set up your configuration file. The bulk of this is creating your username and password so you can store Zcash and complete transactions. Create the folder for it, and start with your username.

mkdir ~/.zcash
echo "rpcuser=username" >> ~/.zcash/zcash.conf

Then, generate a random key as your password.

echo "rpcpassword=`head -c 32 /dev/urandom | base64`" >> ~/.zcash/zcash.conf

Finish up the file by adding a couple of lines that tell the client where to connect and optionally, to start mining.

echo "mainnet=1" >> ~/.zcash/zcash.conf
echo "addnode=mainnet.z.cash" >> ~/.zcash/zcash.conf
# Optional for CPU Mining
echo "gen=1" >> ~/.zcash/zcash.conf

Zcashd running

Start up the Zcash service. You can run it as a daemon in the future with the --daemon flag.

Get Your Wallet Address

Get Your Zcash Wallet Address

You’ve gone through all the steps to set up your wallet. Now, it’s time to get the address that you’ll use to complete transactions with it. Thankfully, that functionality is built into the Zcash utility that you’ve already set up. Run the Zcash CLI to establish an address for your wallet.

zcash-cli getnewaddress

In the future, you can list your wallet address with:

zcash-cli getaddressesbyaccount

Choose a Pool

There are a lot of pools out there for Zcash. It’s hard to say which ones are best, especially since these things always change. This list is fairly comprehensive and should help you get started.

Mining with a pool is key. If you mine solo, the chances of making a profit are very slim. Pick a pool, and stick with it. You’ll see the Zcash start to trickle in shortly after you get started.

Mine with Your GPU

Sure, you can mine with your CPU, but that’s very inefficient, and the chances of getting much out of it are slim. With a decent GPU, though, you can definitely have more success.

There are a couple of GPU mining solutions, but this guide is going to focus on AMD mining with Claymore. AMD cards are most popular among miners, and Claymore is a simple script to use and run.

You can find the latest change notes and a link to the download on this Bitcointalk thread. Use whichever link you prefer, and grab the latest available version.

After you’re done downloading Claymore, unpack it in a directory where you’d like to run it. Open a terminal in that location. You can start up the miner just by executing the “zecminer64” script there, but without passing it anything, you’re not going to get very far.

Claymore mining Zcash

Copy the address from your pool of choice, and pass to the script via the -zpool flag. Then, pass in your wallet address with -zwal. Finally, you can set an intensity level between 1 and 9 with the -i flag. This one isn’t strictly necessary, and the script will set it for you based on your card. When you put it all together, you’ll have something like this:

./zecminer64 -zpool ssl://us-zec.2miners.com:1010 -zwal t1ancMiAivyvCkX5y2BkYfmmjgVjDsXXXXX -i 3

From there, you can just leave it running. If you want your machine to start mining at startup, you can absolutely do that with a startup script.

You’re now prepared to get yourself started mining and using Zcash. Like any cryptocurrency, you should always do your research on profitability before investing in hardware and starting to mine. Always keep an eye out for future updates to both the wallet and mining software. It will make a big difference in both efficiency and security.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Nick Congleton

Nick is a freelance tech. journalist, Linux enthusiast, and a long time PC gamer.