1

With RPC calls to bitcoind, from separate (python) scripts, I'm:

  • calling getnewaddress to set up a new key pair for a 'special' address, assigned to a distinct account (let's call this 'specialAccount')

  • building raw transactions (outside bitcoind) that spend outputs to this special address and then calling bitcoind to sign send

In addition to the above, it is possible that bitcoind is also called directly, to make payments, or whatever.

How can I be absolutely sure that bitcoind does not consume outputs to my special address outside of signing outputs to this address in signrawtransaction?

We can assume that there are no calls that explicitly spend from 'specialAccount', but the problem is that, as I understand it, it is possible for bitcoind to borrow arbitrary unspent outputs for the purpose of paying transaction fees. (See this issue, for example, and also this one.)

Is there any way for me to lock the special address, and prevent this being used to pay transaction fees for other accounts, or to otherwise be able to use bitcoind to sign raw transactions that use outputs to this address without making the public key for the address more generally available within bitcoind?

1

You can use lockunspent to lock (in-memory only) unspent inputs created by transactions whose at least one output was pointing to your "special address".

  • It seems like there can be a couple of race conditions here, one between unspent creation and locking, and another between unlocking and signing? And then, if this lock is not persistent across server stop and start, then that is a problem also.. – Thomas Young Apr 23 '14 at 6:01
  • You can always store any "special addresses" to your DB and then load them back to your bitcoind client upon start-up and lock them before anything else happens. Once locked, they cannot be spent. – George Kimionis Apr 23 '14 at 10:48

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.