0

I'm trying to build out a wallet service and need to figure out how to use the monero rpc commands to update a users balance. In my database, I have a bunch of user's private keys. How do I update each user's balance using only the rpc? Do I pass in the private key into the rpc command and it spits back out the balance for me?

1

First, I'd suggest thinking harder about your design choice of holding users private keys. If you're going to have full custody of users wallets, it begs the question why have per-user wallets in the first place. It's your wallet if you hold the keys, so you could just just assign accounts/subaddress to customers for example.

Second, if you're going to ignore my first point... You cannot use the monerod RPC as it's the node daemon, it doesn't offer wallet level functionality. You also cannot use the monero-wallet-rpc with raw private keys - it operates on a wallet file. Therefore, you would need to restore each wallet file from the supplied keys using monero-wallet-cli, then you can use the monero-wallet-rpc on each wallet file - either use multiple processes, so you have each wallet permanently opened/running, or use one process and the open/close methods to open/close each wallet file as needed.

  • Its designed as a shared key system. Users have a copy of their own private key and so does my service that I provide. -- so is this how wallet.mymonero.com is doing it? Each user has their own wallet file ? – Patoshi パトシ Aug 18 at 4:27
  • Both my points in the answer to your posted question still stand. "so is this how wallet.mymonero.com is doing it? Each user has their own wallet file ?" <- How wallet.mymonero.com may or may not work is a different question. – jtgrassie Aug 18 at 5:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.