Zcash: The First Truly Anonymous Cryptocurrency


I work a lot with cryptocurrencies, so I decided to write a series of articles on this subject. Today I will tell you how to install and configure a Zcash node, as well as monitor it using Zabbix. The information is unique and there is practically nothing on this topic in RuNet, so I decided to share.

If you have a desire to learn how to build and maintain highly available and reliable systems, I recommend that you take the online course
“Administrator Linux. Professional" in OTUS. The course is not for beginners; to enroll you must pass.

Introduction

I set up and worked with nodes of all popular and not so popular cryptocurrencies. Participated in the launch of several crypto exchanges. I have accumulated a lot of experience working with them. This information is very narrow and specific. There is practically nowhere to read someone’s experience, even on the English-language Internet.

I studied everything and set it up myself. I took only official documentation as a basis. There are many nuances in the operation of nodes that need to be taken into account. I will try to share the basic information that I have.

I already wrote an article about setting up cryptocurrency nodes, as well as monitoring them, but it’s all partially outdated, especially the installation. Everything needs to be updated. This time there will be a separate article for each node, so as not to mix everything up.

Creators

The people who created this cryptocurrency are experienced representatives of the crypto industry. Most of them are engaged in scientific development, and it was they who created the unique protocol of the system.

This is important, since the people behind many modern cryptocurrencies are not scientists, but marketers who conduct ICOs not for the sake of creating a quality product, but for their own income.

The position of CEO is occupied by Zooko Wilcox, a man who has devoted his entire life to working on blockchain projects and cryptocurrencies. He has 20 years of experience in this field and a huge number of successful projects under his belt.


Figure 7. Zooko Wilcox – CEO of Zcash. Source: official website

The company also employs many scientists who invented the Zcash protocol and continue to improve it:

  • Eli Ben-Sason is a former professor in the Department of Computer Science;
  • Alessandro Chiesa – Doctor of Science, worked at the University of California;
  • Christina Garman is a graduate student at Johns Hopkins University;
  • Eran Tromer is a former lecturer at Tel Aviv University;
  • Madars Virza is a graduate student at Massachusetts Institute of Technology.

These are not all the people who contributed to the development of Zcash, but these scientists were the most helpful in creating the protocol.

Installing a zcash node

Installing zcash is not difficult, but it’s not easy either, since ready-made packages are only available for Debian. I usually use Ubuntu for nodes, so I will build from source. Although the Debian package will most likely work for Ubuntu, I don’t like experiments. From the source code it will definitely work as it should.

First, let's install the dependencies necessary to build zcash.

# apt install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget curl bsdmainutils automake

We copy the repository to ourselves.

# git clone https://github.com/zcash/zcash.git

Select the branch with the latest version.

# cd zcash/ # git checkout v2.1.0-1

We run the script that downloads the files necessary for assembly. There will be a lot of downloading, about 1.7 Gb.

# ./zcutil/fetch-params.sh

After that we start the assembly.

# ./zcutil/build.sh -j$(nproc)

Let's install the compiled binaries into the system:

# cd src # install -sv zcashd zcash-cli /usr/local/bin/ # install -sv zcash-gtest zcash-tx /usr/local/bin/

Updating a zcash node usually looks like this:

  1. Download and compile new sources.
  2. Stop the node and replace the old sources.
  3. Let's start the node.

If there were no big changes leading to re-indexing or a complete update of the blockchain, then everything will go quickly. If a node starts indexing the blockchain, the downtime can be significant, on some nodes up to several hours.

When the node is in operation, the update must be tested first and see what it leads to. In production, I usually keep 2 nodes - the main and backup. The update is being tested on the backup one. If everything is OK, it becomes the main one, and the worker goes to the reserve. And so it rotates every time when updating.

Dynamics of complexity

The current complexity is 42.2 million chips per true (signed) transaction. According to the graph on bitinfocharts.com , the Zcash mining difficulty indicator grows in proportion to the overall network hashrate, while the speed of signing new blocks remains unchanged. The exchange rate of the ZEC cryptocurrency generally depends on the dynamics of Bitcoin, so the longest duration of a block is observed when the value of both assets increases.

READ Bitcoin price history for all time

The total network hashrate is currently 2.411 gigahash (according to bitinfochars.com ), the estimated profitability of Zcash mining is $0.202 per day for each kilohash. The network transaction fee fluctuates around 0.0016 cents. The current supply of coins released to the market is 5.314 million ZEC out of 21 million possible tokens.

Regardless of fluctuations in the difficulty indicator, the average speed of finding blocks remains equal to 2.5 minutes. The Zcash mining calculator will help you evaluate the profitability (unprofitability) of mining at the moment.

