How to force bitcoind to include a specific transaction as an input of another transaction?

4

1

I would want to force bitcoind to include a specific transaction as an input of another transaction. This is so as to prevent people front wanting to launch a double-spend attack on the website. The method is similar to the one used by SatoshiDice. How can I accomplish this task with the standard client?

ThePiachu

Posted 2012-08-28T15:27:36.363

Reputation: 41 594

Answers

6

This will be possible using the 'raw transaction interface' that was added recently and scheduled to be part of the 0.7.0 release.

With listunspent you can request a list of available coins sent to a particular (wallet) address, and with createrawtransaction you can build a transaction that consumes specified coins. Finally, sendrawtransaction can be used to broadcast a prepared raw transaction to the network.

Pieter Wuille

Posted 2012-08-28T15:27:36.363

Reputation: 54 032

1Any idea of when 0.7.0 will be released?Sebastian Castro 2012-08-29T04:57:20.747

0.7.0rc1 was released yesterday, so... soon.Pieter Wuille 2012-08-29T13:47:09.470