Skip to content

Migrating your Legacy masternode to the new Deterministic masternode system

justanwar edited this page Dec 1, 2020 · 1 revision

Zcoin v.14.0.0. introduces Deterministic Znodes.

You will only be able to use this guide after block 278300 (Approximately June 22 2020, 12:00 UTC) whereby Znode pro-tx registrations are accepted.

This guide is to help those migrating their existing Znodes to the new deterministic Znodes. Unlike the previous Znode system, you will not need to 'start' your Znode. All you need to do is to register your Znode on the Zcoin blockchain via a special transaction called a Provider Registration Transaction (protx).

Preparing for migration

Legacy Znodes can be registered as Deterministic Znodes with this command:

protx register collateralHash collateralIndex ipAndPort ownerAddress operatorPubKey votingAddress operatorReward payoutAddress feeSourceAddress

An example of how this would look like is as follows:

protx register 4950f88867b69760d3cd7c1f53531340f6723eb8f7d7f00730abfa12c5fe10e0 0 207.148.122.12:8168 TRVDAxJwaZYFfmti4aTeKCByz1jbMq8Jy4 995b3e1e2a65ce960a8cc7d305c5914b7f60e888c338c1f3317efbdcac58e82ecc110315ce03f49d9d387ff35c2796ad "" 0 TEZ8M8Fgp8h4HvUjXtjz3krYraRtySiXdw TQGmCxUQHK2xKGYNyeqGdSYQqfEAB2hjtd

This looks extremely complicated but don't worry! The guide will explain each field below.

Step 1: Get information about your 1000 XZC Znode collateral(s)

Fields: collateralHash, collateralIndex, ipAndPort

collateralHash: The txid of your 1000 XZC

collateralIndex: The index of the 1000 XZC within that txid (typically 0 or 1)

ipAndPort: The IP address and port of your VPS hosting your Znode. (e.g. 95.210.72.33:8168)

If you have any existing Znodes, these information can be obtained from your znode.conf. Let's take a look at an example entry in znode.conf

Legacy01 207.148.122.12:8168 7EDVXuXszTFLiUif538HhDVvpxhw7gYkGH1w2fkXgCXUW158Wiz 4950f88867b69760d3cd7c1f53531340f6723eb8f7d7f00730abfa12c5fe10e0 0

We have a Znode labelled Legacy01 that we want to migrate. In the example above,

collateralHash: 4950f88867b69760d3cd7c1f53531340f6723eb8f7d7f00730abfa12c5fe10e0

collateralIndex: 0

ipAndPort: 207.148.122.12:8168

Get all this information for each Znode entry you have.

Step 2: Generate new unused addresses to serve as ownerAddress for each Znode

Fields: ownerAddress, votingAddress

You will need a new, unused address for every Znode you have. You must own this address.

For example, you will need five new ownerAddress if you have five Znodes. These addresses must not contain any coins nor are they to be used for any other purpose.

To generate a new address, you can go to Help > Debug window > Console and type getnewaddress, or you can go to File > Receiving Addresses and click on New. Repeat this until you have a new address for every Znode you have.

Your ownerAddress will also be used for the votingAddress field. They will always be the same.

We do not recommend using these addresses for anything else. Do not use this address as your payoutAddress.

Step 3: Specify an address to be used for fees for the protx transaction

Fields: feeSourceAddress

You will need an address with funds in it to pay the transaction fee for the Provider Register Transaction (protx). This address will be used in the feeSourceAddress field.

If this is not specified, it default to using the payout address. If the payout address does not have sufficient balance to pay the transaction fee, you will be unable to register your Znode.

Make sure your wallet has enough zcoin to pay for the transaction and then go to Help > Debug window > Console and type the following command:

listaddressbalances 0.01

This command will list all the addresses that have a balance more than 0.01 XZC.

From that list, pick one to be used as your feeSourceAddress.

Ensure that the Zcoin address used has sufficient balance to pay the transaction fee.

Step 4: Generate BLS key pairs for each Znode you own

