3.2.3. Renewing the Voting Key

This chapter describes how to renew the voting key of a mijin Catapult(v.2) node with a new key before it expires.
The voting key is the key used for finalization, and each node’s key has an expiration. A node whose key has expired stops voting, and when there are not enough voting nodes, finalization stops.
creation-day:

Nov. 27, 2026

update date:

Nov. 27, 2026

Warning

This procedure requires mijin-catapult-tools 0.3.1 or later (0.3.0 does not include votingkey link ).
This procedure must be performed on every node (api and peer) individually.

3.2.3.1. Voting Key Expiration

A voting key can be used for up to 26280 epochs ( maxVotingKeyLifetime ). Since 1 epoch is 160 blocks ( votingSetGrouping ), the key expires after about 4.2 million blocks.
The voting key created at setup covers epochs 1 to 26280. The number of days until expiration depends on the block generation time as follows.

Block generation time

Approximate time until expiration

10 seconds

About 487 days

15 seconds

About 730 days

30 seconds

About 4 years

60 seconds

About 8 years

Note

If the actual block interval is shorter than the setting, the key expires correspondingly earlier.
You can check the current epoch with latestFinalizedBlock.finalizationEpoch in the REST endpoint /chain/info.
The key for the next period can be registered before the current key expires. Do it well in advance, not just before the expiration.

3.2.3.2. Renewal Overview

Do the following three things for each node.

  1. Create the key file for the next period ( private_key_tree2.dat ) ( votingkey update )

  2. Register the key to the node’s harvesting account ( votingkey link; this sends a VotingKeyLink transaction)

  3. Place the key file in the node’s voting key directory

Warning

The transaction sent in step 2 cannot be undone.
In fee mode, the harvesting account needs a balance of the base currency (cat.currency) sufficient to cover the fee.
Up to 3 voting keys can be registered to one account. Expired keys are not removed automatically, so once 3 keys, including the one created at setup, have been registered, no further renewal is possible (about 6 years ahead with 15-second blocks).

3.2.3.3. Step.1 Log in to the node

Log in remotely to the node and switch to the UNIX user catapult.
If you want to log in to AWS MarketPlace’s mijin Catapult(v.2), see mijin Catapult(v.2) EC2 instance login how to.

Confirm that mijin-catapult-tools is 0.3.1 or later and that votingkey link is available. If it is not installed, install it by referring to mijin account creation.

$ mijin-catapult-tools -V
0.3.1
$ mijin-catapult-tools votingkey -h | grep link
  link [options]    Link the latest Votingkey file to the main Account and

If it is old, update it.

$ yarn global add @tech-bureau/mijin-catapult-tools@latest

3.2.3.4. Step.2 Set the node settings as variables

Set the following values according to the target node.

Variable

Description

Example

R

Node type

api for api nodes, peer for peer nodes

I

Index among nodes of the same type (starting from 0)

0 for api1, 1 for api2, 0 for peer1

URL

REST URL

http://localhost:3000 for api nodes; for peer nodes, the REST of an api node ( http://<api node>:3000 )

$ R=api; I=0; URL=http://localhost:3000
$ VK=/home/catapult/mijin-catapult-package/package/$R/catapult/userconfig/resources/votingkey
$ S=/mnt/mijin/shares

Note

Peer nodes do not have REST, so specify the REST of an api node for URL.

3.2.3.5. Step.3 Create the configuration file

The node’s harvesting account and voting key are in nemesis_addresses_harvesting.json and nemesis_addresses_harvesting_voting.json in the shared data.
From these, create a configuration file in the format read by mijin-catapult-tools ( ~/config.json ).
$ jq -n --arg url $URL \
    --slurpfile h $S/nemesis_addresses_harvesting.json \
    --slurpfile v $S/nemesis_addresses_harvesting_voting.json --arg r $R --argjson i $I '
    def acc(a): {privateKey: a.private_key, publicKey: a.public_key, address: a.address};
    {url: $url, mainAccount: acc($h[0][$r][$i]), keylink: {voting: acc($v[0][$r][$i])}}' > ~/config.json
$ chmod 600 ~/config.json

Warning

~/config.json contains private keys. Be sure to delete it in Step.8 when you are done.

Confirm that the configuration file is for the target node. If the following three public keys are all the same, the file was created correctly.

$ mijin-catapult-tools votingkey info -r ~/config.json -d $VK
2026-11-27T01:05:04.043Z [info] : Start Voting Key Check Dir... /home/catapult/mijin-catapult-package/package/api/catapult/userconfig/resources/votingkey
2026-11-27T01:05:04.045Z [info] : votingfile: index0:  {"publicKey":"E816...D8AC","startEpoch":1,"endEpoch":26280,"filename":"private_key_tree1.dat"}

$ jq -r .keylink.voting.publicKey ~/config.json
E816...D8AC

$ curl -s $URL/accounts/$(jq -r .mainAccount.address ~/config.json) | jq .account.supplementalPublicKeys.voting
{
  "publicKeys": [
    {
      "publicKey": "E816...D8AC",
      "startEpoch": 1,
      "endEpoch": 26280
    }
  ]
}
Also check the owner and permissions of the current key file.
$ ls -l $VK
-rw------- 1 catapult catapult 2522960 Nov 27 01:03 private_key_tree1.dat

3.2.3.6. Step.4 Create the key file for the next period

