Main, Remote and VRF
From within the
_build directory you created in the previous section, run:
./bin/catapult.tools.addressgen --count 3 --network public
This will output 3 key pairs similar to this one:
address (public): NDPPBHSMLVEU75DNUMFX6GWPTGB6PP6AFQU7WSY
address decoded: 68DEF09E4C5D494FF46DA30B7F1ACF9983E7BFC02C29FB4B
public key: 1E886BA00B4F85DBC0B31DBB78DADFAA29945DF7290DB7A4243D94864483C627
private key: 3DDDC333029BC8ACDB460435BBC71041D460B911725B03D6F93805521AAD60CB
Each block is a key pair (there is one block shown above) composed of a
private key, a
public key and an
Copy all of them to a temporary text file for later use and label the key pairs Main, Remote and VRF.
If you already have any of these keys, you can use them instead of the randomly-generated ones.
The most relevant scenario is when using a main account opted-in from a NIS1 account. In this case you can directly use the key obtained in the opt-in process as your Main key instead of the randomly-generated one.
If your node is to be a voting node it must have linked a voting key for the period in which you intend to vote. This is interesting as voting nodes receive voting rewards.
The generation of the voting key, though, is a bit more complex than the previous ones:
- Still from within the
_build directory create another directory called
Create the voting key (or keys):
Voting keys are different from the other keys in that they have a period of validity, for example. They are only valid from a Start Epoch to an End Epoch (see side box).
Nodes are only eligible as voters if they are linked to a valid voting key for the current blockchain epoch, so remember to renew your voting key periodically.
To help you with that task, you can have up to 3 linked voting keys, with different periods, so you can easily renew one key while there’s still another one active (you will need to unlink an older key to be able to link more than 3 keys).
A voting key is created using
catapult.tools.votingkey and providing its period of validity (note you do not use
catapult.tools.addressgen as before):
bin/catapult.tools.votingkey --output votingkeys/private_key_tree1.dat
--startEpoch 100 --endEpoch 460
This creates a file named
votingkeys/private_key_tree1.dat and prints the voting key on the terminal. As your voting keys expire and you create new ones, increase the number on the file name.
generating 361 keys, this might take a while
verifying generated file
saved voting public key: ****************
loaded voting public key: ****************
Copy the voting key public key into the temporary text file where you keep the rest of the keys, label it Voting and save it for later.
Voting key renewal
If all your registered voting keys expire your node will not be eligible as a voter and its account will not receive any voting rewards.
Make sure you always have one voting key registered for the current epoch.
You can check your currently registered voting keys using the
/accounts endpoint of the REST API (Get Account Information), in the
supplementalPublicKeys section. Here is an example.
If you need to renew your keys, create new ones as explained above and then register them as explained in the Link the keys section below.