Fields:operatorPubKey, operatorKey

If you are hosting the Znode on your own, you will need to generate a BLS secret/public key pair for every Znode you have.

These keys will be used to operate your Znode or update information about your Znode (for e.g. if you want to change your VPS). They are roughly equivalent to znodeprivkey in the legacy Znode system. These keys do not control your funds but they do control your Znode meaning it can be stopped or the Znode IP changed.

If you are using a Znode hosting provider, you will not need to generate the BLS key pairs. The Znode hosting provider will provide you with their operatorPubKey that you will use in your protx registration transaction. You therefore will not need to read any further on this step.

If you are hosting your own Znode you can generate the BLS key pairs by typing the bls generate command in the Help > Debug window > Console.

For example:

The string after public will be your operatorPubKey. The string after secret is your operatorKey.

You will use the operatorPubKey in your protx registration transaction.

The secret or operatorKey is used in Znode's zcoin.conf file on your VPS, by default located in ~/.zcoin/zcoin.conf. You will do this by logging into your VPS, opening zcoin.conf with your text editor and inserting a new line with znodeblsprivkey=operatorKey. For example:

znodeblsprivkey=3235bae58e1b46653ee6fd457018c3756797b3b2b5306734873b4a39d9cb8a5f

You will need to stop and start zcoind after making changes to zcoin.conf

During the transition period, do not delete the znodeprivkey line in the zcoin.conf on your VPS. A future update will take care of it.

Step 5: Specify the percentage of Znode rewards you would like to give to your Znode hosting provider (if relevant).

Fields:operatorReward

This is the portion of the Znode reward to be paid to the Znode hosting provider, in percentage (0.00 to 100.00). Set to 0 if you are hosting your own Znode. If you already have an external payment or subscription method with your Znode hosting provider, they will most likely ask you to set this to 0.

Operators will need to set the operatorPayoutAddress with the protx update_service command to receive the Znode reward portion, otherwise it gives everything to the owner.

Once set, the operator reward percentage cannot be changed, so make sure you are very certain about paying your operator!

Step 6: Specify where you would like your Znode rewards to be paid to

Fields:payoutAddress

In the legacy Znode system, Znode rewards are always paid to the same address as your collateral. In the new system, you can specify any address to receive your rewards. You can even have multiple Znodes pay to the same address (though this is bad for privacy).

Pick any address in your wallet or make a new one to be used as the payoutAddress.

Do not use your ownerAddress/votingAddress as a payoutAddress. It will not work.

Registering your Znode

Once you have all the details above, you are ready to do your protx registration transaction to register your Znode on the Zcoin blockchain.

To migrate your Znode to the Deterministic Znode system, use the following command:

`protx register collateralHash collateralIndex ipAndPort ownerAddress operatorPubKey votingAddress operatorReward payoutAddress feeSourceAddress

Before you are able to enter the command, you must first unlock your wallet:

walletpassphrase YOURPASSWORD 60

This command will unlock your wallet for 60 seconds and returns a (null) message when successfully executed.

Some examples are provided below:

Example 1: Self-hosted Znode

# znode.conf
Legacy01 207.148.122.12:8168 7EDVXuXszTFLiUif538HhDVvpxhw7gYkGH1w2fkXgCXUW158Wiz 4950f88867b69760d3cd7c1f53531340f6723eb8f7d7f00730abfa12c5fe10e0 0

We can migrate the self-hosted Znode in the above znode.conf to a Deterministic Znode with zero operatorReward using the following command:

protx register 4950f88867b69760d3cd7c1f53531340f6723eb8f7d7f00730abfa12c5fe10e0 0 207.148.122.12:8168 TRVDAxJwaZYFfmti4aTeKCByz1jbMq8Jy4 995b3e1e2a65ce960a8cc7d305c5914b7f60e888c338c1f3317efbdcac58e82ecc110315ce03f49d9d387ff35c2796ad "" 0 TEZ8M8Fgp8h4HvUjXtjz3krYraRtySiXdw TQGmCxUQHK2xKGYNyeqGdSYQqfEAB2hjtd

where

collateralHash: 4950f88867b69760d3cd7c1f53531340f6723eb8f7d7f00730abfa12c5fe10e0
collateralIndex: 0
ipAndPort: 207.148.122.12:8168
ownerAddress: TRVDAxJwaZYFfmti4aTeKCByz1jbMq8Jy4
operatorPubKey: 995b3e1e2a65ce960a8cc7d305c5914b7f60e888c338c1f3317efbdcac58e82ecc110315ce03f49d9d387ff35c2796ad 
votingAddress: "" (defaults to ownerAddress)
operatorReward: 0
payoutAddress: TEZ8M8Fgp8h4HvUjXtjz3krYraRtySiXdw
feeSourceAddress: TQGmCxUQHK2xKGYNyeqGdSYQqfEAB2hjtd

Example 2: Znode on a hosting service

We can use a similar command to register a Znode that is being hosted by a Znode providers. ipAndPort field is left empty as the provider will perform another protx command on their side. The operatorPubKey is provided by your provider.

protx register 67234c08bfa93b0317df14fa6d3269703bbbf1130382c6929ede2525c0d47f23 "0" "" TTPMVZEpucRkc6bEuQAQenbeVnkA2zF8nY 8ddd4aa99b6f766059c4653d3cee2a6a75b4888cb23e1cc34af0a16e479d5b16df695a2042478d155ac23aa9c9bc4bcd "" 0 TX7Wgd9b7TuHBnDS3j9isUKcmrANgL2qP2

Checking registration status

The protx register command will output a transaction ID after successfully executed.

Registration is successful once the transaction containing your registration is mined and is included in a block. To check, copy the transaction ID and enter it here: explorer.zcoin.io

Once the transaction is mined, the nodes you just registered should appear in the Znodes tab in the wallet.

To check your Znode's status on the Znode itself, do ./zcoin-cli evoznode status. If everything was setup correctly, you should see your Znode's details along with these two lines at the bottom:

"state": "READY",
"status": "Ready

Congratulations, your Znode has been successfully migrated.

Common protx commands

protx register "collateralHash" collateralIndex "ipAndPort" "ownerAddress" "operatorPubKey" "votingAddress" operatorReward "payoutAddress" "feeSourceAddress"

Use the protx register command to register a Znode on the network. You can leave the IP and port section empty ("") and update it later with the protx update_service command. VotingAddress is not used for Znodes so leave it empty ("").

protx update_service "proTxHash" "ipAndPort" "operatorKey" "operatorPayoutAddress" "feeSourceAddress"

Use the protx update_service command to update your IP address or to start a PoSe-banned Znode.

protx update_registrar "proTxHash" "operatorPubKey" "votingAddress" "payoutAddress" "feeSourceAddress"

Use the protx update_registrar command to change the payout address or change Znode hosting provider (operatorPubKey). VotingAddress is not used for Znodes so leave it empty (""). This command will send the Znode into PoSe-banned state unless the operatorPubKey address remains the same when you are changing the payoutAddress.

protx revoke "proTxHash" "operatorKey" reason "feeSourceAddress"

Use the protx revoke command to revoke the operator key for the Znode. This will set the IP address of the Znode to empty and send the Znode into PoSe-banned state. Znode hosters can use this command to stop providing service to the Znode owner.

FAQ

How do I change the IP address of my Znode?

Use the protx update_service command.

Can I set the payout address to my collateral address?

Yes, you can.

My Znode is in PoSe banned status. I have fixed the problem on the Znode, how do I start it again?

Use the protx update_service command.

Can you revoke another Znode if you know the operator private key?

Yes. For this reason, keep your operator private key safe.

Can I reuse my BLS keypair from my old defunct node?

You cannot reuse your old BLS keypair. Generate a new pair.

Revoke reason table

You can use the following table for the reason field in the protx revoke command.

Reason Value Reason
0 Not Specified
1 Termination of Service
2 Compromised Keys
3 Change of Keys (Not compromised)
Clone this wiki locally