Copy the node’s voting key directory to a working directory, and create the key file for the next period in it.
Do not modify the node’s directory directly.
$ cp -r $VK ~/vk-work
$ mijin-catapult-tools votingkey update -r ~/config.json -d ~/vk-work
2026-11-27T01:05:52.590Z [info] : Start Voting Key Update...
2026-11-27T01:05:52.593Z [info] : votingSetGroup: 160
2026-11-27T01:05:52.594Z [info] : votingMaxEpoch: 26280
2026-11-27T01:05:52.594Z [info] : votingStartEpoch: 26281
2026-11-27T01:05:52.594Z [info] : votingEndEpoch: 52560
2026-11-27T01:05:52.594Z [info] : blockGenerationTargetTime: 15
2026-11-27T01:06:14.907Z [info] : Voting Key file Create: SUCCESS /home/catapult/vk-work/private_key_tree2.dat
Creation takes several tens of seconds.
Confirm that the period of private_key_tree2.dat starts right after the end epoch of the current key (26281 to 52560 if the current key is the one created at setup).
$ mijin-catapult-tools votingkey info -r ~/config.json -d ~/vk-work
2026-11-27T01:06:15.545Z [info] : votingfile: index0:  {"publicKey":"E816...D8AC","startEpoch":1,"endEpoch":26280,"filename":"private_key_tree1.dat"}
2026-11-27T01:06:15.545Z [info] : votingfile: index1:  {"publicKey":"E816...D8AC","startEpoch":26281,"endEpoch":52560,"filename":"private_key_tree2.dat"}

Note

The voting public key is derived from the voting key, so it has the same value in the key files of every period.

3.2.3.7. Step.5 Register the key

Register the latest key file in the working directory to the harvesting account.
If End Transaction is displayed, the transaction has been confirmed.
$ mijin-catapult-tools votingkey link -r ~/config.json -d ~/vk-work
2026-11-27T01:23:53.712Z [info] : mijin URL: http://localhost:3000
2026-11-27T01:23:53.713Z [info] : Network: 96
2026-11-27T01:23:53.775Z [info] : Start Voting Key Link...
2026-11-27T01:23:53.777Z [info] : Voting Key file: /home/catapult/vk-work/private_key_tree2.dat
2026-11-27T01:23:53.778Z [info] : Voting Public Key: E816...D8AC
2026-11-27T01:23:53.778Z [info] : votingStartEpoch: 26281
2026-11-27T01:23:53.778Z [info] : votingEndEpoch: 52560
2026-11-27T01:23:53.787Z [info] : Main Account: MBBC...2PQ
2026-11-27T01:23:53.788Z [info] : Linked Voting Key: index0: E816...D8AC (epoch 1 - 26280)
2026-11-27T01:23:53.823Z [info] : Transaction Fee: 0
2026-11-27T01:23:53.824Z [info] : Start Announce Transaction...
2026-11-27T01:24:00.390Z [info] : End Transaction
2026-11-27T01:24:00.390Z [info] : http://localhost:3000/transactionStatus/BD92...19F7
2026-11-27T01:24:00.390Z [info] : http://localhost:3000/transactions/confirmed/BD92...19F7

Confirm that there are now two registered voting keys. The change may not be reflected immediately after confirmation, so if there is still only one, wait a little and check again.

$ curl -s $URL/accounts/$(jq -r .mainAccount.address ~/config.json) | jq .account.supplementalPublicKeys.voting
{
  "publicKeys": [
    {
      "publicKey": "E816...D8AC",
      "startEpoch": 1,
      "endEpoch": 26280
    },
    {
      "publicKey": "E816...D8AC",
      "startEpoch": 26281,
      "endEpoch": 52560
    }
  ]
}

Note

votingkey link exits without sending a transaction in the following cases.
・同じ鍵(公開鍵・開始エポック・終了エポック)がすでに登録されている( already linked )
・開始エポックが、登録済みの鍵の終了エポック以下である( overlaps )
・登録できる上限(3 つ)に達している( maximum )
・期間が 72〜26280 エポックの範囲外である( lifetime )
Even if you run the same command twice, the second run exits with already linked, so the key is never registered twice.

3.2.3.8. Step.6 Place the key file on the node

Place the new key file with the same file name in the node’s voting key directory, and give it the same permissions as the current key file.

$ cp ~/vk-work/private_key_tree2.dat $VK/
$ chmod 600 $VK/private_key_tree2.dat
$ ls -l $VK
-rw------- 1 catapult catapult 2522960 Nov 27 01:23 private_key_tree1.dat
-rw------- 1 catapult catapult 2522960 Nov 27 01:24 private_key_tree2.dat

Warning

The node reads private_key_tree1.dat, private_key_tree2.dat, … in numerical order, and reads the next numbered file when the current key file is used up. Do not leave gaps in the numbering.
If you place the file before the current key expires, there is no need to restart the node.
If the current key has already expired, the node does not read the new file until it is restarted. Restart the node after placing the file.

3.2.3.9. Step.7 Check finalization

Confirm that finalization continues. finalizationEpoch increases by 1 every epoch (160 blocks; about 40 minutes with 15-second blocks).

$ curl -s $URL/chain/info | jq .latestFinalizedBlock
{
  "finalizationEpoch": 4,
  "finalizationPoint": 8,
  "height": "460",
  "hash": "516B...4E42"
}

3.2.3.10. Step.8 Clean up

The configuration file and the working directory contain private keys, so delete them.

$ shred -u ~/vk-work/* ~/config.json
$ rm -rf ~/vk-work
This completes the renewal for one node.
Perform Step.1 to Step.8 on the remaining nodes as well (change R, I, and URL in Step.2 to match each node).