Setting up a Tezos VDF Service
The Tezos blockchain needs a reliable source of randomness. For example, it needs a way of randomly generating the baking schedule fairly. If values from the blockchain are used to seed randomness, it is possible that the outcome could be manipulated by the bakers. There are techniques to overcome such manipulation but they are susceptible to collusion.
What is needed is a randomness source that can be proved to be independent and free from influence. Using Verifiable Delay Functions (VDF) solves this problem. They provide a guaranteed unbiased and unpredictable randomness source that can be efficiently verified. Since the introduction of the Kathmandu protocol, the chain uses Verifiable Delay Functions (VDF) to provide a source of random values and at least one VDF is computed during each blockchain cycle.
This is a deep topic and I’ve listed some references at the end of this article. As a Tezos blockchain participant, you can help by running a VDF service. It is up to the community to ensure that there is at least one VDF computation is completed per cycle. Several key Tezos participants run VDF servers already, but you can run one very easily. This article will show you how to get started quickly.
Prerequisites
-
A Debian or Ubuntu Linux machine with at least 16GB of RAM. The VDF computation needs more memory than a regular Tezos Node or Baker.
-
The machine is running a Tezos Node. To set this up, please see this article.
Install the software
The Octez software includes the VDF service in the baking daemons. For Ubuntu 20,22 or Debian 11,12, you can use these packages. Make sure that your system is up to date with apt update && apt upgrade
then install the packages with dpkg
.
We assume that you have installed the client and node package from the prerequisite article. For the VDF service you will need the baker package. For example, for Ubuntu 22:
dpkg -i ./octez-baker_21.0-1_amd64.deb
The packages are available from my download site. Any missing dependencies can be installed with apt install
.
Enable and run the software
To run the VDF service, enable and start it with systemctl
:
systemctl enable octez-vdf.service
systemctl start octez-vdf.service
The bakers will start in VDF computation mode and you can examine the log files to check for correct operation.
tail -f /var/log/tezos/vdf_PtParisC.log
Actually the VDF package is only a init.d script that starts and stops the bakers in VDF computation mode. You can run the VDF service by hand as follows. The -K
option ensures that the service continues to run even if the node is restarted.
octez-baker-PtParisC run vdf -K
More information
For more information, please see:
- How to get Tezos.
- Getting Started with Tezos.
- Tezos VDF documentation.
- Verifiable Delay Functions, D. Boneh, J. Bonneau, B. Bünz, B. Fisch
- Simple Verifiable Delay Functions, Krzysztof Pietrzak.
- Efficient Verifiable Delay Functions, Benjamin Wesolowski.
- VDF Cybersecurity Seminar, Benjamin Wesolowski
- Introduction to Verifiable Delay Functions, Trail of Bits