Revealing Your Vote

You can reveal your vote in the third phase of each Epoch, from 85% to 95% of the Epoch.

Phase

Block Number

What you can do

0% ~ 75%

start_block ~ vote_start_block - 1

apply candidates and delegate

75% ~ 85%

vote_start_block ~ vote_end_block

vote

85% ~ 95%

reveal_start_block ~ reveal_end_block

reveal vote

95% ~ 100%

reveal_end_block + 1 ~ end_block

check next epoch’s info

Signing Your Address

Before you can send the reveal vote transaction, you need to generate a signature signed by your consensus private key. You can generate it by RPC using chain_signAddress.

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"chain_signAddress","params":["address", "private_key"],"id":1}' localhost:6969/pchain

Where address and private_key are those associated with your node address. This returns a signature that is needed in the next step of the reveal transaction:

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"chain_signAddress","params":["0x4CACBCBF218679DCC9574A90A2061BCA4A8D8B6C", "0xD8AF52E355CD070ED3401800CBC920B6E94F3C49B42808C3049BF7BDB1FA3B19"],"id":1}' localhost:6969/pchain
"0x1214608bcdf2e464b2d37d19b1b671482253e275d33079264045253fbb18689385ac0d5b4128d0c593211588deafd9ea2507b4858bdd42aaef3999045c0407ae"

Sending the Reveal Transaction

You can now reveal your vote by RPC using tdm_revealVote.

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"tdm_revealVote","params":["address", "blspubkey", "amount", "salt", "signature"],"id":1}' localhost:6969/pchain

Where address, blspubkey, amount, and salt is from the vote transaction and signature is from the step above.

In this case:

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"tdm_revealVote","params":["0x4CACBCBF218679DCC9574A90A2061BCA4A8D8B6C", "085586D41F70435700850E19B7DE54B3E793C5EC4C6EC502D19030EF4F2122823E5A765E56CBA7B4C57E50561F77B022313C39895CA303F3C95D7B7282412F334778B95ACE046A79AEA4DB148334527250C8895AC5DB80459BF5D367236B59AF2DB5C0254E30A6D8CD1FA10AB8A5D872F5EBD312D3160D3E4DD496973BDC75E0", "0x9744d24923260b7d1a800", "ilovepchain", "0x1214608bcdf2e464b2d37d19b1b671482253e275d33079264045253fbb18689385ac0d5b4128d0c593211588deafd9ea2507b4858bdd42aaef3999045c0407ae"],"id":1}' localhost:6969/pchain

If successful, this will return a transaction hash that can be checked on PIScan for success.

Check Next Epoch's Validators

Once the Epoch transitions into its last phase, beyond 95%, you can check for your inclusion in the list of validators for the next epoch with the RPC call tdm_getNextEpochValidators.

curl -X POST -H "Content-Type:application/json" --data '{"jsonrpc":"2.0","method":"tdm_getNextEpochValidators","params":[],"id":1}' localhost:6969/pchain | jq '.'

If your node address is in the list outputted, you have successfully become a Pchain validator.

Do I Need to Vote Every Epoch?

Once you have successfully revealed your vote, there is no need to go through this process again unless you want to reduce your vote amount. All additional delegations will be automatically rolled into your node's vote power in the next epoch. If you would like to add your reward PI to your vote power, you can do so by the "append" function in the PIWallet.

How to Quit Being a Validator

If you no longer want to be a validator, you can quit by yourself. You will need to do the two-part process of Vote and Reveal Vote as the same above, with setting the amount to 0. If you are also a candidate node with delegations, you need to cancel candidate submission first.

Last updated