How to validate raw transactions using bitcoind and/or bitcoin-cli (preferably offline)? I've been wanting to join in the fun on this Bitcoin transaction contest but while I'm comfortable enough working out the scripts themselves and playing with the web-based tools suggested, as a relative newbie to Bitcoin I haven't got a clue how to use bitcoind/qt to do the raw transaction validation.

I've downloaded bitcoind/qt/cli but I don't know what to put in my bitcoin.conf nor do I know how to run the tools nor what data I should feed them in order to validate my raw transactions.

I'd prefer to run my raw transaction validations offline but I don't even know if that's a possibility with these tools?

Despite searching wikis, forums, etc, I haven't found a 'dummy's guide' for these tools; everything seems to start from a level of knowledge which is somewhere above where I am at the moment.

I'd be very grateful if somebody could point me in the direction of some suitable information or else provide it here?

And although the organiser of the Bitcoin contest proposed using bitcoind for validating raw transactions I'm happy to consider any other tools/services that would do the equivalent job so if anybody can point me at (simpler?) alternatives that would be fine too.

Thanks in advance.
You can validate transactions in an offline instance of bitcoind that has absolutely none of the block chain!

Launch it like this:

$ bitcoind -datadir=some-datadir -server -connect=localhost:9999


The "connect" parameter gives it the remote connect to. If you point it at a non-listening port, it will never gather any blocks. This is fine for validating transactions.

It will tell you that you need to create a bitcoin.conf, and where, and what to put into it (rpcuser=bitcoinrpc and rpcpassword=some_long_string).

Then your bitcoind RPC url will be

http://bitcoinrpc:password@localhost:8332/


You use the JSON API signrawtransaction documented in section 7.2 of https://en.bitcoin.it/wiki/Raw_Transactions. You will need to pass in the inputs, since they will not be known to the bitcoin daemon.

I'm the author of the Python library pycoin https://github.com/richardkiss/pycoin/ and I use bitcoind to verify that transactions created by pycoin are valid (or in some cases, invalid). See bitcoind_agrees_on_transaction_validity in https://github.com/richardkiss/pycoin/blob/offline_tx/pycoin/services/bitcoind.py for an example usage.

(You could also use pycoin to validate transactions. It works, but it's not quite there yet documentation-wise. It also hasn't been extensively tested on non-standard transactions, so its VM implementation is hardly authoritative.)