Setup and remote access

Now let’s create a configuration file for the zcash node in the ~/.zcash directory.

# mkdir ~/.zcash # mcedit ~/.zcash/zcash.conf rpcuser=username rpcpassword=password addnode=mainnet.z.cash rpcbind=0.0.0.0 rpcallowip=0.0.0.0/0

rpcuserusername for working via rpc
rpcpassworduser password
addnodechoice of blockchain, main mainnet.z.cash or test testnet.z.cash
rpcbindip of the server on which the rpc service will run
rpcallowiplist of allowed IP addresses for connecting to rpc

For the test, I allowed you to listen to all IP addresses of the server and connect from everywhere. Most often this is not necessary. Limit access to the node to a list of only your trusted addresses. I always do this if the node supports this feature. For example, parity for the Ethereum node does not have such settings. Additionally, I always restrict access to the node at the iptables level. I highly recommend doing this.

In general, it is better to run a node not as the root user. Moreover, some nodes cannot be started under root; they require a separate user. My node is usually a virtual machine, where there is nothing except the node itself. In this case, there is no fundamental difference from a security point of view whether it works as root or not.

Pools

The reward for each block is received only by the first miner who mined it. It is almost impossible to be the first to mine a block alone, because it requires enormous power.

That’s why miners unite in pools. The reward is divided among all pool participants in proportion to the power they spent on mining.

The pool itself charges a commission from users. The best pools at the moment are:

  • Flypool;
  • Supernova;
  • Nanopool;
  • Nicehash;
  • Coinmine;
  • Dwarfpool;
  • F2pool.

go

Startup and testing

We have installed and configured the zcash node. Now let's launch it. It supports operation both as a regular application in the console and in daemon mode. The first time you can run it directly in the console to immediately see the result of the work.

#zcashd

The node immediately starts downloading blocks, which is visible in its interface. In general, zcash is one of the few nodes where everything is very clear and understandable. There is no need to look for information about blocks or traffic somewhere in the logs or in requests to the node. Everything is very clear.

In principle, you can run a node in this mode in screen, then you can very quickly and easily view its status. In this form, you can add it to autorun. But it is safer to run zcash nodes as a daemon. She supports this mode.

#zcashd—daemon

The node runs as a service. You can monitor its status in the log - ~/zcash/debug.log. To autorun, just add to cron:

# crontab -e @reboot zcashd -daemon

The status of the node can be checked via the console using zcash-cli .

# zcash-cli getinfo { "version": 2010051, "protocolversion": 170009, "walletversion": 60000, "balance": 0.00000000, "blocks": 368, "timeoffset": 0, "connections": 1, "proxy" ": "", "difficulty": 824.4417744689738, "testnet": false, "keypoololdest": 1579797402, "keypoolsize": 101, "paytxfee": 0.00000000, "relayfee": 0.00000100, "errors": "" }

You can correctly stop the zcash node using the following command:

# zcash-cli stop

Now let's try to perform a remote request about the state of the node via rpc. To do this, go to any other Linux server that has curl. The main thing is to check the work from the application server, where the software for working with the node will run. In the console we run the command:

# curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain ;' https://username: [email protected] :8232/

8232 is the default port that the node listens to, if you did not explicitly specify it in the configuration file. Make sure you enter the correct username or password. If you specify incorrectly, you will not receive anything in response, which is somewhat confusing. Information about this will be in debug.log, but there is so much of it that it is difficult to notice what is needed.

In response to the request, receive information about the state of the node in json format.

The console is not very readable, but it is convenient to parse data, including for the monitoring system. This will be discussed further below. A full description of the api for remote requests can be found in the documentation - https://zcash.readthedocs.io/en/latest/rtd_pages/zig.html.

general information

The Zcash cryptocurrency today is one of the most technically complex and innovative. Almost all representatives of the crypto industry – from miners to investors – were waiting for its launch. The developers have implemented a fundamentally new encryption technology, which is called zk-SNARK.

The main advantage of Zcash, which caused such attention from the professional community, is a new level of transaction anonymity. In this system, it is impossible to track transfers in principle, whereas in Bitcoin and some altcoins this is achievable using modern technologies.

Monitoring the operation of the zcash node

I'll tell you how I monitor the operation of the node. I use Zabbix for this.

If you don’t yet have your own server for monitoring, I recommend materials on this topic. For those who prefer CentOS system:

  1. Installing CentOS 8.
  2. Setting up CentOS 8.
  3. Installation and configuration of zabbix server.

