I'm looking to write up a PHP script that can query 10,000 monero private keys to get its balance. Once the balance is updated, it will be stored in a mysql database. I know scanning the monero blockchain can take quite some time for each address. Each of my users have a shared monero "private key" where they have access to the funds as do I. I want to create a website that keeps track of the balances in these addresses.

I was thinking of scanning each address initially even if it takes awhile. Then keep track of the last scanned height and start from there again on a 5-10 minute cron run. I'm not sure if this is the best method and would like to know if there are other good solutions to this problem?

1 Answer 1


There's a Monero wallet PHP library here (I've never used it so just suggesting) . Perhaps you could use it to create a PHP script that retrieves a wallet balance based on a view key and updates your DB accordingly

The your cron job could iterate over the 10000 wallets (using a managed queue) with the script.

Your DB should hold information like last_update_time in addition to keys, balances, etc.

I would use something like MongoDB for this kind of thing rather than mysql as you don't need a relational db and you will probably want to add fields as you figure out the angles on this thing

  • i need mysql as I work with the drupal cms. Commented Jan 8, 2018 at 4:17
  • Did you check out the library to see if it helps? Commented Jan 8, 2018 at 7:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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