2

I'm trying to build a service where I import a bunch of pirvate keys into bitcoin core or some other software if you recommend a better solution. Once the private keys are imported, I want to monitor these addresses and if anything is positive have it send it to another wallet address I own.

The solution I came up with was import the private keys with importprivkey api call, but does this take multiple private keys or do I have to loop through them?

Once I import these private keys into my wallet. I want to be able to detect if one of the following occurs:

  • if the entire wallet balance is greater than .001
  • or if 1 hour passes

Then, send all coins in the wallet to another address. My questions are:

  • Is there a service to monitor the bitcoin balance, or do I just have to make a cron job to query it every second?
  • When using sendtoaddress api call, do I have to specify a change address?
  • How do other people usually solve this problem?
  • That seems completely pointless. Why not give the target address in the first place then? Aren't you just generating a fee burden for yourself? – Murch Apr 2 '17 at 17:27
1

When using sendtoaddress api call, do I have to specify a change address?

No, it generates a new key pair and sends the balance to it. This key pair is stored in your wallet.dat file.

0

Is there a service to monitor the bitcoin balance, or do I just have to make a cron job to query it every second?

I do not know such service. Anyway, you should not give your private keys for any service.

When using sendtoaddress api call, do I have to specify a change address?

Why do you want to use bitcoin client and api calls for it?

How do other people usually solve this problem?

This is not a "problem". This is a "task". You should monitor transactions in the network and push your transactions which sweep the outputs to your address. I can provide you such toolkit, but not for free

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.