Same thing on Debian 10 if you prefer it:

  1. Installing Debian 10.
  2. Basic Debian setup.
  3. Installing and configuring zabbix on debian.

Here I will not dwell on Zabbix in detail. I have separate articles for this. I’ll tell you right away the essence - what and how I monitor.

In one of the recent versions, Zabbix now has http agents, with which you can send post requests. This greatly simplified many monitoring tasks. What I previously did using scripts and curl can now be done directly in the template and freely transferred from server to server in the form of template export and import.

What I monitor in the zcash node:

  1. The operation of the zcashd service itself on the server.
  2. State of the block and the difference between headers and blocks. The first is the number of blocks in the blockchain, and the second is the block number that is synchronized on your node.
  3. State of the blockchain network, active or not.

And accordingly the triggers:

  1. The zcashd service is not running.
  2. The node begins to lag behind, the difference between headers and blocks exceeds 50 or 100 blocks.
  3. The blockchain network is inactive.

Now how this is implemented. At the end there will be a finished template.

The timeout can be set longer; often 3 seconds is not enough. This item collects the following data:

Next we create dependent elements for data from headers and blocks.

And in preprocessing we select the JSONPATH we need.

By analogy, the same is done for blocks. Then we make a simple trigger comparing them.

In this case, the difference of 9 blocks was the request of the programmers. I don't know what difference is critical for the job.

Next, the network state is taken by the request:

# curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"
getnetworkinfo ","params":[]}' -H 'content-type:text/plain ;' https://username: [email protected] :8232/
The item is created by analogy with blockchaininfo. And for it, a dependent element and a trigger for the presence of the word true in the data from JSONPATH along the path $.result.networks[:1].reachable.

Here is the final list of items and triggers.

A ready-made template with these elements is zabbix-zcash.xml. The import was done from server version 4.4. There are no graphs in the template. Usually all this is looked at in Latest Data.

That’s all I have for installing, configuring and monitoring the zcash node.

Cloud mining ZEC

If you don’t have enough PC power, but you want to do mining, you can use cloud services.

The principle is simple: a crypto investor rents capacity from a company. Rent, of course, is not free.

One such service is Hashflare . He charges $2 for one hashrate. Before renting hashrates you will have to register. Go to the Hashflare web page and click “Register” .

Hashflare.io will ask you to enter your email address, country of residence, date of birth and create a password.

After registration, go to your personal account and scroll down to Equihash. To purchase cloud capacities, click on the cart. We choose how many hashrates we will rent and click “Next”.

Hashflare will provide several payment options: bitcoin transfer, bank card or Payeer payment system.

After payment, cloud mining will begin.

Now there are many services that provide similar services. With the popularization of cryptocurrencies, they literally grew like mushrooms. Among them there are a lot of scammers who take money from crypto enthusiasts and disappear without a trace. Therefore, before you start trusting anyone with your hard-earned money, you should read user reviews on thematic forums.

go

Online course on Linux

If you have a desire to learn how to build and maintain highly available and reliable systems, I recommend that you take the online course “Administrator Linux. Professional" in OTUS. The course is not for beginners; to enroll you need basic knowledge of networks and installing Linux on a virtual machine. The training lasts 5 months, after which successful course graduates will be able to undergo interviews with partners. What this course will give you:

  • Knowledge of Linux architecture.
  • Mastering modern methods and tools for data analysis and processing.
  • Ability to select a configuration for the required tasks, manage processes and ensure system security.
  • Proficient in the basic working tools of a system administrator.
  • Understanding of the specifics of deploying, configuring and maintaining networks built on Linux.
  • The ability to quickly solve emerging problems and ensure stable and uninterrupted operation of the system.

Test yourself on the entrance test and see the program for more details.

conclusions

In this article, we looked at how to mine ZCash on Ubuntu in various ways, using a processor, a video card, and solo mining using the official client.

Related posts:

  • How to use Bitcoin Core

    May 11, 2017

  • Mining Ether on Ubuntu

    July 4, 2017

  • How to use Electrum wallet

    August 12, 2017

  • Mining on Raspberry Pi 3

    September 21, 2017

FLYPOOL

  • Server locations: USA, Europe, China
  • Collection: 1%
  • Minimum payout: 0.001 ZEC
  • Payment scheme: PPLNS
  • Hashrate: 60 MH/s
  • Accurate speed statistics
  • Anonymous mining
  • Instant payouts
  • Efficient mining engine, low rate of lost blocks
  • Detailed general statistics and for each rig
  • E-mail alert system, warning about illegal balls
  • Pool website: zcash.flypool.org
Rating
( 1 rating, average 5 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]