getbalancebyprivatekey RPC, OTA Key submission returns Error

Hello Developers,

I needed some guidance as me and my friend are stuck figuring out a solution.

We are running virtual nodes as validators.

The Prv rewards generated from these vnodes are withdrawn in Multiple Incognito Wallets on different devices.

I got an app developed for personal use, which I used to monitor the PRV balance of these Multiple Incognito wallets

We used “getbalancebyprivatekey” RPC to read wallet balance.

After the Privacy V2 update, I am not able to fetch the prv balance using that app because the “getbalancebyprivatekey” RPC won’t work just by submitting the private key as it did earlier.

So we have been trying to run the “getbalancebyprivatekey” RPC call by submitting the OTA Key

We tried submitting the OTA key using the “submitkey” method ie Default Mode but got a Full Cache Error

Then we tried using the community fullnode ( ) with the following access token: 0ec910a54ffbf2a0bdfc0c8b05e8b5445e51a2ae54f659a35ac7ad9980e4fd2c and still got the same error ie Full Cache Error. Please find the attached screenshot.
Full Cache  Error

I saw developers suggesting not to sending a private key via an RPC call as it is NOT SECURE.

Please help me out by addressing the below-mentioned queries.

Question 1. Am I on the right track ie trying to fetch wallet balance using “getbalancebyprivatekey” RPC? Is there any other RPC?

Question 2. Do I need to configure my virtual nodes(validators) for caching first? For the OTA Key Submission to work?

Question 3. Is there a way to set up a testing node so that I can send test private keys and Test OTA keys and don’t have to worry about the information being stolen? (Please note we are aware of the CLI tool or the go-sdk options)

Any guidance would be of great help. @Gaurav_Saini

1 Like

The error indicates that your previous submission has been successful, and the indexing has also finished, and thus you are now able to retrieve your balance (as was previously explained).

The RPC is correct one for getting the balance, but it should only be used when you own a full-node, and your connection to the full-node is secure. Imagine that you use this RPC with an HTTP connection, then anyone listening on the network will be able to catch your request and thus steal your private key. Another issue is that, the full-node’s owner may log and steal your private key.

Yes you can re-configure your virtual node to enable the enhanced cache, but it is not recommended to enable the enhanced cache on a validator node due to the following reasons:

  • Validator nodes often have data of a single shard at a time, so active caching does not make sure you always have the correct balance for a given private key.
  • Active caching requires an amount of CPU to do the job, so it might affect the nodes’ performance.
    Instead, you can set-up a full-node and have the enhanced cache enabled.

Also, please note that you can also set-up a full-node to do the job of a validator node.

To ensure your private key will not be stolen while using RPC calls, I can suggest the following:

  1. Set up your own full-node. You can find the instruction here.
  2. Secure your full-node by enabling HTTPS protocol (SSL/TLS).

Thanks, @daniel - just a quick follow up question. A secured and hosted full node doesn’t necessarily need to be staked with 1750 PRV if we’re only intending to use it to make RPC calls to query balances from other PRV wallets or transactions between incognito wallets, correct?

1 Like

Yes @sid, the full-node is for data retrieval purposes. It does not necessarily be involved in any kind of staking. And yes, with a full-node, you can query the balances of any wallet.

1 Like

Hello Daniel,
Please let me know if I am on the right track. So I want to set up my own full node so that I can use “getbalancebyprivatekey” RPC call to query balances from other PRV wallets by using use the authorized submission method.
So first I have to create my full node and then configure it with enhanced cache/enhance mode for the RPC to work right?
Any reference article you can suggest that will help me configure my full node for enhanced cache/active caching? Steps defined under “Run a Node with Cache” the correct article for this?

Please let me know if the below-mentioned steps are in the correct order

  1. Create my full node by following the instructions mentioned in the following article
  2. Securing the full-node by enabling HTTPS protocol (SSL/TLS)
  3. Configuring the full-node with an enhanced cache by using the steps defined under “Run a Node with Cache” in the following article

Let me know if I am missing anything here? @sid @Gaurav_Saini

Hi @anirudh.chauhan,

Sorry for the late response.

Apart from the fact that steps 1 & 3 can be combined (you can see it in step 2 of this article, notice the INDEXER_ACCESS_TOKEN must be non-empty and NUM_INDEXER_WORKERS must be non-zero), then that’s all you need to do.