Author

Topic: Automatically transfer btc to another address, possible? (Read 171 times)

legendary
Activity: 2982
Merit: 4193
Do you roughly know how much you will get per transactions? Or when roughly the transactions will come in?

If so, you could create some simple logic to estimate the "perfect" fee for your current situation depending on the amount you received and the mempool.

This shouldn't be too tricky if you can roughly estimate how much you will receive.
I would think using a floating fee would be more appropriate for OP for which that can be specified in sendtoaddress, together with how conservative the fee rates should be. If it's a fixed fee rate, consolidating all the UTXOs would be better. The fees can also be deducted from the send amount, AFAIK so no math has to be done.
legendary
Activity: 1624
Merit: 2481
Thanks a lot, yeah I read about the fees problem.

Do you roughly know how much you will get per transactions? Or when roughly the transactions will come in?

If so, you could create some simple logic to estimate the "perfect" fee for your current situation depending on the amount you received and the mempool.

This shouldn't be too tricky if you can roughly estimate how much you will receive.
legendary
Activity: 1442
Merit: 1179
Use walletnotify combined with JSON-RPC to move your funds upon receipt.
legendary
Activity: 2982
Merit: 4193
For the getbalance, remember to specify minconf=0.

Anyways, is there an issue with doing it after consolidating multiple UTXOs? Monitoring the addresses and consolidating it to the HW wallet introduces an additional step that eats into your fees and the resultant number of UTXOs remains the same.

What I'll do is that I'll set a threshold, ie. 0.1BTC and when I have that amount, I'll get the client to send the funds to the HW wallet. If you are afraid of the risks of being exposed while your funds are being sent to your hot wallet, having automatic transfers doesn't do too much to eliminate the risk of malware attacks anyways. If that's your concern, your focus would be likely to just try to change the addresses to the ones in the HW wallet.
legendary
Activity: 2212
Merit: 3148
₿uy / $ell ..oeleo ;(
There are a few linux scripts out there that will do it using the core reference client.
BUT, the biggest issue is figuring out the fees.
Think about it, if you get some BTC in now and just want to forward it out the core wallet is going to use 0.00082833 BTC/kB
If it's a small transaction you're going to eat up a lot of it.

Code:
bitcoind sendtoaddress WHERE_YOU_WANT_IT_TO_GO amount of  coin

Will send all, you would have to do some math 1st to leave some for fees

Code:
$bitcoind getbalance


Should get you your balance (it's been a while no idea it should work). And you can do some math from there.

-Dave

Thanks a lot, yeah I read about the fees problem. As I said it was just an example of a way to have a automated system to save your coins in a cold storage if you have some random incomes.

I'll see when I'll get the time to test this.
legendary
Activity: 3500
Merit: 6320
Crypto Swap Exchange
There are a few linux scripts out there that will do it using the core reference client.
BUT, the biggest issue is figuring out the fees.
Think about it, if you get some BTC in now and just want to forward it out the core wallet is going to use 0.00082833 BTC/kB
If it's a small transaction you're going to eat up a lot of it.

Code:
bitcoind sendtoaddress WHERE_YOU_WANT_IT_TO_GO amount of  coin

Will send all, you would have to do some math 1st to leave some for fees

Code:
$bitcoind getbalance


Should get you your balance (it's been a while no idea it should work). And you can do some math from there.

-Dave
legendary
Activity: 2212
Merit: 3148
₿uy / $ell ..oeleo ;(
Tried to look for an answer but never found anything really clear.

Here is an example.
If I have 7 addresses and they randomly receive btc in a Bitcoin Core wallet and I want those coins as soon as they come into the wallet be sent to a one address on a hardware wallet is it possible to be done automatically in the moment the coins are received to be transferred to the other address?

Jump to: