Some people were interested in figuring out how to check whether or not your VRF signing (private) key was the correct VRF key registered onto the blockchain.
A problem with using the wrong VRF signing key on your producer node would result in not correctly computing the VRF output needed to determine slot leadership, so you would end up missing slots without knowing. Having a misconfigured VRF signing key shouldn’t be a problem if you only generate one VRF pair and don’t intend on making another pair (there isn’t really a reason to).
To check if your vrf.skey is registered to the ledger:
- Derive the public verification key (vkey) from the private signing key (skey). This doesn’t need to be done if you didn’t lose your original vrf.vkey. This could also be a useful exercise to verify that your current vkey is truly the vkey paired to the skey:
- cardano-cli shelley key verification-key --signing-key-file vrf.skey --verification-key-file vrf.vkey
- Download the ledger state from blockchain:
- cardano-cli shelley query ledger-state --mainnet --out-file ledger-state.json
- Search for your pool’s node ID to find the registered VRF metadata.
- Example, my pool node ID is 593dfbc66c5b8dfc040851a2f4d87191490d4c2312c65dd4418f7b23
- After searching the ledger, I find the VRF entry in your pool’s metadata. Mine looked like:
- “vrf”: “6f3a4457f9a09b0e918c33d065695dafe25f970538de0cb589a65c5027b05c70”,
- The VRF value registered in the ledger is the key-hash of the VRF vkey. You need to compute the key-hash of your vkey and see if it matches the value registered to your pool on the ledger:
- cardano-cli shelley node key-hash-VRF --verification-key-file vrf.vkey --out-file vkeyhash.out
The output file, vkeyhash.out, should match the VRF value that appeared on the ledger in order for your vrf.skey to be correct. If it is not, then you are using the wrong vrf.skey.
A note on changing VRF keys and registering a new pair. Remember that newly registered pool information takes effect 3-epochs from the time you changed your pool information. So, don’t throw away your old VRF pair, since they are still needed for the current and next 2 epochs before it transitions to the new pair.