12

I have a bitcoin wallet address (the private key is known by other people). I periodically receive payment on this address (and cannot change it/receive to other address).

I need:
When I receive a payment on it, automatically and immediately (at 0 confirmations, like in BlockChain.info wallet) send/forward them to my new wallet address (the private key is known only by me).

Is this possible and how?

vlnbg
  • 165
  • 1
  • 9
  • possible duplicate of [Is there a way to automatically send bitcoins from one wallet to another?](http://bitcoin.stackexchange.com/questions/1495/is-there-a-way-to-automatically-send-bitcoins-from-one-wallet-to-another) – Jamie Bull Jul 21 '13 at 16:59
  • This is what I wanted. Using one address to receive payments and another one to spend. And a way to link these two addresses.. – vi.su. Jul 22 '13 at 03:18
  • 1
    May be confusing, but this will be useful many cases. I don't have change my address for every tx, and I don't have to worry about loss of control of this account. – vi.su. Jul 22 '13 at 03:20
  • @JamieBull, does not seem to be duplicate. The OP here explicitly says that the receiving addresses' private is shared with other people, while the linked question does not have such a condition. Due to this, the solutions may differ. – Jus12 Aug 05 '13 at 20:08

2 Answers2

14

You may use /etc/crontab on your Ubuntu:

* * * * * root /bin/bash /usr/local/bin/bitcoin_resender

And script shall looks like:

$ cat /usr/local/bin/bitcoin_resender
#!/bin/bash
if [ $(echo "$(bitcoind getbalance) > 0" | bc) -eq 1 ];then
      bitcoind sendtoaddress YOUR_NEW_ADDRESS $(bitcoind getbalance) "Comment for resender"
fi

It will check every minutes your bitcoind balance and resend each bitcoins to YOUR_NEW_ADDRESS.

Your probably need to check the fee.

  • 5
    Code answer is best answer. – Colin Dean Aug 04 '13 at 14:40
  • 1
    And what about fees? `error: {"code":-4,"message":"Error: This transaction requires a transaction fee of at least 0.024 because of its amount, complexity, or use of recently received funds!"}` – q9f Feb 01 '14 at 14:52
-2

It is not possible.
You need to write your own software for this.

As a workaround, maybe you can import this receiving address to spending wallet?

ripazha
  • 486
  • 2
  • 8